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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ircomm_tty_attach.c

?? 優龍2410linux2.6.8內核源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/********************************************************************* *                 * Filename:      ircomm_tty_attach.c * Version:        * Description:   Code for attaching the serial driver to IrCOMM * Status:        Experimental. * Author:        Dag Brattli <dagb@cs.uit.no> * Created at:    Sat Jun  5 17:42:00 1999 * Modified at:   Tue Jan  4 14:20:49 2000 * Modified by:   Dag Brattli <dagb@cs.uit.no> *  *     Copyright (c) 1999-2000 Dag Brattli, All Rights Reserved. *     Copyright (c) 2000-2003 Jean Tourrilhes <jt@hpl.hp.com> *      *     This program is free software; you can redistribute it and/or  *     modify it under the terms of the GNU General Public License as  *     published by the Free Software Foundation; either version 2 of  *     the License, or (at your option) any later version. *  *     This program is distributed in the hope that it will be useful, *     but WITHOUT ANY WARRANTY; without even the implied warranty of *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *     GNU General Public License for more details. *  *     You should have received a copy of the GNU General Public License  *     along with this program; if not, write to the Free Software  *     Foundation, Inc., 59 Temple Place, Suite 330, Boston,  *     MA 02111-1307 USA *      ********************************************************************/#include <linux/sched.h>#include <linux/init.h>#include <net/irda/irda.h>#include <net/irda/irlmp.h>#include <net/irda/iriap.h>#include <net/irda/irttp.h>#include <net/irda/irias_object.h>#include <net/irda/parameters.h>#include <net/irda/ircomm_core.h>#include <net/irda/ircomm_param.h>#include <net/irda/ircomm_event.h>#include <net/irda/ircomm_tty.h>#include <net/irda/ircomm_tty_attach.h>static void ircomm_tty_ias_register(struct ircomm_tty_cb *self);static void ircomm_tty_discovery_indication(discinfo_t *discovery,					    DISCOVERY_MODE mode,					    void *priv);static void ircomm_tty_getvalue_confirm(int result, __u16 obj_id, 					struct ias_value *value, void *priv);void ircomm_tty_start_watchdog_timer(struct ircomm_tty_cb *self, int timeout);void ircomm_tty_watchdog_timer_expired(void *data);static int ircomm_tty_state_idle(struct ircomm_tty_cb *self, 				 IRCOMM_TTY_EVENT event, 				 struct sk_buff *skb, 				 struct ircomm_tty_info *info);static int ircomm_tty_state_search(struct ircomm_tty_cb *self, 				   IRCOMM_TTY_EVENT event, 				   struct sk_buff *skb, 				   struct ircomm_tty_info *info);static int ircomm_tty_state_query_parameters(struct ircomm_tty_cb *self, 					     IRCOMM_TTY_EVENT event, 					     struct sk_buff *skb, 					     struct ircomm_tty_info *info);static int ircomm_tty_state_query_lsap_sel(struct ircomm_tty_cb *self, 					   IRCOMM_TTY_EVENT event, 					   struct sk_buff *skb, 					   struct ircomm_tty_info *info);static int ircomm_tty_state_setup(struct ircomm_tty_cb *self, 				  IRCOMM_TTY_EVENT event, 				  struct sk_buff *skb, 				  struct ircomm_tty_info *info);static int ircomm_tty_state_ready(struct ircomm_tty_cb *self, 				  IRCOMM_TTY_EVENT event, 				  struct sk_buff *skb, 				  struct ircomm_tty_info *info);char *ircomm_tty_state[] = {	"IRCOMM_TTY_IDLE",	"IRCOMM_TTY_SEARCH",	"IRCOMM_TTY_QUERY_PARAMETERS",	"IRCOMM_TTY_QUERY_LSAP_SEL",	"IRCOMM_TTY_SETUP",	"IRCOMM_TTY_READY",	"*** ERROR *** ",};char *ircomm_tty_event[] = {	"IRCOMM_TTY_ATTACH_CABLE",	"IRCOMM_TTY_DETACH_CABLE",	"IRCOMM_TTY_DATA_REQUEST",	"IRCOMM_TTY_DATA_INDICATION",	"IRCOMM_TTY_DISCOVERY_REQUEST",	"IRCOMM_TTY_DISCOVERY_INDICATION",	"IRCOMM_TTY_CONNECT_CONFIRM",	"IRCOMM_TTY_CONNECT_INDICATION",	"IRCOMM_TTY_DISCONNECT_REQUEST",	"IRCOMM_TTY_DISCONNECT_INDICATION",	"IRCOMM_TTY_WD_TIMER_EXPIRED",	"IRCOMM_TTY_GOT_PARAMETERS",	"IRCOMM_TTY_GOT_LSAPSEL",	"*** ERROR ****",};static int (*state[])(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event,		      struct sk_buff *skb, struct ircomm_tty_info *info) = {	ircomm_tty_state_idle,	ircomm_tty_state_search,	ircomm_tty_state_query_parameters,	ircomm_tty_state_query_lsap_sel,	ircomm_tty_state_setup,	ircomm_tty_state_ready,};/* * Function ircomm_tty_attach_cable (driver) * *    Try to attach cable (IrCOMM link). This function will only return *    when the link has been connected, or if an error condition occurs.  *    If success, the return value is the resulting service type. */int ircomm_tty_attach_cable(struct ircomm_tty_cb *self){	IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );	ASSERT(self != NULL, return -1;);	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;);       	/* Check if somebody has already connected to us */	if (ircomm_is_connected(self->ircomm)) {		IRDA_DEBUG(0, "%s(), already connected!\n", __FUNCTION__ );		return 0;	}	/* Make sure nobody tries to write before the link is up */	self->tty->hw_stopped = 1;	ircomm_tty_ias_register(self);	/* Check if somebody has already connected to us */	if (ircomm_is_connected(self->ircomm)) {		IRDA_DEBUG(0, "%s(), already connected!\n", __FUNCTION__ );		return 0;	}	ircomm_tty_do_event(self, IRCOMM_TTY_ATTACH_CABLE, NULL, NULL);	return 0;}/* * Function ircomm_detach_cable (driver) * *    Detach cable, or cable has been detached by peer * */void ircomm_tty_detach_cable(struct ircomm_tty_cb *self){	IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );	ASSERT(self != NULL, return;);	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);	del_timer(&self->watchdog_timer);	/* Remove IrCOMM hint bits */	irlmp_unregister_client(self->ckey);	irlmp_unregister_service(self->skey);	if (self->iriap) { 		iriap_close(self->iriap);		self->iriap = NULL;	}	/* Remove LM-IAS object */	if (self->obj) {		irias_delete_object(self->obj);		self->obj = NULL;	}	ircomm_tty_do_event(self, IRCOMM_TTY_DETACH_CABLE, NULL, NULL);	/* Reset some values */	self->daddr = self->saddr = 0;	self->dlsap_sel = self->slsap_sel = 0;	memset(&self->settings, 0, sizeof(struct ircomm_params));}/* * Function ircomm_tty_ias_register (self) * *    Register with LM-IAS depending on which service type we are * */static void ircomm_tty_ias_register(struct ircomm_tty_cb *self){	__u8 oct_seq[6];	__u16 hints;	IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );	ASSERT(self != NULL, return;);	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);		if (self->service_type & IRCOMM_3_WIRE_RAW) {		hints = irlmp_service_to_hint(S_PRINTER);		hints |= irlmp_service_to_hint(S_COMM);				/* Register IrLPT with LM-IAS */		self->obj = irias_new_object("IrLPT", IAS_IRLPT_ID);		irias_add_integer_attrib(self->obj, "IrDA:IrLMP:LsapSel", 					 self->slsap_sel, IAS_KERNEL_ATTR);		irias_insert_object(self->obj);	} else {		hints = irlmp_service_to_hint(S_COMM);		/* Register IrCOMM with LM-IAS */		self->obj = irias_new_object("IrDA:IrCOMM", IAS_IRCOMM_ID);		irias_add_integer_attrib(self->obj, "IrDA:TinyTP:LsapSel", 					 self->slsap_sel, IAS_KERNEL_ATTR);				/* Code the parameters into the buffer */		irda_param_pack(oct_seq, "bbbbbb", 				IRCOMM_SERVICE_TYPE, 1, self->service_type,				IRCOMM_PORT_TYPE,    1, IRCOMM_SERIAL);				/* Register parameters with LM-IAS */		irias_add_octseq_attrib(self->obj, "Parameters", oct_seq, 6,					IAS_KERNEL_ATTR);		irias_insert_object(self->obj);	}	self->skey = irlmp_register_service(hints);	self->ckey = irlmp_register_client(hints,					   ircomm_tty_discovery_indication,					   NULL, (void *) self);}/* * Function ircomm_send_initial_parameters (self) * *    Send initial parameters to the remote IrCOMM device. These parameters *    must be sent before any data. */int ircomm_tty_send_initial_parameters(struct ircomm_tty_cb *self){	ASSERT(self != NULL, return -1;);	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;);	if (self->service_type & IRCOMM_3_WIRE_RAW) 		return 0;	/* 	 * Set default values, but only if the application for some reason 	 * haven't set them already	 */	IRDA_DEBUG(2, "%s(), data-rate = %d\n", __FUNCTION__ , 		   self->settings.data_rate);	if (!self->settings.data_rate)		self->settings.data_rate = 9600;	IRDA_DEBUG(2, "%s(), data-format = %d\n", __FUNCTION__ , 		   self->settings.data_format);	if (!self->settings.data_format)		self->settings.data_format = IRCOMM_WSIZE_8;  /* 8N1 */	IRDA_DEBUG(2, "%s(), flow-control = %d\n", __FUNCTION__ , 		   self->settings.flow_control);	/*self->settings.flow_control = IRCOMM_RTS_CTS_IN|IRCOMM_RTS_CTS_OUT;*/	/* Do not set delta values for the initial parameters */	self->settings.dte = IRCOMM_DTR | IRCOMM_RTS;	/* Only send service type parameter when we are the client */	if (self->client)		ircomm_param_request(self, IRCOMM_SERVICE_TYPE, FALSE);	ircomm_param_request(self, IRCOMM_DATA_RATE, FALSE);	ircomm_param_request(self, IRCOMM_DATA_FORMAT, FALSE);		/* For a 3 wire service, we just flush the last parameter and return */	if (self->settings.service_type == IRCOMM_3_WIRE) {		ircomm_param_request(self, IRCOMM_FLOW_CONTROL, TRUE);		return 0;	}	/* Only 9-wire service types continue here */	ircomm_param_request(self, IRCOMM_FLOW_CONTROL, FALSE);#if 0	ircomm_param_request(self, IRCOMM_XON_XOFF, FALSE);	ircomm_param_request(self, IRCOMM_ENQ_ACK, FALSE);#endif		/* Notify peer that we are ready to receive data */	ircomm_param_request(self, IRCOMM_DTE, TRUE);		return 0;}/* * Function ircomm_tty_discovery_indication (discovery) * *    Remote device is discovered, try query the remote IAS to see which *    device it is, and which services it has. * */static void ircomm_tty_discovery_indication(discinfo_t *discovery,					    DISCOVERY_MODE mode,					    void *priv){	struct ircomm_tty_cb *self;	struct ircomm_tty_info info;	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );	/* Important note :	 * We need to drop all passive discoveries.	 * The LSAP management of IrComm is deficient and doesn't deal	 * with the case of two instance connecting to each other	 * simultaneously (it will deadlock in LMP).	 * The proper fix would be to use the same technique as in IrNET,	 * to have one server socket and separate instances for the	 * connecting/connected socket.	 * The workaround is to drop passive discovery, which drastically	 * reduce the probability of this happening.	 * Jean II */	if(mode == DISCOVERY_PASSIVE)		return;	info.daddr = discovery->daddr;	info.saddr = discovery->saddr;	/* FIXME. We probably need to use hashbin_find_next(), but we first	 * need to ensure that "line" is unique. - Jean II */	self = (struct ircomm_tty_cb *) hashbin_get_first(ircomm_tty);	while (self != NULL) {		ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);				ircomm_tty_do_event(self, IRCOMM_TTY_DISCOVERY_INDICATION, 				    NULL, &info);		self = (struct ircomm_tty_cb *) hashbin_get_next(ircomm_tty);	}}/* * Function ircomm_tty_disconnect_indication (instance, sap, reason, skb) * *    Link disconnected * */void ircomm_tty_disconnect_indication(void *instance, void *sap, 				      LM_REASON reason,				      struct sk_buff *skb){	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance;	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );	ASSERT(self != NULL, return;);	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);	if (!self->tty)		return;	/* This will stop control data transfers */	self->flow = FLOW_STOP;	/* Stop data transfers */	self->tty->hw_stopped = 1;	ircomm_tty_do_event(self, IRCOMM_TTY_DISCONNECT_INDICATION, NULL, 			    NULL);}/* * Function ircomm_tty_getvalue_confirm (result, obj_id, value, priv) * *    Got result from the IAS query we make * */static void ircomm_tty_getvalue_confirm(int result, __u16 obj_id, 					struct ias_value *value, 					void *priv){	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) priv;	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );	ASSERT(self != NULL, return;);	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);	/* We probably don't need to make any more queries */	iriap_close(self->iriap);	self->iriap = NULL;	/* Check if request succeeded */	if (result != IAS_SUCCESS) {		IRDA_DEBUG(4, "%s(), got NULL value!\n", __FUNCTION__ );		return;	}	switch (value->type) { 	case IAS_OCT_SEQ:		IRDA_DEBUG(2, "%s(), got octet sequence\n", __FUNCTION__ );		irda_param_extract_all(self, value->t.oct_seq, value->len,				       &ircomm_param_info);		ircomm_tty_do_event(self, IRCOMM_TTY_GOT_PARAMETERS, NULL, 				    NULL);		break;	case IAS_INTEGER:		/* Got LSAP selector */			IRDA_DEBUG(2, "%s(), got lsapsel = %d\n", __FUNCTION__ , 			   value->t.integer);		if (value->t.integer == -1) {			IRDA_DEBUG(0, "%s(), invalid value!\n", __FUNCTION__ );		} else			self->dlsap_sel = value->t.integer;		ircomm_tty_do_event(self, IRCOMM_TTY_GOT_LSAPSEL, NULL, NULL);		break;	case IAS_MISSING:		IRDA_DEBUG(0, "%s(), got IAS_MISSING\n", __FUNCTION__ );		break;	default:		IRDA_DEBUG(0, "%s(), got unknown type!\n", __FUNCTION__ );		break;	}	irias_delete_value(value);}/* * Function ircomm_tty_connect_confirm (instance, sap, qos, max_sdu_size, skb) * *    Connection confirmed * */void ircomm_tty_connect_confirm(void *instance, void *sap, 				struct qos_info *qos, 				__u32 max_data_size, 				__u8 max_header_size, 				struct sk_buff *skb){	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance;	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );	ASSERT(self != NULL, return;);	ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);	self->client = TRUE;	self->max_data_size = max_data_size;	self->max_header_size = max_header_size;	self->flow = FLOW_START;	ircomm_tty_do_event(self, IRCOMM_TTY_CONNECT_CONFIRM, NULL, NULL);	/* No need to kfree_skb - see ircomm_ttp_connect_confirm() */}/* * Function ircomm_tty_connect_indication (instance, sap, qos, max_sdu_size,  *                                         skb) * *    we are discovered and being requested to connect by remote device ! * */void ircomm_tty_connect_indication(void *instance, void *sap, 				   struct qos_info *qos, 				   __u32 max_data_size,				   __u8 max_header_size, 				   struct sk_buff *skb){	struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance;	int clen;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看国产日韩| 欧美性色欧美a在线播放| 1024国产精品| 欧美日韩亚洲综合在线 | 国产精品丝袜黑色高跟| 在线视频欧美区| 美女爽到高潮91| 国产精品美日韩| 在线播放91灌醉迷j高跟美女| 国产资源精品在线观看| 亚洲日本欧美天堂| 精品国产凹凸成av人网站| 色婷婷亚洲精品| 久久草av在线| 日韩毛片一二三区| 欧美精品粉嫩高潮一区二区| 成人免费视频国产在线观看| 亚洲bdsm女犯bdsm网站| 国产精品私人自拍| 欧美大片国产精品| 在线影院国内精品| 国产乱码精品一品二品| 亚洲色图都市小说| 久久精品夜色噜噜亚洲a∨| 欧美日韩一区二区三区四区| 国产成人精品三级| 免费观看91视频大全| 亚洲黄色片在线观看| 久久精品欧美一区二区三区麻豆| 欧美视频精品在线观看| 成人a级免费电影| 久久国产精品免费| 午夜伦理一区二区| 中文字幕一区免费在线观看| 精品va天堂亚洲国产| 91久久线看在观草草青青| 美女网站视频久久| 婷婷国产v国产偷v亚洲高清| 亚洲欧美日韩电影| 国产欧美一区视频| 欧美va亚洲va在线观看蝴蝶网| 欧美影院一区二区三区| av不卡免费在线观看| 国产91丝袜在线观看| 精彩视频一区二区| 麻豆91免费看| 免费在线观看一区二区三区| 亚洲18色成人| 亚洲免费在线视频| 久久久欧美精品sm网站| 精品国产乱码久久久久久牛牛| 欧美久久久久免费| 欧美在线观看视频在线| 91浏览器在线视频| 色中色一区二区| 91美女片黄在线| av不卡在线播放| 91香蕉视频污| 91免费版在线看| 在线免费亚洲电影| 欧美三电影在线| 精品视频1区2区3区| 91成人网在线| kk眼镜猥琐国模调教系列一区二区 | 国产乱色国产精品免费视频| 国产美女久久久久| 国产精品一区三区| 国产麻豆视频一区二区| 激情六月婷婷久久| 国产一区二区不卡在线 | 91网页版在线| 在线亚洲高清视频| 欧美精选在线播放| 日韩欧美国产精品一区| 精品国产三级a在线观看| 久久久亚洲综合| 日本一区二区三区高清不卡| 国产精品久久久久精k8 | 精品日韩一区二区| 久久久噜噜噜久噜久久综合| 亚洲国产电影在线观看| 中文字幕佐山爱一区二区免费| 亚洲精品日韩综合观看成人91| 亚洲国产视频一区二区| 蜜桃在线一区二区三区| 日韩精品一二三| 国产综合久久久久久久久久久久| 成人午夜激情在线| 日本精品视频一区二区三区| 欧美丰满嫩嫩电影| 久久久久久久久一| 国产精品国产三级国产a| 一区二区三区中文字幕精品精品| 午夜精品久久久久久久久| 日韩二区在线观看| 国产成人小视频| 色94色欧美sute亚洲线路一久| 欧美日韩美少妇| 久久精品在线观看| 亚洲与欧洲av电影| 韩国一区二区在线观看| 91免费观看视频在线| 日韩一区二区三区三四区视频在线观看| 5858s免费视频成人| 欧美r级在线观看| 亚洲日本在线看| 麻豆成人在线观看| 日本高清视频一区二区| 26uuu亚洲综合色| 亚洲一区二区视频在线| 狠狠色伊人亚洲综合成人| 国产成人精品影视| 欧美日韩mp4| 国产精品麻豆一区二区| 天堂av在线一区| 成人激情免费网站| 日韩一区国产二区欧美三区| 国产精品色在线| 美女性感视频久久| 欧美性色黄大片| 国产欧美日韩卡一| 美女网站色91| 欧美伊人久久大香线蕉综合69| 国产亚洲美州欧州综合国| 亚洲国产sm捆绑调教视频| 成人福利视频网站| 欧美tk丨vk视频| 亚洲成人免费观看| 一本久道中文字幕精品亚洲嫩| 精品嫩草影院久久| 亚洲成人精品在线观看| 91色在线porny| 日韩视频一区二区三区| 亚洲图片另类小说| 国产成人精品免费| 久久综合狠狠综合久久激情| 日本欧美一区二区在线观看| 91行情网站电视在线观看高清版| 国产精品入口麻豆九色| 玖玖九九国产精品| 4hu四虎永久在线影院成人| 一卡二卡欧美日韩| 北条麻妃国产九九精品视频| 久久综合九色综合欧美98| 日本中文在线一区| 欧美日韩极品在线观看一区| 一区二区三区四区中文字幕| 91视频观看免费| 国产精品久久久久久亚洲伦 | 国产情人综合久久777777| 久久99国产精品尤物| 久久久久久9999| 99精品国产91久久久久久| 亚洲黄色免费网站| 制服丝袜av成人在线看| 久久99蜜桃精品| 国产精品免费看片| 欧美午夜影院一区| 蜜桃av噜噜一区| 国产日本亚洲高清| 日本韩国精品一区二区在线观看| 肉肉av福利一精品导航| 欧美精品一区二区在线观看| 粉嫩av一区二区三区| 一区二区三区.www| 欧美一区二区播放| 国产成人精品免费一区二区| 一区二区免费在线| 欧美一级理论性理论a| 丁香一区二区三区| 亚洲综合激情网| 精品久久久久久久一区二区蜜臀| 国产成人夜色高潮福利影视| 一区二区三区日本| 91精品久久久久久久91蜜桃| 国产精品一级黄| 亚洲第一电影网| 久久看人人爽人人| 欧美在线观看视频在线| 国内外精品视频| 亚洲人成在线观看一区二区| 欧美一二区视频| 99精品国产91久久久久久| 麻豆一区二区三| 亚洲免费大片在线观看| 日韩一区二区三区av| 99久久婷婷国产综合精品| 奇米一区二区三区| 亚洲人妖av一区二区| 精品国产污网站| 欧美亚洲国产怡红院影院| 国产乱子轮精品视频| 亚洲午夜久久久久久久久久久| 国产亚洲综合在线| 欧美日韩国产综合久久 | 韩国一区二区三区| 亚洲国产中文字幕在线视频综合| 久久久精品综合| 欧美一级日韩免费不卡| 色综合色综合色综合色综合色综合|