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

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

?? bluetooth.c

?? linux下的usb接口驅(qū)動程序
?? C
?? 第 1 頁 / 共 3 頁
字號:
		dbg (__FUNCTION__ " - device not opened");		return -EINVAL;	}	if (count == 0) {		dbg(__FUNCTION__ " - write request of 0 bytes");		return 0;	}	if (count == 1) {		dbg(__FUNCTION__ " - write request only included type %d", buf[0]);		return 1;	}#ifdef DEBUG	printk (KERN_DEBUG __FILE__ ": " __FUNCTION__ " - length = %d, data = ", count);	for (i = 0; i < count; ++i) {		printk ("%.2x ", buf[i]);	}	printk ("\n");#endif	if (from_user) {		temp_buffer = kmalloc (count, GFP_KERNEL);		if (temp_buffer == NULL) {			err (__FUNCTION__ "- out of memory.");			retval = -ENOMEM;			goto exit;		}		copy_from_user (temp_buffer, buf, count);		current_buffer = temp_buffer;	} else {		current_buffer = buf;	}	switch (*current_buffer) {		/* First byte indicates the type of packet */		case CMD_PKT:			/* dbg(__FUNCTION__ "- Send cmd_pkt len:%d", count);*/			retval = bluetooth_ctrl_msg (bluetooth, 0x00, 0x00, &current_buffer[1], count-1);			if (retval) {				goto exit;			}			retval = count;			break;		case ACL_PKT:			current_position = current_buffer;			++current_position;			--count;			bytes_sent = 0;			while (count > 0) {				urb = NULL;				/* try to find a free urb in our list */				for (i = 0; i < NUM_BULK_URBS; ++i) {					if (bluetooth->write_urb_pool[i]->status != -EINPROGRESS) {						urb = bluetooth->write_urb_pool[i];						break;					}				}				if (urb == NULL) {					dbg (__FUNCTION__ " - no free urbs");					retval = bytes_sent;					goto exit;				}								buffer_size = min (count, bluetooth->bulk_out_buffer_size);				memcpy (urb->transfer_buffer, current_position, buffer_size);				/* build up our urb */				FILL_BULK_URB (urb, bluetooth->dev, usb_sndbulkpipe(bluetooth->dev, bluetooth->bulk_out_endpointAddress),						urb->transfer_buffer, buffer_size, bluetooth_write_bulk_callback, bluetooth);				urb->transfer_flags |= USB_QUEUE_BULK;				/* send it down the pipe */				retval = usb_submit_urb(urb);				if (retval) {					dbg(__FUNCTION__ " - usb_submit_urb(write bulk) failed with error = %d", retval);					goto exit;				}#ifdef BTBUGGYHARDWARE				/* A workaround for the stalled data bug */				/* May or may not be needed...*/				if (count != 0) {					udelay(500);				}#endif				current_position += buffer_size;				bytes_sent += buffer_size;				count -= buffer_size;			}			retval = bytes_sent + 1;			break;				default :			dbg(__FUNCTION__" - unsupported (at this time) write type");			retval = -EINVAL;			break;	}exit:	if (temp_buffer != NULL)		kfree (temp_buffer);	return retval;} static int bluetooth_write_room (struct tty_struct *tty) {	struct usb_bluetooth *bluetooth = get_usb_bluetooth ((struct usb_bluetooth *)tty->driver_data, __FUNCTION__);	int room = 0;	int i;	if (!bluetooth) {		return -ENODEV;	}	dbg(__FUNCTION__);	if (!bluetooth->active) {		dbg (__FUNCTION__ " - device not open");		return -EINVAL;	}	for (i = 0; i < NUM_BULK_URBS; ++i) {		if (bluetooth->write_urb_pool[i]->status != -EINPROGRESS) {			room += bluetooth->bulk_out_buffer_size;		}	}	dbg(__FUNCTION__ " - returns %d", room);	return room;}static int bluetooth_chars_in_buffer (struct tty_struct *tty) {	struct usb_bluetooth *bluetooth = get_usb_bluetooth ((struct usb_bluetooth *)tty->driver_data, __FUNCTION__);	int chars = 0;	int i;	if (!bluetooth) {		return -ENODEV;	}	if (!bluetooth->active) {		dbg (__FUNCTION__ " - device not open");		return -EINVAL;	}	for (i = 0; i < NUM_BULK_URBS; ++i) {		if (bluetooth->write_urb_pool[i]->status == -EINPROGRESS) {			chars += bluetooth->write_urb_pool[i]->transfer_buffer_length;		}	}	dbg (__FUNCTION__ " - returns %d", chars);	return chars;}static void bluetooth_throttle (struct tty_struct * tty){	struct usb_bluetooth *bluetooth = get_usb_bluetooth ((struct usb_bluetooth *)tty->driver_data, __FUNCTION__);	if (!bluetooth) {		return;	}	dbg(__FUNCTION__);	if (!bluetooth->active) {		dbg (__FUNCTION__ " - device not open");		return;	}		dbg(__FUNCTION__ " unsupported (at this time)");	return;}static void bluetooth_unthrottle (struct tty_struct * tty){	struct usb_bluetooth *bluetooth = get_usb_bluetooth ((struct usb_bluetooth *)tty->driver_data, __FUNCTION__);	if (!bluetooth) {		return;	}	dbg(__FUNCTION__);	if (!bluetooth->active) {		dbg (__FUNCTION__ " - device not open");		return;	}	dbg(__FUNCTION__ " unsupported (at this time)");}static int bluetooth_ioctl (struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg){	struct usb_bluetooth *bluetooth = get_usb_bluetooth ((struct usb_bluetooth *)tty->driver_data, __FUNCTION__);	if (!bluetooth) {		return -ENODEV;	}	dbg(__FUNCTION__ " - cmd 0x%.4x", cmd);	if (!bluetooth->active) {		dbg (__FUNCTION__ " - device not open");		return -ENODEV;	}	/* FIXME!!! */	return -ENOIOCTLCMD;}static void bluetooth_set_termios (struct tty_struct *tty, struct termios * old){	struct usb_bluetooth *bluetooth = get_usb_bluetooth ((struct usb_bluetooth *)tty->driver_data, __FUNCTION__);	if (!bluetooth) {		return;	}	dbg(__FUNCTION__);	if (!bluetooth->active) {		dbg (__FUNCTION__ " - device not open");		return;	}	/* FIXME!!! */	return;}#ifdef BTBUGGYHARDWAREvoid btusb_enable_bulk_read(struct tty_struct *tty){	struct usb_bluetooth *bluetooth = get_usb_bluetooth ((struct usb_bluetooth *)tty->driver_data, __FUNCTION__);	int result;	if (!bluetooth) {		return;	}	dbg(__FUNCTION__);	if (!bluetooth->active) {		dbg (__FUNCTION__ " - device not open");		return;	}	if (bluetooth->read_urb) {		FILL_BULK_URB(bluetooth->read_urb, bluetooth->dev, 			      usb_rcvbulkpipe(bluetooth->dev, bluetooth->bulk_in_endpointAddress),			      bluetooth->bulk_in_buffer, bluetooth->bulk_in_buffer_size, 			      bluetooth_read_bulk_callback, bluetooth);		result = usb_submit_urb(bluetooth->read_urb);		if (result)			err (__FUNCTION__ " - failed submitting read urb, error %d", result);	}}void btusb_disable_bulk_read(struct tty_struct *tty){	struct usb_bluetooth *bluetooth = get_usb_bluetooth ((struct usb_bluetooth *)tty->driver_data, __FUNCTION__);	if (!bluetooth) {		return;	}	dbg(__FUNCTION__);	if (!bluetooth->active) {		dbg (__FUNCTION__ " - device not open");		return;	}	if ((bluetooth->read_urb) && (bluetooth->read_urb->actual_length))		usb_unlink_urb(bluetooth->read_urb);}#endif/***************************************************************************** * urb callback functions *****************************************************************************/static void bluetooth_int_callback (struct urb *urb){	struct usb_bluetooth *bluetooth = get_usb_bluetooth ((struct usb_bluetooth *)urb->context, __FUNCTION__);	unsigned char *data = urb->transfer_buffer;	unsigned int i;	unsigned int count = urb->actual_length;	unsigned int packet_size;	dbg(__FUNCTION__);	if (!bluetooth) {		dbg(__FUNCTION__ " - bad bluetooth pointer, exiting");		return;	}	if (urb->status) {		dbg(__FUNCTION__ " - nonzero int status received: %d", urb->status);		return;	}	if (!count) {		dbg(__FUNCTION__ " - zero length int");		return;	}#ifdef DEBUG	if (count) {		printk (KERN_DEBUG __FILE__ ": " __FUNCTION__ "- length = %d, data = ", count);		for (i = 0; i < count; ++i) {			printk ("%.2x ", data[i]);		}		printk ("\n");	}#endif#ifdef BTBUGGYHARDWARE	if ((count >= 2) && (data[0] == 0xFF) && (data[1] == 0x00)) {		data += 2;		count -= 2;	}	if (count == 0) {		urb->actual_length = 0;		return;	}#endif	/* We add  a packet type identifier to the beginning of each	   HCI frame.  This makes the data in the tty look like a	   serial USB devices.  Each HCI frame can be broken across	   multiple URBs so we buffer them until we have a full hci	   packet */	if (!bluetooth->int_packet_pos) {		bluetooth->int_buffer[0] = EVENT_PKT;		bluetooth->int_packet_pos++;	}		if (bluetooth->int_packet_pos + count > EVENT_BUFFER_SIZE) {		err(__FUNCTION__ " - exceeded EVENT_BUFFER_SIZE");		bluetooth->int_packet_pos = 0;		return;	}	memcpy (&bluetooth->int_buffer[bluetooth->int_packet_pos],		urb->transfer_buffer, count);	bluetooth->int_packet_pos += count;	urb->actual_length = 0;	if (bluetooth->int_packet_pos >= EVENT_HDR_SIZE)		packet_size = bluetooth->int_buffer[2];	else		return;	if (packet_size + EVENT_HDR_SIZE < bluetooth->int_packet_pos) {		err(__FUNCTION__ " - packet was too long");		bluetooth->int_packet_pos = 0;		return;	}	if (packet_size + EVENT_HDR_SIZE == bluetooth->int_packet_pos) {		for (i = 0; i < bluetooth->int_packet_pos; ++i) {			/* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them */			if (bluetooth->tty->flip.count >= TTY_FLIPBUF_SIZE) {				tty_flip_buffer_push(bluetooth->tty);			}			tty_insert_flip_char(bluetooth->tty, bluetooth->int_buffer[i], 0);		}		tty_flip_buffer_push(bluetooth->tty);		bluetooth->int_packet_pos = 0;	}}static void bluetooth_ctrl_callback (struct urb *urb){	struct usb_bluetooth *bluetooth = get_usb_bluetooth ((struct usb_bluetooth *)urb->context, __FUNCTION__);	dbg(__FUNCTION__);	if (!bluetooth) {		dbg(__FUNCTION__ " - bad bluetooth pointer, exiting");		return;	}	if (urb->status) {		dbg(__FUNCTION__ " - nonzero read bulk status received: %d", urb->status);		return;	}}static void bluetooth_read_bulk_callback (struct urb *urb){	struct usb_bluetooth *bluetooth = get_usb_bluetooth ((struct usb_bluetooth *)urb->context, __FUNCTION__);	unsigned char *data = urb->transfer_buffer;	unsigned int count = urb->actual_length;	unsigned int i;	unsigned int packet_size;	int result;	dbg(__FUNCTION__);	if (!bluetooth) {		dbg(__FUNCTION__ " - bad bluetooth pointer, exiting");		return;	}	if (urb->status) {		dbg(__FUNCTION__ " - nonzero read bulk status received: %d", urb->status);		if (urb->status == -ENOENT) {                   			dbg(__FUNCTION__ " - URB canceled, won't reschedule");			return;		}		goto exit;	}	if (!count) {		dbg(__FUNCTION__ " - zero length read bulk");		goto exit;	}#ifdef DEBUG	if (count) {		printk (KERN_DEBUG __FILE__ ": " __FUNCTION__ "- length = %d, data = ", count);		for (i = 0; i < count; ++i) {			printk ("%.2x ", data[i]);		}		printk ("\n");	}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91国偷自产一区二区开放时间| 成人黄色网址在线观看| 久久精品无码一区二区三区| 色综合久久久久综合99| 日韩成人一级片| 中文字幕日韩精品一区| 日韩欧美国产1| 99久久国产综合色|国产精品| 日本va欧美va精品发布| 亚洲综合色在线| 国产午夜一区二区三区| 欧美一区二区三区视频免费播放 | 久久精品国产99国产| 亚洲三级在线观看| 欧美国产视频在线| 日韩午夜在线影院| 99精品视频一区二区三区| 国产在线精品视频| 久久99热国产| 秋霞av亚洲一区二区三| 亚洲成人在线观看视频| 亚洲男人都懂的| 国产精品人妖ts系列视频| 欧美成人一区二区三区在线观看 | 国产91色综合久久免费分享| 青青草原综合久久大伊人精品| 一区二区三区四区av| 国产精品网站在线观看| 久久综合色播五月| 欧美岛国在线观看| 日韩午夜激情av| 51精品久久久久久久蜜臀| 欧美网站大全在线观看| 色激情天天射综合网| 91视频免费播放| 97精品电影院| 色综合久久综合网欧美综合网| 不卡一卡二卡三乱码免费网站| 大胆亚洲人体视频| 国产成人精品一区二区三区四区 | 中文字幕成人网| 中文字幕第一区二区| 国产精品看片你懂得| 中文字幕永久在线不卡| 亚洲视频每日更新| 亚洲人一二三区| 亚洲狠狠爱一区二区三区| 亚洲va欧美va天堂v国产综合| 亚洲一区二区欧美| 亚洲福利一区二区| 乱中年女人伦av一区二区| 美女看a上一区| 国产精品资源在线| 99久久精品免费看| 欧美日韩精品一二三区| 51精品久久久久久久蜜臀| 2022国产精品视频| 日本一区二区在线不卡| 亚洲日本在线观看| 日韩二区三区四区| 麻豆精品在线观看| 成人免费看片app下载| aaa欧美日韩| 欧美日韩一二三区| 精品日韩99亚洲| 亚洲青青青在线视频| 亚洲成人手机在线| 国产激情精品久久久第一区二区| 99精品欧美一区二区蜜桃免费 | 国产麻豆精品在线| 99久久婷婷国产综合精品电影 | xnxx国产精品| 国产精品的网站| 五月天丁香久久| 国产精品亚洲综合一区在线观看| 91美女片黄在线观看91美女| 91精品国产综合久久福利软件| 精品免费99久久| 亚洲视频在线观看一区| 麻豆一区二区99久久久久| 99视频精品免费视频| 3d动漫精品啪啪| 国产精品网站一区| 日韩va欧美va亚洲va久久| 国产99久久久国产精品潘金网站| 色丁香久综合在线久综合在线观看| 欧美丰满美乳xxx高潮www| 男男gaygay亚洲| av激情综合网| 日韩视频一区二区在线观看| 亚洲蜜臀av乱码久久精品蜜桃| 蜜臀久久99精品久久久久宅男| fc2成人免费人成在线观看播放| 欧美性高清videossexo| 久久久久久一级片| 丝袜亚洲另类欧美综合| 99久久精品99国产精品| 久久综合久久综合九色| 视频一区二区国产| 色综合天天天天做夜夜夜夜做| 精品国产欧美一区二区| 亚洲成va人在线观看| 成人免费视频一区| 欧美va亚洲va香蕉在线| 亚洲午夜激情av| 久久这里只有精品6| 伊人色综合久久天天| 国产91精品免费| 精品成人一区二区三区四区| 香蕉影视欧美成人| 在线视频欧美精品| 国产精品美女久久久久久久久久久| 欧美a级一区二区| 欧美视频在线一区| 亚洲视频一区在线| kk眼镜猥琐国模调教系列一区二区| 日韩精品在线看片z| 亚洲.国产.中文慕字在线| 色吊一区二区三区| 亚洲欧美日韩一区| av激情成人网| 成人免费一区二区三区在线观看 | 99精品欧美一区| 国产精品九色蝌蚪自拍| 国产成人在线观看免费网站| 精品久久99ma| 蜜桃久久av一区| 日韩一区二区三区三四区视频在线观看| 亚洲精品视频一区二区| 91丝袜美女网| 亚洲丝袜精品丝袜在线| 91香蕉视频污| 最近日韩中文字幕| 一本大道av伊人久久综合| 中文字幕日韩一区二区| 99精品视频一区二区三区| 中文字幕视频一区| 99久久久久免费精品国产| 日韩毛片一二三区| 91在线视频网址| 亚洲欧美综合另类在线卡通| 成人av免费观看| 亚洲欧美一区二区三区国产精品| 91在线视频免费观看| 亚洲一区二区三区视频在线 | 精品国产91洋老外米糕| 国内偷窥港台综合视频在线播放| 精品剧情v国产在线观看在线| 另类小说综合欧美亚洲| 久久精品人人做人人爽人人| 成人黄色在线网站| 樱桃国产成人精品视频| 欧美日韩的一区二区| 麻豆精品一区二区综合av| 精品精品欲导航| 成人avav影音| 亚洲网友自拍偷拍| 欧美精品一区二区三区蜜臀| 国产91丝袜在线播放| 一区二区在线观看免费| 欧美精品vⅰdeose4hd| 激情综合网天天干| 一区二区中文字幕在线| 色999日韩国产欧美一区二区| 亚洲不卡在线观看| 国产日韩欧美高清在线| 99re这里都是精品| 日本色综合中文字幕| 日本一区免费视频| 欧美日韩一区不卡| 国产乱码精品一区二区三区av | 91精品国产综合久久精品| 国产最新精品精品你懂的| 国产精品国产自产拍高清av | 一区二区三区在线影院| 欧美一区二区播放| 成人av在线一区二区三区| 亚洲aⅴ怡春院| 久久久久久电影| 欧美午夜在线观看| 国产精品1024久久| 日韩国产在线观看一区| 国产婷婷色一区二区三区四区| 色吊一区二区三区| 国产精品亚洲一区二区三区在线| 亚洲人成影院在线观看| 26uuu久久天堂性欧美| 欧美性猛交xxxx乱大交退制版| 精品一二三四区| 亚洲小说欧美激情另类| 久久久久高清精品| 欧美吞精做爰啪啪高潮| 国产成人午夜高潮毛片| 日韩高清不卡一区二区| 亚洲伦在线观看| 国产视频一区在线观看 | 欧美精品一区二区在线播放| 色综合久久天天| 高清日韩电视剧大全免费| 日韩二区在线观看|