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

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

?? cardbus.c

?? Linux Kernel 2.6.9 for OMAP1710
?? C
字號:
/*======================================================================      Cardbus device configuration        cardbus.c 1.87 2002/10/24 06:11:41    The contents of this file are subject to the Mozilla Public    License Version 1.1 (the "License"); you may not use this file    except in compliance with the License. You may obtain a copy of    the License at http://www.mozilla.org/MPL/    Software distributed under the License is distributed on an "AS    IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or    implied. See the License for the specific language governing    rights and limitations under the License.    The initial developer of the original code is David A. Hinds    <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds    are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.    Alternatively, the contents of this file may be used under the    terms of the GNU General Public License version 2 (the "GPL"), in which    case the provisions of the GPL are applicable instead of the    above.  If you wish to allow the use of your version of this file    only under the terms of the GPL and not to allow others to use    your version of this file under the MPL, indicate your decision    by deleting the provisions above and replace them with the notice    and other provisions required by the GPL.  If you do not delete    the provisions above, a recipient may use your version of this    file under either the MPL or the GPL.    ======================================================================*//* * Cardbus handling has been re-written to be more of a PCI bridge thing, * and the PCI code basically does all the resource handling. * *		Linus, Jan 2000 */#include <linux/module.h>#include <linux/kernel.h>#include <linux/string.h>#include <linux/slab.h>#include <linux/mm.h>#include <linux/pci.h>#include <linux/ioport.h>#include <asm/irq.h>#include <asm/io.h>#define IN_CARD_SERVICES#include <pcmcia/version.h>#include <pcmcia/cs_types.h>#include <pcmcia/ss.h>#include <pcmcia/cs.h>#include <pcmcia/bulkmem.h>#include <pcmcia/cistpl.h>#include "cs_internal.h"/*====================================================================*/#define FIND_FIRST_BIT(n)	((n) - ((n) & ((n)-1)))/* Offsets in the Expansion ROM Image Header */#define ROM_SIGNATURE		0x0000	/* 2 bytes */#define ROM_DATA_PTR		0x0018	/* 2 bytes *//* Offsets in the CardBus PC Card Data Structure */#define PCDATA_SIGNATURE	0x0000	/* 4 bytes */#define PCDATA_VPD_PTR		0x0008	/* 2 bytes */#define PCDATA_LENGTH		0x000a	/* 2 bytes */#define PCDATA_REVISION		0x000c#define PCDATA_IMAGE_SZ		0x0010	/* 2 bytes */#define PCDATA_ROM_LEVEL	0x0012	/* 2 bytes */#define PCDATA_CODE_TYPE	0x0014#define PCDATA_INDICATOR	0x0015/*=====================================================================    Expansion ROM's have a special layout, and pointers specify an    image number and an offset within that image.  xlate_rom_addr()    converts an image/offset address to an absolute offset from the    ROM's base address.    =====================================================================*/static u_int xlate_rom_addr(void __iomem *b, u_int addr){	u_int img = 0, ofs = 0, sz;	u_short data;	while ((readb(b) == 0x55) && (readb(b + 1) == 0xaa)) {		if (img == (addr >> 28))			return (addr & 0x0fffffff) + ofs;		data = readb(b + ROM_DATA_PTR) + (readb(b + ROM_DATA_PTR + 1) << 8);		sz = 512 * (readb(b + data + PCDATA_IMAGE_SZ) +			    (readb(b + data + PCDATA_IMAGE_SZ + 1) << 8));		if ((sz == 0) || (readb(b + data + PCDATA_INDICATOR) & 0x80))			break;		b += sz;		ofs += sz;		img++;	}	return 0;}/*=====================================================================    These are similar to setup_cis_mem and release_cis_mem for 16-bit    cards.  The "result" that is used externally is the cb_cis_virt    pointer in the struct pcmcia_socket structure.    =====================================================================*/static void cb_release_cis_mem(struct pcmcia_socket * s){	if (s->cb_cis_virt) {		cs_dbg(s, 1, "cb_release_cis_mem()\n");		iounmap(s->cb_cis_virt);		s->cb_cis_virt = NULL;		s->cb_cis_res = NULL;	}}static int cb_setup_cis_mem(struct pcmcia_socket * s, struct resource *res){	unsigned int start, size;	if (res == s->cb_cis_res)		return 0;	if (s->cb_cis_res)		cb_release_cis_mem(s);	start = res->start;	size = res->end - start + 1;	s->cb_cis_virt = ioremap(start, size);	if (!s->cb_cis_virt)		return -1;	s->cb_cis_res = res;	return 0;}/*=====================================================================    This is used by the CIS processing code to read CIS information    from a CardBus device.    =====================================================================*/int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void *ptr){	struct pci_dev *dev;	struct resource *res;	cs_dbg(s, 3, "read_cb_mem(%d, %#x, %u)\n", space, addr, len);	dev = pci_find_slot(s->cb_dev->subordinate->number, 0);	if (!dev)		goto fail;	/* Config space? */	if (space == 0) {		if (addr + len > 0x100)			goto fail;		for (; len; addr++, ptr++, len--)			pci_read_config_byte(dev, addr, ptr);		return 0;	}	res = dev->resource + space - 1;	if (!res->flags)		goto fail;	if (cb_setup_cis_mem(s, res) != 0)		goto fail;	if (space == 7) {		addr = xlate_rom_addr(s->cb_cis_virt, addr);		if (addr == 0)			goto fail;	}	if (addr + len > res->end - res->start)		goto fail;	memcpy_fromio(ptr, s->cb_cis_virt + addr, len);	return 0;fail:	memset(ptr, 0xff, len);	return -1;}/*=====================================================================    cb_alloc() and cb_free() allocate and free the kernel data    structures for a Cardbus device, and handle the lowest level PCI    device setup issues.    =====================================================================*//* * Since there is only one interrupt available to CardBus * devices, all devices downstream of this device must * be using this IRQ. */static void cardbus_assign_irqs(struct pci_bus *bus, int irq){	struct pci_dev *dev;	list_for_each_entry(dev, &bus->devices, bus_list) {		u8 irq_pin;		pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &irq_pin);		if (irq_pin) {			dev->irq = irq;			pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);		}		if (dev->subordinate)			cardbus_assign_irqs(dev->subordinate, irq);	}}int cb_alloc(struct pcmcia_socket * s){	struct pci_bus *bus = s->cb_dev->subordinate;	struct pci_dev *dev;	unsigned int max, pass;	s->functions = pci_scan_slot(bus, PCI_DEVFN(0, 0));//	pcibios_fixup_bus(bus);	max = bus->secondary;	for (pass = 0; pass < 2; pass++)		list_for_each_entry(dev, &bus->devices, bus_list)			if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||			    dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)				max = pci_scan_bridge(bus, dev, max, pass);	/*	 * Size all resources below the CardBus controller.	 */	pci_bus_size_bridges(bus);	pci_bus_assign_resources(bus);	cardbus_assign_irqs(bus, s->pci_irq);	pci_enable_bridges(bus);	pci_bus_add_devices(bus);	s->irq.AssignedIRQ = s->pci_irq;	return CS_SUCCESS;}void cb_free(struct pcmcia_socket * s){	struct pci_dev *bridge = s->cb_dev;	cb_release_cis_mem(s);	if (bridge)		pci_remove_behind_bridge(bridge);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美午夜精品免费| 国产日韩欧美电影| 久久新电视剧免费观看| 亚洲人快播电影网| 久久国产精品99精品国产| caoporn国产精品| 精品国产不卡一区二区三区| 日韩一区精品字幕| 在线看国产一区| 亚洲国产高清在线| 国产精品亚洲午夜一区二区三区 | 欧美日韩在线播放三区| 日本一区二区三级电影在线观看| 蜜桃视频在线一区| 欧美丰满一区二区免费视频| 亚洲美女偷拍久久| 成人毛片在线观看| 国产日产欧美精品一区二区三区| 秋霞电影网一区二区| 欧美日韩综合一区| 亚洲高清在线精品| 欧美午夜影院一区| 一区二区三区在线视频免费观看| aaa欧美大片| 中文字幕精品一区二区精品绿巨人| 韩国av一区二区| 久久人人97超碰com| 国内成人精品2018免费看| 日韩三级视频中文字幕| 日韩av一区二区三区四区| 欧美日韩免费观看一区三区| 亚洲成a人v欧美综合天堂下载| 色综合中文字幕国产 | 久久久久国产精品厨房| 韩国视频一区二区| 国产日本欧美一区二区| 成人h动漫精品一区二区 | 亚洲精品一区二区三区香蕉 | 99久久精品国产一区| 国产精品二三区| 99精品一区二区三区| 亚洲视频一二三区| 色国产精品一区在线观看| 亚洲高清免费在线| 日韩午夜电影在线观看| 麻豆高清免费国产一区| 久久精品一区二区三区四区| 不卡电影一区二区三区| 亚洲最大成人网4388xx| 在线播放日韩导航| 国产一区二区中文字幕| 18涩涩午夜精品.www| 欧美亚洲综合另类| 蜜臀久久99精品久久久久久9| 欧美zozo另类异族| 99精品在线观看视频| 亚洲五码中文字幕| 精品国产乱码91久久久久久网站| 国产盗摄一区二区| 亚洲一区二三区| 精品sm在线观看| 97精品视频在线观看自产线路二| 亚洲一区免费观看| 久久久亚洲高清| 色综合天天综合网天天狠天天 | 日韩一区二区电影在线| 国产激情视频一区二区三区欧美| 亚洲欧美视频在线观看| 3d成人h动漫网站入口| 成人avav在线| 美国欧美日韩国产在线播放| 中文字幕色av一区二区三区| 91精品国产综合久久国产大片| 国产精品一卡二| 午夜精品久久久| 亚洲欧美日本在线| 久久久久久夜精品精品免费| 在线精品视频免费观看| 国产成人免费在线视频| 五月激情丁香一区二区三区| 亚洲欧美怡红院| 国产亚洲人成网站| 制服.丝袜.亚洲.另类.中文| jizzjizzjizz欧美| 狠狠色丁香婷综合久久| 日本色综合中文字幕| 国产一区二区三区在线观看免费视频| 欧美高清一级片在线观看| 欧美二区乱c少妇| 色婷婷综合激情| 国产精品夜夜爽| 久久99国内精品| 午夜a成v人精品| 亚洲黄色免费电影| 亚洲日本一区二区| 欧美国产禁国产网站cc| 久久久久亚洲蜜桃| 欧美一级片在线看| 欧美久久久久久久久久| 色噜噜狠狠色综合中国| 一本色道综合亚洲| 99精品欧美一区二区蜜桃免费| 国产成人aaa| 国产精品一区专区| 国产一区二区三区香蕉| 久久精品国产亚洲aⅴ| 日韩在线一区二区三区| 日日噜噜夜夜狠狠视频欧美人| 亚洲在线视频免费观看| 亚洲综合色在线| 一区av在线播放| 亚洲成人激情综合网| 亚洲chinese男男1069| 亚洲国产aⅴ天堂久久| 亚洲成人一区二区| 天天色 色综合| 日韩电影在线看| 美女脱光内衣内裤视频久久网站 | 高清成人免费视频| 国产剧情一区二区三区| 高清国产一区二区| 99这里只有精品| 色综合一区二区三区| 在线观看视频91| 欧美日韩国产一区| 日韩欧美二区三区| 久久久亚洲欧洲日产国码αv| 国产日韩欧美亚洲| 亚洲欧美电影一区二区| 亚洲国产aⅴ成人精品无吗| 免费黄网站欧美| 国产麻豆一精品一av一免费 | 综合亚洲深深色噜噜狠狠网站| 最新国产成人在线观看| 亚洲自拍另类综合| 精品亚洲aⅴ乱码一区二区三区| 国产老肥熟一区二区三区| 99久久国产综合精品麻豆| 欧美在线免费播放| 精品成人一区二区三区四区| 国产精品成人一区二区艾草| 亚洲第一狼人社区| 韩日av一区二区| 色94色欧美sute亚洲线路一ni| 日韩一级成人av| 1区2区3区国产精品| 日本女优在线视频一区二区| 国产成人在线免费| 欧美日韩视频在线一区二区 | 亚洲精品v日韩精品| 日韩精品一卡二卡三卡四卡无卡| 国产一区二区看久久| 欧美主播一区二区三区美女| 日韩欧美一二三| 一区二区在线观看视频在线观看| 免费高清成人在线| 一本高清dvd不卡在线观看| 日韩一级成人av| 亚洲综合丝袜美腿| 国产一区二区看久久| 精品视频一区二区三区免费| 国产日产欧美一区二区三区| 丝袜国产日韩另类美女| 成人免费看的视频| 欧美成人精精品一区二区频| 一区二区三区自拍| 福利电影一区二区三区| 日韩一区二区三区免费看 | 欧美日韩国产另类不卡| 中文字幕精品在线不卡| 麻豆精品在线播放| 欧美无乱码久久久免费午夜一区 | 中文一区在线播放| 日韩精品亚洲一区| 色菇凉天天综合网| 国产精品国产a| 国产精品综合二区| 日韩视频在线一区二区| 亚洲一区二区三区中文字幕| 成人午夜伦理影院| 久久久久久一二三区| 九九精品一区二区| 欧美一区二区三区婷婷月色| 亚洲午夜电影在线观看| 色噜噜狠狠色综合中国| 亚洲免费观看高清完整版在线| 国产成人综合网| 国产欧美在线观看一区| 激情五月播播久久久精品| 精品免费国产二区三区| 免费人成网站在线观看欧美高清| 欧美理论片在线| 婷婷激情综合网| 日韩一区二区在线免费观看| 七七婷婷婷婷精品国产| 日韩视频在线一区二区| 久久99国内精品| 国产亲近乱来精品视频| 成人美女视频在线看| 日韩伦理免费电影|