drivers/net/wireless/broadcom/b43/xmit.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/b43/xmit.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/b43/xmit.c- Extension
.c- Size
- 24952 bytes
- Lines
- 915
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
xmit.hphy_common.hdma.hpio.h
Detected Declarations
function b43_tx_legacy_rate_phy_ctl_entfunction b43_plcp_get_bitrate_idx_cckfunction b43_plcp_get_bitrate_idx_ofdmfunction b43_plcp_get_ratecode_cckfunction b43_plcp_get_ratecode_ofdmfunction b43_generate_plcp_hdrfunction b43_generate_tx_phy_ctl1function b43_calc_fallback_ratefunction b43_generate_txhdrfunction b43_rssi_postprocessfunction b43_rxfunction b43_handle_txstatusfunction b43_fill_txstatus_reportfunction b43_tx_suspendfunction b43_tx_resume
Annotated Snippet
if ((octets * 16 % bitrate) > 0) {
plen++;
if ((bitrate == B43_CCK_RATE_11MB)
&& ((octets * 8 % 11) < 4)) {
raw[1] = 0x84;
} else
raw[1] = 0x04;
} else
raw[1] = 0x04;
plcp->data |= cpu_to_le32(plen << 16);
raw[0] = b43_plcp_get_ratecode_cck(bitrate);
}
}
/* TODO: verify if needed for SSLPN or LCN */
static u16 b43_generate_tx_phy_ctl1(struct b43_wldev *dev, u8 bitrate)
{
const struct b43_phy *phy = &dev->phy;
const struct b43_tx_legacy_rate_phy_ctl_entry *e;
u16 control = 0;
u16 bw;
if (phy->type == B43_PHYTYPE_LP)
bw = B43_TXH_PHY1_BW_20;
else /* FIXME */
bw = B43_TXH_PHY1_BW_20;
if (0) { /* FIXME: MIMO */
} else if (b43_is_cck_rate(bitrate) && phy->type != B43_PHYTYPE_LP) {
control = bw;
} else {
control = bw;
e = b43_tx_legacy_rate_phy_ctl_ent(bitrate);
if (e) {
control |= e->coding_rate;
control |= e->modulation;
}
control |= B43_TXH_PHY1_MODE_SISO;
}
return control;
}
static u8 b43_calc_fallback_rate(u8 bitrate, int gmode)
{
switch (bitrate) {
case B43_CCK_RATE_1MB:
return B43_CCK_RATE_1MB;
case B43_CCK_RATE_2MB:
return B43_CCK_RATE_1MB;
case B43_CCK_RATE_5MB:
return B43_CCK_RATE_2MB;
case B43_CCK_RATE_11MB:
return B43_CCK_RATE_5MB;
/*
* Don't just fallback to CCK; it may be in 5GHz operation
* and falling back to CCK won't work out very well.
*/
case B43_OFDM_RATE_6MB:
if (gmode)
return B43_CCK_RATE_5MB;
else
return B43_OFDM_RATE_6MB;
case B43_OFDM_RATE_9MB:
return B43_OFDM_RATE_6MB;
case B43_OFDM_RATE_12MB:
return B43_OFDM_RATE_9MB;
case B43_OFDM_RATE_18MB:
return B43_OFDM_RATE_12MB;
case B43_OFDM_RATE_24MB:
return B43_OFDM_RATE_18MB;
case B43_OFDM_RATE_36MB:
return B43_OFDM_RATE_24MB;
case B43_OFDM_RATE_48MB:
return B43_OFDM_RATE_36MB;
case B43_OFDM_RATE_54MB:
return B43_OFDM_RATE_48MB;
}
B43_WARN_ON(1);
return 0;
}
/* Generate a TX data header. */
int b43_generate_txhdr(struct b43_wldev *dev,
u8 *_txhdr,
struct sk_buff *skb_frag,
struct ieee80211_tx_info *info,
u16 cookie)
{
const unsigned char *fragment_data = skb_frag->data;
Annotation
- Immediate include surface: `xmit.h`, `phy_common.h`, `dma.h`, `pio.h`.
- Detected declarations: `function b43_tx_legacy_rate_phy_ctl_ent`, `function b43_plcp_get_bitrate_idx_cck`, `function b43_plcp_get_bitrate_idx_ofdm`, `function b43_plcp_get_ratecode_cck`, `function b43_plcp_get_ratecode_ofdm`, `function b43_generate_plcp_hdr`, `function b43_generate_tx_phy_ctl1`, `function b43_calc_fallback_rate`, `function b43_generate_txhdr`, `function b43_rssi_postprocess`.
- 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.