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

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

?? cardbus.c

?? 這是一個SIGMA方案的PMP播放器的UCLINUX程序,可播放DVD,VCD,CD MP3...有很好的參考價值.
?? C
字號:
/*======================================================================      Cardbus device configuration        cardbus.c 1.63 1999/11/08 20:47:02    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    <dhinds@pcmcia.sourceforge.org>.  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.        These routines handle allocating resources for Cardbus cards, as    well as setting up and shutting down Cardbus sockets.  They are    called from cs.c in response to Request/ReleaseConfiguration and    Request/ReleaseIO calls.======================================================================*//* * This file is going away.  Cardbus handling has been re-written to be * more of a PCI bridge thing, and the PCI code basically does all the * resource handling. This has wrappers to make the rest of the PCMCIA * subsystem not notice that it's not here any more. * *		Linus, Jan 2000 */#define __NO_VERSION__#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"#ifdef PCMCIA_DEBUGstatic int pc_debug = PCMCIA_DEBUG;#endif/*====================================================================*/#define FIND_FIRST_BIT(n)	((n) - ((n) & ((n)-1)))#define pci_readb		pci_read_config_byte#define pci_writeb		pci_write_config_byte#define pci_readw		pci_read_config_word#define pci_writew		pci_write_config_word#define pci_readl		pci_read_config_dword#define pci_writel		pci_write_config_dword/* 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	0x0015typedef struct cb_config_t {	struct pci_dev dev;} cb_config_t;/*=====================================================================    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(u_char * 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 socket_info_t structure.    =====================================================================*/void cb_release_cis_mem(socket_info_t * s){	if (s->cb_cis_virt) {		DEBUG(1, "cs: cb_release_cis_mem()\n");		iounmap(s->cb_cis_virt);		s->cb_cis_virt = NULL;		s->cb_cis_res = 0;	}}static int cb_setup_cis_mem(socket_info_t * s, struct pci_dev *dev, 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.    =====================================================================*/void read_cb_mem(socket_info_t * s, u_char fn, int space,		 u_int addr, u_int len, void *ptr){	struct pci_dev *dev;	struct resource *res;	DEBUG(3, "cs: read_cb_mem(%d, %#x, %u)\n", space, addr, len);	if (!s->cb_config)		goto fail;	dev = &s->cb_config[fn].dev;	/* Config space? */	if (space == 0) {		if (addr + len > 0x100)			goto fail;		for (; len; addr++, ptr++, len--)			pci_readb(dev, addr, (u_char *) ptr);		return;	}	res = dev->resource + space - 1;	if (!res->flags)		goto fail;	if (cb_setup_cis_mem(s, dev, 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;fail:	memset(ptr, 0xff, len);	return;}/*=====================================================================    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.    =====================================================================*/int cb_alloc(socket_info_t * s){	struct pci_bus *bus;	struct pci_dev tmp;	u_short vend, v, dev;	u_char i, hdr, fn;	cb_config_t *c;	int irq;	bus = s->cap.cb_dev->subordinate;	memset(&tmp, 0, sizeof(tmp));	tmp.bus = bus;	tmp.sysdata = bus->sysdata;	tmp.devfn = 0;	pci_readw(&tmp, PCI_VENDOR_ID, &vend);	pci_readw(&tmp, PCI_DEVICE_ID, &dev);	printk(KERN_INFO "cs: cb_alloc(bus %d): vendor 0x%04x, "	       "device 0x%04x\n", bus->number, vend, dev);	pci_readb(&tmp, PCI_HEADER_TYPE, &hdr);	fn = 1;	if (hdr & 0x80) {		do {			tmp.devfn = fn;			if (pci_readw(&tmp, PCI_VENDOR_ID, &v) || !v || v == 0xffff)				break;			fn++;		} while (fn < 8);	}	s->functions = fn;	c = kmalloc(fn * sizeof(struct cb_config_t), GFP_ATOMIC);	if (!c)		return CS_OUT_OF_RESOURCE;	memset(c, 0, fn * sizeof(struct cb_config_t));	irq = s->cap.pci_irq;	for (i = 0; i < fn; i++) {		struct pci_dev *dev = &c[i].dev;		u8 irq_pin;		int r;		dev->bus = bus;		dev->sysdata = bus->sysdata;		dev->devfn = i;		dev->vendor = vend;		pci_readw(dev, PCI_DEVICE_ID, &dev->device);		dev->hdr_type = hdr & 0x7f;		pci_setup_device(dev);		/* FIXME: Do we need to enable the expansion ROM? */		for (r = 0; r < 7; r++) {			struct resource *res = dev->resource + r;			if (res->flags)				pci_assign_resource(dev, r);		}		/* Does this function have an interrupt at all? */		pci_readb(dev, PCI_INTERRUPT_PIN, &irq_pin);		if (irq_pin) {			dev->irq = irq;			pci_writeb(dev, PCI_INTERRUPT_LINE, irq);		}		pci_enable_device(dev); /* XXX check return */		pci_insert_device(dev, bus);	}	s->cb_config = c;	s->irq.AssignedIRQ = irq;	return CS_SUCCESS;}void cb_free(socket_info_t * s){	cb_config_t *c = s->cb_config;	if (c) {		int i;		s->cb_config = NULL;		for (i = 0 ; i < s->functions ; i++)			pci_remove_device(&c[i].dev);		kfree(c);		printk(KERN_INFO "cs: cb_free(bus %d)\n", s->cap.cb_dev->subordinate->number);	}}/*=====================================================================    cb_config() has the job of allocating all system resources that    a Cardbus card requires.  Rather than using the CIS (which seems    to not always be present), it treats the card as an ordinary PCI    device, and probes the base address registers to determine each    function's IO and memory space needs.    It is called from the RequestIO card service.    ======================================================================*/int cb_config(socket_info_t * s){	return CS_SUCCESS;}/*======================================================================    cb_release() releases all the system resources (IO and memory    space, and interrupt) committed for a Cardbus card by a prior call    to cb_config().    It is called from the ReleaseIO() service.    ======================================================================*/void cb_release(socket_info_t * s){	DEBUG(0, "cs: cb_release(bus %d)\n", s->cap.cb_dev->subordinate->number);}/*=====================================================================    cb_enable() has the job of configuring a socket for a Cardbus    card, and initializing the card's PCI configuration registers.    It first sets up the Cardbus bridge windows, for IO and memory    accesses.  Then, it initializes each card function's base address    registers, interrupt line register, and command register.    It is called as part of the RequestConfiguration card service.    It should be called after a previous call to cb_config() (via the    RequestIO service).    ======================================================================*/void cb_enable(socket_info_t * s){	struct pci_dev *dev;	u_char i;	DEBUG(0, "cs: cb_enable(bus %d)\n", s->cap.cb_dev->subordinate->number);	/* Configure bridge */	cb_release_cis_mem(s);	/* Set up PCI interrupt and command registers */	for (i = 0; i < s->functions; i++) {		dev = &s->cb_config[i].dev;		pci_writeb(dev, PCI_COMMAND, PCI_COMMAND_MASTER |			   PCI_COMMAND_IO | PCI_COMMAND_MEMORY);		pci_writeb(dev, PCI_CACHE_LINE_SIZE, L1_CACHE_BYTES / 4);	}	if (s->irq.AssignedIRQ) {		for (i = 0; i < s->functions; i++) {			dev = &s->cb_config[i].dev;			pci_writeb(dev, PCI_INTERRUPT_LINE, s->irq.AssignedIRQ);		}		s->socket.io_irq = s->irq.AssignedIRQ;		s->ss_entry->set_socket(s->sock, &s->socket);	}}/*======================================================================    cb_disable() unconfigures a Cardbus card previously set up by    cb_enable().    It is called from the ReleaseConfiguration service.    ======================================================================*/void cb_disable(socket_info_t * s){	DEBUG(0, "cs: cb_disable(bus %d)\n", s->cap.cb_dev->subordinate->number);	/* Turn off bridge windows */	cb_release_cis_mem(s);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久只精品国产| aaa欧美色吧激情视频| 亚洲18女电影在线观看| 国产精品妹子av| 国产蜜臀av在线一区二区三区| 精品国产髙清在线看国产毛片| 欧美不卡123| 精品国产91亚洲一区二区三区婷婷| 91精品国产综合久久福利软件 | 国产成人免费xxxxxxxx| 理论电影国产精品| 国产美女娇喘av呻吟久久| 国产精品系列在线观看| 国产精品亚洲午夜一区二区三区| 成人午夜在线播放| 91蜜桃网址入口| 欧美视频一区二区三区在线观看| 欧美日韩精品综合在线| 日韩欧美一区二区免费| 国产日本亚洲高清| 亚洲精品中文在线影院| 亚洲成人激情综合网| 日韩av高清在线观看| 国产一区在线精品| 成人av中文字幕| 欧美人体做爰大胆视频| 欧美精品一区男女天堂| 中文字幕在线一区免费| 91精品国产综合久久精品麻豆| 国产精品美女久久久久aⅴ| 精品乱码亚洲一区二区不卡| 国产婷婷色一区二区三区| 亚洲欧美综合色| 亚洲一区二区欧美激情| 国产一区二区三区| 日本久久一区二区| 亚洲精品一区二区三区蜜桃下载| 中文字幕在线播放不卡一区| 青青草97国产精品免费观看无弹窗版| 韩国av一区二区三区四区| 99国内精品久久| 欧美大尺度电影在线| 亚洲图片激情小说| 狠狠狠色丁香婷婷综合久久五月| 成人综合婷婷国产精品久久蜜臀| 欧美性生活久久| 色偷偷久久一区二区三区| 欧美日韩中文一区| 亚洲国产精品高清| 欧美aaa在线| 色偷偷88欧美精品久久久| 日韩欧美久久久| 亚洲已满18点击进入久久| 一本大道久久a久久精品综合| 欧美日韩dvd在线观看| 日韩一区欧美一区| 韩国欧美一区二区| 欧美一级片免费看| 亚洲最快最全在线视频| 成人免费毛片片v| 337p日本欧洲亚洲大胆精品| 午夜精品福利视频网站| 色综合婷婷久久| 国产精品久久久久久久浪潮网站| 免费成人在线观看视频| 欧美高清你懂得| 一区二区三区精品在线| 91色乱码一区二区三区| 国产精品视频在线看| 国产黄色精品视频| 久久网站最新地址| 久久不见久久见免费视频7 | 久久久国产午夜精品| 日韩精品乱码免费| 欧美精品色一区二区三区| 夜夜亚洲天天久久| 在线日韩国产精品| 亚洲国产毛片aaaaa无费看 | 国产曰批免费观看久久久| 日韩亚洲欧美中文三级| 水蜜桃久久夜色精品一区的特点| 欧美视频一区二区| 午夜电影一区二区| 日韩一级高清毛片| 激情欧美日韩一区二区| 欧美精品一区二区三区蜜臀| 久久99国产精品免费网站| 精品国产一区二区三区久久影院| 久久99久久99| 中文字幕国产一区| 91黄色免费版| 蜜臀av性久久久久av蜜臀妖精| 日韩亚洲欧美高清| 国产精品一区二区三区乱码| 国产精品久久久久婷婷| 欧美在线三级电影| 欧美aaa在线| 国产精品久久夜| 在线亚洲精品福利网址导航| 日精品一区二区三区| 欧美v日韩v国产v| 不卡的看片网站| 亚洲成a人片在线不卡一二三区| 日韩午夜在线影院| 国产成人av在线影院| 毛片av一区二区三区| 久久久久久综合| 91豆麻精品91久久久久久| 午夜a成v人精品| 国产欧美日韩亚州综合| 在线观看亚洲a| 精品一区二区三区免费毛片爱| 国产目拍亚洲精品99久久精品 | 午夜久久久久久久久| 2021中文字幕一区亚洲| 91美女福利视频| 精品一区二区三区欧美| 亚洲蜜臀av乱码久久精品蜜桃| 日韩欧美一二三| 97se狠狠狠综合亚洲狠狠| 亚洲成av人片在线观看| 国产精品福利影院| 欧美成人乱码一区二区三区| 91蜜桃传媒精品久久久一区二区| 久久国产成人午夜av影院| 亚洲视频免费观看| 久久久精品国产免大香伊| 欧美日韩精品一区二区三区四区| 高清不卡一二三区| 久99久精品视频免费观看| 国产三区在线成人av| 欧美一个色资源| 7777精品伊人久久久大香线蕉的 | 国产在线精品一区二区三区不卡| 亚洲午夜视频在线| 亚洲精品老司机| 自拍偷拍国产亚洲| 亚洲国产精品99久久久久久久久 | 精品视频在线免费| 91在线porny国产在线看| 国产99久久久国产精品| 国产精品一品二品| 精品夜夜嗨av一区二区三区| 日韩电影在线一区| 中文字幕视频一区| 青青草原综合久久大伊人精品优势| 欧美日韩国产精品成人| 99久久99久久精品国产片果冻| 美国欧美日韩国产在线播放| 亚洲美女少妇撒尿| 亚洲免费观看在线视频| 欧美日韩国产另类不卡| 国产在线视视频有精品| 亚洲女同一区二区| 欧美国产在线观看| 国产精品乱人伦一区二区| 日韩欧美不卡在线观看视频| 日韩欧美一区二区免费| 欧美日韩一级二级| 色94色欧美sute亚洲线路一ni| 免费成人你懂的| 伊人婷婷欧美激情| 亚洲国产aⅴ成人精品无吗| 国产精品成人免费精品自在线观看| 中文乱码免费一区二区| 亚洲精品一区二区三区香蕉| 日本一区二区免费在线观看视频| 日韩一区二区三区四区| 欧美浪妇xxxx高跟鞋交| 欧美日韩精品一区视频| 欧美日韩一区视频| 欧美日韩一区二区三区四区| 日本二三区不卡| 成人h版在线观看| 成人激情免费视频| 国产999精品久久久久久| 一区二区三区精品在线| 成人激情小说乱人伦| 成人黄色在线看| 成人高清视频在线观看| 国产精品亚洲午夜一区二区三区| 亚洲视频一区在线观看| 奇米亚洲午夜久久精品| 日韩精品成人一区二区三区| 日韩av一区二| 麻豆国产91在线播放| 日韩福利电影在线观看| 久久99精品视频| 国产高清久久久久| 成人综合激情网| 国产高清久久久| 欧美精品视频www在线观看| 欧美一级二级在线观看| 欧美成人a∨高清免费观看| 91网上在线视频| 精品国产123| 国产精品视频线看| 亚洲黄一区二区三区| 福利电影一区二区| 91香蕉视频黄|