drivers/net/wireless/intersil/p54/fwio.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intersil/p54/fwio.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intersil/p54/fwio.c- Extension
.c- Size
- 20894 bytes
- Lines
- 762
- 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/slab.hlinux/firmware.hlinux/etherdevice.hlinux/export.hnet/mac80211.hp54.heeprom.hlmac.h
Detected Declarations
function Copyrightfunction p54_download_eepromfunction p54_update_beacon_timfunction p54_sta_unlockfunction p54_tx_cancelfunction p54_setup_macfunction p54_scanfunction p54_set_ledsfunction p54_set_edcffunction p54_set_psfunction p54_init_xbow_synthfunction p54_upload_keyfunction p54_fetch_statisticsfunction p54_set_groupfilterexport p54_parse_firmware
Annotated Snippet
switch (code) {
case BR_CODE_COMPONENT_ID:
priv->fw_interface = be32_to_cpup((__be32 *)
bootrec->data);
switch (priv->fw_interface) {
case FW_LM86:
case FW_LM20:
case FW_LM87: {
char *iftype = (char *)bootrec->data;
wiphy_info(priv->hw->wiphy,
"p54 detected a LM%c%c firmware\n",
iftype[2], iftype[3]);
break;
}
case FW_FMAC:
default:
wiphy_err(priv->hw->wiphy,
"unsupported firmware\n");
return -ENODEV;
}
break;
case BR_CODE_COMPONENT_VERSION:
/* 24 bytes should be enough for all firmwares */
if (strnlen((unsigned char *) bootrec->data, 24) < 24)
fw_version = (unsigned char *) bootrec->data;
break;
case BR_CODE_DESCR: {
struct bootrec_desc *desc =
(struct bootrec_desc *)bootrec->data;
priv->rx_start = le32_to_cpu(desc->rx_start);
/* FIXME add sanity checking */
priv->rx_end = le32_to_cpu(desc->rx_end) - 0x3500;
priv->headroom = desc->headroom;
priv->tailroom = desc->tailroom;
priv->privacy_caps = desc->privacy_caps;
priv->rx_keycache_size = desc->rx_keycache_size;
if (le32_to_cpu(bootrec->len) == 11)
priv->rx_mtu = le16_to_cpu(desc->rx_mtu);
else
priv->rx_mtu = (size_t)
0x620 - priv->tx_hdr_len;
maxlen = priv->tx_hdr_len + /* USB devices */
sizeof(struct p54_rx_data) +
4 + /* rx alignment */
IEEE80211_MAX_FRAG_THRESHOLD;
if (priv->rx_mtu > maxlen && PAGE_SIZE == 4096) {
printk(KERN_INFO "p54: rx_mtu reduced from %d "
"to %d\n", priv->rx_mtu, maxlen);
priv->rx_mtu = maxlen;
}
break;
}
case BR_CODE_EXPOSED_IF:
exp_if = (struct exp_if *) bootrec->data;
for (i = 0; i < (len * sizeof(*exp_if) / 4); i++)
if (exp_if[i].if_id == cpu_to_le16(IF_ID_LMAC))
priv->fw_var = le16_to_cpu(exp_if[i].variant);
break;
case BR_CODE_DEPENDENT_IF:
break;
case BR_CODE_END_OF_BRA:
case LEGACY_BR_CODE_END_OF_BRA:
end_data = NULL;
break;
default:
break;
}
bootrec = (struct bootrec *)&bootrec->data[len];
}
if (fw_version) {
wiphy_info(priv->hw->wiphy,
"FW rev %s - Softmac protocol %x.%x\n",
fw_version, priv->fw_var >> 8, priv->fw_var & 0xff);
snprintf(dev->wiphy->fw_version, sizeof(dev->wiphy->fw_version),
"%.19s - %x.%x", fw_version,
priv->fw_var >> 8, priv->fw_var & 0xff);
}
if (priv->fw_var < 0x500)
wiphy_info(priv->hw->wiphy,
"you are using an obsolete firmware. "
"visit http://wireless.wiki.kernel.org/en/users/Drivers/p54 "
"and grab one for \"kernel >= 2.6.28\"!\n");
if (priv->fw_var >= 0x300) {
/* Firmware supports QoS, use it! */
if (priv->fw_var >= 0x500) {
priv->tx_stats[P54_QUEUE_AC_VO].limit = 16;
Annotation
- Immediate include surface: `linux/slab.h`, `linux/firmware.h`, `linux/etherdevice.h`, `linux/export.h`, `net/mac80211.h`, `p54.h`, `eeprom.h`, `lmac.h`.
- Detected declarations: `function Copyright`, `function p54_download_eeprom`, `function p54_update_beacon_tim`, `function p54_sta_unlock`, `function p54_tx_cancel`, `function p54_setup_mac`, `function p54_scan`, `function p54_set_leds`, `function p54_set_edcf`, `function p54_set_ps`.
- 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.