drivers/net/wireless/st/cw1200/txrx.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/st/cw1200/txrx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/st/cw1200/txrx.c- Extension
.c- Size
- 39415 bytes
- Lines
- 1466
- 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.
- 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
net/mac80211.hlinux/etherdevice.hlinux/skbuff.hcw1200.hwsm.hbh.hsta.hdebug.h
Detected Declarations
struct cw1200_txinfofunction cw1200_tx_queues_lockfunction cw1200_tx_queues_unlockfunction tx_policy_dumpfunction tx_policy_buildfunction timefunction tx_policy_is_equalfunction tx_policy_findfunction tx_policy_usefunction tx_policy_releasefunction tx_policy_cleanfunction tx_policy_initfunction tx_policy_getfunction tx_policy_putfunction tx_policy_uploadfunction tx_policy_upload_workfunction cw1200_rate_mask_to_wsmfunction cw1200_get_tx_ratefunction cw1200_tx_h_calc_link_idsfunction cw1200_tx_h_pmfunction cw1200_tx_h_calc_tidfunction cw1200_tx_h_cryptfunction cw1200_tx_h_alignfunction cw1200_tx_h_actionfunction cw1200_tx_h_wsmfunction cw1200_tx_h_btfunction ieee80211_is_reassoc_reqfunction cw1200_tx_h_rate_policyfunction cw1200_tx_h_pm_statefunction cw1200_txfunction cw1200_handle_action_rxfunction cw1200_handle_pspollfunction cw1200_tx_confirm_cbfunction cw1200_notify_buffered_txfunction cw1200_skb_dtorfunction cw1200_rx_cbfunction ieee80211_is_actionfunction ether_addr_equalfunction cw1200_alloc_keyfunction cw1200_free_keyfunction cw1200_free_keysfunction cw1200_upload_keysfunction cw1200_link_id_resetfunction cw1200_find_link_idfunction cw1200_alloc_link_idfunction cw1200_link_id_workfunction cw1200_link_id_gc_work
Annotated Snippet
struct cw1200_txinfo {
struct sk_buff *skb;
unsigned queue;
struct ieee80211_tx_info *tx_info;
const struct ieee80211_rate *rate;
struct ieee80211_hdr *hdr;
size_t hdrlen;
const u8 *da;
struct cw1200_sta_priv *sta_priv;
struct ieee80211_sta *sta;
struct cw1200_txpriv txpriv;
};
u32 cw1200_rate_mask_to_wsm(struct cw1200_common *priv, u32 rates)
{
u32 ret = 0;
int i;
for (i = 0; i < 32; ++i) {
if (rates & BIT(i))
ret |= BIT(priv->rates[i].hw_value);
}
return ret;
}
static const struct ieee80211_rate *
cw1200_get_tx_rate(const struct cw1200_common *priv,
const struct ieee80211_tx_rate *rate)
{
if (rate->idx < 0)
return NULL;
if (rate->flags & IEEE80211_TX_RC_MCS)
return &priv->mcs_rates[rate->idx];
return &priv->hw->wiphy->bands[priv->channel->band]->
bitrates[rate->idx];
}
static int
cw1200_tx_h_calc_link_ids(struct cw1200_common *priv,
struct cw1200_txinfo *t)
{
if (t->sta && t->sta_priv->link_id)
t->txpriv.raw_link_id =
t->txpriv.link_id =
t->sta_priv->link_id;
else if (priv->mode != NL80211_IFTYPE_AP)
t->txpriv.raw_link_id =
t->txpriv.link_id = 0;
else if (is_multicast_ether_addr(t->da)) {
if (priv->enable_beacon) {
t->txpriv.raw_link_id = 0;
t->txpriv.link_id = CW1200_LINK_ID_AFTER_DTIM;
} else {
t->txpriv.raw_link_id = 0;
t->txpriv.link_id = 0;
}
} else {
t->txpriv.link_id = cw1200_find_link_id(priv, t->da);
if (!t->txpriv.link_id)
t->txpriv.link_id = cw1200_alloc_link_id(priv, t->da);
if (!t->txpriv.link_id) {
wiphy_err(priv->hw->wiphy,
"No more link IDs available.\n");
return -ENOENT;
}
t->txpriv.raw_link_id = t->txpriv.link_id;
}
if (t->txpriv.raw_link_id)
priv->link_id_db[t->txpriv.raw_link_id - 1].timestamp =
jiffies;
if (t->sta && (t->sta->uapsd_queues & BIT(t->queue)))
t->txpriv.link_id = CW1200_LINK_ID_UAPSD;
return 0;
}
static void
cw1200_tx_h_pm(struct cw1200_common *priv,
struct cw1200_txinfo *t)
{
if (ieee80211_is_auth(t->hdr->frame_control)) {
u32 mask = ~BIT(t->txpriv.raw_link_id);
spin_lock_bh(&priv->ps_state_lock);
priv->sta_asleep_mask &= mask;
priv->pspoll_mask &= mask;
spin_unlock_bh(&priv->ps_state_lock);
}
}
static void
cw1200_tx_h_calc_tid(struct cw1200_common *priv,
struct cw1200_txinfo *t)
Annotation
- Immediate include surface: `net/mac80211.h`, `linux/etherdevice.h`, `linux/skbuff.h`, `cw1200.h`, `wsm.h`, `bh.h`, `sta.h`, `debug.h`.
- Detected declarations: `struct cw1200_txinfo`, `function cw1200_tx_queues_lock`, `function cw1200_tx_queues_unlock`, `function tx_policy_dump`, `function tx_policy_build`, `function time`, `function tx_policy_is_equal`, `function tx_policy_find`, `function tx_policy_use`, `function tx_policy_release`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.