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

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

?? bluetooth.c

?? 講述linux的初始化過程
?? C
?? 第 1 頁 / 共 3 頁
字號(hào):
				printk("cmd_pkt from interrupt!\n");				return count;			}			new_buffer = kmalloc (count-1, GFP_KERNEL);			if (!new_buffer) {				err (__FUNCTION__ "- out of memory.");				return -ENOMEM;			}			if (from_user)				copy_from_user (new_buffer, buf+1, count-1);			else				memcpy (new_buffer, buf+1, count-1);			if (bluetooth_ctrl_msg (bluetooth, 0x00, 0x00, new_buffer, count-1) != 0) {				kfree (new_buffer);				return 0;			}			/* need to free new_buffer somehow... FIXME */			return count;		case ACL_PKT:			current_position = buf;			++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");					return bytes_sent;				}								/* free up the last buffer that this urb used */				if (urb->transfer_buffer != NULL) {					kfree(urb->transfer_buffer);					urb->transfer_buffer = NULL;				}				buffer_size = MIN (count, bluetooth->bulk_out_buffer_size);								new_buffer = kmalloc (buffer_size, GFP_KERNEL);				if (new_buffer == NULL) {					err(__FUNCTION__" no more kernel memory...");					return bytes_sent;				}				if (from_user)					copy_from_user(new_buffer, current_position, buffer_size);				else					memcpy (new_buffer, current_position, buffer_size);				/* build up our urb */				FILL_BULK_URB (urb, bluetooth->dev, usb_sndbulkpipe(bluetooth->dev, bluetooth->bulk_out_endpointAddress),						new_buffer, buffer_size, bluetooth_write_bulk_callback, bluetooth);				urb->transfer_flags |= USB_QUEUE_BULK;				/* send it down the pipe */				status = usb_submit_urb(urb);				if (status)					dbg(__FUNCTION__ " - usb_submit_urb(write bulk) failed with status = %d", status);#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;			}			return bytes_sent + 1;				default :			dbg(__FUNCTION__" - unsupported (at this time) write type");	}	return 0;} 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;#ifdef BTBUGGYHARDWARE	if ((count == 4) && (data[0] == 0x00) && (data[1] == 0x00)	    && (data[2] == 0x00) && (data[3] == 0x00)) {		urb->actual_length = 0;		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 resubmitting read urb, error %d", result);		return;	}#endif	dbg(__FUNCTION__);	if (!bluetooth) {		dbg(__FUNCTION__ " - bad bluetooth pointer, exiting");		goto exit;	}	if (urb->status) {		dbg(__FUNCTION__ " - nonzero read bulk status received: %d", urb->status);		goto exit;	}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
九九精品视频在线看| 亚洲电影一级黄| 亚洲欧洲在线观看av| 国产精品久久夜| 一区二区三区四区在线免费观看| 国产精品短视频| 日日夜夜精品免费视频| 看国产成人h片视频| 国产精品一区二区91| 色94色欧美sute亚洲13| 欧美性猛交一区二区三区精品| 3d成人h动漫网站入口| 久久亚洲综合av| 亚洲国产综合人成综合网站| 欧美日韩国产在线播放网站| 久久99日本精品| 国产成人在线色| 欧美日韩黄色影视| 日本一区二区不卡视频| 亚洲第一精品在线| 成人精品一区二区三区四区| 在线成人免费观看| 亚洲色图都市小说| 国产精品羞羞答答xxdd| 日韩一区二区三区视频在线观看| 国产精品久久久久影视| 国产精品一区二区在线看| 欧美一区日韩一区| 一区二区三区四区在线| 国产麻豆一精品一av一免费| 欧美午夜影院一区| 一区二区在线观看视频| 丁香一区二区三区| 欧美激情综合五月色丁香| 国产在线视频精品一区| 日韩欧美综合在线| 蜜桃视频在线观看一区| 欧美一区二区三区不卡| 青椒成人免费视频| 日韩亚洲欧美一区二区三区| 日韩国产欧美在线视频| 欧美一二三区在线| 国产精品综合av一区二区国产馆| www国产精品av| 国产69精品久久99不卡| 亚洲日本在线a| 欧美在线观看18| 亚洲在线观看免费视频| 欧美精品乱人伦久久久久久| 丝袜亚洲另类欧美| 久久先锋资源网| 日本高清不卡在线观看| 日产精品久久久久久久性色| 日韩一区二区三区免费观看| 成人午夜碰碰视频| 亚洲观看高清完整版在线观看| 日韩午夜小视频| 91蝌蚪porny九色| 久久精品国产99国产| 亚洲国产精品激情在线观看| 在线免费观看日本欧美| 精品一区二区影视| 亚洲综合图片区| 国产日韩欧美精品综合| 欧美一区二区三区四区视频| 成人免费毛片嘿嘿连载视频| 三级精品在线观看| 亚洲午夜在线视频| 国产精品每日更新| 久久网站最新地址| 555www色欧美视频| 欧洲一区二区三区在线| 成人一级片在线观看| 美女视频黄a大片欧美| 亚洲午夜免费电影| 中文字幕欧美一区| 欧美国产97人人爽人人喊| 国产网站一区二区三区| 韩国三级电影一区二区| 精品免费日韩av| 日韩午夜三级在线| 欧美日韩一区不卡| 4438x亚洲最大成人网| 欧美美女bb生活片| 欧美一级日韩不卡播放免费| 欧美日本国产视频| 欧美肥妇free| 亚洲精品一区在线观看| 国产日韩在线不卡| 中文字幕第一区二区| 亚洲天堂2014| 日本成人在线电影网| 国产精品一二三四五| www.爱久久.com| 欧美精品日韩综合在线| wwwwxxxxx欧美| 亚洲免费在线观看视频| 亚洲成人av一区| 国产成人一区在线| 91国产福利在线| 日韩精品一区在线| 国产精品久久久久久久久免费相片 | 久久看人人爽人人| 国产欧美精品区一区二区三区 | 欧美吞精做爰啪啪高潮| 日韩情涩欧美日韩视频| 国产精品国产三级国产aⅴ入口| 亚洲免费在线观看视频| 国模娜娜一区二区三区| 在线观看亚洲一区| 欧美激情艳妇裸体舞| 久久精品国产秦先生| 99国产精品久久久久久久久久| 91精品国产综合久久久久| 国产精品久久久久一区二区三区共 | 国产美女在线观看一区| 欧美人牲a欧美精品| 亚洲人成电影网站色mp4| 成人免费看的视频| 久久久久久亚洲综合| 日本va欧美va精品发布| 精品视频一区二区三区免费| 亚洲视频香蕉人妖| 91视频一区二区三区| 国产精品久久久久久户外露出| 韩国av一区二区| 日韩亚洲欧美在线观看| 日韩电影免费在线看| 欧美色爱综合网| 亚洲h在线观看| 日韩亚洲欧美中文三级| 精品一区二区三区影院在线午夜 | 国产激情视频一区二区在线观看 | 成人激情文学综合网| 国产情人综合久久777777| 国产福利一区二区三区视频在线 | 国产在线不卡一区| 欧美激情自拍偷拍| 在线观看一区日韩| 婷婷中文字幕一区三区| 日韩欧美国产成人一区二区| 国产在线精品一区二区不卡了 | 日韩一级黄色片| 成人免费毛片嘿嘿连载视频| 亚洲精品国产成人久久av盗摄| 欧美麻豆精品久久久久久| 精品写真视频在线观看| 亚洲欧美偷拍卡通变态| 日韩一区二区中文字幕| 97精品超碰一区二区三区| 日韩成人av影视| 亚洲日本在线视频观看| 日韩你懂的在线观看| 色综合天天在线| 激情小说亚洲一区| 午夜av区久久| 国产精品久久久久久久久免费丝袜| 欧美久久久一区| 99久久久国产精品| 国产激情视频一区二区在线观看| 一区二区三区自拍| 国产精品久久毛片a| 精品99999| 精品国产乱码久久久久久老虎| 色嗨嗨av一区二区三区| 91丝袜美腿高跟国产极品老师| 狠狠久久亚洲欧美| 日韩成人免费在线| 视频在线观看91| 视频一区免费在线观看| 亚洲综合色噜噜狠狠| 一个色妞综合视频在线观看| 国产精品美女www爽爽爽| 国产欧美1区2区3区| 久久精品一二三| 国产精品国产三级国产aⅴ中文| 国产色产综合产在线视频| 国产精品色噜噜| 自拍偷拍亚洲欧美日韩| 一区二区三区精品视频| 亚洲国产精品一区二区尤物区| 亚洲国产另类av| 免费久久精品视频| 国产不卡免费视频| 99久久国产免费看| 91福利在线免费观看| 欧美一区二区精品| 国产精品久久久久久亚洲毛片| 亚洲男女毛片无遮挡| 另类小说一区二区三区| 国产精品一区二区三区99| 不卡av免费在线观看| 欧美午夜寂寞影院| 国产亚洲一二三区| 亚洲黄色小视频| 蜜桃av噜噜一区| 99精品一区二区三区| 精品国产不卡一区二区三区| 中文字幕一区在线观看视频| 美女视频网站久久|