drivers/usb/host/fhci.h

Source file repositories/reference/linux-study-clean/drivers/usb/host/fhci.h

File Facts

System
Linux kernel
Corpus path
drivers/usb/host/fhci.h
Extension
.h
Size
18714 bytes
Lines
590
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 fhci_pram {
	__be16 ep_ptr[4];	/* Endpoint porter reg */
	__be32 rx_state;	/* Rx internal state */
	__be32 rx_ptr;		/* Rx internal data pointer */
	__be16 frame_num;	/* Frame number */
	__be16 rx_cnt;		/* Rx byte count */
	__be32 rx_temp;		/* Rx temp */
	__be32 rx_data_temp;	/* Rx data temp */
	__be16 rx_u_ptr;	/* Rx microcode return address temp */
	u8 reserved1[2];	/* reserved area */
	__be32 sof_tbl;		/* SOF lookup table pointer */
	u8 sof_u_crc_temp;	/* SOF micorcode CRC5 temp reg */
	u8 reserved2[0xdb];
};

/* Freescale USB Endpoint*/
struct fhci_ep_pram {
	__be16 rx_base;		/* Rx BD base address */
	__be16 tx_base;		/* Tx BD base address */
	u8 rx_func_code;	/* Rx function code */
	u8 tx_func_code;	/* Tx function code */
	__be16 rx_buff_len;	/* Rx buffer length */
	__be16 rx_bd_ptr;	/* Rx BD pointer */
	__be16 tx_bd_ptr;	/* Tx BD pointer */
	__be32 tx_state;	/* Tx internal state */
	__be32 tx_ptr;		/* Tx internal data pointer */
	__be16 tx_crc;		/* temp transmit CRC */
	__be16 tx_cnt;		/* Tx byte count */
	__be32 tx_temp;		/* Tx temp */
	__be16 tx_u_ptr;	/* Tx microcode return address temp */
	__be16 reserved;
};

struct fhci_controller_list {
	struct list_head ctrl_list;	/* control endpoints */
	struct list_head bulk_list;	/* bulk endpoints */
	struct list_head iso_list;	/* isochronous endpoints */
	struct list_head intr_list;	/* interruput endpoints */
	struct list_head done_list;	/* done transfers */
};

struct virtual_root_hub {
	int dev_num;	/* USB address of the root hub */
	u32 feature;	/* indicates what feature has been set */
	struct usb_hub_status hub;
	struct usb_port_status port;
};

enum fhci_gpios {
	GPIO_USBOE = 0,
	GPIO_USBTP,
	GPIO_USBTN,
	GPIO_USBRP,
	GPIO_USBRN,
	/* these are optional */
	GPIO_SPEED,
	GPIO_POWER,
	NUM_GPIOS,
};

enum fhci_pins {
	PIN_USBOE = 0,
	PIN_USBTP,
	PIN_USBTN,
	NUM_PINS,
};

struct fhci_hcd {
	enum qe_clock fullspeed_clk;
	enum qe_clock lowspeed_clk;
	struct qe_pin *pins[NUM_PINS];
	struct gpio_desc *gpiods[NUM_GPIOS];

	struct qe_usb_ctlr __iomem *regs; /* I/O memory used to communicate */
	struct fhci_pram __iomem *pram;	/* Parameter RAM */
	struct gtm_timer *timer;

	spinlock_t lock;
	struct fhci_usb *usb_lld; /* Low-level driver */
	struct virtual_root_hub *vroot_hub; /* the virtual root hub */
	int active_urbs;
	struct fhci_controller_list *hc_list;
	struct tasklet_struct *process_done_task; /* tasklet for done list */

	struct list_head empty_eds;
	struct list_head empty_tds;

#ifdef CONFIG_FHCI_DEBUG
	int usb_irq_stat[13];
	struct dentry *dfs_root;

Annotation

Implementation Notes