亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? irnet_irda.c

?? 優(yōu)龍2410linux2.6.8內(nèi)核源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
  /* Note : we overload the IrLAN hint bit. As it is only a "hint", and as   * we provide roughly the same functionality as IrLAN, this is ok.   * In fact, the situation is similar as JetSend overloading the Obex hint   */  hints = irlmp_service_to_hint(S_LAN);#ifdef ADVERTISE_HINT  /* Register with IrLMP as a service (advertise our hint bit) */  irnet_server.skey = irlmp_register_service(hints);#endif /* ADVERTISE_HINT */  /* Register with LM-IAS (so that people can connect to us) */  irnet_server.ias_obj = irias_new_object(IRNET_SERVICE_NAME, jiffies);  irias_add_integer_attrib(irnet_server.ias_obj, IRNET_IAS_VALUE, 			   irnet_server.s.stsap_sel, IAS_KERNEL_ATTR);  irias_insert_object(irnet_server.ias_obj);#ifdef DISCOVERY_EVENTS  /* Tell IrLMP we want to be notified of newly discovered nodes */  irlmp_update_client(irnet_server.s.ckey, hints,		      irnet_discovery_indication, irnet_expiry_indication,		      (void *) &irnet_server.s);#endif  DEXIT(IRDA_SERV_TRACE, " - self=0x%p\n", &irnet_server.s);  return 0;}/*------------------------------------------------------------------*//* * Function irda_destroy_server (self) * *    Destroy the IrTTP server... * * Reverse of the previous function... */static inline voidirnet_destroy_server(void){  DENTER(IRDA_SERV_TRACE, "()\n");#ifdef ADVERTISE_HINT  /* Unregister with IrLMP */  irlmp_unregister_service(irnet_server.skey);#endif /* ADVERTISE_HINT */  /* Unregister with LM-IAS */  if(irnet_server.ias_obj)    irias_delete_object(irnet_server.ias_obj);  /* Cleanup the socket part */  irda_irnet_destroy(&irnet_server.s);  DEXIT(IRDA_SERV_TRACE, "\n");  return;}/************************ IRDA-TTP CALLBACKS ************************//* * When we create a IrTTP instance, we pass to it a set of callbacks * that IrTTP will call in case of various events. * We take care of those events here. *//*------------------------------------------------------------------*//* * Function irnet_data_indication (instance, sap, skb) * *    Received some data from TinyTP. Just queue it on the receive queue * */static intirnet_data_indication(void *	instance,		      void *	sap,		      struct sk_buff *skb){  irnet_socket *	ap = (irnet_socket *) instance;  unsigned char *	p;  int			code = 0;  DENTER(IRDA_TCB_TRACE, "(self/ap=0x%p, skb=0x%p)\n",	 ap, skb);  DASSERT(skb != NULL, 0, IRDA_CB_ERROR, "skb is NULL !!!\n");  /* Check is ppp is ready to receive our packet */  if(!ap->ppp_open)    {      DERROR(IRDA_CB_ERROR, "PPP not ready, dropping packet...\n");      /* When we return error, TTP will need to requeue the skb and       * will stop the sender. IrTTP will stall until we send it a       * flow control request... */      return -ENOMEM;    }  /* strip address/control field if present */  p = skb->data;  if((p[0] == PPP_ALLSTATIONS) && (p[1] == PPP_UI))    {      /* chop off address/control */      if(skb->len < 3)	goto err_exit;      p = skb_pull(skb, 2);    }  /* decompress protocol field if compressed */  if(p[0] & 1)    {      /* protocol is compressed */      skb_push(skb, 1)[0] = 0;    }  else    if(skb->len < 2)      goto err_exit;  /* pass to generic ppp layer */  /* Note : how do I know if ppp can accept or not the packet ? This is   * essential if I want to manage flow control smoothly... */  ppp_input(&ap->chan, skb);  DEXIT(IRDA_TCB_TRACE, "\n");  return 0; err_exit:  DERROR(IRDA_CB_ERROR, "Packet too small, dropping...\n");  kfree_skb(skb);  ppp_input_error(&ap->chan, code);  return 0;	/* Don't return an error code, only for flow control... */}/*------------------------------------------------------------------*//* * Function irnet_disconnect_indication (instance, sap, reason, skb) * *    Connection has been closed. Chech reason to find out why * * Note : there are many cases where we come here : *	o attempted to connect, timeout *	o connected, link is broken, LAP has timeout *	o connected, other side close the link *	o connection request on the server not handled */static voidirnet_disconnect_indication(void *	instance,			    void *	sap, 			    LM_REASON	reason,			    struct sk_buff *skb){  irnet_socket *	self = (irnet_socket *) instance;  int			test_open;  int			test_connect;  DENTER(IRDA_TCB_TRACE, "(self=0x%p)\n", self);  DASSERT(self != NULL, , IRDA_CB_ERROR, "Self is NULL !!!\n");  /* Don't care about it, but let's not leak it */  if(skb)    dev_kfree_skb(skb);  /* Prevent higher layer from accessing IrTTP */  test_open = test_and_clear_bit(0, &self->ttp_open);  /* Not connecting anymore...   * (note : TSAP is open, so IAP callbacks are no longer pending...) */  test_connect = test_and_clear_bit(0, &self->ttp_connect);  /* If both self->ttp_open and self->ttp_connect are NULL, it mean that we   * have a race condition with irda_irnet_destroy() or   * irnet_connect_indication(), so don't mess up tsap...   */  if(!(test_open || test_connect))    {      DERROR(IRDA_CB_ERROR, "Race condition detected...\n");      return;    }  /* If we were active, notify the control channel */  if(test_open)    irnet_post_event(self, IRNET_DISCONNECT_FROM,		     self->saddr, self->daddr, self->rname, 0);  else    /* If we were trying to connect, notify the control channel */    if((self->tsap) && (self != &irnet_server.s))      irnet_post_event(self, IRNET_NOANSWER_FROM,		       self->saddr, self->daddr, self->rname, 0);  /* Close our IrTTP connection, cleanup tsap */  if((self->tsap) && (self != &irnet_server.s))    {      DEBUG(IRDA_CB_INFO, "Closing our TTP connection.\n");      irttp_close_tsap(self->tsap);      self->tsap = NULL;    }  /* Cleanup the socket in case we want to reconnect in ppp_output_wakeup() */  self->stsap_sel = 0;  self->daddr = DEV_ADDR_ANY;  self->tx_flow = FLOW_START;  /* Deal with the ppp instance if it's still alive */  if(self->ppp_open)    {      if(test_open)	{#ifdef MISSING_PPP_API	  /* ppp_unregister_channel() wants a user context, which we	   * are guaranteed to NOT have here. What are we supposed	   * to do here ? Jean II */	  /* If we were connected, cleanup & close the PPP channel,	   * which will kill pppd (hangup) and the rest */	  ppp_unregister_channel(&self->chan);	  self->ppp_open = 0;#endif	}      else	{	  /* If we were trying to connect, flush (drain) ppp_generic	   * Tx queue (most often we have blocked it), which will	   * trigger an other attempt to connect. If we are passive,	   * this will empty the Tx queue after last try. */	  ppp_output_wakeup(&self->chan);	}    }  DEXIT(IRDA_TCB_TRACE, "\n");}/*------------------------------------------------------------------*//* * Function irnet_connect_confirm (instance, sap, qos, max_sdu_size, skb) * *    Connections has been confirmed by the remote device * */static voidirnet_connect_confirm(void *	instance,		      void *	sap, 		      struct qos_info *qos,		      __u32	max_sdu_size,		      __u8	max_header_size, 		      struct sk_buff *skb){  irnet_socket *	self = (irnet_socket *) instance;  DENTER(IRDA_TCB_TRACE, "(self=0x%p)\n", self);  /* Check if socket is closing down (via irda_irnet_destroy()) */  if(! test_bit(0, &self->ttp_connect))    {      DERROR(IRDA_CB_ERROR, "Socket no longer connecting. Ouch !\n");      return;    }  /* How much header space do we need to reserve */  self->max_header_size = max_header_size;  /* IrTTP max SDU size in transmit direction */  self->max_sdu_size_tx = max_sdu_size;  self->max_data_size = max_sdu_size;#ifdef STREAM_COMPAT  if(max_sdu_size == 0)    self->max_data_size = irttp_get_max_seg_size(self->tsap);#endif /* STREAM_COMPAT */  /* At this point, IrLMP has assigned our source address */  self->saddr = irttp_get_saddr(self->tsap);  /* Allow higher layer to access IrTTP */  set_bit(0, &self->ttp_open);  clear_bit(0, &self->ttp_connect);	/* Not racy, IrDA traffic is serial */  /* Give a kick in the ass of ppp_generic so that he sends us some data */  ppp_output_wakeup(&self->chan);  /* Check size of received packet */  if(skb->len > 0)    {#ifdef PASS_CONNECT_PACKETS      DEBUG(IRDA_CB_INFO, "Passing connect packet to PPP.\n");      /* Try to pass it to PPP */      irnet_data_indication(instance, sap, skb);#else /* PASS_CONNECT_PACKETS */      DERROR(IRDA_CB_ERROR, "Dropping non empty packet.\n");      kfree_skb(skb);	/* Note : will be optimised with other kfree... */#endif /* PASS_CONNECT_PACKETS */    }  else    kfree_skb(skb);  /* Notify the control channel */  irnet_post_event(self, IRNET_CONNECT_TO,		   self->saddr, self->daddr, self->rname, 0);  DEXIT(IRDA_TCB_TRACE, "\n");}/*------------------------------------------------------------------*//* * Function irnet_flow_indication (instance, sap, flow) * *    Used by TinyTP to tell us if it can accept more data or not * */static voidirnet_flow_indication(void *	instance,		      void *	sap,		      LOCAL_FLOW flow) {  irnet_socket *	self = (irnet_socket *) instance;  LOCAL_FLOW		oldflow = self->tx_flow;  DENTER(IRDA_TCB_TRACE, "(self=0x%p, flow=%d)\n", self, flow);  /* Update our state */  self->tx_flow = flow;  /* Check what IrTTP want us to do... */  switch(flow)    {    case FLOW_START:      DEBUG(IRDA_CB_INFO, "IrTTP wants us to start again\n");      /* Check if we really need to wake up PPP */      if(oldflow == FLOW_STOP)	ppp_output_wakeup(&self->chan);      else	DEBUG(IRDA_CB_INFO, "But we were already transmitting !!!\n");      break;    case FLOW_STOP:      DEBUG(IRDA_CB_INFO, "IrTTP wants us to slow down\n");      break;    default:      DEBUG(IRDA_CB_INFO, "Unknown flow command!\n");      break;    }  DEXIT(IRDA_TCB_TRACE, "\n");}/*------------------------------------------------------------------*//* * Function irnet_status_indication (instance, sap, reason, skb) * *    Link (IrLAP) status report. * */static voidirnet_status_indication(void *	instance,			LINK_STATUS link,			LOCK_STATUS lock){  irnet_socket *	self = (irnet_socket *) instance;  DENTER(IRDA_TCB_TRACE, "(self=0x%p)\n", self);  DASSERT(self != NULL, , IRDA_CB_ERROR, "Self is NULL !!!\n");  /* We can only get this event if we are connected */  switch(link)    {    case STATUS_NO_ACTIVITY:      irnet_post_event(self, IRNET_BLOCKED_LINK,		       self->saddr, self->daddr, self->rname, 0);      break;    default:      DEBUG(IRDA_CB_INFO, "Unknown status...\n");    }  DEXIT(IRDA_TCB_TRACE, "\n");}/*------------------------------------------------------------------*//* * Function irnet_connect_indication(instance, sap, qos, max_sdu_size, userdata) * *    Incoming connection * * In theory, this function is called only on the server socket. * Some other node is attempting to connect to the IrNET service, and has * sent a connection request on our server socket. * We just redirect the connection to the relevant IrNET socket. *  * Note : we also make sure that between 2 irnet nodes, there can * exist only one irnet connection. */static voidirnet_connect_indication(void *		instance,			 void *		sap, 			 struct qos_info *qos,			 __u32		max_sdu_size,			 __u8		max_header_size,			 struct sk_buff *skb){  irnet_socket *	server = &irnet_server.s;  irnet_socket *	new = (irnet_socket *) NULL;  DENTER(IRDA_TCB_TRACE, "(server=0x%p)\n", server);  DASSERT(instance == &irnet_server, , IRDA_CB_ERROR,	  "Invalid instance (0x%p) !!!\n", instance);  DASSERT(sap == irnet_server.s.tsap, , IRDA_CB_ERROR, "Invalid sap !!!\n");  /* Try to find the most appropriate IrNET socket */  new = irnet_find_socket(server);  /* After all this hard work, do we have an socket ? */  if(new == (irnet_socket *) NULL)    {      DEXIT(IRDA_CB_INFO, ": No socket waiting for this connection.\n");      irnet_disconnect_server(server, skb);      return;    }  /* Is the socket already busy ? */  if(test_bit(0, &new->ttp_open))    {      DEXIT(IRDA_CB_INFO, ": Socket already connected.\n");      irnet_disconnect_server(server, skb);      return;    }  /* The following code is a bit tricky, so need comments ;-)   */  /* If ttp_connect is set, the socket is trying to connect to the other   * end and may have sent a IrTTP connection request and is waiting for   * a connection response (that may never come).   * Now, the pain is that the socket may have opened a tsap and is   * waiting on it, while the other end is trying to connect to it on   * another tsap.   * Because IrNET can be peer to peer, we need to workaround this.   * Furthermore, the way the irnetd script is implemented, the   * target will create a second IrNET connection back to the   * originator and expect the originator to bind this new connection   * to the original PPPD instance.   * And of course, if we don't use irnetd, we can have a race when   * both side try to connect simultaneously, which could leave both   * connections half closed (yuck).   * Conclusions :   *	1) The "originator" must accept the new connection and get rid   *	   of the old one so that irnetd works   *	2) One side must deny the new connection to avoid races,   *	   but both side must agree on which side it is...   * Most often, the originator is primary at the LAP layer.   * Jean II   */  /* Now, let's look at the way I wrote the test...   * We need to clear up the ttp_connect flag atomically to prevent   * irnet_disconnect_indication() to mess up the tsap we are going to close.   * We want to clear the ttp_connect flag only if we close the tsap,   * otherwise we will never close it, so we need to check for primary   * *before* doing the test on the flag.   * And of course, ALLOW_SIMULT_CONNECT can disable this entirely...   * Jean II   */  /* Socket already connecting ? On primary ? */  if(0#ifdef ALLOW_SIMULT_CONNECT     || ((irttp_is_primary(server->tsap) == 1)	/* primary */	 && (test_and_clear_bit(0, &new->ttp_connect)))#endif /* ALLOW_SIMULT_CONNECT */     )    {      DERROR(IRDA_CB_ERROR, "Socket already connecting, but going to reuse it !\n");      /* Cleanup the old TSAP if necessary - IrIAP will be cleaned up later */      if(new->tsap != NULL)	{	  /* Close the old connection the new socket was attempting,	   * so that we can hook it up to the new connection.	   * It's now safe to do it... */	  irttp_close_tsap(new->tsap);	  new->tsap = NULL;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
图片区小说区区亚洲影院| 国产欧美日韩卡一| 国产精品理论片| 国产在线视视频有精品| 91精品国产麻豆| 视频一区二区三区中文字幕| 欧洲一区二区三区在线| 自拍偷拍国产精品| 一本色道综合亚洲| 亚洲精品大片www| 精品视频999| 秋霞成人午夜伦在线观看| 欧美一级欧美三级| 久热成人在线视频| 国产婷婷色一区二区三区| 国产精品一二三区在线| 国产精品丝袜91| 97精品视频在线观看自产线路二| 一区在线播放视频| 欧美专区在线观看一区| 亚洲精品国产视频| 欧美日韩一区二区在线观看 | 一区二区三区电影在线播| 色综合天天狠狠| 日本在线播放一区二区三区| 日韩欧美黄色影院| 成人在线视频一区二区| 国产精品视频看| 91福利国产成人精品照片| 亚洲欧美成aⅴ人在线观看| 欧美性色aⅴ视频一区日韩精品| 亚洲图片一区二区| 欧美色视频在线观看| 亚洲午夜精品网| 日韩欧美你懂的| 丁香天五香天堂综合| 亚洲女厕所小便bbb| 色婷婷精品久久二区二区蜜臂av | 成人免费视频视频| 一区二区激情小说| 欧美日韩黄色影视| 国产成人免费视| 亚洲综合久久av| 精品成人在线观看| 日本韩国欧美国产| 国产综合色在线| 一区二区三区在线免费观看| 911精品国产一区二区在线| 国产精品一级黄| 亚洲国产精品精华液网站| 久久久久久久久久久久久久久99| 日本道色综合久久| 狠狠久久亚洲欧美| 一区二区三区电影在线播| 久久人人爽爽爽人久久久| 日本高清不卡一区| 大美女一区二区三区| 五月综合激情网| 综合久久久久综合| 精品999久久久| 欧美日免费三级在线| 成人免费av在线| 美女视频网站久久| 亚洲一区免费观看| 中文字幕亚洲一区二区va在线| 日韩视频免费观看高清完整版 | 免费看日韩精品| 一区二区三区成人| 国产精品污网站| 精品国产乱码久久久久久免费 | 91老师片黄在线观看| 国内精品久久久久影院薰衣草| 性做久久久久久久免费看| ...中文天堂在线一区| 2023国产精品| 日韩欧美国产电影| 欧美日韩视频在线第一区| 91丨九色丨蝌蚪丨老版| 成人黄色小视频| 国产精品综合一区二区三区| 美女在线视频一区| 日韩高清电影一区| 午夜久久久久久久久久一区二区| 亚洲日本va在线观看| 欧美激情一区在线| 国产清纯在线一区二区www| 欧美精品一区二区高清在线观看| 欧美一区二区日韩| 日韩欧美一级精品久久| 宅男噜噜噜66一区二区66| 欧美日韩一区小说| 精品视频1区2区| 欧美日韩一区二区电影| 欧美优质美女网站| 欧美日韩免费高清一区色橹橹| 欧美视频在线一区二区三区| 欧美亚洲一区二区在线观看| 在线观看不卡视频| 欧美精品一二三| 欧美日韩的一区二区| 欧美影视一区二区三区| 日本精品一级二级| 色视频欧美一区二区三区| 欧美亚洲日本国产| 欧美一区二区三区在线视频| 日韩一卡二卡三卡四卡| 精品少妇一区二区三区免费观看| 精品久久国产老人久久综合| 欧美一区二区视频在线观看2022| 久久久蜜桃精品| 成人欧美一区二区三区| 亚洲午夜免费电影| 美国十次综合导航| 国产成人av影院| 色狠狠色狠狠综合| 欧美日韩免费一区二区三区| 欧美一级夜夜爽| 久久久久久毛片| 欧美经典三级视频一区二区三区| 亚洲美女免费视频| 美腿丝袜亚洲色图| 成人免费精品视频| 欧美日韩免费观看一区三区| 欧美精品一区二区在线观看| 国产精品久久久久久久久晋中 | 91精品国产入口| 欧美本精品男人aⅴ天堂| 中日韩av电影| 亚洲chinese男男1069| 久久99深爱久久99精品| 9色porny自拍视频一区二区| 欧美精品在线观看一区二区| 国产丝袜欧美中文另类| 亚洲愉拍自拍另类高清精品| 九九视频精品免费| 91黄色免费网站| 久久精品视频在线看| 亚洲高清视频在线| 国产成人a级片| 在线电影院国产精品| 国产精品福利一区二区| 丝袜亚洲另类丝袜在线| 国内精品久久久久影院薰衣草| 成人app网站| 欧美三区在线观看| 国产三级精品三级| 亚洲一区在线观看免费观看电影高清 | 成人一级黄色片| 91精品国产综合久久精品性色| 国产精品久久久久aaaa樱花 | 成人在线视频首页| 欧美一区二区三区免费在线看| 国产精品久久久久影院| 琪琪久久久久日韩精品| 色综合久久精品| 久久久不卡网国产精品一区| 日本欧美一区二区在线观看| 91在线你懂得| 国产亚洲一区二区在线观看| 日韩精品电影在线| 欧美日韩一区中文字幕| 亚洲日本在线观看| 成人综合婷婷国产精品久久 | 欧美国产97人人爽人人喊| 热久久一区二区| 在线视频综合导航| 国产欧美一区二区三区沐欲| 亚洲一区在线观看网站| 91在线观看美女| 欧美国产日韩在线观看| 极品少妇一区二区三区精品视频 | 久久久综合激的五月天| 亚洲精品免费视频| 国产不卡视频在线播放| 精品国产一区二区三区av性色| 亚洲另类在线一区| 精品亚洲porn| 日韩一区二区三区在线视频| 天堂午夜影视日韩欧美一区二区| 色哟哟亚洲精品| 国产精品你懂的| av中文一区二区三区| 中文字幕欧美一| 99精品1区2区| 亚洲女爱视频在线| 91麻豆精品在线观看| 亚洲日本在线观看| 91久久人澡人人添人人爽欧美| 亚洲欧美日韩小说| 色综合天天综合狠狠| 有坂深雪av一区二区精品| 在线观看日韩精品| 亚洲一区二区精品视频| 欧美日韩国产系列| 日本成人在线视频网站| 日韩精品一区二区三区在线观看| 久久精品国产**网站演员| 2欧美一区二区三区在线观看视频| 国产在线不卡一区| 欧美国产精品劲爆|