⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 n9604.h

📁 LINUX2.4.18内核下的usb GADGET驱动程序
💻 H
字号:
/* * National 9604 USB device controller driver * * Copyright 2003 Technical Solutions Inc. * * ported from: *  * Toshiba TC86C001 ("Goku-S") USB Device Controller driver * * Copyright (C) 2000-2002 Lineo *      by Stuart Lynne, Tom Rushworth, and Bruce Balden * Copyright (C) 2002 Toshiba Corporation * Copyright (C) 2003 MontaVista Software (source@mvista.com) * * This file is licensed under the terms of the GNU General Public * License version 2.  This program is licensed "as is" without any * warranty of any kind, whether express or implied. */#define MAX_FIFO_SIZE   64#define MAX_EP0_SIZE    8struct n9604_ep {	struct usb_ep                           ep;	struct n9604_udc			*dev;	unsigned long				irqs;	int					acct_req_lengths[4];	int					acct_req_dir[4];//direction	unsigned long				queue_reqs;//how many times has n9604_queue been called	unsigned long				queue_active;//how many current requests	unsigned long				packets;//counter of raw packets	unsigned				num:4,						numActual:4,						fifoNum:2,						is_in:1,						stage:2,//for ep0, 0 = unused, 1 = got setup, 2 = done transfer/ready to send/receive ZLP						toggle:1,						nuking:1;//are we killing on off this endpoint//only used for ep0 to help with stages	/* analogous to a host-side qh */	struct list_head			queue;	const struct usb_endpoint_descriptor	*desc;	u8					control;	u8					fifo;	u8					status;	u8					command;};struct n9604_request {	struct usb_request		req;	struct list_head		queue;	int				complete;//this is added for tx requests						//if set the entire request has been written to the fifo, just waiting for confirmation						//from the interrupt that it has been sent	unsigned			mapped:1;};struct n9604_udc {	struct usb_gadget		gadget;	spinlock_t			lock;	struct n9604_ep			ep[7];	struct usb_gadget_driver	*driver;	int				configured;	u8				address;	/* statistics... */	unsigned long			irqs;};/*-------------------------------------------------------------------------*/#define xprintk(dev,level,fmt,args...) \	printk(level "%s %s: " fmt , driver_name , \			"S2410 gadget" , ## args)#define ERROR(dev,fmt,args...) \	xprintk(dev , KERN_ERR , fmt , ## args)#define WARN(dev,fmt,args...) \	xprintk(dev , KERN_WARNING , fmt , ## args)#define INFO(dev,fmt,args...) \	xprintk(dev , KERN_INFO , fmt , ## args)/*-------------------------------------------------------------------------*//* 2.5 stuff that's sometimes missing in 2.4 */#ifndef container_of#define	container_of	list_entry#endif#ifndef likely#define likely(x)	(x)#define unlikely(x)	(x)#endif#ifndef BUG_ON#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)#endif#ifndef WARN_ON#define	WARN_ON(x)	do { } while (0)#endif#ifndef	IRQ_NONEtypedef void irqreturn_t;#define IRQ_NONE#define IRQ_HANDLED#define IRQ_RETVAL(x)#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -