drivers/net/wireless/mediatek/mt76/mt7925/main.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/mediatek/mt76/mt7925/main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/mediatek/mt76/mt7925/main.c- Extension
.c- Size
- 70355 bytes
- Lines
- 2559
- 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.
- 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/etherdevice.hlinux/platform_device.hlinux/pci.hlinux/module.hlinux/ctype.hnet/ipv6.hmt7925.hregd.hmcu.hmac.h
Detected Declarations
function mt7925_init_he_capsfunction mt7925_init_eht_capsfunction mt7925_init_mlo_capsfunction __mt7925_set_stream_he_eht_capsfunction mt7925_set_stream_he_eht_capsfunction __mt7925_startfunction mt7925_startfunction mt7925_mac_link_bss_addfunction mt7925_add_interfacefunction mt7925_roc_iterfunction mt7925_roc_abort_syncfunction mt7925_roc_workfunction mt7925_abort_rocfunction mt7925_set_rocfunction mt7925_set_mlo_rocfunction mt7925_remain_on_channelfunction mt7925_cancel_remain_on_channelfunction mt7925_set_link_keyfunction mt7925_set_keyfunction for_each_set_bitfunction mt7925_pm_interface_iterfunction mt7925_sniffer_interface_iterfunction mt7925_set_runtime_pmfunction mt7925_configfunction mt7925_configure_filterfunction mt7925_get_rates_tablefunction mt7925_mac_link_sta_addfunction objectsfunction for_each_set_bitfunction mt7925_mac_sta_add_linksfunction for_each_set_bitfunction mt7925_mac_sta_addfunction mt7925_mac_set_linksfunction mt7925_mac_link_sta_assocfunction mt7925_mac_sta_eventfunction mt7925_mac_link_sta_removefunction mt7925_mac_sta_remove_linksfunction for_each_set_bitfunction mt7925_mac_sta_removefunction mt7925_set_rts_thresholdfunction mt7925_ampdu_actionfunction mt7925_mlo_pm_iterfunction mt7925_mlo_pm_workfunction mt7925_scan_workfunction mt7925_hw_scanfunction mt7925_cancel_hw_scanfunction mt7925_start_sched_scanfunction mt7925_stop_sched_scan
Annotated Snippet
switch (i) {
case NL80211_IFTYPE_STATION:
case NL80211_IFTYPE_AP:
break;
default:
continue;
}
data[n].types_mask = BIT(i);
mt7925_init_he_caps(phy, band, &data[n], i);
mt7925_init_eht_caps(phy, band, &data[n]);
n++;
}
_ieee80211_set_sband_iftype_data(sband, data, n);
}
void mt7925_set_stream_he_eht_caps(struct mt792x_phy *phy)
{
if (phy->mt76->cap.has_2ghz)
__mt7925_set_stream_he_eht_caps(phy, &phy->mt76->sband_2g.sband,
NL80211_BAND_2GHZ);
if (phy->mt76->cap.has_5ghz)
__mt7925_set_stream_he_eht_caps(phy, &phy->mt76->sband_5g.sband,
NL80211_BAND_5GHZ);
if (phy->mt76->cap.has_6ghz)
__mt7925_set_stream_he_eht_caps(phy, &phy->mt76->sband_6g.sband,
NL80211_BAND_6GHZ);
}
int __mt7925_start(struct mt792x_phy *phy)
{
struct mt76_phy *mphy = phy->mt76;
int err;
err = mt7925_mcu_set_channel_domain(mphy);
if (err)
return err;
err = mt7925_mcu_set_rts_thresh(phy, 0x92b);
if (err)
return err;
mt792x_mac_reset_counters(phy);
set_bit(MT76_STATE_RUNNING, &mphy->state);
ieee80211_queue_delayed_work(mphy->hw, &mphy->mac_work,
MT792x_WATCHDOG_TIME);
if (phy->chip_cap & MT792x_CHIP_CAP_WF_RF_PIN_CTRL_EVT_EN)
wiphy_rfkill_start_polling(mphy->hw->wiphy);
return 0;
}
EXPORT_SYMBOL_GPL(__mt7925_start);
static int mt7925_start(struct ieee80211_hw *hw)
{
struct mt792x_phy *phy = mt792x_hw_phy(hw);
int err;
mt792x_mutex_acquire(phy->dev);
err = __mt7925_start(phy);
mt792x_mutex_release(phy->dev);
return err;
}
static int mt7925_mac_link_bss_add(struct mt792x_dev *dev,
struct ieee80211_bss_conf *link_conf,
struct mt792x_link_sta *mlink)
{
struct mt792x_bss_conf *mconf = mt792x_link_conf_to_mconf(link_conf);
struct ieee80211_vif *vif = link_conf->vif;
struct mt792x_vif *mvif = mconf->vif;
struct mt76_txq *mtxq;
int idx, ret = 0;
if (vif->type == NL80211_IFTYPE_P2P_DEVICE) {
mconf->mt76.idx = MT792x_MAX_INTERFACES;
} else {
mconf->mt76.idx = __ffs64(~dev->mt76.vif_mask);
if (mconf->mt76.idx >= MT792x_MAX_INTERFACES) {
ret = -ENOSPC;
goto out;
}
Annotation
- Immediate include surface: `linux/etherdevice.h`, `linux/platform_device.h`, `linux/pci.h`, `linux/module.h`, `linux/ctype.h`, `net/ipv6.h`, `mt7925.h`, `regd.h`.
- Detected declarations: `function mt7925_init_he_caps`, `function mt7925_init_eht_caps`, `function mt7925_init_mlo_caps`, `function __mt7925_set_stream_he_eht_caps`, `function mt7925_set_stream_he_eht_caps`, `function __mt7925_start`, `function mt7925_start`, `function mt7925_mac_link_bss_add`, `function mt7925_add_interface`, `function mt7925_roc_iter`.
- 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.