亚洲欧美第一页_禁久久精品乱码_粉嫩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亚洲va在线观看蝴蝶网| 欧洲另类一二三四区| 色综合天天综合在线视频| 亚洲444eee在线观看| 亚洲黄色免费网站| 亚洲一区二区在线播放相泽| 亚洲精选一二三| 一级日本不卡的影视| 亚洲一区二区三区视频在线播放| 亚洲女同女同女同女同女同69| 亚洲欧洲日韩综合一区二区| 亚洲日本一区二区| 亚洲永久免费av| 欧美影院一区二区三区| 欧美性大战xxxxx久久久| 欧美日本免费一区二区三区| 在线观看91精品国产麻豆| 在线不卡中文字幕播放| 日韩三级伦理片妻子的秘密按摩| 日韩精品中文字幕在线不卡尤物| 久久久久久一级片| 中文字幕一区二区三区四区不卡| 亚洲精品国产第一综合99久久| 亚洲一区自拍偷拍| 日韩av网站免费在线| 国内外成人在线| 成人免费福利片| 色哟哟国产精品| 91精品国产高清一区二区三区 | 91精品国产综合久久久久久| 欧美一区二区三区四区在线观看 | 亚洲激情自拍偷拍| 五月天丁香久久| 国产一区二区三区四区五区入口| 不卡视频一二三| 欧美精品一卡两卡| 久久久久久亚洲综合影院红桃| 亚洲人成人一区二区在线观看| 午夜久久久久久| 国产成人午夜精品影院观看视频| 91老师国产黑色丝袜在线| 91精品国产综合久久久蜜臀粉嫩 | 日韩一区二区在线观看| 国产欧美一区二区精品性| 亚洲国产裸拍裸体视频在线观看乱了| 麻豆视频观看网址久久| www.欧美亚洲| 日韩视频一区二区在线观看| 国产精品毛片久久久久久| 午夜精品久久久久| 成人精品视频一区二区三区| 欧美精品亚洲一区二区在线播放| 国产欧美日韩在线视频| 亚洲第一久久影院| 成人精品视频一区二区三区 | 精品奇米国产一区二区三区| 综合中文字幕亚洲| 国产一区二区三区在线观看免费 | 美女诱惑一区二区| av影院午夜一区| 精品三级在线看| 亚洲一区二区精品久久av| 国产成人高清在线| 制服丝袜国产精品| 亚洲同性gay激情无套| 精品一区二区三区影院在线午夜| 在线中文字幕一区二区| 国产欧美综合在线观看第十页| 日韩精品免费视频人成| 日本国产一区二区| 国产精品午夜电影| 经典三级一区二区| 91精品免费在线观看| 亚洲欧美日韩系列| 成人av在线资源| 久久久精品国产免大香伊| 欧美人xxxx| 亚洲一区视频在线| 91香蕉国产在线观看软件| 久久婷婷成人综合色| 蜜臀va亚洲va欧美va天堂| 欧美无人高清视频在线观看| 国产精品嫩草99a| 国产盗摄一区二区| 2024国产精品| 国产在线一区二区| 欧美成人在线直播| 青青国产91久久久久久| 欧美日韩精品一区二区三区蜜桃 | 青青青伊人色综合久久| 欧美三区在线观看| 亚洲18女电影在线观看| 欧美日韩在线综合| 亚洲成人免费电影| 欧美色视频在线| 一区二区理论电影在线观看| 91免费看视频| 一区二区欧美在线观看| 在线观看av一区二区| 一区二区三区中文字幕电影 | 337p粉嫩大胆色噜噜噜噜亚洲| 日日夜夜精品视频天天综合网| 欧美日韩日日夜夜| 丝袜美腿一区二区三区| 欧美丰满少妇xxxbbb| 人人精品人人爱| 日韩精品在线一区二区| 久久99精品久久久久久国产越南 | 美女mm1313爽爽久久久蜜臀| 欧美日韩国产大片| 日韩电影在线观看电影| 欧美精品高清视频| 蜜臀va亚洲va欧美va天堂| 精品剧情在线观看| 国产成人免费视频一区| 国产精品伦理一区二区| 91麻豆国产在线观看| 亚洲免费观看视频| 精品视频123区在线观看| 免费成人在线播放| 久久精品综合网| 99视频一区二区| 91高清视频在线| 亚洲第一福利视频在线| 欧美一区二区人人喊爽| 久久成人免费网| 欧美极品少妇xxxxⅹ高跟鞋| 色综合久久久久| 日韩专区欧美专区| 久久影院电视剧免费观看| 成人一区二区三区| 亚洲综合一二三区| 欧美刺激午夜性久久久久久久| 国产黄色精品网站| 一区二区三区四区亚洲| 91精品在线麻豆| 国产91清纯白嫩初高中在线观看 | 精品一区二区三区在线观看国产| 国产午夜亚洲精品不卡| 色国产精品一区在线观看| 日本成人中文字幕| 国产精品免费av| 制服丝袜亚洲色图| 不卡一区二区三区四区| 天堂影院一区二区| 日本一区二区三区在线观看| 在线观看不卡一区| 国产精品18久久久久| 一级特黄大欧美久久久| 久久久久久久av麻豆果冻| 色天使久久综合网天天| 极品尤物av久久免费看| 亚洲一区在线电影| 国产欧美日韩精品在线| 欧美日韩情趣电影| 国产a精品视频| 蜜桃精品视频在线观看| 一区二区三区在线视频播放| 久久午夜羞羞影院免费观看| 91久久一区二区| 国产成人综合精品三级| 日韩制服丝袜先锋影音| 国产精品不卡在线| 日韩一区二区免费视频| 91在线porny国产在线看| 精品一区二区三区在线视频| 亚洲最大成人网4388xx| 久久久亚洲国产美女国产盗摄 | 在线成人高清不卡| 99久久精品久久久久久清纯| 久久草av在线| 亚洲一区成人在线| 国产精品久久久久久久久久免费看| 欧美精品aⅴ在线视频| 91碰在线视频| 成人做爰69片免费看网站| 麻豆91精品91久久久的内涵| 一区二区在线观看视频在线观看| 国产视频一区二区三区在线观看| 欧美一区二区三区在线观看| 在线观看91精品国产入口| av一区二区不卡| 国产精品白丝av| 精品亚洲porn| 乱中年女人伦av一区二区| 亚州成人在线电影| 亚洲自拍偷拍网站| 亚洲四区在线观看| 国产精品欧美精品| 亚洲国产成人私人影院tom| 久久久久久亚洲综合影院红桃| 欧美tk—视频vk| 亚洲精品一区二区三区影院| 在线播放中文字幕一区| 欧美日本一区二区三区四区| 欧美视频在线观看一区二区| 91伊人久久大香线蕉| 91丨九色丨黑人外教|