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

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

?? ircomm_core.c

?? 優(yōu)龍2410linux2.6.8內(nèi)核源代碼
?? C
字號(hào):
/********************************************************************* *                 * Filename:      ircomm_core.c * Version:       1.0 * Description:   IrCOMM service interface * Status:        Experimental. * Author:        Dag Brattli <dagb@cs.uit.no> * Created at:    Sun Jun  6 20:37:34 1999 * Modified at:   Tue Dec 21 13:26:41 1999 * Modified by:   Dag Brattli <dagb@cs.uit.no> *  *     Copyright (c) 1999 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/config.h>#include <linux/module.h>#include <linux/sched.h>#include <linux/proc_fs.h>#include <linux/seq_file.h>#include <linux/init.h>#include <net/irda/irda.h>#include <net/irda/irmod.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/ircomm_event.h>#include <net/irda/ircomm_lmp.h>#include <net/irda/ircomm_ttp.h>#include <net/irda/ircomm_param.h>#include <net/irda/ircomm_core.h>static int __ircomm_close(struct ircomm_cb *self);static void ircomm_control_indication(struct ircomm_cb *self, 				      struct sk_buff *skb, int clen);#ifdef CONFIG_PROC_FSextern struct proc_dir_entry *proc_irda;static int ircomm_seq_open(struct inode *, struct file *);static struct file_operations ircomm_proc_fops = {	.owner		= THIS_MODULE,	.open           = ircomm_seq_open,	.read           = seq_read,	.llseek         = seq_lseek,	.release	= seq_release,};#endif /* CONFIG_PROC_FS */hashbin_t *ircomm = NULL;int __init ircomm_init(void){	ircomm = hashbin_new(HB_LOCK); 	if (ircomm == NULL) {		ERROR("%s(), can't allocate hashbin!\n", __FUNCTION__);		return -ENOMEM;	}	#ifdef CONFIG_PROC_FS	{ struct proc_dir_entry *ent;	ent = create_proc_entry("ircomm", 0, proc_irda);	if (ent) 		ent->proc_fops = &ircomm_proc_fops;	}#endif /* CONFIG_PROC_FS */		MESSAGE("IrCOMM protocol (Dag Brattli)\n");			return 0;}void __exit ircomm_cleanup(void){	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );	hashbin_delete(ircomm, (FREE_FUNC) __ircomm_close);#ifdef CONFIG_PROC_FS	remove_proc_entry("ircomm", proc_irda);#endif /* CONFIG_PROC_FS */}/* * Function ircomm_open (client_notify) * *    Start a new IrCOMM instance * */struct ircomm_cb *ircomm_open(notify_t *notify, __u8 service_type, int line){	struct ircomm_cb *self = NULL;	int ret;	IRDA_DEBUG(2, "%s(), service_type=0x%02x\n", __FUNCTION__ ,		   service_type);	ASSERT(ircomm != NULL, return NULL;);	self = kmalloc(sizeof(struct ircomm_cb), GFP_ATOMIC);	if (self == NULL)		return NULL;	memset(self, 0, sizeof(struct ircomm_cb));	self->notify = *notify;	self->magic = IRCOMM_MAGIC;	/* Check if we should use IrLMP or IrTTP */	if (service_type & IRCOMM_3_WIRE_RAW) {		self->flow_status = FLOW_START;		ret = ircomm_open_lsap(self);	} else		ret = ircomm_open_tsap(self);	if (ret < 0) {		kfree(self);		return NULL;	}	self->service_type = service_type;	self->line = line;	hashbin_insert(ircomm, (irda_queue_t *) self, line, NULL);	ircomm_next_state(self, IRCOMM_IDLE);		return self;}EXPORT_SYMBOL(ircomm_open);/* * Function ircomm_close_instance (self) * *    Remove IrCOMM instance * */static int __ircomm_close(struct ircomm_cb *self){	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );	/* Disconnect link if any */	ircomm_do_event(self, IRCOMM_DISCONNECT_REQUEST, NULL, NULL);	/* Remove TSAP */	if (self->tsap) {		irttp_close_tsap(self->tsap);		self->tsap = NULL;	}	/* Remove LSAP */	if (self->lsap) {		irlmp_close_lsap(self->lsap);		self->lsap = NULL;	}	self->magic = 0;	kfree(self);	return 0;}/* * Function ircomm_close (self) * *    Closes and removes the specified IrCOMM instance * */int ircomm_close(struct ircomm_cb *self){	struct ircomm_cb *entry;	ASSERT(self != NULL, return -EIO;);	ASSERT(self->magic == IRCOMM_MAGIC, return -EIO;);	IRDA_DEBUG(0, "%s()\n", __FUNCTION__ );	entry = hashbin_remove(ircomm, self->line, NULL);	ASSERT(entry == self, return -1;);	        return __ircomm_close(self);}EXPORT_SYMBOL(ircomm_close);/* * Function ircomm_connect_request (self, service_type) * *    Impl. of this function is differ from one of the reference. This *    function does discovery as well as sending connect request *  */int ircomm_connect_request(struct ircomm_cb *self, __u8 dlsap_sel, 			   __u32 saddr, __u32 daddr, struct sk_buff *skb,			   __u8 service_type){	struct ircomm_info info;	int ret;	IRDA_DEBUG(2 , "%s()\n", __FUNCTION__ );	ASSERT(self != NULL, return -1;);	ASSERT(self->magic == IRCOMM_MAGIC, return -1;);	self->service_type= service_type;	info.dlsap_sel = dlsap_sel;	info.saddr = saddr;	info.daddr = daddr;	ret = ircomm_do_event(self, IRCOMM_CONNECT_REQUEST, skb, &info);	return ret;}EXPORT_SYMBOL(ircomm_connect_request);/* * Function ircomm_connect_indication (self, qos, skb) * *    Notify user layer about the incoming connection * */void ircomm_connect_indication(struct ircomm_cb *self, struct sk_buff *skb,			       struct ircomm_info *info){	int clen = 0;		IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );	/* Check if the packet contains data on the control channel */	if (skb->len > 0)		clen = skb->data[0];		/* 	 * If there are any data hiding in the control channel, we must 	 * deliver it first. The side effect is that the control channel 	 * will be removed from the skb	 */	if (self->notify.connect_indication)		self->notify.connect_indication(self->notify.instance, self, 						info->qos, info->max_data_size,						info->max_header_size, skb);	else {		IRDA_DEBUG(0, "%s(), missing handler\n", __FUNCTION__ );	}}/* * Function ircomm_connect_response (self, userdata, max_sdu_size) * *    User accepts connection * */int ircomm_connect_response(struct ircomm_cb *self, struct sk_buff *userdata){	int ret;	ASSERT(self != NULL, return -1;);	ASSERT(self->magic == IRCOMM_MAGIC, return -1;);	IRDA_DEBUG(4, "%s()\n", __FUNCTION__ );	ret = ircomm_do_event(self, IRCOMM_CONNECT_RESPONSE, userdata, NULL);	return ret;}	EXPORT_SYMBOL(ircomm_connect_response);/* * Function connect_confirm (self, skb) * *    Notify user layer that the link is now connected * */void ircomm_connect_confirm(struct ircomm_cb *self, struct sk_buff *skb,			    struct ircomm_info *info){	IRDA_DEBUG(4, "%s()\n", __FUNCTION__ );	if (self->notify.connect_confirm )		self->notify.connect_confirm(self->notify.instance,					     self, info->qos, 					     info->max_data_size,					     info->max_header_size, skb);	else {		IRDA_DEBUG(0, "%s(), missing handler\n", __FUNCTION__ );	}}/* * Function ircomm_data_request (self, userdata) * *    Send IrCOMM data to peer device * */int ircomm_data_request(struct ircomm_cb *self, struct sk_buff *skb){	int ret;	IRDA_DEBUG(4, "%s()\n", __FUNCTION__ );	ASSERT(self != NULL, return -EFAULT;);	ASSERT(self->magic == IRCOMM_MAGIC, return -EFAULT;);	ASSERT(skb != NULL, return -EFAULT;);		ret = ircomm_do_event(self, IRCOMM_DATA_REQUEST, skb, NULL);	return ret;}EXPORT_SYMBOL(ircomm_data_request);/* * Function ircomm_data_indication (self, skb) * *    Data arrived, so deliver it to user * */void ircomm_data_indication(struct ircomm_cb *self, struct sk_buff *skb){		IRDA_DEBUG(4, "%s()\n", __FUNCTION__ );	ASSERT(skb->len > 0, return;);	if (self->notify.data_indication)		self->notify.data_indication(self->notify.instance, self, skb);	else {		IRDA_DEBUG(0, "%s(), missing handler\n", __FUNCTION__ );	}}/* * Function ircomm_process_data (self, skb) * *    Data arrived which may contain control channel data * */void ircomm_process_data(struct ircomm_cb *self, struct sk_buff *skb){	int clen;	ASSERT(skb->len > 0, return;);	clen = skb->data[0];	/* 	 * If there are any data hiding in the control channel, we must 	 * deliver it first. The side effect is that the control channel 	 * will be removed from the skb	 */	if (clen > 0)		ircomm_control_indication(self, skb, clen);	/* Remove control channel from data channel */	skb_pull(skb, clen+1);	if (skb->len)		ircomm_data_indication(self, skb);			else {		IRDA_DEBUG(4, "%s(), data was control info only!\n",			   __FUNCTION__ );	}}/* * Function ircomm_control_request (self, params) * *    Send control data to peer device * */int ircomm_control_request(struct ircomm_cb *self, struct sk_buff *skb){	int ret;		IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );	ASSERT(self != NULL, return -EFAULT;);	ASSERT(self->magic == IRCOMM_MAGIC, return -EFAULT;);	ASSERT(skb != NULL, return -EFAULT;);		ret = ircomm_do_event(self, IRCOMM_CONTROL_REQUEST, skb, NULL);	return ret;}EXPORT_SYMBOL(ircomm_control_request);/* * Function ircomm_control_indication (self, skb) * *    Data has arrived on the control channel * */static void ircomm_control_indication(struct ircomm_cb *self, 				      struct sk_buff *skb, int clen){	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );		/* Use udata for delivering data on the control channel */	if (self->notify.udata_indication) {		struct sk_buff *ctrl_skb;		/* We don't own the skb, so clone it */		ctrl_skb = skb_clone(skb, GFP_ATOMIC);		if (!ctrl_skb)			return;		/* Remove data channel from control channel */		skb_trim(ctrl_skb, clen+1);			self->notify.udata_indication(self->notify.instance, self, 					      ctrl_skb);		/* Drop reference count -		 * see ircomm_tty_control_indication(). */		dev_kfree_skb(ctrl_skb);	} else {		IRDA_DEBUG(0, "%s(), missing handler\n", __FUNCTION__ );	}}/* * Function ircomm_disconnect_request (self, userdata, priority) * *    User layer wants to disconnect the IrCOMM connection * */int ircomm_disconnect_request(struct ircomm_cb *self, struct sk_buff *userdata){	struct ircomm_info info;	int ret;	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );	ASSERT(self != NULL, return -1;);	ASSERT(self->magic == IRCOMM_MAGIC, return -1;);	ret = ircomm_do_event(self, IRCOMM_DISCONNECT_REQUEST, userdata, 			      &info);	return ret;}EXPORT_SYMBOL(ircomm_disconnect_request);/* * Function disconnect_indication (self, skb) * *    Tell user that the link has been disconnected * */void ircomm_disconnect_indication(struct ircomm_cb *self, struct sk_buff *skb,				  struct ircomm_info *info){	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );       	ASSERT(info != NULL, return;);	if (self->notify.disconnect_indication) {		self->notify.disconnect_indication(self->notify.instance, self,						   info->reason, skb);	} else {		IRDA_DEBUG(0, "%s(), missing handler\n", __FUNCTION__ );	}}/* * Function ircomm_flow_request (self, flow) * *     * */void ircomm_flow_request(struct ircomm_cb *self, LOCAL_FLOW flow){	IRDA_DEBUG(2, "%s()\n", __FUNCTION__ );	ASSERT(self != NULL, return;);	ASSERT(self->magic == IRCOMM_MAGIC, return;);	if (self->service_type == IRCOMM_3_WIRE_RAW)		return;	irttp_flow_request(self->tsap, flow);}EXPORT_SYMBOL(ircomm_flow_request);#ifdef CONFIG_PROC_FSstatic void *ircomm_seq_start(struct seq_file *seq, loff_t *pos){	struct ircomm_cb *self;	loff_t off = 0;	spin_lock_irq(&ircomm->hb_spinlock);	for (self = (struct ircomm_cb *) hashbin_get_first(ircomm);	     self != NULL;	     self = (struct ircomm_cb *) hashbin_get_next(ircomm)) {		if (off++ == *pos)			break;			}	return self;}static void *ircomm_seq_next(struct seq_file *seq, void *v, loff_t *pos){	++*pos;	return (void *) hashbin_get_next(ircomm);}static void ircomm_seq_stop(struct seq_file *seq, void *v){	spin_unlock_irq(&ircomm->hb_spinlock);}static int ircomm_seq_show(struct seq_file *seq, void *v){ 		const struct ircomm_cb *self = v;	ASSERT(self->magic == IRCOMM_MAGIC, return -EINVAL; );	if(self->line < 0x10)		seq_printf(seq, "ircomm%d", self->line);	else		seq_printf(seq, "irlpt%d", self->line - 0x10);	seq_printf(seq,		   " state: %s, slsap_sel: %#02x, dlsap_sel: %#02x, mode:",		   ircomm_state[ self->state],		   self->slsap_sel, self->dlsap_sel); 	if(self->service_type & IRCOMM_3_WIRE_RAW)		seq_printf(seq, " 3-wire-raw");	if(self->service_type & IRCOMM_3_WIRE)		seq_printf(seq, " 3-wire");	if(self->service_type & IRCOMM_9_WIRE)		seq_printf(seq, " 9-wire");	if(self->service_type & IRCOMM_CENTRONICS)		seq_printf(seq, " Centronics");	seq_putc(seq, '\n');	return 0;}static struct seq_operations ircomm_seq_ops = {	.start  = ircomm_seq_start,	.next   = ircomm_seq_next,	.stop   = ircomm_seq_stop,	.show   = ircomm_seq_show,};static int ircomm_seq_open(struct inode *inode, struct file *file){	return seq_open(file, &ircomm_seq_ops);}#endif /* CONFIG_PROC_FS */MODULE_AUTHOR("Dag Brattli <dag@brattli.net>");MODULE_DESCRIPTION("IrCOMM protocol");MODULE_LICENSE("GPL");module_init(ircomm_init);module_exit(ircomm_cleanup);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色婷婷一区二区三区四区| 日韩亚洲欧美中文三级| 欧美日韩成人一区二区| 国产日产亚洲精品系列| 亚洲成人av一区二区三区| 成人黄色网址在线观看| 精品毛片乱码1区2区3区| 亚洲一区二区三区在线看| 成人久久久精品乱码一区二区三区| 欧美精品视频www在线观看 | 色吊一区二区三区| 久久亚洲二区三区| 日韩av二区在线播放| 欧美午夜免费电影| 亚洲精品免费看| 成人黄色在线网站| 日本一区二区三区视频视频| 国产精品影音先锋| 欧美一级片免费看| 免费人成网站在线观看欧美高清| 欧美区在线观看| 亚洲电影欧美电影有声小说| 91福利在线看| 亚洲成a人v欧美综合天堂下载| 在线精品亚洲一区二区不卡| 亚洲一区二区在线免费观看视频| 91丨九色丨黑人外教| 亚洲欧洲日产国码二区| 91丨九色丨国产丨porny| 国产精品久久久久久久久免费丝袜 | 日韩精品午夜视频| 欧美精品色综合| 美国十次综合导航| 亚洲精品一区二区三区四区高清 | 爽好多水快深点欧美视频| 欧美日韩视频第一区| 日韩精品久久理论片| 欧美一级高清片| 国产在线精品一区二区夜色| 亚洲精品一区二区三区香蕉| 粉嫩aⅴ一区二区三区四区五区 | 久久亚洲免费视频| 韩国成人精品a∨在线观看| 国产欧美日韩三级| 成人精品鲁一区一区二区| 国产精品卡一卡二| 色婷婷狠狠综合| 午夜电影一区二区三区| 精品久久久久99| 成人爱爱电影网址| 亚洲午夜av在线| 欧美变态凌虐bdsm| 成人18精品视频| 亚洲丰满少妇videoshd| 精品裸体舞一区二区三区| 成人激情动漫在线观看| 亚洲www啪成人一区二区麻豆| 精品欧美一区二区三区精品久久| 粉嫩一区二区三区性色av| 亚洲麻豆国产自偷在线| 日韩亚洲欧美中文三级| 成人永久看片免费视频天堂| 亚洲国产日韩综合久久精品| 精品99一区二区三区| 在线免费观看日韩欧美| 韩国毛片一区二区三区| 亚洲专区一二三| 国产视频911| 欧美人成免费网站| 成人国产精品免费观看| 蜜臀av性久久久久蜜臀aⅴ| 中文字幕一区二区三区色视频 | 中文字幕在线观看一区二区| 欧美日韩午夜精品| 国产98色在线|日韩| 日韩欧美资源站| 久久99国产精品久久99果冻传媒| 久久久午夜精品| 欧美视频自拍偷拍| 成人动漫在线一区| 开心九九激情九九欧美日韩精美视频电影| 亚洲色图另类专区| 精品91自产拍在线观看一区| 欧美日韩精品一区二区在线播放| 成人ar影院免费观看视频| 美女视频黄频大全不卡视频在线播放| 综合自拍亚洲综合图不卡区| 欧美sm美女调教| 欧美一区二区三级| 欧美在线视频不卡| 91看片淫黄大片一级| 国产91露脸合集magnet| 久久99精品视频| 免费高清在线一区| 日韩在线一二三区| 亚洲国产精品自拍| 亚洲成av人片一区二区三区| 精品一区二区在线免费观看| 亚洲一区在线播放| 亚洲天堂精品视频| 国产精品三级在线观看| 欧美精品一区二区三区高清aⅴ| 欧美日韩一区三区四区| 欧美亚洲一区二区在线| www.亚洲激情.com| heyzo一本久久综合| 成人午夜视频福利| 国产精品 欧美精品| 国产精品亚洲а∨天堂免在线| 卡一卡二国产精品| 免费高清不卡av| 精品一二三四区| 国内成人免费视频| 国产乱码精品一区二区三区忘忧草| 狠狠色丁香婷婷综合| www.av亚洲| 亚洲国产综合在线| 精品久久国产字幕高潮| 91精品国产一区二区| 欧美高清视频www夜色资源网| 欧美亚洲禁片免费| 91精品国产黑色紧身裤美女| 69av一区二区三区| 亚洲精品在线三区| 日本一区二区成人| 亚洲免费成人av| 亚洲r级在线视频| 免费xxxx性欧美18vr| 国产激情一区二区三区| 成人av电影在线观看| 在线观看欧美精品| 日韩视频免费直播| 国产午夜精品久久久久久久 | 精品国产成人在线影院| 久久久久高清精品| 亚洲免费av在线| 奇米影视一区二区三区| 国产成人午夜精品5599| 成人爱爱电影网址| 99精品1区2区| 51精品久久久久久久蜜臀| 精品国产免费视频| 国产精品毛片大码女人| 亚洲精品美腿丝袜| 美国毛片一区二区三区| 99免费精品在线观看| 欧美精品第1页| 国产精品理论在线观看| 亚洲成va人在线观看| 国产精品 欧美精品| 91传媒视频在线播放| 久久综合色播五月| 亚洲精品国产品国语在线app| 麻豆国产精品777777在线| 99国产精品一区| 欧美成人女星排名| 一区二区三区美女视频| 国产成人自拍网| 制服丝袜国产精品| 亚洲欧美国产77777| 国产一区二区伦理片| 这里只有精品免费| 亚洲激情第一区| 国产成人8x视频一区二区| 欧美一二三区在线| 一区二区三区四区国产精品| 国产成人综合在线| 精品人在线二区三区| 亚洲国产欧美另类丝袜| aaa欧美日韩| 久久久午夜电影| www.成人网.com| 国产女同性恋一区二区| 蜜桃视频一区二区| 欧美日韩中文精品| 亚洲欧美另类小说| 丁香婷婷综合网| 午夜精品久久久久久不卡8050| av电影在线观看一区| 日韩一区二区在线观看| 亚洲婷婷国产精品电影人久久| 国模大尺度一区二区三区| 欧美日韩激情一区| 亚洲在线视频网站| 色中色一区二区| 亚洲天堂a在线| 不卡影院免费观看| 国产女主播在线一区二区| 国产一区不卡在线| 精品国产伦一区二区三区观看方式 | 成人av先锋影音| 久久在线免费观看| 精品一区二区国语对白| 精品久久99ma| 麻豆精品国产传媒mv男同| 日韩一区二区三区视频在线 | 亚洲va欧美va人人爽| 成人a区在线观看| 国产视频一区二区三区在线观看| 久久精品国产在热久久|