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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? pciehp_core.c

?? audio driver for hotplug pci on linux 2.6.27
?? C
字號:
/* * 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/moduleparam.h>#include <linux/kernel.h>#include <linux/types.h>#include <linux/pci.h>#include "pciehp.h"#include <linux/interrupt.h>#include <linux/time.h>/* Global variables */int pciehp_debug;int pciehp_poll_mode;int pciehp_poll_time;int pciehp_force;struct workqueue_struct *pciehp_wq;#define DRIVER_VERSION	"0.4"#define DRIVER_AUTHOR	"Dan Zink <dan.zink@compaq.com>, Greg Kroah-Hartman <greg@kroah.com>, Dely Sy <dely.l.sy@intel.com>"#define DRIVER_DESC	"PCI Express Hot Plug Controller Driver"MODULE_AUTHOR(DRIVER_AUTHOR);MODULE_DESCRIPTION(DRIVER_DESC);MODULE_LICENSE("GPL");module_param(pciehp_debug, bool, 0644);module_param(pciehp_poll_mode, bool, 0644);module_param(pciehp_poll_time, int, 0644);module_param(pciehp_force, bool, 0644);MODULE_PARM_DESC(pciehp_debug, "Debugging mode enabled or not");MODULE_PARM_DESC(pciehp_poll_mode, "Using polling mechanism for hot-plug events or not");MODULE_PARM_DESC(pciehp_poll_time, "Polling mechanism frequency, in seconds");MODULE_PARM_DESC(pciehp_force, "Force pciehp, even if _OSC and OSHP are missing");#define PCIE_MODULE_NAME "pciehp"static int set_attention_status (struct hotplug_slot *slot, u8 value);static int enable_slot		(struct hotplug_slot *slot);static int disable_slot		(struct hotplug_slot *slot);static int get_power_status	(struct hotplug_slot *slot, u8 *value);static int get_attention_status	(struct hotplug_slot *slot, u8 *value);static int get_latch_status	(struct hotplug_slot *slot, u8 *value);static int get_adapter_status	(struct hotplug_slot *slot, u8 *value);static int get_max_bus_speed	(struct hotplug_slot *slot, enum pci_bus_speed *value);static int get_cur_bus_speed	(struct hotplug_slot *slot, enum pci_bus_speed *value);static struct hotplug_slot_ops pciehp_hotplug_slot_ops = {	.owner =		THIS_MODULE,	.set_attention_status =	set_attention_status,	.enable_slot =		enable_slot,	.disable_slot =		disable_slot,	.get_power_status =	get_power_status,	.get_attention_status =	get_attention_status,	.get_latch_status =	get_latch_status,	.get_adapter_status =	get_adapter_status,  	.get_max_bus_speed =	get_max_bus_speed,  	.get_cur_bus_speed =	get_cur_bus_speed,};/* * Check the status of the Electro Mechanical Interlock (EMI) */static int get_lock_status(struct hotplug_slot *hotplug_slot, u8 *value){	struct slot *slot = hotplug_slot->private;	return (slot->hpc_ops->get_emi_status(slot, value));}/* * sysfs interface for the Electro Mechanical Interlock (EMI) * 1 == locked, 0 == unlocked */static ssize_t lock_read_file(struct hotplug_slot *slot, char *buf){	int retval;	u8 value;	retval = get_lock_status(slot, &value);	if (retval)		goto lock_read_exit;	retval = sprintf (buf, "%d\n", value);lock_read_exit:	return retval;}/* * Change the status of the Electro Mechanical Interlock (EMI) * This is a toggle - in addition there must be at least 1 second * in between toggles. */static int set_lock_status(struct hotplug_slot *hotplug_slot, u8 status){	struct slot *slot = hotplug_slot->private;	int retval;	u8 value;	mutex_lock(&slot->ctrl->crit_sect);	/* has it been >1 sec since our last toggle? */	if ((get_seconds() - slot->last_emi_toggle) < 1) {		mutex_unlock(&slot->ctrl->crit_sect);		return -EINVAL;	}	/* see what our current state is */	retval = get_lock_status(hotplug_slot, &value);	if (retval || (value == status))		goto set_lock_exit;	slot->hpc_ops->toggle_emi(slot);set_lock_exit:	mutex_unlock(&slot->ctrl->crit_sect);	return 0;}/* * sysfs interface which allows the user to toggle the Electro Mechanical * Interlock.  Valid values are either 0 or 1.  0 == unlock, 1 == lock */static ssize_t lock_write_file(struct hotplug_slot *slot, const char *buf,		size_t count){	unsigned long llock;	u8 lock;	int retval = 0;	llock = simple_strtoul(buf, NULL, 10);	lock = (u8)(llock & 0xff);	switch (lock) {		case 0:		case 1:			retval = set_lock_status(slot, lock);			break;		default:			err ("%d is an invalid lock value\n", lock);			retval = -EINVAL;	}	if (retval)		return retval;	return count;}static struct hotplug_slot_attribute hotplug_slot_attr_lock = {	.attr = {.name = "lock", .mode = S_IFREG | S_IRUGO | S_IWUSR},	.show = lock_read_file,	.store = lock_write_file};/** * release_slot - free up the memory used by a slot * @hotplug_slot: slot to free */static void release_slot(struct hotplug_slot *hotplug_slot){	dbg("%s - physical_slot = %s\n", __func__,	    hotplug_slot_name(hotplug_slot));	kfree(hotplug_slot->info);	kfree(hotplug_slot);}static int init_slots(struct controller *ctrl){	struct slot *slot;	struct hotplug_slot *hotplug_slot;	struct hotplug_slot_info *info;	char name[SLOT_NAME_SIZE];	int retval = -ENOMEM;	list_for_each_entry(slot, &ctrl->slot_list, slot_list) {		hotplug_slot = kzalloc(sizeof(*hotplug_slot), GFP_KERNEL);		if (!hotplug_slot)			goto error;		info = kzalloc(sizeof(*info), GFP_KERNEL);		if (!info)			goto error_hpslot;		/* register this slot with the hotplug pci core */		hotplug_slot->info = info;		hotplug_slot->private = slot;		hotplug_slot->release = &release_slot;		hotplug_slot->ops = &pciehp_hotplug_slot_ops;		slot->hotplug_slot = hotplug_slot;		snprintf(name, SLOT_NAME_SIZE, "%u", slot->number);		dbg("Registering bus=%x dev=%x hp_slot=%x sun=%x "		    "slot_device_offset=%x\n", slot->bus, slot->device,		    slot->hp_slot, slot->number, ctrl->slot_device_offset);		retval = pci_hp_register(hotplug_slot,					 ctrl->pci_dev->subordinate,					 slot->device,					 name);		if (retval) {			err("pci_hp_register failed with error %d\n", retval);			goto error_info;		}		get_power_status(hotplug_slot, &info->power_status);		get_attention_status(hotplug_slot, &info->attention_status);		get_latch_status(hotplug_slot, &info->latch_status);		get_adapter_status(hotplug_slot, &info->adapter_status);		/* create additional sysfs entries */		if (EMI(ctrl)) {			retval = sysfs_create_file(&hotplug_slot->pci_slot->kobj,				&hotplug_slot_attr_lock.attr);			if (retval) {				pci_hp_deregister(hotplug_slot);				err("cannot create additional sysfs entries\n");				goto error_info;			}		}	}	return 0;error_info:	kfree(info);error_hpslot:	kfree(hotplug_slot);error:	return retval;}static void cleanup_slots(struct controller *ctrl){	struct slot *slot;	list_for_each_entry(slot, &ctrl->slot_list, slot_list) {		if (EMI(ctrl))			sysfs_remove_file(&slot->hotplug_slot->pci_slot->kobj,				&hotplug_slot_attr_lock.attr);		pci_hp_deregister(slot->hotplug_slot);	}}/* * set_attention_status - Turns the Amber LED for a slot on, off or blink */static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status){	struct slot *slot = hotplug_slot->private;	dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));	hotplug_slot->info->attention_status = status;	if (ATTN_LED(slot->ctrl))		slot->hpc_ops->set_attention_status(slot, status);	return 0;}static int enable_slot(struct hotplug_slot *hotplug_slot){	struct slot *slot = hotplug_slot->private;	dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));	return pciehp_sysfs_enable_slot(slot);}static int disable_slot(struct hotplug_slot *hotplug_slot){	struct slot *slot = hotplug_slot->private;	dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));	return pciehp_sysfs_disable_slot(slot);}static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value){	struct slot *slot = hotplug_slot->private;	int retval;	dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));	retval = slot->hpc_ops->get_power_status(slot, value);	if (retval < 0)		*value = hotplug_slot->info->power_status;	return 0;}static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value){	struct slot *slot = hotplug_slot->private;	int retval;	dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));	retval = slot->hpc_ops->get_attention_status(slot, value);	if (retval < 0)		*value = hotplug_slot->info->attention_status;	return 0;}static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value){	struct slot *slot = hotplug_slot->private;	int retval;	dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));	retval = slot->hpc_ops->get_latch_status(slot, value);	if (retval < 0)		*value = hotplug_slot->info->latch_status;	return 0;}static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value){	struct slot *slot = hotplug_slot->private;	int retval;	dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));	retval = slot->hpc_ops->get_adapter_status(slot, value);	if (retval < 0)		*value = hotplug_slot->info->adapter_status;	return 0;}static int get_max_bus_speed(struct hotplug_slot *hotplug_slot,				enum pci_bus_speed *value){	struct slot *slot = hotplug_slot->private;	int retval;	dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));	retval = slot->hpc_ops->get_max_bus_speed(slot, value);	if (retval < 0)		*value = PCI_SPEED_UNKNOWN;	return 0;}static int get_cur_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value){	struct slot *slot = hotplug_slot->private;	int retval;	dbg("%s - physical_slot = %s\n", __func__, slot_name(slot));	retval = slot->hpc_ops->get_cur_bus_speed(slot, value);	if (retval < 0)		*value = PCI_SPEED_UNKNOWN;	return 0;}static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_id *id){	int rc;	struct controller *ctrl;	struct slot *t_slot;	u8 value;	struct pci_dev *pdev = dev->port;	if (pciehp_force)		dbg("Bypassing BIOS check for pciehp use on %s\n",		    pci_name(pdev));	else if (pciehp_get_hp_hw_control_from_firmware(pdev))		goto err_out_none;	ctrl = pcie_init(dev);	if (!ctrl) {		dbg("%s: controller initialization failed\n", PCIE_MODULE_NAME);		goto err_out_none;	}	set_service_data(dev, ctrl);	/* Setup the slot information structures */	rc = init_slots(ctrl);	if (rc) {		if (rc == -EBUSY)			warn("%s: slot already registered by another "				"hotplug driver\n", PCIE_MODULE_NAME);		else			err("%s: slot initialization failed\n",				PCIE_MODULE_NAME);		goto err_out_release_ctlr;	}	t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset);	t_slot->hpc_ops->get_adapter_status(t_slot, &value); /* Check if slot is occupied */	if (value && pciehp_force) {		rc = pciehp_enable_slot(t_slot);		if (rc)	/* -ENODEV: shouldn't happen, but deal with it */			value = 0;	}	if ((POWER_CTRL(ctrl)) && !value) {		rc = t_slot->hpc_ops->power_off_slot(t_slot); /* Power off slot if not occupied*/		if (rc)			goto err_out_free_ctrl_slot;	}	return 0;err_out_free_ctrl_slot:	cleanup_slots(ctrl);err_out_release_ctlr:	ctrl->hpc_ops->release_ctlr(ctrl);err_out_none:	return -ENODEV;}static void pciehp_remove (struct pcie_device *dev){	struct controller *ctrl = get_service_data(dev);	cleanup_slots(ctrl);	ctrl->hpc_ops->release_ctlr(ctrl);}#ifdef CONFIG_PMstatic int pciehp_suspend (struct pcie_device *dev, pm_message_t state){	printk("%s ENTRY\n", __func__);	return 0;}static int pciehp_resume (struct pcie_device *dev){	printk("%s ENTRY\n", __func__);	if (pciehp_force) {		struct controller *ctrl = get_service_data(dev);		struct slot *t_slot;		u8 status;		/* reinitialize the chipset's event detection logic */		pcie_enable_notification(ctrl);		t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset);		/* Check if slot is occupied */		t_slot->hpc_ops->get_adapter_status(t_slot, &status);		if (status)			pciehp_enable_slot(t_slot);		else			pciehp_disable_slot(t_slot);	}	return 0;}#endifstatic struct pcie_port_service_id port_pci_ids[] = { {	.vendor = PCI_ANY_ID,	.device = PCI_ANY_ID,	.port_type = PCIE_ANY_PORT,	.service_type = PCIE_PORT_SERVICE_HP,	.driver_data =	0,	}, { /* end: all zeroes */ }};static const char device_name[] = "hpdriver";static struct pcie_port_service_driver hpdriver_portdrv = {	.name		= (char *)device_name,	.id_table	= &port_pci_ids[0],	.probe		= pciehp_probe,	.remove		= pciehp_remove,#ifdef	CONFIG_PM	.suspend	= pciehp_suspend,	.resume		= pciehp_resume,#endif	/* PM */};static int __init pcied_init(void){	int retval = 0;	retval = pcie_port_service_register(&hpdriver_portdrv); 	dbg("pcie_port_service_register = %d\n", retval);  	info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); 	if (retval)		dbg("%s: Failure to register service\n", __func__);	return retval;}static void __exit pcied_cleanup(void){	dbg("unload_pciehpd()\n");	pcie_port_service_unregister(&hpdriver_portdrv);	info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n");}module_init(pcied_init);module_exit(pcied_cleanup);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产91综合久久蜜臀| 蜜臀av国产精品久久久久| 男人操女人的视频在线观看欧美| 国产99精品视频| 日韩欧美在线不卡| 一区二区三区四区在线| 国产成人精品免费一区二区| 制服.丝袜.亚洲.中文.综合| 亚洲桃色在线一区| 国产不卡视频一区二区三区| 日韩一区二区精品| 亚洲国产aⅴ天堂久久| 99久久精品国产毛片| 久久美女高清视频| 奇米色一区二区三区四区| 在线观看国产一区二区| 国产精品久久久久一区| 国产福利91精品| 日韩精品中午字幕| 日本亚洲视频在线| 欧美日韩成人综合在线一区二区| 亚洲四区在线观看| 成人免费黄色大片| 国产欧美一区二区三区鸳鸯浴| 美女网站色91| 午夜天堂影视香蕉久久| 91在线视频网址| 国产精品免费久久| 成人午夜在线视频| 日本一区二区三区高清不卡| 国产又粗又猛又爽又黄91精品| 日韩午夜激情av| 蜜臂av日日欢夜夜爽一区| 欧美一级二级在线观看| 婷婷久久综合九色综合伊人色| 91麻豆免费在线观看| 亚洲视频一区二区在线观看| 99在线精品观看| 国产精品蜜臀在线观看| 成人国产电影网| 国产精品灌醉下药二区| 成人国产亚洲欧美成人综合网| 欧美国产欧美综合| 成人黄色777网| 亚洲男同1069视频| 色乱码一区二区三区88| 亚洲综合视频网| 欧美视频在线不卡| 午夜精品在线看| 欧美一区二区网站| 久久99精品视频| 久久综合色婷婷| 国产91富婆露脸刺激对白| 国产欧美一区二区在线观看| 成人性视频网站| 中文字幕亚洲一区二区av在线| av激情亚洲男人天堂| 亚洲精品免费视频| 欧美日韩国产大片| 免费高清在线视频一区·| 精品国内片67194| 国产成人av网站| 伊人开心综合网| 欧美日韩的一区二区| 久久99久久99精品免视看婷婷| 久久精品人人做人人爽97| 99久久精品费精品国产一区二区| 一区二区高清视频在线观看| 在线播放一区二区三区| 国内精品久久久久影院薰衣草| 国产欧美一区二区精品秋霞影院| 91在线视频免费91| 日产国产高清一区二区三区 | 久久99久久精品| 国产日韩欧美精品在线| 91麻豆免费视频| 日本欧美一区二区三区乱码| 久久久精品影视| 色偷偷一区二区三区| 免费黄网站欧美| 欧美国产精品一区| 欧美色图天堂网| 另类小说图片综合网| 国产精品久久久久一区| 制服丝袜国产精品| 成人精品国产免费网站| 午夜国产不卡在线观看视频| 久久综合色之久久综合| 色婷婷av一区二区三区gif| 奇米色一区二区| 中文字幕一区二区三区精华液| 欧美日韩成人综合在线一区二区 | 午夜久久福利影院| 国产高清在线观看免费不卡| 亚洲精品成人a在线观看| 日韩欧美亚洲一区二区| 色综合色综合色综合色综合色综合| 视频一区免费在线观看| 国产精品私人自拍| 在线不卡中文字幕播放| 99re这里都是精品| 精品在线一区二区三区| 一区二区三区电影在线播| 26uuu色噜噜精品一区二区| 在线观看免费亚洲| 成人做爰69片免费看网站| 午夜精品在线视频一区| √…a在线天堂一区| 日韩欧美成人午夜| 欧美中文一区二区三区| 成人综合婷婷国产精品久久蜜臀| 日韩电影在线一区二区| 亚洲精品少妇30p| 久久久久久久久免费| 91精品视频网| 色婷婷亚洲综合| 国产成人av影院| 久国产精品韩国三级视频| 亚洲激情第一区| 国产精品免费看片| 337p粉嫩大胆色噜噜噜噜亚洲| 欧美日韩www| 在线视频中文字幕一区二区| 丰满岳乱妇一区二区三区| 老司机午夜精品| 肉色丝袜一区二区| 一区二区三区四区不卡视频| 国产精品免费观看视频| 久久综合久久鬼色中文字| 欧美一区二区三区播放老司机| 91福利小视频| 色综合久久久久| 成人sese在线| 国产精品18久久久久久久久久久久| 喷白浆一区二区| 偷拍亚洲欧洲综合| 亚洲国产精品视频| 亚洲精品国产无天堂网2021| 国产精品高潮呻吟久久| 国产视频一区二区在线观看| 精品国产网站在线观看| 日韩亚洲欧美高清| 欧美中文字幕久久 | 久草这里只有精品视频| 奇米精品一区二区三区四区| 日韩中文字幕不卡| 午夜视频在线观看一区二区| 亚洲成人免费电影| 亚洲国产成人91porn| 亚洲一区在线电影| 亚洲二区在线视频| 亚洲一级不卡视频| 亚洲 欧美综合在线网络| 亚洲va欧美va天堂v国产综合| 一区二区久久久久久| 亚洲综合久久久| 亚洲第四色夜色| 午夜日韩在线观看| 石原莉奈在线亚洲三区| 琪琪一区二区三区| 蜜乳av一区二区三区| 九色综合国产一区二区三区| 精品一区二区在线播放| 国产一区二区精品在线观看| 国产一区不卡在线| 国产suv一区二区三区88区| 成人一区二区三区在线观看| 成人国产亚洲欧美成人综合网| eeuss鲁片一区二区三区| 99精品国产一区二区三区不卡| 色偷偷久久人人79超碰人人澡 | 精品国产髙清在线看国产毛片| 欧美一区二区三区在线视频| 日韩精品在线看片z| 久久人人爽爽爽人久久久| 国产欧美一区二区精品性| 中文字幕在线不卡视频| 又紧又大又爽精品一区二区| 五月激情综合色| 狠狠色综合色综合网络| 成人免费看黄yyy456| 色狠狠色狠狠综合| 91精品国产欧美一区二区成人 | 欧美美女直播网站| 日韩一级在线观看| 久久久精品黄色| 国产精品黄色在线观看| 亚洲一区电影777| 蜜桃精品视频在线| 大美女一区二区三区| 日本精品一区二区三区四区的功能| 欧美精品在线视频| 精品粉嫩aⅴ一区二区三区四区| 国产精品久久久久婷婷| 五月婷婷另类国产| 国产在线日韩欧美| 色94色欧美sute亚洲线路一ni| 欧美一区二区视频在线观看| 欧美极品aⅴ影院| 亚洲一二三四区不卡|