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

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

?? drivers.c

?? linux2.6.16版本
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * drivers.c * * 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. * * Copyright (c) 1999 The Puffin Group * Copyright (c) 2001 Matthew Wilcox for Hewlett Packard * Copyright (c) 2001 Helge Deller <deller@gmx.de> * Copyright (c) 2001,2002 Ryan Bradetich  * Copyright (c) 2004-2005 Thibaut VARENE <varenet@parisc-linux.org> *  * The file handles registering devices and drivers, then matching them. * It's the closest we get to a dating agency. * * If you're thinking about modifying this file, here are some gotchas to * bear in mind: *  - 715/Mirage device paths have a dummy device between Lasi and its children *  - The EISA adapter may show up as a sibling or child of Wax *  - Dino has an optionally functional serial port.  If firmware enables it, *    it shows up as a child of Dino.  If firmware disables it, the buswalk *    finds it and it shows up as a child of Cujo *  - Dino has both parisc and pci devices as children *  - parisc devices are discovered in a random order, including children *    before parents in some cases. */#include <linux/slab.h>#include <linux/types.h>#include <linux/kernel.h>#include <linux/pci.h>#include <linux/spinlock.h>#include <linux/string.h>#include <asm/hardware.h>#include <asm/io.h>#include <asm/pdc.h>#include <asm/parisc-device.h>/* See comments in include/asm-parisc/pci.h */struct hppa_dma_ops *hppa_dma_ops __read_mostly;EXPORT_SYMBOL(hppa_dma_ops);static struct device root = {	.bus_id = "parisc",};static inline int check_dev(struct device *dev){	if (dev->bus == &parisc_bus_type) {		struct parisc_device *pdev;		pdev = to_parisc_device(dev);		return pdev->id.hw_type != HPHW_FAULTY;	}	return 1;}static struct device *parse_tree_node(struct device *parent, int index, struct hardware_path *modpath);struct recurse_struct {	void * obj;	int (*fn)(struct device *, void *);};static int descend_children(struct device * dev, void * data){	struct recurse_struct * recurse_data = (struct recurse_struct *)data;	if (recurse_data->fn(dev, recurse_data->obj))		return 1;	else		return device_for_each_child(dev, recurse_data, descend_children);}/** *	for_each_padev - Iterate over all devices in the tree *	@fn:	Function to call for each device. *	@data:	Data to pass to the called function. * *	This performs a depth-first traversal of the tree, calling the *	function passed for each node.  It calls the function for parents *	before children. */static int for_each_padev(int (*fn)(struct device *, void *), void * data){	struct recurse_struct recurse_data = {		.obj	= data,		.fn	= fn,	};	return device_for_each_child(&root, &recurse_data, descend_children);}/** * match_device - Report whether this driver can handle this device * @driver: the PA-RISC driver to try * @dev: the PA-RISC device to try */static int match_device(struct parisc_driver *driver, struct parisc_device *dev){	const struct parisc_device_id *ids;	for (ids = driver->id_table; ids->sversion; ids++) {		if ((ids->sversion != SVERSION_ANY_ID) &&		    (ids->sversion != dev->id.sversion))			continue;		if ((ids->hw_type != HWTYPE_ANY_ID) &&		    (ids->hw_type != dev->id.hw_type))			continue;		if ((ids->hversion != HVERSION_ANY_ID) &&		    (ids->hversion != dev->id.hversion))			continue;		return 1;	}	return 0;}static int parisc_driver_probe(struct device *dev){	int rc;	struct parisc_device *pa_dev = to_parisc_device(dev);	struct parisc_driver *pa_drv = to_parisc_driver(dev->driver);	rc = pa_drv->probe(pa_dev);	if (!rc)		pa_dev->driver = pa_drv;	return rc;}static int parisc_driver_remove(struct device *dev){	struct parisc_device *pa_dev = to_parisc_device(dev);	struct parisc_driver *pa_drv = to_parisc_driver(dev->driver);	if (pa_drv->remove)		pa_drv->remove(pa_dev);	return 0;}	/** * register_parisc_driver - Register this driver if it can handle a device * @driver: the PA-RISC driver to try */int register_parisc_driver(struct parisc_driver *driver){	/* FIXME: we need this because apparently the sti	 * driver can be registered twice */	if(driver->drv.name) {		printk(KERN_WARNING 		       "BUG: skipping previously registered driver %s\n",		       driver->name);		return 1;	}	if (!driver->probe) {		printk(KERN_WARNING 		       "BUG: driver %s has no probe routine\n",		       driver->name);		return 1;	}	driver->drv.bus = &parisc_bus_type;	/* We install our own probe and remove routines */	WARN_ON(driver->drv.probe != NULL);	WARN_ON(driver->drv.remove != NULL);	driver->drv.name = driver->name;	return driver_register(&driver->drv);}EXPORT_SYMBOL(register_parisc_driver);struct match_count {	struct parisc_driver * driver;	int count;};static int match_and_count(struct device * dev, void * data){	struct match_count * m = data;	struct parisc_device * pdev = to_parisc_device(dev);	if (check_dev(dev)) {		if (match_device(m->driver, pdev))			m->count++;	}	return 0;}/** * count_parisc_driver - count # of devices this driver would match * @driver: the PA-RISC driver to try * * Use by IOMMU support to "guess" the right size IOPdir. * Formula is something like memsize/(num_iommu * entry_size). */int count_parisc_driver(struct parisc_driver *driver){	struct match_count m = {		.driver	= driver,		.count	= 0,	};	for_each_padev(match_and_count, &m);	return m.count;}/** * unregister_parisc_driver - Unregister this driver from the list of drivers * @driver: the PA-RISC driver to unregister */int unregister_parisc_driver(struct parisc_driver *driver){	driver_unregister(&driver->drv);	return 0;}EXPORT_SYMBOL(unregister_parisc_driver);struct find_data {	unsigned long hpa;	struct parisc_device * dev;};static int find_device(struct device * dev, void * data){	struct parisc_device * pdev = to_parisc_device(dev);	struct find_data * d = (struct find_data*)data;	if (check_dev(dev)) {		if (pdev->hpa.start == d->hpa) {			d->dev = pdev;			return 1;		}	}	return 0;}static struct parisc_device *find_device_by_addr(unsigned long hpa){	struct find_data d = {		.hpa	= hpa,	};	int ret;	ret = for_each_padev(find_device, &d);	return ret ? d.dev : NULL;}/** * find_pa_parent_type - Find a parent of a specific type * @dev: The device to start searching from * @type: The device type to search for. * * Walks up the device tree looking for a device of the specified type. * If it finds it, it returns it.  If not, it returns NULL. */const struct parisc_device *find_pa_parent_type(const struct parisc_device *padev, int type){	const struct device *dev = &padev->dev;	while (dev != &root) {		struct parisc_device *candidate = to_parisc_device(dev);		if (candidate->id.hw_type == type)			return candidate;		dev = dev->parent;	}	return NULL;}#ifdef CONFIG_PCIstatic inline int is_pci_dev(struct device *dev){	return dev->bus == &pci_bus_type;}#elsestatic inline int is_pci_dev(struct device *dev){	return 0;}#endif/* * get_node_path fills in @path with the firmware path to the device. * Note that if @node is a parisc device, we don't fill in the 'mod' field. * This is because both callers pass the parent and fill in the mod * themselves.  If @node is a PCI device, we do fill it in, even though this * is inconsistent. */static void get_node_path(struct device *dev, struct hardware_path *path){	int i = 5;	memset(&path->bc, -1, 6);	if (is_pci_dev(dev)) {		unsigned int devfn = to_pci_dev(dev)->devfn;		path->mod = PCI_FUNC(devfn);		path->bc[i--] = PCI_SLOT(devfn);		dev = dev->parent;	}	while (dev != &root) {		if (is_pci_dev(dev)) {			unsigned int devfn = to_pci_dev(dev)->devfn;			path->bc[i--] = PCI_SLOT(devfn) | (PCI_FUNC(devfn)<< 5);		} else if (dev->bus == &parisc_bus_type) {			path->bc[i--] = to_parisc_device(dev)->hw_path;		}		dev = dev->parent;	}}static char *print_hwpath(struct hardware_path *path, char *output){	int i;	for (i = 0; i < 6; i++) {		if (path->bc[i] == -1)			continue;		output += sprintf(output, "%u/", (unsigned char) path->bc[i]);	}	output += sprintf(output, "%u", (unsigned char) path->mod);	return output;}/** * print_pa_hwpath - Returns hardware path for PA devices * dev: The device to return the path for * output: Pointer to a previously-allocated array to place the path in. * * This function fills in the output array with a human-readable path * to a PA device.  This string is compatible with that used by PDC, and * may be printed on the outside of the box. */char *print_pa_hwpath(struct parisc_device *dev, char *output){	struct hardware_path path;	get_node_path(dev->dev.parent, &path);	path.mod = dev->hw_path;	return print_hwpath(&path, output);}EXPORT_SYMBOL(print_pa_hwpath);#if defined(CONFIG_PCI) || defined(CONFIG_ISA)/** * get_pci_node_path - Determines the hardware path for a PCI device * @pdev: The device to return the path for * @path: Pointer to a previously-allocated array to place the path in. * * This function fills in the hardware_path structure with the route to * the specified PCI device.  This structure is suitable for passing to * PDC calls. */void get_pci_node_path(struct pci_dev *pdev, struct hardware_path *path){	get_node_path(&pdev->dev, path);}EXPORT_SYMBOL(get_pci_node_path);/** * print_pci_hwpath - Returns hardware path for PCI devices * dev: The device to return the path for * output: Pointer to a previously-allocated array to place the path in. * * This function fills in the output array with a human-readable path * to a PCI device.  This string is compatible with that used by PDC, and * may be printed on the outside of the box. */char *print_pci_hwpath(struct pci_dev *dev, char *output){	struct hardware_path path;	get_pci_node_path(dev, &path);	return print_hwpath(&path, output);}EXPORT_SYMBOL(print_pci_hwpath);#endif /* defined(CONFIG_PCI) || defined(CONFIG_ISA) */static void setup_bus_id(struct parisc_device *padev){	struct hardware_path path;	char *output = padev->dev.bus_id;	int i;	get_node_path(padev->dev.parent, &path);	for (i = 0; i < 6; i++) {		if (path.bc[i] == -1)			continue;		output += sprintf(output, "%u:", (unsigned char) path.bc[i]);	}	sprintf(output, "%u", (unsigned char) padev->hw_path);}struct parisc_device * create_tree_node(char id, struct device *parent){	struct parisc_device *dev = kzalloc(sizeof(*dev), GFP_KERNEL);	if (!dev)		return NULL;	dev->hw_path = id;	dev->id.hw_type = HPHW_FAULTY;	dev->dev.parent = parent;	setup_bus_id(dev);	dev->dev.bus = &parisc_bus_type;	dev->dma_mask = 0xffffffffUL;	/* PARISC devices are 32-bit */	/* make the generic dma mask a pointer to the parisc one */	dev->dev.dma_mask = &dev->dma_mask;	dev->dev.coherent_dma_mask = dev->dma_mask;	device_register(&dev->dev);	return dev;}struct match_id_data {	char id;	struct parisc_device * dev;};static int match_by_id(struct device * dev, void * data){

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区三区四区五区黄| 在线亚洲一区观看| 亚洲第一会所有码转帖| 自拍偷拍亚洲综合| 亚洲精品成人精品456| 亚洲人成影院在线观看| 亚洲欧洲成人精品av97| 亚洲人成亚洲人成在线观看图片| 国产精品情趣视频| 依依成人综合视频| 亚洲综合精品久久| 午夜精品久久久久久久| 婷婷丁香久久五月婷婷| 蜜乳av一区二区三区| 国内成人免费视频| 99久久精品免费看| 欧美巨大另类极品videosbest| 欧美日韩一区不卡| 久久久三级国产网站| 中文字幕中文字幕在线一区| 一区二区三区波多野结衣在线观看| 欧美国产丝袜视频| 亚洲一区在线播放| 精品一区二区三区久久| 成人自拍视频在线| 欧美日韩一级二级| 国产欧美日本一区二区三区| 亚洲女与黑人做爰| 美女免费视频一区二区| 福利电影一区二区| 欧美日韩大陆在线| 2欧美一区二区三区在线观看视频| 国产欧美日韩在线观看| 亚洲一区二区视频| 国产精品综合网| 91黄色免费观看| 久久青草国产手机看片福利盒子 | 久久66热偷产精品| 成人午夜伦理影院| 国产福利一区二区三区| 亚洲一本大道在线| 午夜精品免费在线| 韩国三级电影一区二区| 色天使色偷偷av一区二区| 制服.丝袜.亚洲.中文.综合| 国产亚洲美州欧州综合国| 亚洲电影中文字幕在线观看| 国产毛片精品一区| 6080日韩午夜伦伦午夜伦| 国产欧美日韩在线视频| 久久99精品国产麻豆婷婷洗澡| 99久久精品国产毛片| 欧美va亚洲va香蕉在线| 一区二区三区中文免费| 国产.欧美.日韩| 欧美刺激午夜性久久久久久久| 亚洲码国产岛国毛片在线| 韩国三级在线一区| 67194成人在线观看| 亚洲视频你懂的| 东方欧美亚洲色图在线| 欧美一级爆毛片| 午夜精品123| 成人高清视频在线| 久久久国产综合精品女国产盗摄| 日韩精品成人一区二区在线| 91精品办公室少妇高潮对白| 国产精品视频一二三| 精品在线视频一区| 日韩欧美的一区| 另类欧美日韩国产在线| 91精品国产美女浴室洗澡无遮挡| 亚洲美女淫视频| 欧美主播一区二区三区美女| 亚洲六月丁香色婷婷综合久久| 成人av网站免费观看| 国产精品国产三级国产普通话蜜臀| 懂色av一区二区三区免费看| 精品国产亚洲在线| 久久精品国产色蜜蜜麻豆| 精品理论电影在线观看| 九色综合狠狠综合久久| 精品日产卡一卡二卡麻豆| 狠狠色丁香婷婷综合久久片| 精品福利av导航| 成熟亚洲日本毛茸茸凸凹| 国产精品麻豆视频| 色婷婷av久久久久久久| 亚洲v中文字幕| 欧美一级免费大片| 国产一区视频导航| 中文字幕制服丝袜一区二区三区| 色综合天天在线| 五月婷婷另类国产| 日韩精品一区二区三区四区 | 中文字幕一区在线观看视频| 福利一区二区在线观看| 国产精品家庭影院| 欧美性感一类影片在线播放| 婷婷中文字幕综合| 日韩午夜在线播放| 成人午夜激情在线| 亚洲大尺度视频在线观看| 欧美xxxx老人做受| 99精品欧美一区二区三区小说| 亚洲自拍偷拍麻豆| 精品国产一区二区三区久久影院| 成人小视频免费在线观看| 一区二区三区在线视频免费观看| 日韩亚洲欧美在线| 91在线视频免费91| 久久精品国产亚洲高清剧情介绍 | 一区二区三区欧美在线观看| 日韩一区二区三区四区| av在线播放成人| 日本亚洲三级在线| 亚洲精品菠萝久久久久久久| 日韩欧美精品三级| 色av一区二区| 国产激情视频一区二区三区欧美| 亚洲在线免费播放| 日本一区二区三区久久久久久久久不| 欧美性一二三区| 成人激情黄色小说| 狠狠色丁香久久婷婷综合_中| 一区二区三区国产豹纹内裤在线| 久久久久国产免费免费| 欧美精品18+| 色婷婷av一区二区三区软件| 国产在线不卡一区| 偷拍一区二区三区| 亚洲人被黑人高潮完整版| 久久久国产精品麻豆| 欧美丰满少妇xxxbbb| 色天天综合色天天久久| www.欧美日韩| 懂色av一区二区三区免费观看| 蜜臀av性久久久久蜜臀av麻豆| 一区二区三区**美女毛片| 亚洲欧洲日韩一区二区三区| 国产日本亚洲高清| 久久亚洲私人国产精品va媚药| 欧美高清激情brazzers| 欧洲亚洲精品在线| 色婷婷久久久久swag精品| www.欧美日韩| 91亚洲精品久久久蜜桃| 国产精品白丝av| 国产露脸91国语对白| 免费高清不卡av| 免费观看在线综合色| 免费一级片91| 蜜乳av一区二区| 久久99精品国产.久久久久| 免费观看一级特黄欧美大片| 日本亚洲欧美天堂免费| 久久99精品一区二区三区三区| 日韩在线观看一区二区| 天天av天天翘天天综合网| 亚洲成人av福利| 青青草一区二区三区| 蜜臀91精品一区二区三区| 久久国产精品露脸对白| 国产一区欧美二区| 成人激情av网| 色先锋久久av资源部| 欧美日韩精品一区二区三区蜜桃 | 国产精品天美传媒沈樵| **欧美大码日韩| 亚洲女女做受ⅹxx高潮| 亚洲电影激情视频网站| 青青国产91久久久久久| 国产成人精品一区二| 91在线一区二区三区| 欧美日韩高清在线| xnxx国产精品| 亚洲日本一区二区| 亚洲va在线va天堂| 国产一区不卡精品| 色哟哟国产精品免费观看| 欧美一区二区女人| 国产欧美日韩卡一| 午夜精品一区二区三区免费视频| 麻豆精品国产91久久久久久| 成人黄色网址在线观看| 欧美日韩高清影院| 国产精品毛片a∨一区二区三区| 亚洲最大色网站| 国产精品亚洲一区二区三区妖精| 91亚洲大成网污www| 91精品在线观看入口| 欧美国产精品一区二区三区| 一区二区三区四区高清精品免费观看| 奇米在线7777在线精品| 成人午夜免费av| 日韩午夜在线观看视频| 亚洲欧美日韩国产一区二区三区| 免费观看成人av| 在线精品视频一区二区| 国产亚洲人成网站|