drivers/net/wireless/mediatek/mt76/mt7615/main.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/mediatek/mt76/mt7615/main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/mediatek/mt76/mt7615/main.c- Extension
.c- Size
- 35078 bytes
- Lines
- 1374
- 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/etherdevice.hlinux/module.hmt7615.hmcu.h
Detected Declarations
function mt7615_dev_runningfunction mt7615_startfunction mt7615_stopfunction get_free_idxfunction get_omac_idxfunction mt7615_add_interfacefunction mt7615_remove_interfacefunction mt7615_set_channelfunction mt7615_set_keyfunction mt7615_set_sar_specsfunction mt7615_configfunction mt7615_conf_txfunction mt7615_configure_filterfunction mt7615_update_mu_groupfunction mt7615_bss_info_changedfunction mt7615_channel_switch_beaconfunction mt7615_mac_sta_addfunction mt7615_mac_sta_removefunction mt7615_sta_rate_tbl_updatefunction mt7615_tx_workerfunction mt7615_txfunction mt7615_set_rts_thresholdfunction mt7615_ampdu_actionfunction mt7615_sta_addfunction mt7615_sta_removefunction mt7615_get_statsfunction mt7615_get_tsffunction mt7615_set_tsffunction mt7615_offset_tsffunction mt7615_set_coverage_classfunction mt7615_set_antennafunction mt7615_roc_iterfunction mt7615_roc_workfunction mt7615_roc_timerfunction mt7615_scan_workfunction mt7615_hw_scanfunction mt7615_cancel_hw_scanfunction mt7615_start_sched_scanfunction mt7615_stop_sched_scanfunction mt7615_remain_on_channelfunction mt7615_cancel_remain_on_channelfunction mt7615_sta_set_decap_offloadfunction mt7615_suspendfunction mt7615_resumefunction mt7615_set_wakeupfunction mt7615_set_rekey_dataexport mt7615_set_channelexport mt7615_mac_sta_add
Annotated Snippet
if (phy->mt76->test.state != MT76_TM_STATE_OFF) {
mt7615_mutex_acquire(dev);
mt76_testmode_reset(phy->mt76, false);
mt7615_mutex_release(dev);
}
#endif
ret = mt76_update_channel(phy->mt76);
}
mt7615_mutex_acquire(dev);
if (changed & IEEE80211_CONF_CHANGE_MONITOR) {
mt76_testmode_reset(phy->mt76, true);
if (!(hw->conf.flags & IEEE80211_CONF_MONITOR))
phy->rxfilter |= MT_WF_RFCR_DROP_OTHER_UC;
else
phy->rxfilter &= ~MT_WF_RFCR_DROP_OTHER_UC;
mt76_wr(dev, MT_WF_RFCR(band), phy->rxfilter);
}
mt7615_mutex_release(dev);
return ret;
}
static int
mt7615_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
unsigned int link_id, u16 queue,
const struct ieee80211_tx_queue_params *params)
{
struct mt76_vif_link *mvif = (struct mt76_vif_link *)vif->drv_priv;
struct mt7615_dev *dev = mt7615_hw_dev(hw);
int err;
mt7615_mutex_acquire(dev);
queue = mt7615_lmac_mapping(dev, queue);
queue += mvif->wmm_idx * MT7615_MAX_WMM_SETS;
err = mt7615_mcu_set_wmm(dev, queue, params);
mt7615_mutex_release(dev);
return err;
}
static void mt7615_configure_filter(struct ieee80211_hw *hw,
unsigned int changed_flags,
unsigned int *total_flags,
u64 multicast)
{
struct mt7615_dev *dev = mt7615_hw_dev(hw);
struct mt7615_phy *phy = mt7615_hw_phy(hw);
bool band = phy != &dev->phy;
u32 ctl_flags = MT_WF_RFCR1_DROP_ACK |
MT_WF_RFCR1_DROP_BF_POLL |
MT_WF_RFCR1_DROP_BA |
MT_WF_RFCR1_DROP_CFEND |
MT_WF_RFCR1_DROP_CFACK;
u32 flags = 0;
mt7615_mutex_acquire(dev);
#define MT76_FILTER(_flag, _hw) do { \
flags |= *total_flags & FIF_##_flag; \
phy->rxfilter &= ~(_hw); \
if (!mt76_testmode_enabled(phy->mt76)) \
phy->rxfilter |= !(flags & FIF_##_flag) * (_hw);\
} while (0)
phy->rxfilter &= ~(MT_WF_RFCR_DROP_OTHER_BSS |
MT_WF_RFCR_DROP_FRAME_REPORT |
MT_WF_RFCR_DROP_PROBEREQ |
MT_WF_RFCR_DROP_MCAST_FILTERED |
MT_WF_RFCR_DROP_MCAST |
MT_WF_RFCR_DROP_BCAST |
MT_WF_RFCR_DROP_DUPLICATE |
MT_WF_RFCR_DROP_A2_BSSID |
MT_WF_RFCR_DROP_UNWANTED_CTL |
MT_WF_RFCR_DROP_STBC_MULTI);
if (phy->n_beacon_vif || !mt7615_firmware_offload(dev))
phy->rxfilter &= ~MT_WF_RFCR_DROP_OTHER_BEACON;
MT76_FILTER(OTHER_BSS, MT_WF_RFCR_DROP_OTHER_TIM |
MT_WF_RFCR_DROP_A3_MAC |
MT_WF_RFCR_DROP_A3_BSSID);
Annotation
- Immediate include surface: `linux/etherdevice.h`, `linux/module.h`, `mt7615.h`, `mcu.h`.
- Detected declarations: `function mt7615_dev_running`, `function mt7615_start`, `function mt7615_stop`, `function get_free_idx`, `function get_omac_idx`, `function mt7615_add_interface`, `function mt7615_remove_interface`, `function mt7615_set_channel`, `function mt7615_set_key`, `function mt7615_set_sar_specs`.
- 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.