drivers/net/wireless/broadcom/b43/pio.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/b43/pio.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/b43/pio.c- Extension
.c- Size
- 20029 bytes
- Lines
- 822
- 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.
- 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
b43.hpio.hdma.hmain.hxmit.hlinux/delay.hlinux/sched.hlinux/slab.h
Detected Declarations
function Copyrightfunction index_to_pioqueue_basefunction pio_txqueue_offsetfunction pio_rxqueue_offsetfunction b43_pio_cancel_tx_packetsfunction b43_destroy_pioqueue_txfunction b43_destroy_pioqueue_rxfunction b43_pio_freefunction b43_pio_initfunction tx_write_2byte_queuefunction pio_tx_frame_2byte_queuefunction tx_write_4byte_queuefunction pio_tx_frame_4byte_queuefunction pio_tx_framefunction b43_pio_txfunction b43_pio_handle_txstatusfunction pio_rx_framefunction b43_pio_rxfunction b43_pio_tx_suspend_queuefunction b43_pio_tx_resume_queuefunction b43_pio_tx_suspendfunction b43_pio_tx_resume
Annotated Snippet
if (pack->skb) {
ieee80211_free_txskb(q->dev->wl->hw, pack->skb);
pack->skb = NULL;
}
}
}
static void b43_destroy_pioqueue_tx(struct b43_pio_txqueue *q,
const char *name)
{
if (!q)
return;
b43_pio_cancel_tx_packets(q);
kfree(q);
}
static void b43_destroy_pioqueue_rx(struct b43_pio_rxqueue *q,
const char *name)
{
if (!q)
return;
kfree(q);
}
#define destroy_queue_tx(pio, queue) do { \
b43_destroy_pioqueue_tx((pio)->queue, __stringify(queue)); \
(pio)->queue = NULL; \
} while (0)
#define destroy_queue_rx(pio, queue) do { \
b43_destroy_pioqueue_rx((pio)->queue, __stringify(queue)); \
(pio)->queue = NULL; \
} while (0)
void b43_pio_free(struct b43_wldev *dev)
{
struct b43_pio *pio;
if (!b43_using_pio_transfers(dev))
return;
pio = &dev->pio;
destroy_queue_rx(pio, rx_queue);
destroy_queue_tx(pio, tx_queue_mcast);
destroy_queue_tx(pio, tx_queue_AC_VO);
destroy_queue_tx(pio, tx_queue_AC_VI);
destroy_queue_tx(pio, tx_queue_AC_BE);
destroy_queue_tx(pio, tx_queue_AC_BK);
}
int b43_pio_init(struct b43_wldev *dev)
{
struct b43_pio *pio = &dev->pio;
int err = -ENOMEM;
b43_write32(dev, B43_MMIO_MACCTL, b43_read32(dev, B43_MMIO_MACCTL)
& ~B43_MACCTL_BE);
b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_RXPADOFF, 0);
pio->tx_queue_AC_BK = b43_setup_pioqueue_tx(dev, 0);
if (!pio->tx_queue_AC_BK)
goto out;
pio->tx_queue_AC_BE = b43_setup_pioqueue_tx(dev, 1);
if (!pio->tx_queue_AC_BE)
goto err_destroy_bk;
pio->tx_queue_AC_VI = b43_setup_pioqueue_tx(dev, 2);
if (!pio->tx_queue_AC_VI)
goto err_destroy_be;
pio->tx_queue_AC_VO = b43_setup_pioqueue_tx(dev, 3);
if (!pio->tx_queue_AC_VO)
goto err_destroy_vi;
pio->tx_queue_mcast = b43_setup_pioqueue_tx(dev, 4);
if (!pio->tx_queue_mcast)
goto err_destroy_vo;
pio->rx_queue = b43_setup_pioqueue_rx(dev, 0);
if (!pio->rx_queue)
goto err_destroy_mcast;
b43dbg(dev->wl, "PIO initialized\n");
err = 0;
out:
return err;
err_destroy_mcast:
destroy_queue_tx(pio, tx_queue_mcast);
Annotation
- Immediate include surface: `b43.h`, `pio.h`, `dma.h`, `main.h`, `xmit.h`, `linux/delay.h`, `linux/sched.h`, `linux/slab.h`.
- Detected declarations: `function Copyright`, `function index_to_pioqueue_base`, `function pio_txqueue_offset`, `function pio_rxqueue_offset`, `function b43_pio_cancel_tx_packets`, `function b43_destroy_pioqueue_tx`, `function b43_destroy_pioqueue_rx`, `function b43_pio_free`, `function b43_pio_init`, `function tx_write_2byte_queue`.
- Atlas domain: Driver Families / drivers/net.
- 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.