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

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

?? pciehp_ctrl.c

?? linux-2.6.15.6
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * PCI Express Hot Plug Controller Driver * * Copyright (C) 1995,2001 Compaq Computer Corporation * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com) * Copyright (C) 2001 IBM Corp. * Copyright (C) 2003-2004 Intel Corporation * * All rights reserved. * * 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, GOOD TITLE or * NON INFRINGEMENT.  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., 675 Mass Ave, Cambridge, MA 02139, USA. * * Send feedback to <greg@kroah.com>, <kristen.c.accardi@intel.com> * */#include <linux/module.h>#include <linux/kernel.h>#include <linux/types.h>#include <linux/smp_lock.h>#include <linux/pci.h>#include "../pci.h"#include "pciehp.h"static void interrupt_event_handler(struct controller *ctrl);static struct semaphore event_semaphore;	/* mutex for process loop (up if something to process) */static struct semaphore event_exit;		/* guard ensure thread has exited before calling it quits */static int event_finished;static unsigned long pushbutton_pending;	/* = 0 */static unsigned long surprise_rm_pending;	/* = 0 */u8 pciehp_handle_attention_button(u8 hp_slot, void *inst_id){	struct controller *ctrl = (struct controller *) inst_id;	struct slot *p_slot;	u8 rc = 0;	u8 getstatus;	struct event_info *taskInfo;	/* Attention Button Change */	dbg("pciehp:  Attention button interrupt received.\n");		/* This is the structure that tells the worker thread what to do */	taskInfo = &(ctrl->event_queue[ctrl->next_event]);	p_slot = pciehp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);	p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);		ctrl->next_event = (ctrl->next_event + 1) % MAX_EVENTS;	taskInfo->hp_slot = hp_slot;	rc++;	/*	 *  Button pressed - See if need to TAKE ACTION!!!	 */	info("Button pressed on Slot(%d)\n", ctrl->first_slot + hp_slot);	taskInfo->event_type = INT_BUTTON_PRESS;	if ((p_slot->state == BLINKINGON_STATE)	    || (p_slot->state == BLINKINGOFF_STATE)) {		/* Cancel if we are still blinking; this means that we press the		 * attention again before the 5 sec. limit expires to cancel hot-add		 * or hot-remove		 */		taskInfo->event_type = INT_BUTTON_CANCEL;		info("Button cancel on Slot(%d)\n", ctrl->first_slot + hp_slot);	} else if ((p_slot->state == POWERON_STATE)		   || (p_slot->state == POWEROFF_STATE)) {		/* Ignore if the slot is on power-on or power-off state; this 		 * means that the previous attention button action to hot-add or		 * hot-remove is undergoing		 */		taskInfo->event_type = INT_BUTTON_IGNORE;		info("Button ignore on Slot(%d)\n", ctrl->first_slot + hp_slot);	}	if (rc)		up(&event_semaphore);	/* signal event thread that new event is posted */	return 0;}u8 pciehp_handle_switch_change(u8 hp_slot, void *inst_id){	struct controller *ctrl = (struct controller *) inst_id;	struct slot *p_slot;	u8 rc = 0;	u8 getstatus;	struct event_info *taskInfo;	/* Switch Change */	dbg("pciehp:  Switch interrupt received.\n");	/* This is the structure that tells the worker thread	 * what to do	 */	taskInfo = &(ctrl->event_queue[ctrl->next_event]);	ctrl->next_event = (ctrl->next_event + 1) % MAX_EVENTS;	taskInfo->hp_slot = hp_slot;	rc++;	p_slot = pciehp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);	p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);	if (getstatus) {		/*		 * Switch opened		 */		info("Latch open on Slot(%d)\n", ctrl->first_slot + hp_slot);		taskInfo->event_type = INT_SWITCH_OPEN;	} else {		/*		 *  Switch closed		 */		info("Latch close on Slot(%d)\n", ctrl->first_slot + hp_slot);		taskInfo->event_type = INT_SWITCH_CLOSE;	}	if (rc)		up(&event_semaphore);	/* signal event thread that new event is posted */	return rc;}u8 pciehp_handle_presence_change(u8 hp_slot, void *inst_id){	struct controller *ctrl = (struct controller *) inst_id;	struct slot *p_slot;	u8 presence_save, rc = 0;	struct event_info *taskInfo;	/* Presence Change */	dbg("pciehp:  Presence/Notify input change.\n");	/* This is the structure that tells the worker thread	 * what to do	 */	taskInfo = &(ctrl->event_queue[ctrl->next_event]);	ctrl->next_event = (ctrl->next_event + 1) % MAX_EVENTS;	taskInfo->hp_slot = hp_slot;	rc++;	p_slot = pciehp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);	/* Switch is open, assume a presence change	 * Save the presence state	 */	p_slot->hpc_ops->get_adapter_status(p_slot, &presence_save);	if (presence_save) {		/*		 * Card Present		 */		info("Card present on Slot(%d)\n", ctrl->first_slot + hp_slot);		taskInfo->event_type = INT_PRESENCE_ON;	} else {		/*		 * Not Present		 */		info("Card not present on Slot(%d)\n", ctrl->first_slot + hp_slot);		taskInfo->event_type = INT_PRESENCE_OFF;	}	if (rc)		up(&event_semaphore);	/* signal event thread that new event is posted */	return rc;}u8 pciehp_handle_power_fault(u8 hp_slot, void *inst_id){	struct controller *ctrl = (struct controller *) inst_id;	struct slot *p_slot;	u8 rc = 0;	struct event_info *taskInfo;	/* power fault */	dbg("pciehp:  Power fault interrupt received.\n");	/* this is the structure that tells the worker thread	 * what to do	 */	taskInfo = &(ctrl->event_queue[ctrl->next_event]);	ctrl->next_event = (ctrl->next_event + 1) % MAX_EVENTS;	taskInfo->hp_slot = hp_slot;	rc++;	p_slot = pciehp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);	if ( !(p_slot->hpc_ops->query_power_fault(p_slot))) {		/*		 * power fault Cleared		 */		info("Power fault cleared on Slot(%d)\n", ctrl->first_slot + hp_slot);		taskInfo->event_type = INT_POWER_FAULT_CLEAR;	} else {		/*		 *   power fault		 */		info("Power fault on Slot(%d)\n", ctrl->first_slot + hp_slot);		taskInfo->event_type = INT_POWER_FAULT;		info("power fault bit %x set\n", hp_slot);	}	if (rc)		up(&event_semaphore);	/* signal event thread that new event is posted */	return rc;}/* 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 int board_added(struct slot *p_slot){	u8 hp_slot;	int rc = 0;	struct controller *ctrl = p_slot->ctrl;	hp_slot = p_slot->device - ctrl->slot_device_offset;	dbg("%s: slot device, slot offset, hp slot = %d, %d ,%d\n",			__FUNCTION__, p_slot->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 */	wait_for_ctrl_irq (ctrl);	/*  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;	}	/* Check for a power fault */	if (p_slot->hpc_ops->query_power_fault(p_slot)) {		dbg("%s: power fault detected\n", __FUNCTION__);		rc = POWER_FAILURE;		goto err_exit;	}	rc = pciehp_configure_device(p_slot);	if (rc) {		err("Cannot add device 0x%x:%x\n", p_slot->bus,				p_slot->device);		goto err_exit;	}	/*	 * 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);  	}	return 0;err_exit:	set_slot_off(ctrl, p_slot);	return -1;}/** * remove_board - Turns off slot and LED's * */static int remove_board(struct slot *p_slot){	u8 device;	u8 hp_slot;	int rc;	struct controller *ctrl = p_slot->ctrl;	if (pciehp_unconfigure_device(p_slot))		return 1;	device = p_slot->device;	hp_slot = p_slot->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);	/* 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);	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;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩免费视频线观看| 亚洲国产色一区| 亚洲国产中文字幕| 九九精品一区二区| 色婷婷久久一区二区三区麻豆| 日韩欧美国产系列| 亚洲午夜免费电影| av中文字幕一区| 亚洲精品一区二区精华| 亚洲成av人片一区二区| 99久久久久久| 国产精品视频一二三区| 九九在线精品视频| 欧美丰满高潮xxxx喷水动漫| 国产精品家庭影院| 国产白丝精品91爽爽久久 | 色嗨嗨av一区二区三区| 久久九九全国免费| 美女网站在线免费欧美精品| 色婷婷亚洲精品| 亚洲视频一区二区在线| 成人三级在线视频| 国产亚洲欧美一区在线观看| 久久不见久久见中文字幕免费| 欧美日韩不卡在线| 亚洲国产精品一区二区尤物区| 97久久精品人人做人人爽50路| 日本一区二区成人在线| 国产成人一级电影| www国产亚洲精品久久麻豆| 免费在线观看不卡| 日韩精品一区二区三区视频| 欧美bbbbb| 日韩欧美高清一区| 国内成人自拍视频| 精品国产乱码久久久久久久 | 欧美电影免费提供在线观看| 五月综合激情网| 91精品国产综合久久久蜜臀粉嫩 | 婷婷综合五月天| 欧美日韩dvd在线观看| 亚洲成在线观看| 69久久99精品久久久久婷婷| 日韩国产欧美在线视频| 日韩免费性生活视频播放| 麻豆成人av在线| 久久久美女艺术照精彩视频福利播放| 国模一区二区三区白浆| 欧美国产禁国产网站cc| 97se狠狠狠综合亚洲狠狠| 亚洲小说欧美激情另类| 日韩一二在线观看| 国产suv精品一区二区三区| 中文字幕在线不卡国产视频| 在线免费一区三区| 日本亚洲视频在线| 亚洲国产精品av| 欧美亚洲一区三区| 蜜乳av一区二区| 国产精品麻豆久久久| 欧美无乱码久久久免费午夜一区| 免费av网站大全久久| 国产视频不卡一区| 在线观看av一区| 激情久久五月天| 亚洲免费在线播放| 日韩区在线观看| 成人免费毛片片v| 午夜视频一区二区| 国产亚洲成年网址在线观看| 在线免费av一区| 国产美女一区二区| 亚洲国产成人高清精品| 国产亚洲一二三区| 欧美久久久久久久久中文字幕| 国产剧情一区二区三区| 亚洲福利国产精品| 国产精品福利一区| 欧美电视剧免费观看| 色婷婷国产精品| 国产精品69久久久久水密桃| 亚洲午夜三级在线| 国产精品第13页| 日韩免费高清电影| 欧洲视频一区二区| 国产福利一区二区三区视频 | 国产精品每日更新| 欧美mv日韩mv国产网站| 在线观看日韩电影| 不卡的av在线| 国产精品白丝av| 精品一区二区久久久| 午夜激情一区二区| 亚洲柠檬福利资源导航| 欧美国产乱子伦 | 成人av在线播放网站| 经典三级在线一区| 日韩av中文字幕一区二区| 亚洲精品乱码久久久久久久久| 久久综合九色欧美综合狠狠| 欧美精品欧美精品系列| 日本韩国精品一区二区在线观看| 国产精品一区二区黑丝| 久久99久久久久久久久久久| 天涯成人国产亚洲精品一区av| 亚洲精品视频免费看| 亚洲欧洲精品天堂一级 | 97久久精品人人做人人爽50路| 国产寡妇亲子伦一区二区| 老司机免费视频一区二区| 天天影视涩香欲综合网 | 91精品国产欧美日韩| 欧美视频一区二区三区四区| 在线欧美日韩国产| 久久成人精品无人区| 日韩美女主播在线视频一区二区三区 | 亚洲伊人色欲综合网| 日韩视频一区二区三区| 在线成人小视频| 欧美色图天堂网| 欧美日韩不卡在线| 日韩欧美亚洲另类制服综合在线| 欧美一区二区私人影院日本| 欧美一区二区三区在| 日韩女优毛片在线| xf在线a精品一区二区视频网站| 日韩精品专区在线| 久久久久久电影| 国产色91在线| 国产精品久久久99| 一区二区三区成人| 美腿丝袜亚洲色图| 国产综合色在线视频区| 成人免费毛片嘿嘿连载视频| 97成人超碰视| 91精品国产综合久久福利软件 | 午夜精品久久久久久久| 丝袜美腿亚洲综合| 国产一区二区0| 97久久精品人人做人人爽| 欧美日韩综合在线| 久久夜色精品国产噜噜av| 中文字幕亚洲欧美在线不卡| 一区二区三区精品| 美女脱光内衣内裤视频久久网站| 国产乱码精品1区2区3区| 成人国产在线观看| 欧美日韩电影在线播放| 久久香蕉国产线看观看99| 亚洲欧洲色图综合| 麻豆成人久久精品二区三区红| 风间由美一区二区av101| 在线免费观看成人短视频| 精品久久久网站| 亚洲精品欧美综合四区| 精品中文字幕一区二区| 99国产精品久久久久久久久久| 欧美日韩一二三区| 国产欧美日本一区二区三区| 亚洲午夜三级在线| 福利一区福利二区| 日韩精品一区二区三区视频| 亚洲美女区一区| 国产乱码一区二区三区| 精品视频在线免费观看| 欧美国产视频在线| 六月丁香婷婷久久| 欧美三级韩国三级日本三斤| 国产精品国产三级国产普通话99 | 国产精品对白交换视频| 日本不卡高清视频| 91久久国产最好的精华液| 久久久99精品久久| 蜜臀av在线播放一区二区三区| 成人福利视频网站| 欧美电视剧在线观看完整版| 亚洲精品成a人| 国产69精品久久久久777| 日韩一区二区免费在线观看| 一区二区三区日韩欧美| 成人性生交大片免费| 日韩免费高清电影| 丝袜美腿成人在线| 色素色在线综合| 亚洲欧美综合色| 成人动漫精品一区二区| 久久综合九色综合欧美亚洲| 免费观看成人av| 欧美久久久影院| 婷婷开心激情综合| 欧美三级视频在线播放| 亚洲一区二区三区四区的 | 成人黄色电影在线| 久久精品人人做| 国产伦理精品不卡| 精品国产免费视频| 国内久久婷婷综合| 2021中文字幕一区亚洲| 九九精品一区二区| 26uuu国产一区二区三区|