drivers/net/wireless/intersil/p54/txrx.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intersil/p54/txrx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intersil/p54/txrx.c- Extension
.c- Size
- 25964 bytes
- Lines
- 948
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/export.hlinux/firmware.hlinux/etherdevice.hasm/div64.hnet/mac80211.hp54.hlmac.h
Detected Declarations
function Copyrightfunction p54_assign_addressfunction skb_queue_walkfunction p54_tx_pendingfunction p54_wake_queuesfunction p54_tx_qos_accounting_allocfunction p54_tx_qos_accounting_freefunction p54_free_skbfunction p54_txfunction p54_rssi_to_dbmfunction p54_pspoll_workaroundfunction p54_rx_datafunction p54_rx_frame_sentfunction p54_rx_eeprom_readbackfunction p54_rx_statsfunction p54_rx_trapfunction p54_rx_controlfunction p54_rxfunction p54_tx_80211_headerfunction p54_convert_algofunction p54_tx_80211export p54_free_skbexport p54_rx
Annotated Snippet
if (!target_skb && hole_size >= len) {
target_skb = entry->prev;
hole_size -= len;
target_addr = last_addr;
break;
}
last_addr = range->end_addr;
}
if (unlikely(!target_skb)) {
if (priv->rx_end - last_addr >= len) {
target_skb = skb_peek_tail(&priv->tx_queue);
if (target_skb) {
info = IEEE80211_SKB_CB(target_skb);
range = (void *)info->rate_driver_data;
target_addr = range->end_addr;
}
} else {
spin_unlock_irqrestore(&priv->tx_queue.lock, flags);
return -ENOSPC;
}
}
info = IEEE80211_SKB_CB(skb);
range = (void *) info->rate_driver_data;
range->start_addr = target_addr;
range->end_addr = target_addr + len;
data->req_id = cpu_to_le32(target_addr + priv->headroom);
if (IS_DATA_FRAME(skb) &&
unlikely(GET_HW_QUEUE(skb) == P54_QUEUE_BEACON))
priv->beacon_req_id = data->req_id;
if (target_skb)
__skb_queue_after(&priv->tx_queue, target_skb, skb);
else
__skb_queue_head(&priv->tx_queue, skb);
spin_unlock_irqrestore(&priv->tx_queue.lock, flags);
return 0;
}
static void p54_tx_pending(struct p54_common *priv)
{
struct sk_buff *skb;
int ret;
skb = skb_dequeue(&priv->tx_pending);
if (unlikely(!skb))
return ;
ret = p54_assign_address(priv, skb);
if (unlikely(ret))
skb_queue_head(&priv->tx_pending, skb);
else
priv->tx(priv->hw, skb);
}
static void p54_wake_queues(struct p54_common *priv)
{
unsigned long flags;
unsigned int i;
if (unlikely(priv->mode == NL80211_IFTYPE_UNSPECIFIED))
return ;
p54_tx_pending(priv);
spin_lock_irqsave(&priv->tx_stats_lock, flags);
for (i = 0; i < priv->hw->queues; i++) {
if (priv->tx_stats[i + P54_QUEUE_DATA].len <
priv->tx_stats[i + P54_QUEUE_DATA].limit)
ieee80211_wake_queue(priv->hw, i);
}
spin_unlock_irqrestore(&priv->tx_stats_lock, flags);
}
static int p54_tx_qos_accounting_alloc(struct p54_common *priv,
struct sk_buff *skb,
const u16 p54_queue)
{
struct p54_tx_queue_stats *queue;
unsigned long flags;
if (WARN_ON(p54_queue >= P54_QUEUE_NUM))
return -EINVAL;
queue = &priv->tx_stats[p54_queue];
spin_lock_irqsave(&priv->tx_stats_lock, flags);
if (unlikely(queue->len >= queue->limit && IS_QOS_QUEUE(p54_queue))) {
spin_unlock_irqrestore(&priv->tx_stats_lock, flags);
return -ENOSPC;
Annotation
- Immediate include surface: `linux/export.h`, `linux/firmware.h`, `linux/etherdevice.h`, `asm/div64.h`, `net/mac80211.h`, `p54.h`, `lmac.h`.
- Detected declarations: `function Copyright`, `function p54_assign_address`, `function skb_queue_walk`, `function p54_tx_pending`, `function p54_wake_queues`, `function p54_tx_qos_accounting_alloc`, `function p54_tx_qos_accounting_free`, `function p54_free_skb`, `function p54_tx`, `function p54_rssi_to_dbm`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.