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

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

?? pciehp_ctrl.c

?? 底層驅動開發
?? C
?? 第 1 頁 / 共 5 頁
字號:
		return 0;	} else		return 2;}/** * pciehp_slot_find - Looks for a node by bus, and device, multiple functions accessed * @bus: bus to find * @device: device to find * @index: is 0 for first function found, 1 for the second... * * Returns pointer to the node if successful, %NULL otherwise. */struct pci_func *pciehp_slot_find(u8 bus, u8 device, u8 index){	int found = -1;	struct pci_func *func;	func = pciehp_slot_list[bus];	dbg("%s: bus %x device %x index %x\n",		__FUNCTION__, bus, device, index);	if (func != NULL) {		dbg("%s: func-> bus %x device %x function %x pci_dev %p\n",			__FUNCTION__, func->bus, func->device, func->function,			func->pci_dev);	} else		dbg("%s: func == NULL\n", __FUNCTION__);	if ((func == NULL) || ((func->device == device) && (index == 0)))		return func;	if (func->device == device)		found++;	while (func->next != NULL) {		func = func->next;		dbg("%s: In while loop, func-> bus %x device %x function %x pci_dev %p\n",			__FUNCTION__, func->bus, func->device, func->function,			func->pci_dev);		if (func->device == device)			found++;		dbg("%s: while loop, found %d, index %d\n", __FUNCTION__,			found, index);		if ((found == index) || (func->function == index)) {			dbg("%s: Found bus %x dev %x func %x\n", __FUNCTION__,					func->bus, func->device, func->function);			return func;		}	}	return NULL;}static int is_bridge(struct pci_func * func){	/* Check the header type */	if (((func->config_space[0x03] >> 16) & 0xFF) == 0x01)		return 1;	else		return 0;}/* The following routines constitute the bulk of the    hotplug controller logic */static void set_slot_off(struct controller *ctrl, struct slot * pslot){	/* Wait for exclusive access to hardware */	down(&ctrl->crit_sect);	/* turn off slot, turn on Amber LED, turn off Green LED if supported*/	if (POWER_CTRL(ctrl->ctrlcap)) {		if (pslot->hpc_ops->power_off_slot(pslot)) {   			err("%s: Issue of Slot Power Off command failed\n", __FUNCTION__);			up(&ctrl->crit_sect);			return;		}		wait_for_ctrl_irq (ctrl);	}	if (PWR_LED(ctrl->ctrlcap)) {		pslot->hpc_ops->green_led_off(pslot);   		wait_for_ctrl_irq (ctrl);	}	if (ATTN_LED(ctrl->ctrlcap)) { 		if (pslot->hpc_ops->set_attention_status(pslot, 1)) {   			err("%s: Issue of Set Attention Led command failed\n", __FUNCTION__);			up(&ctrl->crit_sect);			return;		}		wait_for_ctrl_irq (ctrl);	}	/* Done with exclusive hardware access */	up(&ctrl->crit_sect);}/** * board_added - Called after a board has been added to the system. * * Turns power on for the board * Configures board * */static u32 board_added(struct pci_func * func, struct controller * ctrl){	u8 hp_slot;	int index;	u32 temp_register = 0xFFFFFFFF;	u32 rc = 0;	struct pci_func *new_func = NULL;	struct slot *p_slot;	struct resource_lists res_lists;	p_slot = pciehp_find_slot(ctrl, func->device);	hp_slot = func->device - ctrl->slot_device_offset;	dbg("%s: func->device, slot_offset, hp_slot = %d, %d ,%d\n", __FUNCTION__, func->device, ctrl->slot_device_offset, hp_slot);	/* Wait for exclusive access to hardware */	down(&ctrl->crit_sect);	if (POWER_CTRL(ctrl->ctrlcap)) {		/* Power on slot */		rc = p_slot->hpc_ops->power_on_slot(p_slot);		if (rc) {			up(&ctrl->crit_sect);			return -1;		}		/* Wait for the command to complete */		wait_for_ctrl_irq (ctrl);	}		if (PWR_LED(ctrl->ctrlcap)) {		p_slot->hpc_ops->green_led_blink(p_slot);					/* Wait for the command to complete */		wait_for_ctrl_irq (ctrl);	}	/* Done with exclusive hardware access */	up(&ctrl->crit_sect);	/* Wait for ~1 second */	dbg("%s: before long_delay\n", __FUNCTION__);	wait_for_ctrl_irq (ctrl);	dbg("%s: afterlong_delay\n", __FUNCTION__);	/*  Check link training status */	rc = p_slot->hpc_ops->check_lnk_status(ctrl);  	if (rc) {		err("%s: Failed to check link status\n", __FUNCTION__);		set_slot_off(ctrl, p_slot);		return rc;	}	dbg("%s: func status = %x\n", __FUNCTION__, func->status);	/* Check for a power fault */	if (func->status == 0xFF) {		/* power fault occurred, but it was benign */		temp_register = 0xFFFFFFFF;		dbg("%s: temp register set to %x by power fault\n", __FUNCTION__, temp_register);		rc = POWER_FAILURE;		func->status = 0;	} else {		/* Get vendor/device ID u32 */		rc = pci_bus_read_config_dword (ctrl->pci_dev->subordinate, PCI_DEVFN(func->device, func->function), 			PCI_VENDOR_ID, &temp_register);		dbg("%s: pci_bus_read_config_dword returns %d\n", __FUNCTION__, rc);		dbg("%s: temp_register is %x\n", __FUNCTION__, temp_register);		if (rc != 0) {			/* Something's wrong here */			temp_register = 0xFFFFFFFF;			dbg("%s: temp register set to %x by error\n", __FUNCTION__, temp_register);		}		/* Preset return code.  It will be changed later if things go okay. */		rc = NO_ADAPTER_PRESENT;	}	/* All F's is an empty slot or an invalid board */	if (temp_register != 0xFFFFFFFF) {	  /* Check for a board in the slot */		res_lists.io_head = ctrl->io_head;		res_lists.mem_head = ctrl->mem_head;		res_lists.p_mem_head = ctrl->p_mem_head;		res_lists.bus_head = ctrl->bus_head;		res_lists.irqs = NULL;		rc = configure_new_device(ctrl, func, 0, &res_lists, 0, 0);		dbg("%s: back from configure_new_device\n", __FUNCTION__);		ctrl->io_head = res_lists.io_head;		ctrl->mem_head = res_lists.mem_head;		ctrl->p_mem_head = res_lists.p_mem_head;		ctrl->bus_head = res_lists.bus_head;		pciehp_resource_sort_and_combine(&(ctrl->mem_head));		pciehp_resource_sort_and_combine(&(ctrl->p_mem_head));		pciehp_resource_sort_and_combine(&(ctrl->io_head));		pciehp_resource_sort_and_combine(&(ctrl->bus_head));		if (rc) {			set_slot_off(ctrl, p_slot);			return rc;		}		pciehp_save_slot_config(ctrl, func);		func->status = 0;		func->switch_save = 0x10;		func->is_a_board = 0x01;		/* next, we will instantiate the linux pci_dev structures 		 * (with appropriate driver notification, if already present) 		 */		index = 0;		do {			new_func = pciehp_slot_find(ctrl->slot_bus, func->device, index++);			if (new_func && !new_func->pci_dev) {				dbg("%s:call pci_hp_configure_dev, func %x\n", 					__FUNCTION__, index);				pciehp_configure_device(ctrl, new_func);			}		} while (new_func); 		/*  		 * Some PCI Express root ports require fixup after hot-plug operation. 		 */ 		if (pcie_mch_quirk) 			pci_fixup_device(pci_fixup_final, ctrl->pci_dev);   		if (PWR_LED(ctrl->ctrlcap)) {  			/* Wait for exclusive access to hardware */  			down(&ctrl->crit_sect);     			p_slot->hpc_ops->green_led_on(p_slot);    			/* Wait for the command to complete */  			wait_for_ctrl_irq (ctrl);  	  			/* Done with exclusive hardware access */  			up(&ctrl->crit_sect);  		}	} else {		set_slot_off(ctrl, p_slot);		return -1;	}	return 0;}/** * remove_board - Turns off slot and LED's * */static u32 remove_board(struct pci_func *func, struct controller *ctrl){	int index;	u8 skip = 0;	u8 device;	u8 hp_slot;	u32 rc;	struct resource_lists res_lists;	struct pci_func *temp_func;	struct slot *p_slot;	if (func == NULL)		return 1;	if (pciehp_unconfigure_device(func))		return 1;	device = func->device;	hp_slot = func->device - ctrl->slot_device_offset;	p_slot = pciehp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);	dbg("In %s, hp_slot = %d\n", __FUNCTION__, hp_slot);	if ((ctrl->add_support) &&		!(func->bus_head || func->mem_head || func->p_mem_head || func->io_head)) {		/* Here we check to see if we've saved any of the board's		 * resources already.  If so, we'll skip the attempt to		 * determine what's being used.		 */		index = 0;		temp_func = func;		while ((temp_func = pciehp_slot_find(temp_func->bus, temp_func->device, index++))) {			if (temp_func->bus_head || temp_func->mem_head			    || temp_func->p_mem_head || temp_func->io_head) {				skip = 1;				break;			}		}		if (!skip)			rc = pciehp_save_used_resources(ctrl, func, DISABLE_CARD);	}	/* Change status to shutdown */	if (func->is_a_board)		func->status = 0x01;	func->configured = 0;	/* Wait for exclusive access to hardware */	down(&ctrl->crit_sect);	if (POWER_CTRL(ctrl->ctrlcap)) {		/* power off slot */		rc = p_slot->hpc_ops->power_off_slot(p_slot);		if (rc) {			err("%s: Issue of Slot Disable command failed\n", __FUNCTION__);			up(&ctrl->crit_sect);			return rc;		}		/* Wait for the command to complete */		wait_for_ctrl_irq (ctrl);	}	if (PWR_LED(ctrl->ctrlcap)) {		/* turn off Green LED */		p_slot->hpc_ops->green_led_off(p_slot);			/* Wait for the command to complete */		wait_for_ctrl_irq (ctrl);	}	/* Done with exclusive hardware access */	up(&ctrl->crit_sect);	if (ctrl->add_support) {		while (func) {			res_lists.io_head = ctrl->io_head;			res_lists.mem_head = ctrl->mem_head;			res_lists.p_mem_head = ctrl->p_mem_head;			res_lists.bus_head = ctrl->bus_head;			dbg("Returning resources to ctlr lists for (B/D/F) = (%#x/%#x/%#x)\n", 				func->bus, func->device, func->function);			pciehp_return_board_resources(func, &res_lists);			ctrl->io_head = res_lists.io_head;			ctrl->mem_head = res_lists.mem_head;			ctrl->p_mem_head = res_lists.p_mem_head;			ctrl->bus_head = res_lists.bus_head;			pciehp_resource_sort_and_combine(&(ctrl->mem_head));			pciehp_resource_sort_and_combine(&(ctrl->p_mem_head));			pciehp_resource_sort_and_combine(&(ctrl->io_head));			pciehp_resource_sort_and_combine(&(ctrl->bus_head));			if (is_bridge(func)) {				dbg("PCI Bridge Hot-Remove s:b:d:f(%02x:%02x:%02x:%02x)\n", 					ctrl->seg, func->bus, func->device, func->function);				bridge_slot_remove(func);			} else {				dbg("PCI Function Hot-Remove s:b:d:f(%02x:%02x:%02x:%02x)\n", 					ctrl->seg, func->bus, func->device, func->function);				slot_remove(func);			}			func = pciehp_slot_find(ctrl->slot_bus, device, 0);		}		/* Setup slot structure with entry for empty slot */		func = pciehp_slot_create(ctrl->slot_bus);		if (func == NULL) {			return 1;		}		func->bus = ctrl->slot_bus;		func->device = device;		func->function = 0;		func->configured = 0;		func->switch_save = 0x10;		func->is_a_board = 0;	}	return 0;}static void pushbutton_helper_thread(unsigned long data){	pushbutton_pending = data;	up(&event_semaphore);}/** * pciehp_pushbutton_thread * * Scheduled procedure to handle blocking stuff for the pushbuttons * Handles all pending events and exits. * */static void pciehp_pushbutton_thread(unsigned long slot){	struct slot *p_slot = (struct slot *) slot;	u8 getstatus;		pushbutton_pending = 0;	if (!p_slot) {		dbg("%s: Error! slot NULL\n", __FUNCTION__);		return;	}	p_slot->hpc_ops->get_power_status(p_slot, &getstatus);	if (getstatus) {		p_slot->state = POWEROFF_STATE;		dbg("In power_down_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device);		pciehp_disable_slot(p_slot);		p_slot->state = STATIC_STATE;	} else {		p_slot->state = POWERON_STATE;		dbg("In add_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device);		if (pciehp_enable_slot(p_slot) && PWR_LED(p_slot->ctrl->ctrlcap)) {			/* Wait for exclusive access to hardware */			down(&p_slot->ctrl->crit_sect);			p_slot->hpc_ops->green_led_off(p_slot);			/* Wait for the command to complete */			wait_for_ctrl_irq (p_slot->ctrl);			/* Done with exclusive hardware access */			up(&p_slot->ctrl->crit_sect);		}		p_slot->state = STATIC_STATE;	}	return;}/** * pciehp_surprise_rm_thread * * Scheduled procedure to handle blocking stuff for the surprise removal * Handles all pending events and exits. * */static void pciehp_surprise_rm_thread(unsigned long slot){	struct slot *p_slot = (struct slot *) slot;	u8 getstatus;		surprise_rm_pending = 0;	if (!p_slot) {		dbg("%s: Error! slot NULL\n", __FUNCTION__);		return;	}	p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);	if (!getstatus) {		p_slot->state = POWEROFF_STATE;		dbg("In removing board, b:d(%x:%x)\n", p_slot->bus, p_slot->device);		pciehp_disable_slot(p_slot);		p_slot->state = STATIC_STATE;	} else {		p_slot->state = POWERON_STATE;		dbg("In add_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device);		if (pciehp_enable_slot(p_slot) && PWR_LED(p_slot->ctrl->ctrlcap)) {			/* Wait for exclusive access to hardware */			down(&p_slot->ctrl->crit_sect);			p_slot->hpc_ops->green_led_off(p_slot);			/* Wait for the command to complete */			wait_for_ctrl_irq (p_slot->ctrl);			/* Done with exclusive hardware access */			up(&p_slot->ctrl->crit_sect);		}		p_slot->state = STATIC_STATE;	}	return;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜电影网一区| 一区二区三区四区在线| 99久久伊人精品| 亚洲国产成人av网| 国产精品素人一区二区| 欧美精品乱码久久久久久| 成人小视频免费在线观看| 亚洲欧美国产高清| 国产精品天天看| 精品国产乱码久久久久久久| 欧美体内she精视频| 国产91清纯白嫩初高中在线观看| 亚洲大片精品永久免费| 亚洲一区二区三区美女| 午夜电影久久久| 亚洲欧洲无码一区二区三区| 日韩欧美高清一区| 日韩亚洲欧美高清| 日韩欧美亚洲另类制服综合在线| 日本二三区不卡| 91麻豆视频网站| 99久久精品99国产精品| 成人一二三区视频| 成人免费不卡视频| av亚洲产国偷v产偷v自拍| 国产99久久久国产精品免费看| 精品一区二区免费在线观看| 极品美女销魂一区二区三区| 国产真实乱对白精彩久久| 国产在线一区二区综合免费视频| 美洲天堂一区二卡三卡四卡视频| 国产三级精品三级| 婷婷国产在线综合| 欧美成人艳星乳罩| 欧美吞精做爰啪啪高潮| 欧美日韩精品专区| 欧美一区二区三区四区视频 | 丝袜脚交一区二区| 日韩欧美综合在线| 91久久精品一区二区二区| 91国偷自产一区二区三区成为亚洲经典 | 懂色av一区二区三区免费看| 不卡高清视频专区| 欧洲av一区二区嗯嗯嗯啊| 欧美女孩性生活视频| 337p粉嫩大胆色噜噜噜噜亚洲 | 337p日本欧洲亚洲大胆精品| 中文字幕乱码一区二区免费| 亚洲精品视频自拍| 国产精品456| 欧美性大战久久久久久久蜜臀| 精品久久国产老人久久综合| 亚洲欧美日韩久久| 精品中文av资源站在线观看| 色婷婷精品大在线视频| 久久久激情视频| 捆绑变态av一区二区三区| 成人黄页毛片网站| 26uuu久久天堂性欧美| 亚洲午夜精品一区二区三区他趣| 国产一级精品在线| 欧美一卡二卡三卡四卡| 亚洲最新在线观看| 99久久婷婷国产综合精品| 精品国产一区二区三区久久影院| 亚洲www啪成人一区二区麻豆| 99在线热播精品免费| 国产欧美久久久精品影院| 免费观看在线综合| 精品视频一区三区九区| 亚洲一区二区三区四区五区黄| 成人一道本在线| 国产精品色呦呦| 成人激情免费视频| 国产女主播一区| 风流少妇一区二区| 国产女同性恋一区二区| 国产乱人伦精品一区二区在线观看 | 日韩欧美美女一区二区三区| 午夜欧美2019年伦理| 日韩午夜av电影| 精品一区二区三区久久久| 精品精品国产高清一毛片一天堂| 日本aⅴ免费视频一区二区三区| 日韩欧美在线综合网| 狠狠色综合色综合网络| 国产欧美日韩三区| aaa国产一区| 天堂一区二区在线| 日韩欧美国产综合在线一区二区三区| 免费欧美高清视频| 国产精品妹子av| 欧美亚洲动漫另类| 国内外成人在线| 亚洲自拍与偷拍| 久久久亚洲精品一区二区三区| 福利一区二区在线| 日韩和欧美一区二区三区| 久久综合九色综合欧美亚洲| 成人精品视频一区二区三区 | 国产成人鲁色资源国产91色综| 亚洲欧美视频在线观看视频| 欧美日韩在线不卡| 国产一区欧美日韩| 一区二区欧美在线观看| 精品国产免费人成在线观看| 色综合中文字幕国产 | 久久亚洲免费视频| 欧美老肥妇做.爰bbww| www.亚洲精品| 精品一区二区三区免费观看| 亚洲综合丝袜美腿| 中文字幕av一区二区三区免费看| 欧美区在线观看| 欧美一a一片一级一片| 播五月开心婷婷综合| 久久国产乱子精品免费女| 午夜久久久久久久久| 一区二区三区在线观看动漫| 国产精品嫩草99a| 亚洲国产成人自拍| 国产欧美综合色| 亚洲国产经典视频| 国产性做久久久久久| 精品国产99国产精品| 欧美变态口味重另类| 日韩欧美一区电影| 精品国产免费人成在线观看| 69堂成人精品免费视频| 91精品午夜视频| 精品日韩一区二区| 久久中文字幕电影| 国产日韩欧美综合在线| 国产亚洲精品超碰| 国产精品美女久久久久久久 | 欧美激情一区二区三区全黄| 久久久91精品国产一区二区精品| 国产婷婷精品av在线| 中文字幕不卡一区| 亚洲国产日韩精品| 乱一区二区av| 91亚洲国产成人精品一区二区三 | 欧美一区二区三区四区五区| 欧美不卡一区二区三区| 久久精品一区二区三区不卡| 欧美激情一区三区| 亚洲国产aⅴ天堂久久| 麻豆91精品视频| 成人黄色av网站在线| 色婷婷综合久久久中文字幕| 91精品免费观看| 中文字幕一区在线观看| 日本不卡视频一二三区| 成人免费电影视频| 日韩一区二区三区免费看| 国产欧美一区二区精品性色| 亚洲bdsm女犯bdsm网站| 粉嫩av一区二区三区粉嫩| 欧美人牲a欧美精品| 国产精品久久久久aaaa| 韩国精品主播一区二区在线观看| 91婷婷韩国欧美一区二区| 精品电影一区二区三区| 亚洲成人激情综合网| av福利精品导航| 国产午夜精品福利| 久久99这里只有精品| 欧美日韩成人综合在线一区二区| 国产精品卡一卡二| 午夜精品久久久久影视| 亚洲成人动漫在线观看| 日韩av在线发布| 国产大陆精品国产| 久久综合色一综合色88| 日产精品久久久久久久性色| 欧美三区在线观看| 亚洲在线视频一区| 97久久精品人人做人人爽50路 | 欧美日韩中文国产| 亚洲激情图片小说视频| 色狠狠综合天天综合综合| 国产女人aaa级久久久级 | 欧美在线一二三| 亚洲国产综合视频在线观看| 在线观看网站黄不卡| 亚洲成在线观看| 欧美大片国产精品| 精品在线播放午夜| 国产精品三级av在线播放| av电影在线不卡| 天堂成人免费av电影一区| 日韩精品专区在线| 国产大片一区二区| 亚洲国产综合色| 久久影院午夜片一区| 色综合天天在线| 久久99精品国产麻豆不卡| 国产日韩欧美不卡| 欧美偷拍一区二区| 粉嫩久久99精品久久久久久夜|