drivers/net/wireless/ath/ath6kl/usb.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath6kl/usb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath6kl/usb.c- Extension
.c- Size
- 31927 bytes
- Lines
- 1253
- Domain
- Driver Families
- Bucket
- drivers/net
- 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.
- 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/module.hlinux/usb.hdebug.hcore.h
Detected Declarations
struct ath6kl_usb_pipestruct ath6kl_usbstruct ath6kl_urb_contextstruct ath6kl_usb_ctrl_diag_cmd_writestruct ath6kl_usb_ctrl_diag_cmd_readstruct ath6kl_usb_ctrl_diag_resp_readenum ATH6KL_USB_PIPE_IDfunction ath6kl_usb_alloc_urb_from_pipefunction ath6kl_usb_free_urb_to_pipefunction ath6kl_usb_cleanup_recv_urbfunction ath6kl_usb_alloc_pipe_resourcesfunction ath6kl_usb_free_pipe_resourcesfunction ath6kl_usb_cleanup_pipe_resourcesfunction ath6kl_usb_get_logical_pipe_numfunction ath6kl_usb_setup_pipe_resourcesfunction ath6kl_usb_post_recv_transfersfunction ath6kl_usb_flush_allfunction ath6kl_usb_start_recv_pipesfunction ath6kl_usb_recv_completefunction ath6kl_usb_usb_transmit_completefunction ath6kl_usb_io_comp_workfunction ath6kl_usb_destroyfunction ath6kl_usb_device_detachedfunction hif_startfunction ath6kl_usb_sendfunction hif_stopfunction ath6kl_usb_get_default_pipefunction ath6kl_usb_map_service_pipefunction ath6kl_usb_get_free_queue_numberfunction hif_detach_htcfunction ath6kl_usb_submit_ctrl_outfunction ath6kl_usb_submit_ctrl_infunction ath6kl_usb_ctrl_msg_exchangefunction ath6kl_usb_diag_read32function ath6kl_usb_diag_write32function ath6kl_usb_bmi_readfunction ath6kl_usb_bmi_writefunction ath6kl_usb_power_onfunction ath6kl_usb_power_offfunction ath6kl_usb_stopfunction ath6kl_usb_cleanup_scatterfunction ath6kl_usb_suspendfunction ath6kl_usb_resumefunction ath6kl_usb_probefunction ath6kl_usb_disconnectfunction ath6kl_usb_pm_suspendfunction ath6kl_usb_pm_resume
Annotated Snippet
struct ath6kl_usb_pipe {
struct list_head urb_list_head;
struct usb_anchor urb_submitted;
u32 urb_alloc;
u32 urb_cnt;
u32 urb_cnt_thresh;
unsigned int usb_pipe_handle;
u32 flags;
u8 ep_address;
u8 logical_pipe_num;
struct ath6kl_usb *ar_usb;
u16 max_packet_size;
struct work_struct io_complete_work;
struct sk_buff_head io_comp_queue;
struct usb_endpoint_descriptor *ep_desc;
};
#define ATH6KL_USB_PIPE_FLAG_TX (1 << 0)
/* usb device object */
struct ath6kl_usb {
/* protects pipe->urb_list_head and pipe->urb_cnt */
spinlock_t cs_lock;
struct usb_device *udev;
struct usb_interface *interface;
struct ath6kl_usb_pipe pipes[ATH6KL_USB_PIPE_MAX];
u8 *diag_cmd_buffer;
u8 *diag_resp_buffer;
struct ath6kl *ar;
struct workqueue_struct *wq;
};
/* usb urb object */
struct ath6kl_urb_context {
struct list_head link;
struct ath6kl_usb_pipe *pipe;
struct sk_buff *skb;
struct ath6kl *ar;
};
/* USB endpoint definitions */
#define ATH6KL_USB_EP_ADDR_APP_CTRL_IN 0x81
#define ATH6KL_USB_EP_ADDR_APP_DATA_IN 0x82
#define ATH6KL_USB_EP_ADDR_APP_DATA2_IN 0x83
#define ATH6KL_USB_EP_ADDR_APP_INT_IN 0x84
#define ATH6KL_USB_EP_ADDR_APP_CTRL_OUT 0x01
#define ATH6KL_USB_EP_ADDR_APP_DATA_LP_OUT 0x02
#define ATH6KL_USB_EP_ADDR_APP_DATA_MP_OUT 0x03
#define ATH6KL_USB_EP_ADDR_APP_DATA_HP_OUT 0x04
/* diagnostic command definitions */
#define ATH6KL_USB_CONTROL_REQ_SEND_BMI_CMD 1
#define ATH6KL_USB_CONTROL_REQ_RECV_BMI_RESP 2
#define ATH6KL_USB_CONTROL_REQ_DIAG_CMD 3
#define ATH6KL_USB_CONTROL_REQ_DIAG_RESP 4
#define ATH6KL_USB_CTRL_DIAG_CC_READ 0
#define ATH6KL_USB_CTRL_DIAG_CC_WRITE 1
struct ath6kl_usb_ctrl_diag_cmd_write {
__le32 cmd;
__le32 address;
__le32 value;
__le32 _pad[1];
} __packed;
struct ath6kl_usb_ctrl_diag_cmd_read {
__le32 cmd;
__le32 address;
} __packed;
struct ath6kl_usb_ctrl_diag_resp_read {
__le32 value;
} __packed;
/* function declarations */
static void ath6kl_usb_recv_complete(struct urb *urb);
#define ATH6KL_USB_IS_BULK_EP(attr) (((attr) & 3) == 0x02)
#define ATH6KL_USB_IS_INT_EP(attr) (((attr) & 3) == 0x03)
#define ATH6KL_USB_IS_ISOC_EP(attr) (((attr) & 3) == 0x01)
#define ATH6KL_USB_IS_DIR_IN(addr) ((addr) & 0x80)
/* pipe/urb operations */
static struct ath6kl_urb_context *
ath6kl_usb_alloc_urb_from_pipe(struct ath6kl_usb_pipe *pipe)
{
struct ath6kl_urb_context *urb_context = NULL;
Annotation
- Immediate include surface: `linux/module.h`, `linux/usb.h`, `debug.h`, `core.h`.
- Detected declarations: `struct ath6kl_usb_pipe`, `struct ath6kl_usb`, `struct ath6kl_urb_context`, `struct ath6kl_usb_ctrl_diag_cmd_write`, `struct ath6kl_usb_ctrl_diag_cmd_read`, `struct ath6kl_usb_ctrl_diag_resp_read`, `enum ATH6KL_USB_PIPE_ID`, `function ath6kl_usb_alloc_urb_from_pipe`, `function ath6kl_usb_free_urb_to_pipe`, `function ath6kl_usb_cleanup_recv_urb`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.