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

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

?? drivers.c

?? linux 內核源代碼
?? 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;	if (device_register(&dev->dev)) {		kfree(dev);		return NULL;	}	return dev;}struct match_id_data {	char id;	struct parisc_device * dev;};static int match_by_id(struct device * dev, void * data){	struct parisc_device * pdev = to_parisc_device(dev);	struct match_id_data * d = data;	if (pdev->hw_path == d->id) {		d->dev = pdev;		return 1;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区成人在线视频| 欧美一区二区在线免费观看| 国产精品视频麻豆| 国内精品久久久久影院薰衣草 | 亚洲欧洲色图综合| 午夜欧美视频在线观看| 精品国产91洋老外米糕| 国产欧美视频在线观看| 国产真实精品久久二三区| 日韩午夜激情电影| 欧美蜜桃一区二区三区| 久久久久久久久久电影| 国内精品在线播放| 国产欧美一区二区三区鸳鸯浴| 午夜精品影院在线观看| 日韩一级精品视频在线观看| 久久精品国产亚洲a| 久久在线免费观看| 日韩高清不卡一区二区| 久久久久久久网| eeuss鲁一区二区三区| 亚洲免费观看高清完整版在线观看| 欧美在线免费观看视频| 久久精品久久99精品久久| 久久久av毛片精品| 91丨九色丨蝌蚪丨老版| 美女在线一区二区| 欧美国产日韩一二三区| 色综合av在线| 免费在线观看成人| 国产精品久久久久三级| 欧美日韩一区二区欧美激情 | 欧美在线一二三| 久久电影国产免费久久电影| 国产精品久久久久久久久免费相片 | 久久99热99| 欧美国产精品v| 欧美色倩网站大全免费| 麻豆视频观看网址久久| 国产精品国产三级国产a | 欧美一区二区三区在| 国产一区二区在线影院| 一区二区三区在线免费播放 | 日韩av午夜在线观看| 一本久久综合亚洲鲁鲁五月天 | 免费人成黄页网站在线一区二区| 久久久久国产精品麻豆ai换脸 | 中文字幕一区二区三区色视频| 欧美日韩在线综合| 99热精品国产| 久久99国产精品免费网站| 亚洲乱码一区二区三区在线观看| 欧美一区二区三区在线电影| 在线观看中文字幕不卡| 国产成a人亚洲| 日本怡春院一区二区| 最新欧美精品一区二区三区| 国产亚洲欧美激情| 欧美一区二区免费视频| 色欧美88888久久久久久影院| 久久精品国产澳门| 日韩高清不卡一区| 亚洲国产精品视频| 日韩美女精品在线| 国产欧美精品一区二区三区四区| 日韩欧美国产一区二区在线播放| 在线一区二区视频| bt欧美亚洲午夜电影天堂| 韩国成人福利片在线播放| 美女免费视频一区二区| 午夜精品福利一区二区三区蜜桃| 亚洲女人的天堂| 国产女主播一区| 国产精品婷婷午夜在线观看| 精品1区2区在线观看| 91精品一区二区三区久久久久久| 欧洲人成人精品| 国产高清无密码一区二区三区| 毛片av一区二区三区| 首页亚洲欧美制服丝腿| 亚洲同性gay激情无套| 久久久久久久久久看片| 久久久综合精品| 久久综合色播五月| 精品成人在线观看| 日韩亚洲欧美在线| 26uuu国产电影一区二区| 7777精品伊人久久久大香线蕉经典版下载| 色吧成人激情小说| 91精品1区2区| 日韩午夜在线播放| 精品久久免费看| 亚洲精品一区在线观看| 91麻豆精品国产91久久久更新时间| 欧美视频在线播放| 欧美日韩一区成人| 日韩一区二区三区在线| 欧美日韩精品一区二区三区| 欧美老肥妇做.爰bbww| 91精品欧美久久久久久动漫| 欧美一区二区三区婷婷月色| 久久一留热品黄| 国产欧美日韩精品a在线观看| 国产免费成人在线视频| 中文字幕一区不卡| 亚洲mv大片欧洲mv大片精品| 日本午夜精品一区二区三区电影| 老司机免费视频一区二区| 精品一区二区在线免费观看| 极品销魂美女一区二区三区| 国产成人一区在线| 色琪琪一区二区三区亚洲区| 一本色道久久加勒比精品| 欧美另类z0zxhd电影| 欧美电影一区二区三区| 2021中文字幕一区亚洲| 最新热久久免费视频| 日本色综合中文字幕| 国产盗摄视频一区二区三区| 91网上在线视频| 欧美视频三区在线播放| 中文字幕不卡一区| 亚洲第一主播视频| 国产一区二区三区香蕉| 成人激情文学综合网| 日韩一卡二卡三卡| 国产精品美女久久久久aⅴ国产馆| 无码av免费一区二区三区试看| 国产福利一区二区三区| 欧美精品v日韩精品v韩国精品v| 国产精品三级av在线播放| 久久国产三级精品| 欧美在线观看视频一区二区| 国产片一区二区| 久久精品国产精品亚洲红杏| 欧美性大战久久久久久久蜜臀| 久久久91精品国产一区二区精品| 日韩福利电影在线| 欧美日韩精品欧美日韩精品| 国产精品三级av| 国产高清不卡二三区| 日韩一区二区三区高清免费看看| 一区二区三区在线观看欧美| 成人动漫av在线| 国产日产欧美一区二区三区| 三级欧美在线一区| 欧美日韩国产另类一区| 一区二区三区在线看| 成人性生交大片免费看中文网站| 日韩免费高清视频| 免费观看久久久4p| 91精品国产一区二区三区蜜臀| 亚洲一区二区在线观看视频 | 六月丁香婷婷久久| 欧美精品日韩一本| 亚洲成人自拍偷拍| 欧美性色综合网| 亚洲一区二区视频在线| 91麻豆福利精品推荐| 国产精品久久久久久久久免费桃花 | 盗摄精品av一区二区三区| 精品88久久久久88久久久| 久久se精品一区二区| 欧美大片日本大片免费观看| 久久99最新地址| 精品国产乱码久久久久久夜甘婷婷| 免费看日韩精品| 亚洲精品一区二区三区在线观看 | 欧美大片一区二区三区| 久久精品国产第一区二区三区| 日韩视频在线你懂得| 精品一区二区国语对白| 久久久亚洲精品石原莉奈| 国产夫妻精品视频| 一区在线观看免费| 欧美视频一区二| 日本不卡视频在线观看| 日韩精品一区二区三区视频在线观看 | 国产激情视频一区二区在线观看| 精品国产91洋老外米糕| 成人在线综合网站| 亚洲精品国产视频| 91精品国产一区二区人妖| 狠狠色丁香久久婷婷综合丁香| 欧美韩日一区二区三区四区| 99久久er热在这里只有精品66| 一区二区三区四区不卡在线| 欧美精品乱码久久久久久按摩| 久久精品99国产国产精| 国产欧美综合在线观看第十页| av不卡免费在线观看| 亚洲国产日日夜夜| 2024国产精品视频| 色婷婷精品大视频在线蜜桃视频 | 激情综合色丁香一区二区| 国产精品久久午夜| 欧美女孩性生活视频| 高清日韩电视剧大全免费| 亚洲激情网站免费观看| 欧美成人综合网站|