drivers/usb/host/ohci-sm501.c
Source file repositories/reference/linux-study-clean/drivers/usb/host/ohci-sm501.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/host/ohci-sm501.c- Extension
.c- Size
- 6809 bytes
- Lines
- 264
- 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.
- 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/interrupt.hlinux/jiffies.hlinux/platform_device.hlinux/dma-mapping.hlinux/sm501.hlinux/sm501-regs.h
Detected Declarations
function HCDfunction ohci_sm501_startfunction ohci_hcd_sm501_drv_probefunction ohci_hcd_sm501_drv_removefunction ohci_sm501_suspendfunction ohci_sm501_resume
Annotated Snippet
// SPDX-License-Identifier: GPL-1.0+
/*
* OHCI HCD (Host Controller Driver) for USB.
*
* (C) Copyright 1999 Roman Weissgaerber <weissg@vienna.at>
* (C) Copyright 2000-2005 David Brownell
* (C) Copyright 2002 Hewlett-Packard Company
* (C) Copyright 2008 Magnus Damm
*
* SM501 Bus Glue - based on ohci-omap.c
*
* This file is licenced under the GPL.
*/
#include <linux/interrupt.h>
#include <linux/jiffies.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <linux/sm501.h>
#include <linux/sm501-regs.h>
static int ohci_sm501_init(struct usb_hcd *hcd)
{
return ohci_init(hcd_to_ohci(hcd));
}
static int ohci_sm501_start(struct usb_hcd *hcd)
{
struct device *dev = hcd->self.controller;
int ret;
ret = ohci_run(hcd_to_ohci(hcd));
if (ret < 0) {
dev_err(dev, "can't start %s", hcd->self.bus_name);
ohci_stop(hcd);
}
return ret;
}
/*-------------------------------------------------------------------------*/
static const struct hc_driver ohci_sm501_hc_driver = {
.description = hcd_name,
.product_desc = "SM501 OHCI",
.hcd_priv_size = sizeof(struct ohci_hcd),
/*
* generic hardware linkage
*/
.irq = ohci_irq,
.flags = HCD_USB11 | HCD_MEMORY,
/*
* basic lifecycle operations
*/
.reset = ohci_sm501_init,
.start = ohci_sm501_start,
.stop = ohci_stop,
.shutdown = ohci_shutdown,
/*
* managing i/o requests and associated device resources
*/
.urb_enqueue = ohci_urb_enqueue,
.urb_dequeue = ohci_urb_dequeue,
.endpoint_disable = ohci_endpoint_disable,
/*
* scheduling support
*/
.get_frame_number = ohci_get_frame,
/*
* root hub support
*/
.hub_status_data = ohci_hub_status_data,
.hub_control = ohci_hub_control,
#ifdef CONFIG_PM
.bus_suspend = ohci_bus_suspend,
.bus_resume = ohci_bus_resume,
#endif
.start_port_reset = ohci_start_port_reset,
};
/*-------------------------------------------------------------------------*/
static int ohci_hcd_sm501_drv_probe(struct platform_device *pdev)
{
const struct hc_driver *driver = &ohci_sm501_hc_driver;
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/jiffies.h`, `linux/platform_device.h`, `linux/dma-mapping.h`, `linux/sm501.h`, `linux/sm501-regs.h`.
- Detected declarations: `function HCD`, `function ohci_sm501_start`, `function ohci_hcd_sm501_drv_probe`, `function ohci_hcd_sm501_drv_remove`, `function ohci_sm501_suspend`, `function ohci_sm501_resume`.
- Atlas domain: Driver Families / drivers/usb.
- Implementation status: source implementation candidate.
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.