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

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

?? pciehp_ctrl.c

?? h內核
?? 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>, <dely.l.sy@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一区二区三区免费野_久草精品视频
一区二区三区丝袜| 久久精品视频在线看| 国产91精品一区二区麻豆亚洲| 视频在线观看一区二区三区| 美女网站一区二区| 在线观看国产日韩| 男男gaygay亚洲| 亚洲成av人**亚洲成av**| 亚洲精品日日夜夜| 天天色天天操综合| 免费在线一区观看| 成人午夜在线视频| 在线观看91精品国产入口| 欧美精品久久一区| 26uuu精品一区二区三区四区在线| 日韩亚洲欧美综合| 国产精品免费网站在线观看| 亚洲欧美激情一区二区| 蜜桃视频一区二区| 91性感美女视频| 精品成a人在线观看| 亚洲欧美一区二区不卡| 精品无码三级在线观看视频| 成人性生交大合| 日韩一区二区精品在线观看| 欧美激情一区二区三区四区| 性感美女极品91精品| 成人三级在线视频| 日韩女同互慰一区二区| 国产精品毛片久久久久久| 三级久久三级久久| 91在线免费播放| 中文字幕欧美三区| 韩日欧美一区二区三区| 欧美久久高跟鞋激| 亚洲成人高清在线| 色素色在线综合| 一区二区三区自拍| 91亚洲男人天堂| 亚洲天堂久久久久久久| 粉嫩aⅴ一区二区三区四区五区| 欧美成人艳星乳罩| 蜜桃精品视频在线| 欧美精品一区二区三区一线天视频 | 一级特黄大欧美久久久| a美女胸又www黄视频久久| 精品入口麻豆88视频| 久久se这里有精品| 久久亚洲一区二区三区四区| 九九久久精品视频| 国产香蕉久久精品综合网| 成人免费高清视频| 亚洲激情在线播放| 欧美高清视频一二三区| 国产在线精品免费av| 国产女人18水真多18精品一级做| 粉嫩高潮美女一区二区三区| 亚洲视频一二区| 91精品国产91久久久久久最新毛片| 性做久久久久久久免费看| 久久精品一区二区三区不卡| 99精品一区二区| 毛片av一区二区三区| 久久久噜噜噜久久人人看| 91网站黄www| 麻豆视频一区二区| 亚洲自拍偷拍网站| 久久免费看少妇高潮| 色综合中文综合网| 99热精品一区二区| 日本欧美一区二区三区| 成人免费在线观看入口| 日韩一区二区不卡| 色猫猫国产区一区二在线视频| 日韩影院在线观看| 亚洲高清视频中文字幕| 久久久久久亚洲综合影院红桃 | 亚洲欧美电影一区二区| 精品国产一区二区国模嫣然| 欧洲国内综合视频| 92精品国产成人观看免费| 国产精品99久| 国产成人av资源| 国产精品一二一区| 成人国产亚洲欧美成人综合网| 免费人成在线不卡| 免费成人在线播放| 另类小说欧美激情| 国产精品一二三区在线| 国产在线视频一区二区| 国内精品第一页| 国产成人午夜99999| 国产成人精品影视| 色哟哟国产精品免费观看| 日本精品一区二区三区四区的功能| 99久久久无码国产精品| 欧洲亚洲精品在线| 欧美一级片在线观看| 日韩午夜精品视频| 国产精品久久久久婷婷| 亚洲图片欧美色图| 久久er精品视频| thepron国产精品| 欧美视频一区二区三区四区 | 极品美女销魂一区二区三区免费| 久久国产视频网| 97久久精品人人做人人爽50路| 欧美三级中文字幕在线观看| 欧美一区二区三区免费在线看| 久久这里只精品最新地址| 自拍偷拍国产精品| 久久精品国产秦先生| 91无套直看片红桃| 国产欧美综合色| 亚洲成人激情社区| 在线观看一区日韩| 国产精品美女www爽爽爽| 日韩va亚洲va欧美va久久| 91啪亚洲精品| 国产日韩欧美在线一区| 午夜精品久久久久久久| 色婷婷综合久色| 中文字幕av一区二区三区| 麻豆成人免费电影| 欧美一二三四区在线| 亚洲精品高清在线观看| 成人国产精品免费观看视频| 精品国产亚洲一区二区三区在线观看| 亚洲精品v日韩精品| 99re亚洲国产精品| 亚洲天堂网中文字| 色噜噜狠狠色综合中国| 亚洲欧洲日本在线| 99久久婷婷国产综合精品电影| 国产日韩精品一区二区三区| 国产成人在线影院 | 春色校园综合激情亚洲| 国产欧美精品国产国产专区| 久久99精品国产麻豆婷婷 | 蜜臀av性久久久久av蜜臀妖精| 欧美日韩大陆一区二区| 午夜久久久久久电影| 欧美一区二区三区啪啪| 国产一区二区美女诱惑| 中文无字幕一区二区三区| 91一区二区三区在线观看| www国产亚洲精品久久麻豆| 国产亚洲一区二区三区四区| 亚洲最新视频在线观看| 国产一区二区免费视频| 亚洲视频香蕉人妖| 欧美一级免费大片| 粉嫩嫩av羞羞动漫久久久| 午夜在线电影亚洲一区| 精品国产免费视频| 在线精品国精品国产尤物884a| 喷水一区二区三区| 亚洲精品视频在线看| 日韩视频在线你懂得| 色综合视频一区二区三区高清| 日韩激情视频在线观看| 日韩理论片中文av| 国产日韩欧美在线一区| 56国语精品自产拍在线观看| 99久久99久久精品免费看蜜桃| 麻豆精品精品国产自在97香蕉| 中文字幕中文字幕在线一区| 日韩视频在线你懂得| 欧美欧美午夜aⅴ在线观看| 99re在线精品| 色偷偷一区二区三区| 不卡av在线免费观看| 国产福利一区二区三区在线视频| 亚洲第一久久影院| 亚洲第一狼人社区| 视频在线观看91| 免费在线成人网| 国产尤物一区二区| 国产精品亚洲视频| 菠萝蜜视频在线观看一区| 国产aⅴ综合色| 国产99久久精品| 99视频热这里只有精品免费| 91丝袜高跟美女视频| av动漫一区二区| 欧美在线观看视频一区二区三区| 色婷婷久久99综合精品jk白丝| 91美女在线观看| 69av一区二区三区| 欧美韩国日本综合| 一区二区三区四区不卡在线| 性做久久久久久久久| 国产一区二区调教| 91亚洲午夜精品久久久久久| 欧美美女bb生活片| 国产女人水真多18毛片18精品视频| 中文字幕一区二区5566日韩| 综合在线观看色| 免费不卡在线观看| 99国产精品久久|