Lines Matching refs:dev
13 struct mt7601u_dev *dev = hw->priv; in mt7601u_start() local
16 mutex_lock(&dev->mutex); in mt7601u_start()
18 ret = mt7601u_mac_start(dev); in mt7601u_start()
22 ieee80211_queue_delayed_work(dev->hw, &dev->mac_work, in mt7601u_start()
24 ieee80211_queue_delayed_work(dev->hw, &dev->cal_work, in mt7601u_start()
27 mutex_unlock(&dev->mutex); in mt7601u_start()
33 struct mt7601u_dev *dev = hw->priv; in mt7601u_stop() local
35 mutex_lock(&dev->mutex); in mt7601u_stop()
37 cancel_delayed_work_sync(&dev->cal_work); in mt7601u_stop()
38 cancel_delayed_work_sync(&dev->mac_work); in mt7601u_stop()
39 mt7601u_mac_stop(dev); in mt7601u_stop()
41 mutex_unlock(&dev->mutex); in mt7601u_stop()
47 struct mt7601u_dev *dev = hw->priv; in mt7601u_add_interface() local
59 if (!ether_addr_equal(dev->macaddr, vif->addr)) in mt7601u_add_interface()
60 mt7601u_set_macaddr(dev, vif->addr); in mt7601u_add_interface()
62 if (dev->wcid_mask[wcid / BITS_PER_LONG] & BIT(wcid % BITS_PER_LONG)) in mt7601u_add_interface()
64 dev->wcid_mask[wcid / BITS_PER_LONG] |= BIT(wcid % BITS_PER_LONG); in mt7601u_add_interface()
74 struct mt7601u_dev *dev = hw->priv; in mt7601u_remove_interface() local
78 dev->wcid_mask[wcid / BITS_PER_LONG] &= ~BIT(wcid % BITS_PER_LONG); in mt7601u_remove_interface()
83 struct mt7601u_dev *dev = hw->priv; in mt7601u_config() local
86 mutex_lock(&dev->mutex); in mt7601u_config()
90 ret = mt7601u_phy_set_channel(dev, &hw->conf.chandef); in mt7601u_config()
94 mutex_unlock(&dev->mutex); in mt7601u_config()
103 struct mt7601u_dev *dev = hw->priv; in mt76_configure_filter() local
108 dev->rxfilter &= ~(_hw); \ in mt76_configure_filter()
109 dev->rxfilter |= !(flags & FIF_##_flag) * (_hw); \ in mt76_configure_filter()
112 mutex_lock(&dev->mutex); in mt76_configure_filter()
114 dev->rxfilter &= ~MT_RX_FILTR_CFG_OTHER_BSS; in mt76_configure_filter()
128 mt76_wr(dev, MT_RX_FILTR_CFG, dev->rxfilter); in mt76_configure_filter()
130 mutex_unlock(&dev->mutex); in mt76_configure_filter()
137 struct mt7601u_dev *dev = hw->priv; in mt7601u_bss_info_changed() local
139 mutex_lock(&dev->mutex); in mt7601u_bss_info_changed()
142 mt7601u_phy_con_cal_onoff(dev, info); in mt7601u_bss_info_changed()
145 mt7601u_addr_wr(dev, MT_MAC_BSSID_DW0, info->bssid); in mt7601u_bss_info_changed()
152 mt7601u_mac_config_tsf(dev, false, 0); in mt7601u_bss_info_changed()
156 mt7601u_wr(dev, MT_LEGACY_BASIC_RATE, info->basic_rates); in mt7601u_bss_info_changed()
157 mt7601u_wr(dev, MT_HT_FBK_CFG0, 0x65432100); in mt7601u_bss_info_changed()
158 mt7601u_wr(dev, MT_HT_FBK_CFG1, 0xedcba980); in mt7601u_bss_info_changed()
159 mt7601u_wr(dev, MT_LG_FBK_CFG0, 0xedcba988); in mt7601u_bss_info_changed()
160 mt7601u_wr(dev, MT_LG_FBK_CFG1, 0x00002100); in mt7601u_bss_info_changed()
164 mt7601u_mac_config_tsf(dev, true, info->beacon_int); in mt7601u_bss_info_changed()
167 mt7601u_mac_set_protection(dev, info->use_cts_prot, in mt7601u_bss_info_changed()
171 mt7601u_mac_set_short_preamble(dev, info->use_short_preamble); in mt7601u_bss_info_changed()
176 mt76_rmw_field(dev, MT_BKOFF_SLOT_CFG, in mt7601u_bss_info_changed()
181 mt7601u_phy_recalibrate_after_assoc(dev); in mt7601u_bss_info_changed()
183 mutex_unlock(&dev->mutex); in mt7601u_bss_info_changed()
187 mt76_wcid_alloc(struct mt7601u_dev *dev) in mt76_wcid_alloc() argument
191 for (i = 0; i < ARRAY_SIZE(dev->wcid_mask); i++) { in mt76_wcid_alloc()
192 idx = ffs(~dev->wcid_mask[i]); in mt76_wcid_alloc()
197 dev->wcid_mask[i] |= BIT(idx); in mt76_wcid_alloc()
212 struct mt7601u_dev *dev = hw->priv; in mt7601u_sta_add() local
218 mutex_lock(&dev->mutex); in mt7601u_sta_add()
220 idx = mt76_wcid_alloc(dev); in mt7601u_sta_add()
228 mt7601u_mac_wcid_setup(dev, idx, mvif->idx, sta->addr); in mt7601u_sta_add()
229 mt76_clear(dev, MT_WCID_DROP(idx), MT_WCID_DROP_MASK(idx)); in mt7601u_sta_add()
230 rcu_assign_pointer(dev->wcid[idx], &msta->wcid); in mt7601u_sta_add()
231 mt7601u_mac_set_ampdu_factor(dev); in mt7601u_sta_add()
234 mutex_unlock(&dev->mutex); in mt7601u_sta_add()
243 struct mt7601u_dev *dev = hw->priv; in mt7601u_sta_remove() local
247 mutex_lock(&dev->mutex); in mt7601u_sta_remove()
248 rcu_assign_pointer(dev->wcid[idx], NULL); in mt7601u_sta_remove()
249 mt76_set(dev, MT_WCID_DROP(idx), MT_WCID_DROP_MASK(idx)); in mt7601u_sta_remove()
250 dev->wcid_mask[idx / BITS_PER_LONG] &= ~BIT(idx % BITS_PER_LONG); in mt7601u_sta_remove()
251 mt7601u_mac_wcid_setup(dev, idx, 0, NULL); in mt7601u_sta_remove()
252 mt7601u_mac_set_ampdu_factor(dev); in mt7601u_sta_remove()
253 mutex_unlock(&dev->mutex); in mt7601u_sta_remove()
269 struct mt7601u_dev *dev = hw->priv; in mt7601u_sw_scan() local
271 mt7601u_agc_save(dev); in mt7601u_sw_scan()
272 set_bit(MT7601U_STATE_SCANNING, &dev->state); in mt7601u_sw_scan()
279 struct mt7601u_dev *dev = hw->priv; in mt7601u_sw_scan_complete() local
281 mt7601u_agc_restore(dev); in mt7601u_sw_scan_complete()
282 clear_bit(MT7601U_STATE_SCANNING, &dev->state); in mt7601u_sw_scan_complete()
284 ieee80211_queue_delayed_work(dev->hw, &dev->cal_work, in mt7601u_sw_scan_complete()
286 if (dev->freq_cal.enabled) in mt7601u_sw_scan_complete()
287 ieee80211_queue_delayed_work(dev->hw, &dev->freq_cal.work, in mt7601u_sw_scan_complete()
296 struct mt7601u_dev *dev = hw->priv; in mt7601u_set_key() local
326 ret = mt76_mac_wcid_set_key(dev, wcid->idx, key); in mt7601u_set_key()
331 return mt76_mac_shared_key_setup(dev, mvif->idx, idx, key); in mt7601u_set_key()
334 return mt76_mac_wcid_set_key(dev, msta->wcid.idx, key); in mt7601u_set_key()
339 struct mt7601u_dev *dev = hw->priv; in mt7601u_set_rts_threshold() local
341 mt76_rmw_field(dev, MT_TX_RTS_CFG, MT_TX_RTS_CFG_THRESH, value); in mt7601u_set_rts_threshold()
350 struct mt7601u_dev *dev = hw->priv; in mt76_ampdu_action() local
361 mt76_set(dev, MT_WCID_ADDR(msta->wcid.idx) + 4, BIT(16 + tid)); in mt76_ampdu_action()
364 mt76_clear(dev, MT_WCID_ADDR(msta->wcid.idx) + 4, in mt76_ampdu_action()
388 struct mt7601u_dev *dev = hw->priv; in mt76_sta_rate_tbl_update() local
401 mt76_mac_wcid_set_rate(dev, &msta->wcid, &rate); in mt76_sta_rate_tbl_update()