drivers/net/wireless/zydas/zd1211rw/zd_mac.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/zydas/zd1211rw/zd_mac.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/zydas/zd1211rw/zd_mac.c- Extension
.c- Size
- 40959 bytes
- Lines
- 1547
- 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.
- 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
linux/netdevice.hlinux/etherdevice.hlinux/slab.hlinux/usb.hlinux/jiffies.hnet/ieee80211_radiotap.hzd_def.hzd_chip.hzd_mac.hzd_rf.h
Detected Declarations
struct zd_reg_alpha2_mapfunction zd_reg2alpha2function zd_check_signalfunction zd_mac_preinit_hwfunction zd_mac_init_hwfunction zd_mac_clearfunction set_rx_filterfunction set_mac_and_bssidfunction set_mc_hashfunction zd_op_startfunction zd_op_stopfunction zd_restore_settingsfunction ieee80211_tx_status_irqsafefunction zd_mac_tx_failedfunction skb_queue_walkfunction zd_mac_tx_to_devfunction zd_calc_tx_length_usfunction cs_set_controlfunction zd_mac_match_cur_beaconfunction zd_mac_free_cur_beacon_lockedfunction zd_mac_free_cur_beaconfunction zd_mac_config_beaconfunction fill_ctrlsetfunction zd_op_txfunction filter_ackfunction zd_mac_rxfunction zd_op_add_interfacefunction zd_op_remove_interfacefunction zd_op_configfunction zd_beacon_donefunction zd_process_intrfunction zd_op_prepare_multicastfunction netdev_hw_addr_list_for_eachfunction zd_op_configure_filterfunction filterfunction zd_op_bss_info_changedfunction zd_op_get_tsffunction beacon_watchdog_handlerfunction beacon_initfunction beacon_enablefunction beacon_disablefunction link_led_handlerfunction housekeeping_initfunction housekeeping_enablefunction housekeeping_disable
Annotated Snippet
struct zd_reg_alpha2_map {
u32 reg;
char alpha2[2] __nonstring;
};
static struct zd_reg_alpha2_map reg_alpha2_map[] = {
{ ZD_REGDOMAIN_FCC, "US" },
{ ZD_REGDOMAIN_IC, "CA" },
{ ZD_REGDOMAIN_ETSI, "DE" }, /* Generic ETSI, use most restrictive */
{ ZD_REGDOMAIN_JAPAN, "JP" },
{ ZD_REGDOMAIN_JAPAN_2, "JP" },
{ ZD_REGDOMAIN_JAPAN_3, "JP" },
{ ZD_REGDOMAIN_SPAIN, "ES" },
{ ZD_REGDOMAIN_FRANCE, "FR" },
};
/* This table contains the hardware specific values for the modulation rates. */
static const struct ieee80211_rate zd_rates[] = {
{ .bitrate = 10,
.hw_value = ZD_CCK_RATE_1M, },
{ .bitrate = 20,
.hw_value = ZD_CCK_RATE_2M,
.hw_value_short = ZD_CCK_RATE_2M | ZD_CCK_PREA_SHORT,
.flags = IEEE80211_RATE_SHORT_PREAMBLE },
{ .bitrate = 55,
.hw_value = ZD_CCK_RATE_5_5M,
.hw_value_short = ZD_CCK_RATE_5_5M | ZD_CCK_PREA_SHORT,
.flags = IEEE80211_RATE_SHORT_PREAMBLE },
{ .bitrate = 110,
.hw_value = ZD_CCK_RATE_11M,
.hw_value_short = ZD_CCK_RATE_11M | ZD_CCK_PREA_SHORT,
.flags = IEEE80211_RATE_SHORT_PREAMBLE },
{ .bitrate = 60,
.hw_value = ZD_OFDM_RATE_6M,
.flags = 0 },
{ .bitrate = 90,
.hw_value = ZD_OFDM_RATE_9M,
.flags = 0 },
{ .bitrate = 120,
.hw_value = ZD_OFDM_RATE_12M,
.flags = 0 },
{ .bitrate = 180,
.hw_value = ZD_OFDM_RATE_18M,
.flags = 0 },
{ .bitrate = 240,
.hw_value = ZD_OFDM_RATE_24M,
.flags = 0 },
{ .bitrate = 360,
.hw_value = ZD_OFDM_RATE_36M,
.flags = 0 },
{ .bitrate = 480,
.hw_value = ZD_OFDM_RATE_48M,
.flags = 0 },
{ .bitrate = 540,
.hw_value = ZD_OFDM_RATE_54M,
.flags = 0 },
};
/*
* Zydas retry rates table. Each line is listed in the same order as
* in zd_rates[] and contains all the rate used when a packet is sent
* starting with a given rates. Let's consider an example :
*
* "11 Mbits : 4, 3, 2, 1, 0" means :
* - packet is sent using 4 different rates
* - 1st rate is index 3 (ie 11 Mbits)
* - 2nd rate is index 2 (ie 5.5 Mbits)
* - 3rd rate is index 1 (ie 2 Mbits)
* - 4th rate is index 0 (ie 1 Mbits)
*/
static const struct tx_retry_rate zd_retry_rates[] = {
{ /* 1 Mbits */ 1, { 0 }},
{ /* 2 Mbits */ 2, { 1, 0 }},
{ /* 5.5 Mbits */ 3, { 2, 1, 0 }},
{ /* 11 Mbits */ 4, { 3, 2, 1, 0 }},
{ /* 6 Mbits */ 5, { 4, 3, 2, 1, 0 }},
{ /* 9 Mbits */ 6, { 5, 4, 3, 2, 1, 0}},
{ /* 12 Mbits */ 5, { 6, 3, 2, 1, 0 }},
{ /* 18 Mbits */ 6, { 7, 6, 3, 2, 1, 0 }},
{ /* 24 Mbits */ 6, { 8, 6, 3, 2, 1, 0 }},
{ /* 36 Mbits */ 7, { 9, 8, 6, 3, 2, 1, 0 }},
{ /* 48 Mbits */ 8, {10, 9, 8, 6, 3, 2, 1, 0 }},
{ /* 54 Mbits */ 9, {11, 10, 9, 8, 6, 3, 2, 1, 0 }}
};
static const struct ieee80211_channel zd_channels[] = {
{ .center_freq = 2412, .hw_value = 1 },
{ .center_freq = 2417, .hw_value = 2 },
{ .center_freq = 2422, .hw_value = 3 },
Annotation
- Immediate include surface: `linux/netdevice.h`, `linux/etherdevice.h`, `linux/slab.h`, `linux/usb.h`, `linux/jiffies.h`, `net/ieee80211_radiotap.h`, `zd_def.h`, `zd_chip.h`.
- Detected declarations: `struct zd_reg_alpha2_map`, `function zd_reg2alpha2`, `function zd_check_signal`, `function zd_mac_preinit_hw`, `function zd_mac_init_hw`, `function zd_mac_clear`, `function set_rx_filter`, `function set_mac_and_bssid`, `function set_mc_hash`, `function zd_op_start`.
- 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.