drivers/usb/renesas_usbhs/mod_host.c
Source file repositories/reference/linux-study-clean/drivers/usb/renesas_usbhs/mod_host.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/renesas_usbhs/mod_host.c- Extension
.c- Size
- 37433 bytes
- Lines
- 1575
- 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.
- 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/io.hlinux/list.hlinux/module.hlinux/platform_device.hlinux/slab.hlinux/usb.hlinux/usb/hcd.hcommon.h
Detected Declarations
struct usbhsh_requeststruct usbhsh_devicestruct usbhsh_epstruct usbhsh_hprivfunction usbhsh_ureq_freefunction usbhsh_is_runningfunction usbhsh_endpoint_sequence_savefunction usbhsh_pipe_attachfunction usbhs_for_each_pipe_with_dcpfunction usbhsh_pipe_detachfunction usbhsh_endpoint_attachfunction usbhsh_endpoint_detachfunction usbhsh_endpoint_detach_allfunction usbhsh_connected_to_rhdevfunction usbhsh_device_has_endpointfunction urbfunction usbhsh_device_detachfunction usbhsh_queue_donefunction usbhsh_queue_pushfunction usbhsh_queue_force_popfunction usbhsh_queue_force_pop_allfunction usbhsh_is_request_addressfunction usbhsh_setup_stage_packet_pushfunction usbhsh_device_attachfunction usbhsh_data_stage_packet_donefunction usbhsh_data_stage_packet_pushfunction usbhsh_status_stage_packet_pushfunction usbhsh_dcp_queue_pushfunction usbhsh_dma_map_ctrlfunction usbhsh_host_startfunction usbhsh_host_stopfunction usbhsh_urb_dequeuefunction usbhsh_endpoint_disablefunction usbhsh_hub_status_datafunction __usbhsh_hub_hub_featurefunction __usbhsh_hub_port_featurefunction __usbhsh_hub_get_statusfunction usbhsh_hub_controlfunction usbhsh_bus_nopfunction usbhsh_irq_attchfunction usbhsh_irq_dtchfunction usbhsh_irq_setup_ackfunction usbhsh_irq_setup_errfunction usbhsh_pipe_init_for_hostfunction usbhsh_startfunction usbhsh_stopfunction usbhs_mod_host_probefunction usbhs_mod_host_remove
Annotated Snippet
struct usbhsh_request {
struct urb *urb;
struct usbhs_pkt pkt;
};
struct usbhsh_device {
struct usb_device *usbv;
struct list_head ep_list_head; /* list of usbhsh_ep */
};
struct usbhsh_ep {
struct usbhs_pipe *pipe; /* attached pipe */
struct usbhsh_device *udev; /* attached udev */
struct usb_host_endpoint *ep;
struct list_head ep_list; /* list to usbhsh_device */
unsigned int counter; /* pipe attach counter */
};
#define USBHSH_DEVICE_MAX 10 /* see DEVADDn / DCPMAXP / PIPEMAXP */
#define USBHSH_PORT_MAX 7 /* see DEVADDn :: HUBPORT */
struct usbhsh_hpriv {
struct usbhs_mod mod;
struct usbhs_pipe *dcp;
struct usbhsh_device udev[USBHSH_DEVICE_MAX];
u32 port_stat; /* USB_PORT_STAT_xxx */
struct completion setup_ack_done;
};
static const char usbhsh_hcd_name[] = "renesas_usbhs host";
/*
* macro
*/
#define usbhsh_priv_to_hpriv(priv) \
container_of(usbhs_mod_get(priv, USBHS_HOST), struct usbhsh_hpriv, mod)
#define __usbhsh_for_each_udev(start, pos, h, i) \
for ((i) = start; \
((i) < USBHSH_DEVICE_MAX) && ((pos) = (h)->udev + (i)); \
(i)++)
#define usbhsh_for_each_udev(pos, hpriv, i) \
__usbhsh_for_each_udev(1, pos, hpriv, i)
#define usbhsh_for_each_udev_with_dev0(pos, hpriv, i) \
__usbhsh_for_each_udev(0, pos, hpriv, i)
#define usbhsh_hcd_to_hpriv(h) (struct usbhsh_hpriv *)((h)->hcd_priv)
#define usbhsh_hcd_to_dev(h) ((h)->self.controller)
#define usbhsh_hpriv_to_priv(h) ((h)->mod.priv)
#define usbhsh_hpriv_to_dcp(h) ((h)->dcp)
#define usbhsh_hpriv_to_hcd(h) \
container_of((void *)h, struct usb_hcd, hcd_priv)
#define usbhsh_ep_to_uep(u) ((u)->hcpriv)
#define usbhsh_uep_to_pipe(u) ((u)->pipe)
#define usbhsh_uep_to_udev(u) ((u)->udev)
#define usbhsh_uep_to_ep(u) ((u)->ep)
#define usbhsh_urb_to_ureq(u) ((u)->hcpriv)
#define usbhsh_urb_to_usbv(u) ((u)->dev)
#define usbhsh_usbv_to_udev(d) dev_get_drvdata(&(d)->dev)
#define usbhsh_udev_to_usbv(h) ((h)->usbv)
#define usbhsh_udev_is_used(h) usbhsh_udev_to_usbv(h)
#define usbhsh_pipe_to_uep(p) ((p)->mod_private)
#define usbhsh_device_parent(d) (usbhsh_usbv_to_udev((d)->usbv->parent))
#define usbhsh_device_hubport(d) ((d)->usbv->portnum)
#define usbhsh_device_number(h, d) ((int)((d) - (h)->udev))
#define usbhsh_device_nth(h, d) ((h)->udev + d)
#define usbhsh_device0(h) usbhsh_device_nth(h, 0)
#define usbhsh_port_stat_init(h) ((h)->port_stat = 0)
#define usbhsh_port_stat_set(h, s) ((h)->port_stat |= (s))
#define usbhsh_port_stat_clear(h, s) ((h)->port_stat &= ~(s))
#define usbhsh_port_stat_get(h) ((h)->port_stat)
#define usbhsh_pkt_to_ureq(p) \
container_of((void *)p, struct usbhsh_request, pkt)
/*
* req alloc/free
Annotation
- Immediate include surface: `linux/io.h`, `linux/list.h`, `linux/module.h`, `linux/platform_device.h`, `linux/slab.h`, `linux/usb.h`, `linux/usb/hcd.h`, `common.h`.
- Detected declarations: `struct usbhsh_request`, `struct usbhsh_device`, `struct usbhsh_ep`, `struct usbhsh_hpriv`, `function usbhsh_ureq_free`, `function usbhsh_is_running`, `function usbhsh_endpoint_sequence_save`, `function usbhsh_pipe_attach`, `function usbhs_for_each_pipe_with_dcp`, `function usbhsh_pipe_detach`.
- Atlas domain: Driver Families / drivers/usb.
- Implementation status: source implementation candidate.
- 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.