STRUCT MT7601U_DEV(9)
π struct mt7601u_dev(9) β the kernel API manual, but make it cute
okay so this is a page from the Kernel API Manual about struct mt7601u_dev, and bestie it is the adapter structure, like the main character of the whole mt7601u driver. let's get into it π«Ά
β¨ NAME β¨
struct mt7601u_dev β the adapter structure. that's it, that's the vibe. she holds the whole adapter together π
πΈ SYNOPSIS πΈ
here's the whole struct, exactly as she lives, no cap, every field in order:
struct mt7601u_dev {
struct ieee80211_hw *hw;
struct device *dev;
unsigned long state;
struct mutex mutex;
unsigned long wcid_mask[N_WCIDS / BITS_PER_LONG];
struct cfg80211_chan_def chandef;
struct ieee80211_supported_band *sband_2g;
struct mt7601u_mcu mcu;
struct delayed_work cal_work;
struct delayed_work mac_work;
struct workqueue_struct *stat_wq;
struct delayed_work stat_work;
struct mt76_wcid *mon_wcid;
struct mt76_wcid *wcid[N_WCIDS];
spinlock_t lock;
spinlock_t mac_lock;
const u16 *beacon_offsets;
u8 macaddr[ETH_ALEN];
struct mt7601u_eeprom_params *ee;
struct mutex vendor_req_mutex;
void *vend_buf;
struct mutex reg_atomic_mutex;
struct mutex hw_atomic_mutex;
u32 rxfilter;
u32 debugfs_reg;
u8 out_eps[8];
u8 in_eps[8];
u16 out_max_packet;
u16 in_max_packet;
spinlock_t tx_lock;
struct tasklet_struct tx_tasklet;
struct mt7601u_tx_queue *tx_q;
struct sk_buff_head tx_skb_done;
atomic_t avg_ampdu_len;
spinlock_t rx_lock;
struct tasklet_struct rx_tasklet;
struct mt7601u_rx_queue rx_q;
spinlock_t con_mon_lock;
u8 ap_bssid[ETH_ALEN];
s8 bcn_freq_off;
u8 bcn_phy_mode;
struct ewma_rssi avg_rssi;
u8 agc_save;
struct mt7601u_freq_cal freq_cal;
bool tssi_read_trig;
s8 tssi_init;
s8 tssi_init_hvga;
s16 tssi_init_hvga_offset_db;
int prev_pwr_diff;
enum mt_temp_mode temp_mode;
int curr_temp;
int dpd_temp;
s8 raw_temp;
bool pll_lock_protect;
u8 bw;
bool chan_ext_below;
u32 rf_pa_mode[2];
struct mac_stats stats;
};
like, that's a lot of fields and honestly? iconic. she's booked and busy π
π Members π
okay so this is the part where the manpage actually tells you what the locks do, which is lowkey the most important part because locks are literally how we don't corrupt everything. pay attention bestie π§
mutexβ ensures exclusive access from mac80211 callbacks. one at a time, please, no shoving πlockβ protectswcid->tx_rate.mac_lockβ locks out mac80211's tx status and rx paths.vendor_req_mutexβ protectsvend_buf, and ensures atomicity of read/write accesses.reg_atomic_mutexβ ensures atomicity of indirect register accesses, meaning accesses to RF and BBP. fancy indirect stuff, she's got it handled β¨hw_atomic_mutexβ ensures exclusive access to HW during critical operations, so that's power management and channel switch. nobody else gets to touch the hardware mid-glow-up π₯tx_lockβ protectstx_qand changes of theMT7601U_STATE_*_STATSflags instate. note the*there, it's a whole family of flags, don't @ me πrx_lockβ protectsrx_q. symmetric queen πΈcon_mon_lockβ protectsap_bssid,bcn_*,avg_rssi. yes, all three, she's a multitasker π
fr fr bestie: these lock descriptions are the whole point of the page. if you mix up which lock guards what, you get a data race and that's not the vibe check you want π
π SEE ALSO π
go read the actual kernel file, that's where the real lore lives:
./drivers/net/wireless/mediatek/mt7601u/mt7601u.h
iykyk, header files are where the truth is β
and that's the page!! this one came from the source path ./drivers/net/wireless/mediate... (yes it got cut off on the original page, that's just how it renders, no cap) and it's dated October 2026. slay, go forth and guard your locks properly bestie ππβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms