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

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

?? rpaphp_core.c

?? audio driver for hotplug pci on linux 2.6.27
?? C
字號:
/* * PCI Hot Plug Controller Driver for RPA-compliant PPC64 platform. * Copyright (C) 2003 Linda Xie <lxie@us.ibm.com> * * 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 <lxie@us.ibm.com> * */#include <linux/kernel.h>#include <linux/module.h>#include <linux/moduleparam.h>#include <linux/pci.h>#include <linux/pci_hotplug.h>#include <linux/slab.h>#include <linux/smp.h>#include <linux/init.h>#include <asm/eeh.h>       /* for eeh_add_device() */#include <asm/rtas.h>		/* rtas_call */#include <asm/pci-bridge.h>	/* for pci_controller */#include "../pci.h"		/* for pci_add_new_bus */				/* and pci_do_scan_bus */#include "rpaphp.h"int debug;LIST_HEAD(rpaphp_slot_head);#define DRIVER_VERSION	"0.1"#define DRIVER_AUTHOR	"Linda Xie <lxie@us.ibm.com>"#define DRIVER_DESC	"RPA HOT Plug PCI Controller Driver"#define MAX_LOC_CODE 128MODULE_AUTHOR(DRIVER_AUTHOR);MODULE_DESCRIPTION(DRIVER_DESC);MODULE_LICENSE("GPL");module_param(debug, bool, 0644);/** * set_attention_status - set attention LED * @hotplug_slot: target &hotplug_slot * @value: LED control value * * echo 0 > attention -- set LED OFF * echo 1 > attention -- set LED ON * echo 2 > attention -- set LED ID(identify, light is blinking) */static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value){	int rc;	struct slot *slot = (struct slot *)hotplug_slot->private;	switch (value) {	case 0:	case 1:	case 2:		break;	default:		value = 1;		break;	}	rc = rtas_set_indicator(DR_INDICATOR, slot->index, value);	if (!rc)		hotplug_slot->info->attention_status = value;	return rc;}/** * get_power_status - get power status of a slot * @hotplug_slot: slot to get status * @value: pointer to store status */static int get_power_status(struct hotplug_slot *hotplug_slot, u8 * value){	int retval, level;	struct slot *slot = (struct slot *)hotplug_slot->private;	retval = rtas_get_power_level (slot->power_domain, &level);	if (!retval)		*value = level;	return retval;}/** * get_attention_status - get attention LED status * @hotplug_slot: slot to get status * @value: pointer to store status */static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value){	struct slot *slot = (struct slot *)hotplug_slot->private;	*value = slot->hotplug_slot->info->attention_status;	return 0;}static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 * value){	struct slot *slot = (struct slot *)hotplug_slot->private;	int rc, state;	rc = rpaphp_get_sensor_state(slot, &state);	*value = NOT_VALID;	if (rc)		return rc;	if (state == EMPTY)		*value = EMPTY;	else if (state == PRESENT)		*value = slot->state;	return 0;}static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value){	struct slot *slot = (struct slot *)hotplug_slot->private;	switch (slot->type) {	case 1:	case 2:	case 3:	case 4:	case 5:	case 6:		*value = PCI_SPEED_33MHz;	/* speed for case 1-6 */		break;	case 7:	case 8:		*value = PCI_SPEED_66MHz;		break;	case 11:	case 14:		*value = PCI_SPEED_66MHz_PCIX;		break;	case 12:	case 15:		*value = PCI_SPEED_100MHz_PCIX;		break;	case 13:	case 16:		*value = PCI_SPEED_133MHz_PCIX;		break;	default:		*value = PCI_SPEED_UNKNOWN;		break;	}	return 0;}static int get_children_props(struct device_node *dn, const int **drc_indexes,		const int **drc_names, const int **drc_types,		const int **drc_power_domains){	const int *indexes, *names, *types, *domains;	indexes = of_get_property(dn, "ibm,drc-indexes", NULL);	names = of_get_property(dn, "ibm,drc-names", NULL);	types = of_get_property(dn, "ibm,drc-types", NULL);	domains = of_get_property(dn, "ibm,drc-power-domains", NULL);	if (!indexes || !names || !types || !domains) {		/* Slot does not have dynamically-removable children */		return -EINVAL;	}	if (drc_indexes)		*drc_indexes = indexes;	if (drc_names)		/* &drc_names[1] contains NULL terminated slot names */		*drc_names = names;	if (drc_types)		/* &drc_types[1] contains NULL terminated slot types */		*drc_types = types;	if (drc_power_domains)		*drc_power_domains = domains;	return 0;}/* To get the DRC props describing the current node, first obtain it's * my-drc-index property.  Next obtain the DRC list from it's parent.  Use * the my-drc-index for correlation, and obtain the requested properties. */int rpaphp_get_drc_props(struct device_node *dn, int *drc_index,		char **drc_name, char **drc_type, int *drc_power_domain){	const int *indexes, *names;	const int *types, *domains;	const unsigned int *my_index;	char *name_tmp, *type_tmp;	int i, rc;	my_index = of_get_property(dn, "ibm,my-drc-index", NULL);	if (!my_index) {		/* Node isn't DLPAR/hotplug capable */		return -EINVAL;	}	rc = get_children_props(dn->parent, &indexes, &names, &types, &domains);	if (rc < 0) {		return -EINVAL;	}	name_tmp = (char *) &names[1];	type_tmp = (char *) &types[1];	/* Iterate through parent properties, looking for my-drc-index */	for (i = 0; i < indexes[0]; i++) {		if ((unsigned int) indexes[i + 1] == *my_index) {			if (drc_name)                		*drc_name = name_tmp;			if (drc_type)				*drc_type = type_tmp;			if (drc_index)				*drc_index = *my_index;			if (drc_power_domain)				*drc_power_domain = domains[i+1];			return 0;		}		name_tmp += (strlen(name_tmp) + 1);		type_tmp += (strlen(type_tmp) + 1);	}	return -EINVAL;}static int is_php_type(char *drc_type){	unsigned long value;	char *endptr;	/* PCI Hotplug nodes have an integer for drc_type */	value = simple_strtoul(drc_type, &endptr, 10);	if (endptr == drc_type)		return 0;	return 1;}/** * is_php_dn() - return 1 if this is a hotpluggable pci slot, else 0 * @dn: target &device_node * @indexes: passed to get_children_props() * @names: passed to get_children_props() * @types: returned from get_children_props() * @power_domains: * * This routine will return true only if the device node is * a hotpluggable slot. This routine will return false * for built-in pci slots (even when the built-in slots are * dlparable.) */static int is_php_dn(struct device_node *dn, const int **indexes,		const int **names, const int **types, const int **power_domains){	const int *drc_types;	int rc;	rc = get_children_props(dn, indexes, names, &drc_types, power_domains);	if (rc < 0)		return 0;	if (!is_php_type((char *) &drc_types[1]))		return 0;	*types = drc_types;	return 1;}/** * rpaphp_add_slot -- declare a hotplug slot to the hotplug subsystem. * @dn: device node of slot * * This subroutine will register a hotplugable slot with the * PCI hotplug infrastructure. This routine is typicaly called * during boot time, if the hotplug slots are present at boot time, * or is called later, by the dlpar add code, if the slot is * being dynamically added during runtime. * * If the device node points at an embedded (built-in) slot, this * routine will just return without doing anything, since embedded * slots cannot be hotplugged. * * To remove a slot, it suffices to call rpaphp_deregister_slot(). */int rpaphp_add_slot(struct device_node *dn){	struct slot *slot;	int retval = 0;	int i;	const int *indexes, *names, *types, *power_domains;	char *name, *type;	if (!dn->name || strcmp(dn->name, "pci"))		return 0;	/* If this is not a hotplug slot, return without doing anything. */	if (!is_php_dn(dn, &indexes, &names, &types, &power_domains))		return 0;	dbg("Entry %s: dn->full_name=%s\n", __func__, dn->full_name);	/* register PCI devices */	name = (char *) &names[1];	type = (char *) &types[1];	for (i = 0; i < indexes[0]; i++) {		slot = alloc_slot_struct(dn, indexes[i + 1], name, power_domains[i + 1]);		if (!slot)			return -ENOMEM;		slot->type = simple_strtoul(type, NULL, 10);						dbg("Found drc-index:0x%x drc-name:%s drc-type:%s\n",				indexes[i + 1], name, type);		retval = rpaphp_enable_slot(slot);		if (!retval)			retval = rpaphp_register_slot(slot);		if (retval)			dealloc_slot_struct(slot);		name += strlen(name) + 1;		type += strlen(type) + 1;	}	dbg("%s - Exit: rc[%d]\n", __func__, retval);	/* XXX FIXME: reports a failure only if last entry in loop failed */	return retval;}static void __exit cleanup_slots(void){	struct list_head *tmp, *n;	struct slot *slot;	/*	 * Unregister all of our slots with the pci_hotplug subsystem,	 * and free up all memory that we had allocated.	 * memory will be freed in release_slot callback. 	 */	list_for_each_safe(tmp, n, &rpaphp_slot_head) {		slot = list_entry(tmp, struct slot, rpaphp_slot_list);		list_del(&slot->rpaphp_slot_list);		pci_hp_deregister(slot->hotplug_slot);	}	return;}static int __init rpaphp_init(void){	struct device_node *dn = NULL;	info(DRIVER_DESC " version: " DRIVER_VERSION "\n");	while ((dn = of_find_node_by_name(dn, "pci")))		rpaphp_add_slot(dn);	return 0;}static void __exit rpaphp_exit(void){	cleanup_slots();}static int enable_slot(struct hotplug_slot *hotplug_slot){	struct slot *slot = (struct slot *)hotplug_slot->private;	int state;	int retval;	if (slot->state == CONFIGURED)		return 0;	retval = rpaphp_get_sensor_state(slot, &state);	if (retval)		return retval;	if (state == PRESENT) {		pcibios_add_pci_devices(slot->bus);		slot->state = CONFIGURED;	} else if (state == EMPTY) {		slot->state = EMPTY;	} else {		err("%s: slot[%s] is in invalid state\n", __func__, slot->name);		slot->state = NOT_VALID;		return -EINVAL;	}	return 0;}static int disable_slot(struct hotplug_slot *hotplug_slot){	struct slot *slot = (struct slot *)hotplug_slot->private;	if (slot->state == NOT_CONFIGURED)		return -EINVAL;	pcibios_remove_pci_devices(slot->bus);	slot->state = NOT_CONFIGURED;	return 0;}struct hotplug_slot_ops rpaphp_hotplug_slot_ops = {	.owner = THIS_MODULE,	.enable_slot = enable_slot,	.disable_slot = disable_slot,	.set_attention_status = set_attention_status,	.get_power_status = get_power_status,	.get_attention_status = get_attention_status,	.get_adapter_status = get_adapter_status,	.get_max_bus_speed = get_max_bus_speed,};module_init(rpaphp_init);module_exit(rpaphp_exit);EXPORT_SYMBOL_GPL(rpaphp_add_slot);EXPORT_SYMBOL_GPL(rpaphp_slot_head);EXPORT_SYMBOL_GPL(rpaphp_get_drc_props);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产91精品精华液一区二区三区| 青青草国产精品亚洲专区无| 日韩欧美视频一区| 欧美日韩精品三区| 欧美图区在线视频| 91福利视频在线| 在线观看日韩高清av| 欧美影片第一页| 欧洲av在线精品| 在线精品视频免费播放| 欧美日韩一区中文字幕| 欧美色手机在线观看| 欧日韩精品视频| 欧美久久高跟鞋激| 日韩一二三区视频| 欧美精品一区二区在线播放 | 久久综合国产精品| 欧美成人r级一区二区三区| 欧美电视剧在线观看完整版| 精品国产91乱码一区二区三区| 欧美一级欧美三级在线观看| 日韩午夜中文字幕| 国产日韩精品一区| 中文字幕一区在线| 亚洲成人高清在线| 九九视频精品免费| 成人av免费在线观看| 在线免费亚洲电影| 亚洲精品在线网站| 中文字幕中文乱码欧美一区二区| 亚洲精品福利视频网站| 日韩精品一区第一页| 国产一区二区毛片| 色综合久久88色综合天天| 制服丝袜av成人在线看| 国产视频亚洲色图| 亚洲一级二级在线| 国内精品伊人久久久久av影院| 不卡欧美aaaaa| 9191久久久久久久久久久| 精品成人免费观看| 亚洲一区二区偷拍精品| 久久99深爱久久99精品| 91浏览器打开| 精品福利二区三区| 亚洲一区自拍偷拍| 国产高清不卡一区二区| 欧美午夜精品免费| 欧美激情一区二区三区四区 | 欧美日韩在线免费视频| 久久综合九色综合久久久精品综合| 亚洲女同ⅹxx女同tv| 亚洲v精品v日韩v欧美v专区| 国产呦萝稀缺另类资源| 欧美在线你懂的| 国产欧美日韩另类一区| 日韩在线一区二区| 色哟哟国产精品| 欧美激情综合五月色丁香小说| 日韩av电影一区| 欧美在线色视频| √…a在线天堂一区| 国产乱码一区二区三区| 欧美精品色一区二区三区| 亚洲三级电影网站| 成人免费高清视频| 久久久无码精品亚洲日韩按摩| 日韩精品福利网| 欧美亚洲另类激情小说| 中文字幕亚洲不卡| 成人精品电影在线观看| 久久久国产精品麻豆| 久久国内精品视频| 91精品国产综合久久久久久漫画 | 日韩一区有码在线| 国产精品一二三| 精品盗摄一区二区三区| 男男成人高潮片免费网站| 欧美日韩精品一区二区在线播放| 亚洲欧美日韩在线不卡| 色天天综合久久久久综合片| 亚洲人成网站在线| 94-欧美-setu| 一区二区在线观看av| 色综合久久综合中文综合网| 亚洲色图欧美激情| 色婷婷av一区二区三区软件| 亚洲一区二区三区四区在线免费观看 | 国产乱国产乱300精品| 精品毛片乱码1区2区3区| 九九精品一区二区| 91.成人天堂一区| 青青青伊人色综合久久| 欧美电影精品一区二区| 国产一区二区三区精品视频| 国产婷婷色一区二区三区 | 国产三级三级三级精品8ⅰ区| 麻豆精品一区二区三区| 日韩亚洲欧美成人一区| 精品午夜一区二区三区在线观看| 精品国产一区二区三区久久久蜜月 | 亚洲精品中文字幕乱码三区| 色爱区综合激月婷婷| 亚洲一区二区三区国产| 91 com成人网| 国产成人精品一区二区三区四区| 国产精品久久久久久久久久久免费看| 99视频一区二区| 亚洲国产精品一区二区www| 日韩视频在线你懂得| 国产iv一区二区三区| 亚洲一卡二卡三卡四卡| 亚洲精品一区二区三区精华液 | 亚洲高清在线精品| 欧美大白屁股肥臀xxxxxx| 国产成人亚洲综合a∨婷婷| 亚洲欧美二区三区| 日韩视频在线永久播放| 99re免费视频精品全部| 日韩中文字幕av电影| 中文字幕乱码久久午夜不卡| 欧美精品电影在线播放| 成人美女视频在线观看18| 亚洲国产精品久久艾草纯爱| 精品福利在线导航| 欧美日韩精品欧美日韩精品| 国产精品99久久久久久久女警| 亚洲制服丝袜av| 国产精品久久三| 欧美岛国在线观看| 欧美日韩高清影院| 99视频精品在线| 国产大陆a不卡| 全部av―极品视觉盛宴亚洲| 亚洲精品欧美专区| 国产精品视频麻豆| 久久综合精品国产一区二区三区| 欧美日韩一区二区在线观看| 成人av网站免费| 久久精品国产亚洲aⅴ| 亚洲va韩国va欧美va| 亚洲天堂成人网| 中文av一区特黄| 国产欧美综合色| 久久久五月婷婷| 337p粉嫩大胆噜噜噜噜噜91av| 欧美人妇做爰xxxⅹ性高电影| 91在线播放网址| 东方欧美亚洲色图在线| 国产呦萝稀缺另类资源| 久久电影网站中文字幕 | 91精品国产综合久久久久久漫画| 色综合久久久久综合| av一区二区三区四区| 丰满亚洲少妇av| 国产激情一区二区三区桃花岛亚洲| 秋霞国产午夜精品免费视频| 午夜国产精品一区| 午夜精品久久久久久久久久久| 艳妇臀荡乳欲伦亚洲一区| 亚洲精品乱码久久久久久日本蜜臀| 国产精品午夜免费| 中文字幕一区av| 亚洲欧美在线观看| 亚洲人成电影网站色mp4| 亚洲视频网在线直播| 综合亚洲深深色噜噜狠狠网站| 国产精品美女久久久久久久久| 国产日韩高清在线| 国产精品国模大尺度视频| 国产精品三级av| 中文字幕字幕中文在线中不卡视频| 自拍偷自拍亚洲精品播放| 亚洲综合色婷婷| 视频精品一区二区| 韩国欧美国产1区| 粉嫩aⅴ一区二区三区四区| av在线播放成人| 欧美视频在线播放| 日韩一区二区在线观看视频| 26uuu色噜噜精品一区二区| 久久久久久久久久久久电影| 自拍视频在线观看一区二区| 一区二区三区欧美激情| 日韩精品福利网| 国产精品影视网| 99久久精品免费| 欧美一区二区成人| 国产精品久久久久三级| 亚洲黄色免费电影| 精品一区二区精品| 99re视频这里只有精品| 91精品国产色综合久久 | 高清不卡一区二区| 欧美三级电影在线观看| 欧美精品一区二区三区一线天视频| 国产精品私人自拍| 日韩av在线播放中文字幕| 高清视频一区二区| 8x福利精品第一导航|