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

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

?? pciehp_ctrl.c

?? 底層驅動開發
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* this is the main worker thread */static int event_thread(void* data){	struct controller *ctrl;	lock_kernel();	daemonize("pciehpd_event");	unlock_kernel();	while (1) {		dbg("!!!!event_thread sleeping\n");		down_interruptible (&event_semaphore);		dbg("event_thread woken finished = %d\n", event_finished);		if (event_finished || signal_pending(current))			break;		/* Do stuff here */		if (pushbutton_pending)			pciehp_pushbutton_thread(pushbutton_pending);		else if (surprise_rm_pending)			pciehp_surprise_rm_thread(surprise_rm_pending);		else			for (ctrl = pciehp_ctrl_list; ctrl; ctrl=ctrl->next)				interrupt_event_handler(ctrl);	}	dbg("event_thread signals exit\n");	up(&event_exit);	return 0;}int pciehp_event_start_thread(void){	int pid;	/* initialize our semaphores */	init_MUTEX_LOCKED(&event_exit);	event_finished=0;	init_MUTEX_LOCKED(&event_semaphore);	pid = kernel_thread(event_thread, NULL, 0);	if (pid < 0) {		err ("Can't start up our event thread\n");		return -1;	}	dbg("Our event thread pid = %d\n", pid);	return 0;}void pciehp_event_stop_thread(void){	event_finished = 1;	dbg("event_thread finish command given\n");	up(&event_semaphore);	dbg("wait for event_thread to exit\n");	down(&event_exit);}static int update_slot_info(struct slot *slot){	struct hotplug_slot_info *info;	/* char buffer[SLOT_NAME_SIZE]; */	int result;	info = kmalloc(sizeof(struct hotplug_slot_info), GFP_KERNEL);	if (!info)		return -ENOMEM;	/* make_slot_name (&buffer[0], SLOT_NAME_SIZE, slot); */	slot->hpc_ops->get_power_status(slot, &(info->power_status));	slot->hpc_ops->get_attention_status(slot, &(info->attention_status));	slot->hpc_ops->get_latch_status(slot, &(info->latch_status));	slot->hpc_ops->get_adapter_status(slot, &(info->adapter_status));	/* result = pci_hp_change_slot_info(buffer, info); */	result = pci_hp_change_slot_info(slot->hotplug_slot, info);	kfree (info);	return result;}static void interrupt_event_handler(struct controller *ctrl){	int loop = 0;	int change = 1;	struct pci_func *func;	u8 hp_slot;	u8 getstatus;	struct slot *p_slot;	while (change) {		change = 0;		for (loop = 0; loop < 10; loop++) {			if (ctrl->event_queue[loop].event_type != 0) {				hp_slot = ctrl->event_queue[loop].hp_slot;				func = pciehp_slot_find(ctrl->slot_bus, (hp_slot + ctrl->slot_device_offset), 0);				p_slot = pciehp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);				dbg("hp_slot %d, func %p, p_slot %p\n", hp_slot, func, p_slot);				if (ctrl->event_queue[loop].event_type == INT_BUTTON_CANCEL) {					dbg("button cancel\n");					del_timer(&p_slot->task_event);					switch (p_slot->state) {					case BLINKINGOFF_STATE:						/* Wait for exclusive access to hardware */						down(&ctrl->crit_sect);												if (PWR_LED(ctrl->ctrlcap)) {							p_slot->hpc_ops->green_led_on(p_slot);							/* Wait for the command to complete */							wait_for_ctrl_irq (ctrl);						}						if (ATTN_LED(ctrl->ctrlcap)) {							p_slot->hpc_ops->set_attention_status(p_slot, 0);							/* Wait for the command to complete */							wait_for_ctrl_irq (ctrl);						}						/* Done with exclusive hardware access */						up(&ctrl->crit_sect);						break;					case BLINKINGON_STATE:						/* Wait for exclusive access to hardware */						down(&ctrl->crit_sect);						if (PWR_LED(ctrl->ctrlcap)) {							p_slot->hpc_ops->green_led_off(p_slot);							/* Wait for the command to complete */							wait_for_ctrl_irq (ctrl);						}						if (ATTN_LED(ctrl->ctrlcap)){							p_slot->hpc_ops->set_attention_status(p_slot, 0);							/* Wait for the command to complete */							wait_for_ctrl_irq (ctrl);						}						/* Done with exclusive hardware access */						up(&ctrl->crit_sect);						break;					default:						warn("Not a valid state\n");						return;					}					info(msg_button_cancel, p_slot->number);					p_slot->state = STATIC_STATE;				}				/* ***********Button Pressed (No action on 1st press...) */				else if (ctrl->event_queue[loop].event_type == INT_BUTTON_PRESS) {										if (ATTN_BUTTN(ctrl->ctrlcap)) {						dbg("Button pressed\n");						p_slot->hpc_ops->get_power_status(p_slot, &getstatus);						if (getstatus) {							/* slot is on */							dbg("slot is on\n");							p_slot->state = BLINKINGOFF_STATE;							info(msg_button_off, p_slot->number);						} else {							/* slot is off */							dbg("slot is off\n");							p_slot->state = BLINKINGON_STATE;							info(msg_button_on, p_slot->number);						}						/* Wait for exclusive access to hardware */						down(&ctrl->crit_sect);						/* blink green LED and turn off amber */						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);						}						if (ATTN_LED(ctrl->ctrlcap)) {							p_slot->hpc_ops->set_attention_status(p_slot, 0);							/* Wait for the command to complete */							wait_for_ctrl_irq (ctrl);						}						/* Done with exclusive hardware access */						up(&ctrl->crit_sect);						init_timer(&p_slot->task_event);						p_slot->task_event.expires = jiffies + 5 * HZ;   /* 5 second delay */						p_slot->task_event.function = (void (*)(unsigned long)) pushbutton_helper_thread;						p_slot->task_event.data = (unsigned long) p_slot;						dbg("add_timer p_slot = %p\n", (void *) p_slot);						add_timer(&p_slot->task_event);					}				}				/***********POWER FAULT********************/				else if (ctrl->event_queue[loop].event_type == INT_POWER_FAULT) {					if (POWER_CTRL(ctrl->ctrlcap)) {						dbg("power fault\n");						/* Wait for exclusive access to hardware */						down(&ctrl->crit_sect);						if (ATTN_LED(ctrl->ctrlcap)) {							p_slot->hpc_ops->set_attention_status(p_slot, 1);							wait_for_ctrl_irq (ctrl);						}						if (PWR_LED(ctrl->ctrlcap)) {							p_slot->hpc_ops->green_led_off(p_slot);							wait_for_ctrl_irq (ctrl);						}						/* Done with exclusive hardware access */						up(&ctrl->crit_sect);					}				}				/***********SURPRISE REMOVAL********************/				else if ((ctrl->event_queue[loop].event_type == INT_PRESENCE_ON) || 					(ctrl->event_queue[loop].event_type == INT_PRESENCE_OFF)) {					if (HP_SUPR_RM(ctrl->ctrlcap)) {						dbg("Surprise Removal\n");						if (p_slot) {							surprise_rm_pending = (unsigned long) p_slot;							up(&event_semaphore);							update_slot_info(p_slot);						}					}				} else {					/* refresh notification */					if (p_slot)						update_slot_info(p_slot);				}				ctrl->event_queue[loop].event_type = 0;				change = 1;			}		}		/* End of FOR loop */	}}int pciehp_enable_slot(struct slot *p_slot){	u8 getstatus = 0;	int rc;	struct pci_func *func;	func = pciehp_slot_find(p_slot->bus, p_slot->device, 0);	if (!func) {		dbg("%s: Error! slot NULL\n", __FUNCTION__);		return 1;	}	/* Check to see if (latch closed, card present, power off) */	down(&p_slot->ctrl->crit_sect);	rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);	if (rc || !getstatus) {		info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number);		up(&p_slot->ctrl->crit_sect);		return 1;	}	if (MRL_SENS(p_slot->ctrl->ctrlcap)) {			rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);		if (rc || getstatus) {			info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number);			up(&p_slot->ctrl->crit_sect);			return 1;		}	}		if (POWER_CTRL(p_slot->ctrl->ctrlcap)) {			rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);		if (rc || getstatus) {			info("%s: already enabled on slot(%x)\n", __FUNCTION__, p_slot->number);			up(&p_slot->ctrl->crit_sect);			return 1;		}	}	up(&p_slot->ctrl->crit_sect);	slot_remove(func);	func = pciehp_slot_create(p_slot->bus);	if (func == NULL)		return 1;	func->bus = p_slot->bus;	func->device = p_slot->device;	func->function = 0;	func->configured = 0;	func->is_a_board = 1;	/* We have to save the presence info for these slots */	p_slot->hpc_ops->get_adapter_status(p_slot, &(func->presence_save));	p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);	func->switch_save = !getstatus? 0x10:0;	rc = board_added(func, p_slot->ctrl);	if (rc) {		if (is_bridge(func))			bridge_slot_remove(func);		else			slot_remove(func);		/* Setup slot structure with entry for empty slot */		func = pciehp_slot_create(p_slot->bus);		if (func == NULL)			return 1;	/* Out of memory */		func->bus = p_slot->bus;		func->device = p_slot->device;		func->function = 0;		func->configured = 0;		func->is_a_board = 1;		/* We have to save the presence info for these slots */		p_slot->hpc_ops->get_adapter_status(p_slot, &(func->presence_save));		p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);		func->switch_save = !getstatus? 0x10:0;	}	if (p_slot)		update_slot_info(p_slot);	return rc;}int pciehp_disable_slot(struct slot *p_slot){	u8 class_code, header_type, BCR;	u8 index = 0;	u8 getstatus = 0;	u32 rc = 0;	int ret = 0;	unsigned int devfn;	struct pci_bus *pci_bus = p_slot->ctrl->pci_dev->subordinate;	struct pci_func *func;	if (!p_slot->ctrl)		return 1;	/* Check to see if (latch closed, card present, power on) */	down(&p_slot->ctrl->crit_sect);	if (!HP_SUPR_RM(p_slot->ctrl->ctrlcap)) {			ret = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus);		if (ret || !getstatus) {			info("%s: no adapter on slot(%x)\n", __FUNCTION__, p_slot->number);			up(&p_slot->ctrl->crit_sect);			return 1;		}	}	if (MRL_SENS(p_slot->ctrl->ctrlcap)) {			ret = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);		if (ret || getstatus) {			info("%s: latch open on slot(%x)\n", __FUNCTION__, p_slot->number);			up(&p_slot->ctrl->crit_sect);			return 1;		}	}	if (POWER_CTRL(p_slot->ctrl->ctrlcap)) {			ret = p_slot->hpc_ops->get_power_status(p_slot, &getstatus);		if (ret || !getstatus) {			info("%s: already disabled slot(%x)\n", __FUNCTION__, p_slot->number);			up(&p_slot->ctrl->crit_sect);			return 1;		}	}	up(&p_slot->ctrl->crit_sect);	func = pciehp_slot_find(p_slot->bus, p_slot->device, index++);	/* Make sure there are no video controllers here	 * for all func of p_slot	 */	while (func && !rc) {		pci_bus->number = func->bus;		devfn = PCI_DEVFN(func->device, func->function);		/* Check the Class Code */		rc = pci_bus_read_config_byte (pci_bus, devfn, 0x0B, &class_code);		if (rc)			return rc;		if (class_code == PCI_BASE_CLASS_DISPLAY) {			/* Display/Video adapter (not supported) */			rc = REMOVE_NOT_SUPPORTED;		} else {			/* See if it's a bridge */			rc = pci_bus_read_config_byte (pci_bus, devfn, PCI_HEADER_TYPE, &header_type);			if (rc)				return rc;			/* If it's a bridge, check the VGA Enable bit */			if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {				rc = pci_bus_read_config_byte (pci_bus, devfn, PCI_BRIDGE_CONTROL, &BCR);				if (rc)					return rc;				/* If the VGA Enable bit is set, remove isn't supported */				if (BCR & PCI_BRIDGE_CTL_VGA) {					rc = REMOVE_NOT_SUPPORTED;				}			}		}		func = pciehp_slot_find(p_slot->bus, p_slot->device, index++);	}	func = pciehp_slot_find(p_slot->bus, p_slot->device, 0);	if ((func != NULL) && !rc) {		rc = remove_board(func, p_slot->ctrl);	} else if (!rc)		rc = 1;	if (p_slot)		update_slot_info(p_slot);	return rc;}/** * configure_new_device - Configures the PCI header information of one board. * * @ctrl: pointer to controller structure * @func: pointer to function structure * @behind_bridge: 1 if this is a recursive call, 0 if not * @resources: pointer to set of resource lists * * Returns 0 if success * */static u32 configure_new_device(struct controller * ctrl, struct pci_func * func,	u8 behind_bridge, struct resource_lists * resources, u8 bridge_bus, u8 bridge_dev){	u8 temp_byte, function, max_functions, stop_it;	int rc;	u32 ID;	struct pci_func *new_slot;	struct pci_bus lpci_bus, *pci_bus;	int index;	new_slot = func;	dbg("%s\n", __FUNCTION__);	memcpy(&lpci_bus, ctrl->pci_dev->subordinate, sizeof(lpci_bus));	pci_bus = &lpci_bus;	pci_bus->number = func->bus;	/* Check for Multi-function device */	rc = pci_bus_read_config_byte(pci_bus, PCI_DEVFN(func->device, func->function), 0x0E, &temp_byte);	if (rc) {		dbg("%s: rc = %d\n", __FUNCTION__, rc);		return rc;	}	if (temp_byte & 0x80)	/* Multi-function device */		max_functions = 8;	else		max_functions = 1;	function = 0;	do {		rc = configure_new_function(ctrl, new_slot, behind_bridge,					resources, bridge_bus, bridge_dev);		if (rc) {			dbg("configure_new_function failed: %d\n", rc);			index = 0;			while (new_slot) {				new_slot = pciehp_slot_find(new_slot->bus,						new_slot->device, index++);				if (new_slot)					pciehp_return_board_resources(new_slot,						resources);			}			return rc;		}		function++;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美大尺度电影在线| 日韩中文字幕麻豆| 午夜视频一区在线观看| 精品一区二区三区在线观看| 99久久精品国产导航| 欧美一区二区三级| 亚洲精品国产高清久久伦理二区| 国内偷窥港台综合视频在线播放| 91麻豆国产在线观看| 久久久亚洲精品一区二区三区| 亚洲一区二区三区中文字幕| 成人av资源在线观看| 欧美一区在线视频| 一区二区三区国产精华| 丁香五精品蜜臀久久久久99网站| 日韩一级精品视频在线观看| 亚洲狼人国产精品| 91香蕉视频污| 国产精品嫩草影院av蜜臀| 国产一区二区在线视频| 欧美一区二区三区视频免费播放| 亚洲欧美激情在线| www.亚洲色图| 中文字幕亚洲不卡| 成人激情动漫在线观看| 国产精品视频麻豆| 国产suv一区二区三区88区| 国产午夜久久久久| 高清在线不卡av| 国产日韩欧美麻豆| 国产精品888| 国产精品久久久久天堂| 成人久久18免费网站麻豆 | 国产成人av一区二区三区在线| 制服丝袜在线91| 亚洲 欧美综合在线网络| 欧美在线一区二区三区| 亚洲综合在线观看视频| 欧美中文字幕一区二区三区 | 久久久99精品久久| 国产资源在线一区| 国产婷婷一区二区| av爱爱亚洲一区| 樱花影视一区二区| 欧美三级乱人伦电影| 日本欧美一区二区三区| 精品粉嫩超白一线天av| 国产精品亚洲第一区在线暖暖韩国| 久久久久青草大香线综合精品| 国产精品亚洲第一| 国产精品传媒入口麻豆| 日本道免费精品一区二区三区| 亚洲自拍偷拍网站| 日韩一区二区三区在线观看| 午夜精品福利久久久| 日韩欧美国产一区在线观看| 国产精品一卡二卡在线观看| 国产精品久久一卡二卡| 欧美网站大全在线观看| 老色鬼精品视频在线观看播放| 久久综合999| 99国产一区二区三精品乱码| 亚洲午夜激情网站| 久久久久久9999| 色婷婷亚洲一区二区三区| 日韩不卡免费视频| 欧美精彩视频一区二区三区| 欧美三级日韩三级| 国产精品一区二区x88av| 一区二区三区国产精华| 久久伊99综合婷婷久久伊| 91网站最新地址| 麻豆91在线观看| 伊人性伊人情综合网| 精品欧美一区二区久久 | 国产精品一区二区在线观看不卡 | 日韩在线a电影| 国产欧美日韩亚州综合 | 在线免费亚洲电影| 久久成人久久鬼色| 亚洲主播在线播放| 国产精品福利av| 精品sm在线观看| 91国偷自产一区二区开放时间 | 日韩不卡免费视频| 亚洲欧美日韩中文播放| 2021国产精品久久精品| 色狠狠桃花综合| 国产精品456| 美女视频黄免费的久久| 亚洲宅男天堂在线观看无病毒| 国产欧美日韩视频在线观看| 91精品国产色综合久久不卡蜜臀| aaa欧美大片| 国产传媒欧美日韩成人| 蜜乳av一区二区| 亚洲福利视频三区| 亚洲一区二区在线视频| 亚洲啪啪综合av一区二区三区| 精品国产欧美一区二区| 欧美日韩一区二区三区四区五区| 99在线精品视频| 粉嫩aⅴ一区二区三区四区 | 国产精品女主播av| 国产亚洲成年网址在线观看| 日韩久久久精品| 欧美一区午夜视频在线观看| 欧美精三区欧美精三区| 在线看日韩精品电影| 色综合久久中文字幕| 91在线观看成人| 91婷婷韩国欧美一区二区| 成人黄色大片在线观看| 国产精品99精品久久免费| 国产乱子伦一区二区三区国色天香| 日本视频中文字幕一区二区三区| 亚洲国产三级在线| 视频一区二区国产| 免费观看一级欧美片| 日本vs亚洲vs韩国一区三区| 日本 国产 欧美色综合| 欧美写真视频网站| 久久狠狠亚洲综合| 97成人超碰视| 视频一区中文字幕| 日本v片在线高清不卡在线观看| 午夜激情一区二区三区| 人人狠狠综合久久亚洲| 另类小说综合欧美亚洲| 麻豆精品国产传媒mv男同| 秋霞av亚洲一区二区三| 国产毛片一区二区| 91在线观看污| 欧美蜜桃一区二区三区| 日韩精品中文字幕在线一区| 亚洲精品一区二区三区香蕉| 久久精品视频一区二区三区| 亚洲四区在线观看| 亚洲国产精品久久不卡毛片 | 免费三级欧美电影| 国产在线播精品第三| 99精品在线观看视频| 精品视频999| 26uuu色噜噜精品一区二区| 国产精品嫩草影院com| 亚洲国产精品久久久久秋霞影院 | 五月天激情综合| 激情六月婷婷综合| 91视频你懂的| 日韩视频一区二区在线观看| 国产欧美日韩激情| 亚洲激情中文1区| 久久97超碰国产精品超碰| 91在线观看一区二区| 日韩亚洲欧美一区二区三区| 国产精品国产a级| 麻豆免费看一区二区三区| bt欧美亚洲午夜电影天堂| 欧美精品久久天天躁| 中文字幕国产一区二区| 视频一区二区中文字幕| 波多野结衣在线一区| 欧美一级日韩不卡播放免费| 国产精品久久久久国产精品日日| 午夜精品免费在线| 国产精品18久久久久久久久久久久| 欧美日韩在线播放三区| 国产精品三级视频| 精品一二三四区| 欧美日韩一区二区三区在线| 日本一区二区成人| 久久av资源站| 欧美理论电影在线| 亚洲欧美一区二区久久| 国产经典欧美精品| 精品国产精品网麻豆系列| 亚洲成av人在线观看| 95精品视频在线| 国产精品久久三| 国产在线精品不卡| 91精品国产综合久久精品图片 | 国产精品美女久久久久久2018| 日韩精品三区四区| 欧美日韩国产中文| 亚洲一级二级三级| 色婷婷av一区二区三区大白胸| 国产欧美日韩在线观看| 国产在线不卡一区| 亚洲精品在线免费观看视频| 日韩av在线免费观看不卡| 91精品1区2区| 亚洲国产成人av网| 欧美视频在线一区二区三区| 亚洲色欲色欲www| 91在线国产福利| 亚洲综合色视频| 欧美精品v国产精品v日韩精品| 性做久久久久久| 欧美精品一级二级三级| 日韩激情av在线|