drivers/net/wireless/intersil/p54/p54usb.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intersil/p54/p54usb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intersil/p54/p54usb.c- Extension
.c- Size
- 29750 bytes
- Lines
- 1141
- 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.
- 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/usb.hlinux/pci.hlinux/slab.hlinux/firmware.hlinux/etherdevice.hlinux/delay.hlinux/crc32.hlinux/module.hnet/mac80211.hp54.hlmac.hp54usb.h
Detected Declarations
function p54u_rx_cbfunction p54u_tx_cbfunction p54u_tx_dummy_cbfunction p54u_stopfunction p54u_init_urbsfunction p54u_openfunction p54u_lm87_chksumfunction p54u_tx_lm87function p54u_tx_net2280function p54u_writefunction p54u_readfunction p54u_bulk_msgfunction p54u_device_resetfunction p54u_firmware_reset_3887function p54u_upload_firmware_3887function usb_rcvbulkpipefunction usb_rcvbulkpipefunction p54u_upload_firmware_net2280function p54_find_typefunction p54u_start_opsfunction p54u_load_firmware_cbfunction p54u_load_firmwarefunction p54u_probefunction p54u_disconnectfunction p54u_pre_resetfunction p54u_resumefunction p54u_post_resetfunction p54u_suspend
Annotated Snippet
if (unlikely(!skb)) {
/* TODO check rx queue length and refill *somewhere* */
return;
}
info = (struct p54u_rx_info *) skb->cb;
info->urb = urb;
info->dev = dev;
urb->transfer_buffer = skb_tail_pointer(skb);
urb->context = skb;
} else {
if (priv->hw_type == P54U_NET2280)
skb_push(skb, priv->common.tx_hdr_len);
if (priv->common.fw_interface == FW_LM87) {
skb_push(skb, 4);
skb_put(skb, 4);
}
skb_reset_tail_pointer(skb);
skb_trim(skb, 0);
urb->transfer_buffer = skb_tail_pointer(skb);
}
skb_queue_tail(&priv->rx_queue, skb);
usb_anchor_urb(urb, &priv->submitted);
if (usb_submit_urb(urb, GFP_ATOMIC)) {
skb_unlink(skb, &priv->rx_queue);
usb_unanchor_urb(urb);
dev_kfree_skb_irq(skb);
}
}
static void p54u_tx_cb(struct urb *urb)
{
struct sk_buff *skb = urb->context;
struct ieee80211_hw *dev =
usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0));
p54_free_skb(dev, skb);
}
static void p54u_tx_dummy_cb(struct urb *urb) { }
static void p54u_free_urbs(struct ieee80211_hw *dev)
{
struct p54u_priv *priv = dev->priv;
usb_kill_anchored_urbs(&priv->submitted);
}
static void p54u_stop(struct ieee80211_hw *dev)
{
/*
* TODO: figure out how to reliably stop the 3887 and net2280 so
* the hardware is still usable next time we want to start it.
* until then, we just stop listening to the hardware..
*/
p54u_free_urbs(dev);
}
static int p54u_init_urbs(struct ieee80211_hw *dev)
{
struct p54u_priv *priv = dev->priv;
struct urb *entry = NULL;
struct sk_buff *skb;
struct p54u_rx_info *info;
int ret = 0;
while (skb_queue_len(&priv->rx_queue) < 32) {
skb = __dev_alloc_skb(priv->common.rx_mtu + 32, GFP_KERNEL);
if (!skb) {
ret = -ENOMEM;
goto err;
}
entry = usb_alloc_urb(0, GFP_KERNEL);
if (!entry) {
ret = -ENOMEM;
goto err;
}
usb_fill_bulk_urb(entry, priv->udev,
usb_rcvbulkpipe(priv->udev, P54U_PIPE_DATA),
skb_tail_pointer(skb),
priv->common.rx_mtu + 32, p54u_rx_cb, skb);
info = (struct p54u_rx_info *) skb->cb;
info->urb = entry;
info->dev = dev;
skb_queue_tail(&priv->rx_queue, skb);
usb_anchor_urb(entry, &priv->submitted);
ret = usb_submit_urb(entry, GFP_KERNEL);
if (ret) {
skb_unlink(skb, &priv->rx_queue);
Annotation
- Immediate include surface: `linux/usb.h`, `linux/pci.h`, `linux/slab.h`, `linux/firmware.h`, `linux/etherdevice.h`, `linux/delay.h`, `linux/crc32.h`, `linux/module.h`.
- Detected declarations: `function p54u_rx_cb`, `function p54u_tx_cb`, `function p54u_tx_dummy_cb`, `function p54u_stop`, `function p54u_init_urbs`, `function p54u_open`, `function p54u_lm87_chksum`, `function p54u_tx_lm87`, `function p54u_tx_net2280`, `function p54u_write`.
- Atlas domain: Driver Families / drivers/net.
- 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.