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

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

?? ohci1394.c

?? 這個是uClinux下的ieee1394驅動
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* * ohci1394.c - driver for OHCI 1394 boards * Copyright (C)1999,2000 Sebastien Rougeaux <sebastien.rougeaux@anu.edu.au> *                        Gord Peters <GordPeters@smarttech.com> *              2001      Ben Collins <bcollins@debian.org> * * 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.  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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *//* * Things known to be working: * . Async Request Transmit * . Async Response Receive * . Async Request Receive * . Async Response Transmit * . Iso Receive * . DMA mmap for iso receive * . Config ROM generation * * Things implemented, but still in test phase: * . Iso Transmit *  * Things not implemented: * . Async Stream Packets * . DMA error recovery * * Known bugs: * . devctl BUS_RESET arg confusion (reset type or root holdoff?) *//*  * Acknowledgments: * * Adam J Richter <adam@yggdrasil.com> *  . Use of pci_class to find device * * Andreas Tobler <toa@pop.agri.ch> *  . Updated proc_fs calls * * Emilie Chung	<emilie.chung@axis.com> *  . Tip on Async Request Filter * * Pascal Drolet <pascal.drolet@informission.ca> *  . Various tips for optimization and functionnalities * * Robert Ficklin <rficklin@westengineering.com> *  . Loop in irq_handler * * James Goodwin <jamesg@Filanet.com> *  . Various tips on initialization, self-id reception, etc. * * Albrecht Dress <ad@mpifr-bonn.mpg.de> *  . Apple PowerBook detection * * Daniel Kobras <daniel.kobras@student.uni-tuebingen.de> *  . Reset the board properly before leaving + misc cleanups * * Leon van Stuivenberg <leonvs@iae.nl> *  . Bug fixes * * Ben Collins <bcollins@debian.org> *  . Working big-endian support *  . Updated to 2.4.x module scheme (PCI aswell) *  . Removed procfs support since it trashes random mem *  . Config ROM generation */#include <linux/config.h>#include <linux/kernel.h>#include <linux/list.h>#include <linux/slab.h>#include <linux/interrupt.h>#include <linux/wait.h>#include <linux/errno.h>#include <linux/module.h>#include <linux/pci.h>#include <linux/fs.h>#include <linux/poll.h>#include <asm/byteorder.h>#include <asm/atomic.h>#include <asm/uaccess.h>#include <linux/tqueue.h>#include <linux/delay.h>#include <linux/spinlock.h>#include <asm/pgtable.h>#include <asm/page.h>#include <linux/sched.h>#include <linux/types.h>#include <linux/wrapper.h>#include <linux/vmalloc.h>#include <linux/init.h>#ifdef CONFIG_ALL_PPC#include <asm/machdep.h>#include <asm/pmac_feature.h>#include <asm/prom.h>#include <asm/pci-bridge.h>#endif#include "ieee1394.h"#include "ieee1394_types.h"#include "hosts.h"#include "ieee1394_core.h"#include "highlevel.h"#include "ohci1394.h"#ifdef CONFIG_IEEE1394_VERBOSEDEBUG#define OHCI1394_DEBUG#endif#ifdef DBGMSG#undef DBGMSG#endif#ifdef OHCI1394_DEBUG#define DBGMSG(card, fmt, args...) \printk(KERN_INFO "%s_%d: " fmt "\n" , OHCI1394_DRIVER_NAME, card , ## args)#else#define DBGMSG(card, fmt, args...)#endif#ifdef CONFIG_IEEE1394_OHCI_DMA_DEBUG#define OHCI_DMA_ALLOC(fmt, args...) \	HPSB_ERR("%s(%s)alloc(%d): "fmt, OHCI1394_DRIVER_NAME, __FUNCTION__, \		++global_outstanding_dmas, ## args)#define OHCI_DMA_FREE(fmt, args...) \	HPSB_ERR("%s(%s)free(%d): "fmt, OHCI1394_DRIVER_NAME, __FUNCTION__, \		--global_outstanding_dmas, ## args)u32 global_outstanding_dmas = 0;#else#define OHCI_DMA_ALLOC(fmt, args...)#define OHCI_DMA_FREE(fmt, args...)#endif/* print general (card independent) information */#define PRINT_G(level, fmt, args...) \printk(level "%s: " fmt "\n" , OHCI1394_DRIVER_NAME , ## args)/* print card specific information */#define PRINT(level, card, fmt, args...) \printk(level "%s_%d: " fmt "\n" , OHCI1394_DRIVER_NAME, card , ## args)static char version[] __devinitdata =	"$Rev: 578 $ Ben Collins <bcollins@debian.org>";/* Module Parameters */MODULE_PARM(attempt_root,"i");MODULE_PARM_DESC(attempt_root, "Attempt to make the host root (default = 0).");static int attempt_root = 0;MODULE_PARM(phys_dma,"i");MODULE_PARM_DESC(phys_dma, "Enable physical dma (default = 1).");static int phys_dma = 1;static void dma_trm_tasklet(unsigned long data);static void dma_trm_reset(struct dma_trm_ctx *d);static void ohci1394_pci_remove(struct pci_dev *pdev);#ifndef __LITTLE_ENDIAN/* Swap a series of quads inplace. */static __inline__ void block_swab32(quadlet_t *data, size_t size) {	while (size--)		data[size] = swab32(data[size]);}static unsigned hdr_sizes[] = {	3,	/* TCODE_WRITEQ */	4,	/* TCODE_WRITEB */	3,	/* TCODE_WRITE_RESPONSE */	0,	/* ??? */	3,	/* TCODE_READQ */	4,	/* TCODE_READB */	3,	/* TCODE_READQ_RESPONSE */	4,	/* TCODE_READB_RESPONSE */	1,	/* TCODE_CYCLE_START (???) */	4,	/* TCODE_LOCK_REQUEST */	2,	/* TCODE_ISO_DATA */	4,	/* TCODE_LOCK_RESPONSE */};/* Swap headers */static inline void packet_swab(quadlet_t *data, int tcode, int len){	if (tcode > TCODE_LOCK_RESPONSE || hdr_sizes[tcode] == 0)		return;	block_swab32(data, hdr_sizes[tcode]);}#else/* Don't waste cycles on same sex byte swaps */#define packet_swab(w,x,y)#define block_swab32(x,y)#endif /* !LITTLE_ENDIAN *//*********************************** * IEEE-1394 functionality section * ***********************************/static u8 get_phy_reg(struct ti_ohci *ohci, u8 addr) {	int i;	unsigned long flags;	quadlet_t r;	spin_lock_irqsave (&ohci->phy_reg_lock, flags);	reg_write(ohci, OHCI1394_PhyControl, (addr << 8) | 0x00008000);	for (i = 0; i < OHCI_LOOP_COUNT; i++) {		if (reg_read(ohci, OHCI1394_PhyControl) & 0x80000000)			break;		mdelay(1);	}	r = reg_read(ohci, OHCI1394_PhyControl);	if (i >= OHCI_LOOP_COUNT)		PRINT (KERN_ERR, ohci->id, "Get PHY Reg timeout [0x%08x/0x%08x/%d]",		       r, r & 0x80000000, i);  	spin_unlock_irqrestore (&ohci->phy_reg_lock, flags);     	return (r & 0x00ff0000) >> 16;}static void set_phy_reg(struct ti_ohci *ohci, u8 addr, u8 data){	int i;	unsigned long flags;	u32 r = 0;	spin_lock_irqsave (&ohci->phy_reg_lock, flags);	reg_write(ohci, OHCI1394_PhyControl, (addr << 8) | data | 0x00004000);	for (i = 0; i < OHCI_LOOP_COUNT; i++) {		r = reg_read(ohci, OHCI1394_PhyControl);		if (!(r & 0x00004000))			break;		mdelay(1);	}	if (i == OHCI_LOOP_COUNT)		PRINT (KERN_ERR, ohci->id, "Set PHY Reg timeout [0x%08x/0x%08x/%d]",		       r, r & 0x00004000, i);	spin_unlock_irqrestore (&ohci->phy_reg_lock, flags);	return;}/* Or's our value into the current value */static void set_phy_reg_mask(struct ti_ohci *ohci, u8 addr, u8 data){	u8 old;	old = get_phy_reg (ohci, addr);	old |= data;	set_phy_reg (ohci, addr, old);	return;}static void handle_selfid(struct ti_ohci *ohci, struct hpsb_host *host,				int phyid, int isroot){	quadlet_t *q = ohci->selfid_buf_cpu;	quadlet_t self_id_count=reg_read(ohci, OHCI1394_SelfIDCount);	size_t size;	quadlet_t q0, q1;	/* Check status of self-id reception */	if (ohci->selfid_swap)		q0 = le32_to_cpu(q[0]);	else		q0 = q[0];	if ((self_id_count & 0x80000000) || 	    ((self_id_count & 0x00FF0000) != (q0 & 0x00FF0000))) {		PRINT(KERN_ERR, ohci->id, 		      "Error in reception of SelfID packets [0x%08x/0x%08x] (count: %d)",		      self_id_count, q0, ohci->self_id_errors);		/* Tip by James Goodwin <jamesg@Filanet.com>:		 * We had an error, generate another bus reset in response.  */		if (ohci->self_id_errors<OHCI1394_MAX_SELF_ID_ERRORS) {			set_phy_reg_mask (ohci, 1, 0x40);			ohci->self_id_errors++;		} else {			PRINT(KERN_ERR, ohci->id, 			      "Too many errors on SelfID error reception, giving up!");		}		return;	}	/* SelfID Ok, reset error counter. */	ohci->self_id_errors = 0;		size = ((self_id_count & 0x00001FFC) >> 2) - 1;	q++;	while (size > 0) {		if (ohci->selfid_swap) {			q0 = le32_to_cpu(q[0]);			q1 = le32_to_cpu(q[1]);		} else {			q0 = q[0];			q1 = q[1];		}				if (q0 == ~q1) {			DBGMSG (ohci->id, "SelfID packet 0x%x received", q0);			hpsb_selfid_received(host, cpu_to_be32(q0));			if (((q0 & 0x3f000000) >> 24) == phyid)				DBGMSG (ohci->id, "SelfID for this node is 0x%08x", q0);		} else {			PRINT(KERN_ERR, ohci->id,			      "SelfID is inconsistent [0x%08x/0x%08x]", q0, q1);		}		q += 2;		size -= 2;	}	DBGMSG(ohci->id, "SelfID complete");	hpsb_selfid_complete(host, phyid, isroot);	return;}static void ohci_soft_reset(struct ti_ohci *ohci) {	int i;	reg_write(ohci, OHCI1394_HCControlSet, 0x00010000);  	for (i = 0; i < OHCI_LOOP_COUNT; i++) {		if (reg_read(ohci, OHCI1394_HCControlSet) & 0x00010000)			break;		mdelay(1);	}	DBGMSG (ohci->id, "Soft reset finished");}static int run_context(struct ti_ohci *ohci, int reg, char *msg){	u32 nodeId;	/* check that the node id is valid */	nodeId = reg_read(ohci, OHCI1394_NodeID);	if (!(nodeId&0x80000000)) {		PRINT(KERN_ERR, ohci->id, 		      "Running dma failed because Node ID is not valid");		return -1;	}	/* check that the node number != 63 */	if ((nodeId&0x3f)==63) {		PRINT(KERN_ERR, ohci->id, 		      "Running dma failed because Node ID == 63");		return -1;	}		/* Run the dma context */	reg_write(ohci, reg, 0x8000);		if (msg) PRINT(KERN_DEBUG, ohci->id, "%s", msg);		return 0;}/* Generate the dma receive prgs and start the context */static void initialize_dma_rcv_ctx(struct dma_rcv_ctx *d, int generate_irq){	struct ti_ohci *ohci = (struct ti_ohci*)(d->ohci);	int i;	ohci1394_stop_context(ohci, d->ctrlClear, NULL);	for (i=0; i<d->num_desc; i++) {		u32 c;				c = DMA_CTL_INPUT_MORE | DMA_CTL_UPDATE | DMA_CTL_BRANCH;		if (generate_irq)			c |= DMA_CTL_IRQ;						d->prg_cpu[i]->control = cpu_to_le32(c | d->buf_size);		/* End of descriptor list? */		if (i + 1 < d->num_desc) {			d->prg_cpu[i]->branchAddress =				cpu_to_le32((d->prg_bus[i+1] & 0xfffffff0) | 0x1);		} else {			d->prg_cpu[i]->branchAddress =				cpu_to_le32((d->prg_bus[0] & 0xfffffff0));		}		d->prg_cpu[i]->address = cpu_to_le32(d->buf_bus[i]);		d->prg_cpu[i]->status = cpu_to_le32(d->buf_size);	}        d->buf_ind = 0;        d->buf_offset = 0;	/* Tell the controller where the first AR program is */	reg_write(ohci, d->cmdPtr, d->prg_bus[0] | 0x1);	/* Run AR context */	reg_write(ohci, d->ctrlSet, 0x00008000);	DBGMSG(ohci->id, "Receive DMA ctx=%d initialized", d->ctx);}/* Initialize the dma transmit context */static void initialize_dma_trm_ctx(struct dma_trm_ctx *d){	struct ti_ohci *ohci = (struct ti_ohci*)(d->ohci);	/* Stop the context */	ohci1394_stop_context(ohci, d->ctrlClear, NULL);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一二区视频| 中文一区一区三区高中清不卡| 日韩免费高清视频| 久久尤物电影视频在线观看| 中文字幕五月欧美| 日韩vs国产vs欧美| 成人深夜在线观看| 欧美日韩一级视频| 欧美激情一区二区三区四区| 亚洲国产一区视频| 国产最新精品免费| 在线观看视频91| 久久久噜噜噜久久人人看 | 亚洲va中文字幕| 美女任你摸久久| 91香蕉视频污| 精品噜噜噜噜久久久久久久久试看| 欧美国产禁国产网站cc| 丝袜诱惑制服诱惑色一区在线观看 | 久久疯狂做爰流白浆xx| 99国产精品久久久久久久久久| 8v天堂国产在线一区二区| 日本一区二区三级电影在线观看| 午夜精品久久久久久不卡8050| 国产精品系列在线观看| 欧美男女性生活在线直播观看| 国产日产精品一区| 秋霞午夜av一区二区三区| 91麻豆免费看| 国产欧美日韩精品一区| 日本在线不卡一区| 在线中文字幕一区| 国产精品乱码人人做人人爱| 久久99久久久久久久久久久| 日本黄色一区二区| 国产精品久久夜| 精品一区二区在线看| 欧美日韩免费一区二区三区视频| 国产精品无人区| 国产精品自拍一区| 日韩一级视频免费观看在线| 亚洲国产裸拍裸体视频在线观看乱了 | 欧美日韩精品系列| 国产精品国产自产拍高清av| 国产一区二区三区美女| 欧美一区二区成人| 亚洲一区二区三区四区的| k8久久久一区二区三区| 国产三级三级三级精品8ⅰ区| 麻豆国产精品777777在线| 欧美色男人天堂| 亚洲综合在线电影| 一本色道亚洲精品aⅴ| 综合中文字幕亚洲| 风间由美一区二区av101| 2023国产精华国产精品| 久热成人在线视频| 日韩视频在线永久播放| 日本怡春院一区二区| 555www色欧美视频| 五月激情综合色| 欧美日韩另类一区| 亚洲电影你懂得| 欧美色视频一区| 午夜欧美视频在线观看| 精品视频在线看| 五月激情综合婷婷| 欧美一区二区黄色| 久久精品99国产国产精| 91精品国产麻豆国产自产在线 | 欧美另类久久久品| 亚洲一区二区在线观看视频| 欧美性猛片aaaaaaa做受| 亚洲一区在线视频观看| 精品视频在线免费观看| 天天色综合成人网| 日韩三级伦理片妻子的秘密按摩| 蜜臂av日日欢夜夜爽一区| 日韩一区二区电影在线| 国产一区二区在线看| 久久精品一区四区| 99视频在线观看一区三区| 亚洲免费在线观看视频| 欧美羞羞免费网站| 青青青伊人色综合久久| 日韩精品一区二区三区三区免费| 激情综合色播五月| 国产视频不卡一区| 成人av电影免费观看| 一区二区三区成人在线视频| 欧美精品乱码久久久久久按摩| 蜜臀av性久久久久蜜臀aⅴ| 精品1区2区在线观看| 成人自拍视频在线| 一区二区三区美女视频| 欧美日韩一二三区| 久久精品国产一区二区三| 久久精品一级爱片| 色999日韩国产欧美一区二区| 图片区日韩欧美亚洲| 2019国产精品| 91视频国产观看| 男女性色大片免费观看一区二区| 2024国产精品| 91女神在线视频| 美女视频黄免费的久久 | 91色|porny| 日本欧美一区二区三区| 国产亚洲欧美色| 在线日韩国产精品| 青青草伊人久久| 国产精品久久久久一区二区三区共| 色狠狠一区二区三区香蕉| 美女www一区二区| 国产精品久久久久四虎| 欧美酷刑日本凌虐凌虐| 国产成人在线免费观看| 亚洲h动漫在线| 久久精品视频免费| 精品1区2区3区| 豆国产96在线|亚洲| 亚洲成a人在线观看| 欧美国产一区视频在线观看| 欧美日韩国产色站一区二区三区| 国产成人午夜精品5599| 亚洲成人福利片| 中文欧美字幕免费| 制服视频三区第一页精品| 成人精品视频一区二区三区尤物| 日一区二区三区| 136国产福利精品导航| 精品伦理精品一区| 欧美日韩亚洲另类| 成人va在线观看| 狠狠网亚洲精品| 午夜视频在线观看一区| 国产精品第一页第二页第三页| 日韩欧美一区二区久久婷婷| 一本高清dvd不卡在线观看| 国产一区二区三区在线观看精品 | 欧美一区二区视频网站| 9久草视频在线视频精品| 韩国欧美一区二区| 三级精品在线观看| 一区二区在线看| 中文子幕无线码一区tr| 精品日韩在线一区| 在线观看91av| 欧美色倩网站大全免费| 99久久伊人精品| 国产精品夜夜嗨| 久久精品国产99久久6| 亚洲午夜国产一区99re久久| 中文字幕一区二区日韩精品绯色| www国产精品av| 欧美zozozo| 欧美一区二视频| 在线不卡欧美精品一区二区三区| 91猫先生在线| 91色在线porny| 91在线视频观看| 成人免费高清在线观看| 国产成人av一区二区三区在线 | 精品欧美乱码久久久久久| 欧美日韩成人一区二区| 欧美自拍偷拍午夜视频| 色婷婷久久综合| 一本大道久久a久久精品综合| 成人av网在线| eeuss鲁片一区二区三区| 国产成人午夜片在线观看高清观看 | 欧美三级一区二区| 在线观看区一区二| 在线观看一区日韩| 欧美性受xxxx黑人xyx性爽| 91行情网站电视在线观看高清版| 91小宝寻花一区二区三区| 99v久久综合狠狠综合久久| 99在线精品视频| 色综合久久综合网| 在线观看免费视频综合| 91黄色在线观看| 欧美日韩三级一区| 欧美一区二区视频网站| 欧美第一区第二区| 久久中文娱乐网| 国产视频911| 国产精品对白交换视频| 亚洲精品成人悠悠色影视| 亚洲国产精品久久久久婷婷884 | 91久久精品日日躁夜夜躁欧美| 色一情一乱一乱一91av| 91麻豆视频网站| 欧美日本精品一区二区三区| 欧美美女一区二区三区| 欧美一区二区日韩一区二区| 日韩欧美一级特黄在线播放| 久久色在线观看| 国产精品二区一区二区aⅴ污介绍| 亚洲欧美日韩精品久久久久|