drivers/usb/misc/sisusbvga/sisusb.h

Source file repositories/reference/linux-study-clean/drivers/usb/misc/sisusbvga/sisusb.h

File Facts

System
Linux kernel
Corpus path
drivers/usb/misc/sisusbvga/sisusb.h
Extension
.h
Size
9107 bytes
Lines
279
Domain
Driver Families
Bucket
drivers/usb
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct sisusb_urb_context {	/* urb->context for outbound bulk URBs */
	struct sisusb_usb_data *sisusb;
	int urbindex;
	int *actual_length;
};

struct sisusb_usb_data {
	struct usb_device *sisusb_dev;
	struct usb_interface *interface;
	struct kref kref;
	wait_queue_head_t wait_q;	/* for syncind and timeouts */
	struct mutex lock;	/* general race avoidance */
	unsigned int ifnum;	/* interface number of the USB device */
	int minor;		/* minor (for logging clarity) */
	int isopen;		/* !=0 if open */
	int present;		/* !=0 if device is present on the bus */
	int ready;		/* !=0 if device is ready for userland */
	int numobufs;		/* number of obufs = number of out urbs */
	char *obuf[NUMOBUFS], *ibuf;	/* transfer buffers */
	int obufsize, ibufsize;
	struct urb *sisurbout[NUMOBUFS];
	struct urb *sisurbin;
	unsigned char urbstatus[NUMOBUFS];
	unsigned char completein;
	struct sisusb_urb_context urbout_context[NUMOBUFS];
	unsigned long flagb0;
	unsigned long vrambase;	/* framebuffer base */
	unsigned int vramsize;	/* framebuffer size (bytes) */
	unsigned long mmiobase;
	unsigned int mmiosize;
	unsigned long ioportbase;
	unsigned char devinit;	/* device initialized? */
	unsigned char gfxinit;	/* graphics core initialized? */
	unsigned short chipid, chipvendor;
	unsigned short chiprevision;
};

#define to_sisusb_dev(d) container_of(d, struct sisusb_usb_data, kref)

/* USB transport related */

/* urbstatus */
#define SU_URB_BUSY   1
#define SU_URB_ALLOC  2

/* Endpoints */

#define SISUSB_EP_GFX_IN	0x0e	/* gfx std packet out(0e)/in(8e) */
#define SISUSB_EP_GFX_OUT	0x0e

#define SISUSB_EP_GFX_BULK_OUT	0x01	/* gfx mem bulk out/in */
#define SISUSB_EP_GFX_BULK_IN	0x02	/* ? 2 is "OUT" ? */

#define SISUSB_EP_GFX_LBULK_OUT	0x03	/* gfx large mem bulk out */

#define SISUSB_EP_UNKNOWN_04	0x04	/* ? 4 is "OUT" ? - unused */

#define SISUSB_EP_BRIDGE_IN	0x0d	/* Net2280 out(0d)/in(8d) */
#define SISUSB_EP_BRIDGE_OUT	0x0d

#define SISUSB_TYPE_MEM		0
#define SISUSB_TYPE_IO		1

struct sisusb_packet {
	unsigned short header;
	u32 address;
	u32 data;
} __attribute__ ((__packed__));

#define CLEARPACKET(packet) memset(packet, 0, 10)

/* PCI bridge related */

#define SISUSB_PCI_MEMBASE	0xd0000000
#define SISUSB_PCI_MMIOBASE	0xe4000000
#define SISUSB_PCI_IOPORTBASE	0x0000d000

#define SISUSB_PCI_PSEUDO_MEMBASE	0x10000000
#define SISUSB_PCI_PSEUDO_MMIOBASE	0x20000000
#define SISUSB_PCI_PSEUDO_IOPORTBASE	0x0000d000
#define SISUSB_PCI_PSEUDO_PCIBASE	0x00010000

#define SISUSB_PCI_MMIOSIZE	(128*1024)
#define SISUSB_PCI_PCONFSIZE	0x5c

/* graphics core related */

#define AROFFSET	0x40
#define ARROFFSET	0x41
#define GROFFSET	0x4e

Annotation

Implementation Notes