drivers/usb/isp1760/isp1760-hcd.c
Source file repositories/reference/linux-study-clean/drivers/usb/isp1760/isp1760-hcd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/isp1760/isp1760-hcd.c- Extension
.c- Size
- 67353 bytes
- Lines
- 2625
- 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.
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/gpio/consumer.hlinux/module.hlinux/kernel.hlinux/slab.hlinux/list.hlinux/usb.hlinux/usb/hcd.hlinux/debugfs.hlinux/uaccess.hlinux/io.hlinux/iopoll.hlinux/mm.hlinux/timer.hlinux/unaligned.hasm/cacheflush.hisp1760-core.hisp1760-hcd.hisp1760-regs.h
Detected Declarations
struct ptdstruct ptd_le32struct isp1760_qtdstruct isp1760_qhstruct urb_listitemfunction isp1760_hcd_readfunction isp1760_hcd_portsc1_set_clearfunction isp1760_hcd_writefunction isp1760_hcd_setfunction isp1760_hcd_clearfunction isp1760_hcd_set_and_waitfunction isp1760_hcd_set_and_wait_swapfunction isp1760_hcd_clear_and_waitfunction isp1760_hcd_is_setfunction isp1760_hcd_ppc_is_setfunction isp1760_hcd_n_portsfunction memoryfunction isp1760_mem_readfunction isp1763_mem_readfunction mem_readfunction isp1760_mem_writefunction isp1763_mem_writefunction mem_writefunction isp1760_ptd_readfunction isp1763_ptd_readfunction ptd_readfunction isp1763_ptd_writefunction isp1760_ptd_writefunction ptd_writefunction init_memoryfunction alloc_memfunction free_memfunction ehci_resetfunction qh_freefunction priv_initfunction isp1760_hc_setupfunction base_to_chipfunction last_qtd_of_urbfunction create_ptd_atlfunction transform_add_intfunction wayfunction create_ptd_intfunction isp1760_urb_donefunction qtd_freefunction start_bus_transferfunction is_short_bulkfunction collect_qtdsfunction list_for_each_entry_safe
Annotated Snippet
struct ptd {
__dw dw0;
__dw dw1;
__dw dw2;
__dw dw3;
__dw dw4;
__dw dw5;
__dw dw6;
__dw dw7;
};
struct ptd_le32 {
__le32 dw0;
__le32 dw1;
__le32 dw2;
__le32 dw3;
__le32 dw4;
__le32 dw5;
__le32 dw6;
__le32 dw7;
};
#define PTD_OFFSET 0x0400
#define ISO_PTD_OFFSET 0x0400
#define INT_PTD_OFFSET 0x0800
#define ATL_PTD_OFFSET 0x0c00
#define PAYLOAD_OFFSET 0x1000
#define ISP_BANK_0 0x00
#define ISP_BANK_1 0x01
#define ISP_BANK_2 0x02
#define ISP_BANK_3 0x03
#define TO_DW(x) ((__force __dw)x)
#define TO_U32(x) ((__force u32)x)
/* ATL */
/* DW0 */
#define DW0_VALID_BIT TO_DW(1)
#define FROM_DW0_VALID(x) (TO_U32(x) & 0x01)
#define TO_DW0_LENGTH(x) TO_DW((((u32)x) << 3))
#define TO_DW0_MAXPACKET(x) TO_DW((((u32)x) << 18))
#define TO_DW0_MULTI(x) TO_DW((((u32)x) << 29))
#define TO_DW0_ENDPOINT(x) TO_DW((((u32)x) << 31))
/* DW1 */
#define TO_DW1_DEVICE_ADDR(x) TO_DW((((u32)x) << 3))
#define TO_DW1_PID_TOKEN(x) TO_DW((((u32)x) << 10))
#define DW1_TRANS_BULK TO_DW(((u32)2 << 12))
#define DW1_TRANS_INT TO_DW(((u32)3 << 12))
#define DW1_TRANS_SPLIT TO_DW(((u32)1 << 14))
#define DW1_SE_USB_LOSPEED TO_DW(((u32)2 << 16))
#define TO_DW1_PORT_NUM(x) TO_DW((((u32)x) << 18))
#define TO_DW1_HUB_NUM(x) TO_DW((((u32)x) << 25))
/* DW2 */
#define TO_DW2_DATA_START_ADDR(x) TO_DW((((u32)x) << 8))
#define TO_DW2_RL(x) TO_DW(((x) << 25))
#define FROM_DW2_RL(x) ((TO_U32(x) >> 25) & 0xf)
/* DW3 */
#define FROM_DW3_NRBYTESTRANSFERRED(x) TO_U32((x) & 0x3fff)
#define FROM_DW3_SCS_NRBYTESTRANSFERRED(x) TO_U32((x) & 0x07ff)
#define TO_DW3_NAKCOUNT(x) TO_DW(((x) << 19))
#define FROM_DW3_NAKCOUNT(x) ((TO_U32(x) >> 19) & 0xf)
#define TO_DW3_CERR(x) TO_DW(((x) << 23))
#define FROM_DW3_CERR(x) ((TO_U32(x) >> 23) & 0x3)
#define TO_DW3_DATA_TOGGLE(x) TO_DW(((x) << 25))
#define FROM_DW3_DATA_TOGGLE(x) ((TO_U32(x) >> 25) & 0x1)
#define TO_DW3_PING(x) TO_DW(((x) << 26))
#define FROM_DW3_PING(x) ((TO_U32(x) >> 26) & 0x1)
#define DW3_ERROR_BIT TO_DW((1 << 28))
#define DW3_BABBLE_BIT TO_DW((1 << 29))
#define DW3_HALT_BIT TO_DW((1 << 30))
#define DW3_ACTIVE_BIT TO_DW((1 << 31))
#define FROM_DW3_ACTIVE(x) ((TO_U32(x) >> 31) & 0x01)
#define INT_UNDERRUN (1 << 2)
#define INT_BABBLE (1 << 1)
#define INT_EXACT (1 << 0)
#define SETUP_PID (2)
#define IN_PID (1)
#define OUT_PID (0)
/* Errata 1 */
#define RL_COUNTER (0)
#define NAK_COUNTER (0)
#define ERR_COUNTER (3)
struct isp1760_qtd {
u8 packet_type;
void *data_buffer;
Annotation
- Immediate include surface: `linux/gpio/consumer.h`, `linux/module.h`, `linux/kernel.h`, `linux/slab.h`, `linux/list.h`, `linux/usb.h`, `linux/usb/hcd.h`, `linux/debugfs.h`.
- Detected declarations: `struct ptd`, `struct ptd_le32`, `struct isp1760_qtd`, `struct isp1760_qh`, `struct urb_listitem`, `function isp1760_hcd_read`, `function isp1760_hcd_portsc1_set_clear`, `function isp1760_hcd_write`, `function isp1760_hcd_set`, `function isp1760_hcd_clear`.
- Atlas domain: Driver Families / drivers/usb.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.