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

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

?? pciehp_ctrl.c

?? 底層驅動開發
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* * 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/config.h>#include <linux/module.h>#include <linux/kernel.h>#include <linux/types.h>#include <linux/slab.h>#include <linux/workqueue.h>#include <linux/interrupt.h>#include <linux/delay.h>#include <linux/wait.h>#include <linux/smp_lock.h>#include <linux/pci.h>#include "../pci.h"#include "pciehp.h"#include "pciehprm.h"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);static int configure_new_function( struct controller *ctrl, struct pci_func *func,	u8 behind_bridge, struct resource_lists *resources, u8 bridge_bus, u8 bridge_dev);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 pci_func *func;	struct event_info *taskInfo;	/* Attention Button Change */	dbg("pciehp:  Attention button interrupt received.\n");		func = pciehp_slot_find(ctrl->slot_bus, (hp_slot + ctrl->slot_device_offset), 0);	/* 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_adapter_status(p_slot, &(func->presence_save));	p_slot->hpc_ops->get_latch_status(p_slot, &getstatus);		ctrl->next_event = (ctrl->next_event + 1) % 10;	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 pci_func *func;	struct event_info *taskInfo;	/* Switch Change */	dbg("pciehp:  Switch interrupt received.\n");	func = pciehp_slot_find(ctrl->slot_bus, (hp_slot + ctrl->slot_device_offset), 0);	/* 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) % 10;	taskInfo->hp_slot = hp_slot;	rc++;	p_slot = pciehp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);	p_slot->hpc_ops->get_adapter_status(p_slot, &(func->presence_save));	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);		func->switch_save = 0;		taskInfo->event_type = INT_SWITCH_OPEN;	} else {		/*		 *  Switch closed		 */		info("Latch close on Slot(%d)\n", ctrl->first_slot + hp_slot);		func->switch_save = 0x10;		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 rc = 0;	struct pci_func *func;	struct event_info *taskInfo;	/* Presence Change */	dbg("pciehp:  Presence/Notify input change.\n");	func = pciehp_slot_find(ctrl->slot_bus, (hp_slot + ctrl->slot_device_offset), 0);	/* 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) % 10;	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, &(func->presence_save));	if (func->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 pci_func *func;	struct event_info *taskInfo;	/* power fault */	dbg("pciehp:  Power fault interrupt received.\n");	func = pciehp_slot_find(ctrl->slot_bus, (hp_slot + ctrl->slot_device_offset), 0);	/* 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) % 10;	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);		func->status = 0x00;		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;		/* set power fault status for this board */		func->status = 0xFF;		info("power fault bit %x set\n", hp_slot);	}	if (rc)		up(&event_semaphore);	/* signal event thread that new event is posted */	return rc;}/** * sort_by_size: sort nodes by their length, smallest first. * * @head: list to sort */static int sort_by_size(struct pci_resource **head){	struct pci_resource *current_res;	struct pci_resource *next_res;	int out_of_order = 1;	if (!(*head))		return 1;	if (!((*head)->next))		return 0;	while (out_of_order) {		out_of_order = 0;		/* Special case for swapping list head */		if (((*head)->next) &&		    ((*head)->length > (*head)->next->length)) {			out_of_order++;			current_res = *head;			*head = (*head)->next;			current_res->next = (*head)->next;			(*head)->next = current_res;		}		current_res = *head;		while (current_res->next && current_res->next->next) {			if (current_res->next->length > current_res->next->next->length) {				out_of_order++;				next_res = current_res->next;				current_res->next = current_res->next->next;				current_res = current_res->next;				next_res->next = current_res->next;				current_res->next = next_res;			} else				current_res = current_res->next;		}	}  /* End of out_of_order loop */	return 0;}/* * sort_by_max_size * * Sorts nodes on the list by their length. * Largest first. * */static int sort_by_max_size(struct pci_resource **head){	struct pci_resource *current_res;	struct pci_resource *next_res;	int out_of_order = 1;	if (!(*head))		return 1;	if (!((*head)->next))		return 0;	while (out_of_order) {		out_of_order = 0;		/* Special case for swapping list head */		if (((*head)->next) &&		    ((*head)->length < (*head)->next->length)) {			out_of_order++;			current_res = *head;			*head = (*head)->next;			current_res->next = (*head)->next;			(*head)->next = current_res;		}		current_res = *head;		while (current_res->next && current_res->next->next) {			if (current_res->next->length < current_res->next->next->length) {				out_of_order++;				next_res = current_res->next;				current_res->next = current_res->next->next;				current_res = current_res->next;				next_res->next = current_res->next;				current_res->next = next_res;			} else				current_res = current_res->next;		}	}  /* End of out_of_order loop */	return 0;}/** * do_pre_bridge_resource_split: return one unused resource node * @head: list to scan * */static struct pci_resource *do_pre_bridge_resource_split(struct pci_resource **head,				struct pci_resource **orig_head, u32 alignment){	struct pci_resource *prevnode = NULL;	struct pci_resource *node;	struct pci_resource *split_node;	u32 rc;	u32 temp_dword;	dbg("do_pre_bridge_resource_split\n");	if (!(*head) || !(*orig_head))		return NULL;	rc = pciehp_resource_sort_and_combine(head);	if (rc)		return NULL;	if ((*head)->base != (*orig_head)->base)		return NULL;	if ((*head)->length == (*orig_head)->length)		return NULL;	/* If we got here, there the bridge requires some of the resource, but	 *  we may be able to split some off of the front	 */		node = *head;	if (node->length & (alignment -1)) {		/* this one isn't an aligned length, so we'll make a new entry		 * and split it up.		 */		split_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL);		if (!split_node)			return NULL;		temp_dword = (node->length | (alignment-1)) + 1 - alignment;		split_node->base = node->base;		split_node->length = temp_dword;		node->length -= temp_dword;		node->base += split_node->length;		/* Put it in the list */		*head = split_node;		split_node->next = node;	}	if (node->length < alignment)		return NULL;	/* Now unlink it */	if (*head == node) {		*head = node->next;	} else {		prevnode = *head;		while (prevnode->next != node)			prevnode = prevnode->next;		prevnode->next = node->next;	}	node->next = NULL;	return node;}/** * do_bridge_resource_split: return one unused resource node * @head: list to scan * */static struct pci_resource *do_bridge_resource_split(struct pci_resource **head, u32 alignment){	struct pci_resource *prevnode = NULL;	struct pci_resource *node;	u32 rc;	u32 temp_dword;	if (!(*head))		return NULL;	rc = pciehp_resource_sort_and_combine(head);	if (rc)		return NULL;	node = *head;	while (node->next) {		prevnode = node;		node = node->next;		kfree(prevnode);	}	if (node->length < alignment) {		kfree(node);		return NULL;	}	if (node->base & (alignment - 1)) {		/* Short circuit if adjusted size is too small */		temp_dword = (node->base | (alignment-1)) + 1;		if ((node->length - (temp_dword - node->base)) < alignment) {			kfree(node);			return NULL;		}		node->length -= (temp_dword - node->base);		node->base = temp_dword;	}	if (node->length & (alignment - 1)) {		/* There's stuff in use after this node */		kfree(node);		return NULL;	}	return node;}/* * get_io_resource * * this function sorts the resource list by size and then * returns the first node of "size" length that is not in the * ISA aliasing window.  If it finds a node larger than "size" * it will split it up. *

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲va中文字幕| 五月天亚洲精品| 日韩视频一区在线观看| 一本色道久久加勒比精品| 国产一区二区三区av电影| 麻豆久久久久久久| 久久精品国产99| 九九视频精品免费| 国产麻豆91精品| 国产精品资源网站| 成人性生交大片免费看中文网站| 国产福利视频一区二区三区| 高清国产一区二区三区| 不卡一区二区在线| 色婷婷综合中文久久一本| 在线视频一区二区三| 欧美日本乱大交xxxxx| 8x8x8国产精品| 国产夜色精品一区二区av| 国产精品久久久爽爽爽麻豆色哟哟| 自拍视频在线观看一区二区| 亚洲欧美日韩在线| 日韩av一级电影| 国产一区二区福利视频| 成人av资源在线| 欧美三区在线观看| 久久综合999| 亚洲免费三区一区二区| 婷婷综合另类小说色区| 国产露脸91国语对白| 色一情一乱一乱一91av| 4438x成人网最大色成网站| 久久青草欧美一区二区三区| 一区二区三区在线视频观看58 | 精久久久久久久久久久| 国产成人免费在线视频| 欧美日韩一区 二区 三区 久久精品| 精品久久人人做人人爱| 亚洲午夜日本在线观看| 韩国精品免费视频| 在线视频综合导航| 国产欧美精品一区二区色综合| 亚洲一区二区免费视频| 亚洲另类在线视频| 国产精品日产欧美久久久久| 亚洲一区在线看| 国产老肥熟一区二区三区| 在线区一区二视频| 久久久91精品国产一区二区三区| 久久国产精品99精品国产 | 99免费精品在线观看| 在线成人小视频| 亚洲女同一区二区| 成人性生交大片免费看在线播放| 欧美肥妇free| 一片黄亚洲嫩模| 不卡av在线免费观看| 久久久精品免费观看| 捆绑紧缚一区二区三区视频 | 日韩av高清在线观看| 欧美亚洲日本一区| 1区2区3区欧美| 风流少妇一区二区| 久久只精品国产| 国内成人自拍视频| 日韩欧美亚洲国产另类| 亚洲第一久久影院| 欧美视频在线一区二区三区| 日韩理论在线观看| 99视频一区二区| 亚洲人亚洲人成电影网站色| 成人av电影免费在线播放| 国产日韩精品久久久| 国产福利不卡视频| 久久综合狠狠综合久久综合88 | 国产日韩欧美高清在线| 韩国欧美一区二区| 欧美一级黄色大片| 久久99久久99精品免视看婷婷 | 欧美一级夜夜爽| 青青草原综合久久大伊人精品| 91精品久久久久久久91蜜桃 | 成人欧美一区二区三区黑人麻豆| 国产69精品久久久久毛片| 国产免费成人在线视频| 成人h版在线观看| 亚洲伦在线观看| 欧美视频一区二区在线观看| 五月天激情综合网| 欧美一级在线观看| 国产精品1024| 日韩一区在线免费观看| 欧美视频中文一区二区三区在线观看 | 亚洲视频在线一区观看| 在线观看国产日韩| 天堂成人国产精品一区| 日韩免费电影网站| 国产盗摄一区二区| 亚洲精品伦理在线| 欧美一级精品大片| 岛国av在线一区| 亚洲国产精品一区二区www在线| 欧美午夜精品免费| 久久国产尿小便嘘嘘| 日本一区二区久久| 色综合天天综合网天天狠天天| 亚洲成av人片在线| 中文字幕免费在线观看视频一区| 91高清视频免费看| 经典三级一区二区| 亚洲欧美日韩成人高清在线一区| 777奇米四色成人影色区| 国产剧情一区二区三区| 亚洲一二三区在线观看| 久久午夜电影网| 欧美视频在线一区二区三区 | 337p亚洲精品色噜噜| 国产精品18久久久久久久久久久久 | 欧美大片一区二区三区| 99免费精品在线| 久久国产人妖系列| 亚洲高清不卡在线| 欧美国产精品一区| 精品欧美一区二区久久| 91色婷婷久久久久合中文| 久久超碰97中文字幕| 亚洲精品高清在线观看| 久久久国产精华| 欧美另类高清zo欧美| 成人午夜碰碰视频| 国内精品免费在线观看| 午夜精品久久久久久久99水蜜桃| 国产精品天天摸av网| 久久欧美一区二区| 日韩一区二区电影网| 欧美性生活一区| 色综合中文字幕国产| 久草这里只有精品视频| 日韩av不卡在线观看| 亚洲超碰97人人做人人爱| 成人欧美一区二区三区视频网页| 亚洲精品一区二区精华| 日韩欧美一区在线观看| 欧美性videosxxxxx| 色诱亚洲精品久久久久久| 成人永久aaa| 国产精品一卡二| 国产精品18久久久久| 国产精品性做久久久久久| 久久精品99久久久| 理论电影国产精品| 麻豆一区二区三| 狠狠色丁香婷婷综合| 国产一区二区三区观看| 国产精品99精品久久免费| 国产酒店精品激情| 丁香天五香天堂综合| 91麻豆成人久久精品二区三区| 国产一区二区三区黄视频 | 日本伊人精品一区二区三区观看方式| 综合av第一页| 一区二区欧美在线观看| 中文字幕字幕中文在线中不卡视频| 中文字幕欧美日本乱码一线二线| 国产精品欧美一区喷水| 亚洲精品水蜜桃| 午夜精品爽啪视频| 免费看黄色91| 国产剧情一区二区三区| 不卡av电影在线播放| 欧洲另类一二三四区| 欧美一区二区三区在线电影| 欧美mv和日韩mv的网站| 国产精品久久久久婷婷二区次| 国产精品久久久一本精品| 亚洲一区二区三区在线| 日本欧美一区二区在线观看| 国产乱码精品一品二品| 日本道色综合久久| 91精品国产综合久久香蕉麻豆 | 在线精品视频小说1| 日韩一区二区在线播放| 日本一区二区三区在线不卡| 亚洲美女电影在线| 久久成人av少妇免费| 99re这里只有精品6| 91精品欧美一区二区三区综合在 | 欧美精品免费视频| 欧美激情综合在线| 午夜精品一区二区三区电影天堂 | 亚洲高清免费观看高清完整版在线观看| 视频一区欧美日韩| 成人动漫一区二区三区| 日韩欧美在线观看一区二区三区| 国产精品人人做人人爽人人添 | 国产成人免费视频网站高清观看视频| 在线观看日韩国产| 久久久精品tv| 蜜桃视频第一区免费观看| 色综合天天综合网国产成人综合天 |