/freebsd/sys/contrib/dev/mediatek/mt76/ |
H A D | tx.c | 65 struct mt76_wcid *wcid; in mt76_tx_status_unlock() local 67 wcid = rcu_dereference(dev->wcid[cb->wcid]); in mt76_tx_status_unlock() 68 if (wcid) { in mt76_tx_status_unlock() 69 status.sta = wcid_to_sta(wcid); in mt76_tx_status_unlock() 70 if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) { in mt76_tx_status_unlock() 71 rs.rate_idx = wcid->rate; in mt76_tx_status_unlock() 121 mt76_tx_status_skb_add(struct mt76_dev *dev, struct mt76_wcid *wcid, in mt76_tx_status_skb_add() argument 131 if (!wcid || !rcu_access_pointer(dev->wcid[wcid->idx])) in mt76_tx_status_skb_add() 149 pid = idr_alloc(&wcid->pktid, skb, MT_PACKET_ID_FIRST, in mt76_tx_status_skb_add() 156 cb->wcid = wcid->idx; in mt76_tx_status_skb_add() [all …]
|
H A D | mt76x02_txrx.c | 17 struct mt76_wcid *wcid = &dev->mt76.global_wcid; in mt76x02_tx() local 23 wcid = &msta->wcid; in mt76x02_tx() 28 wcid = &mvif->group_wcid; in mt76x02_tx() 31 mt76_tx(&dev->mphy, control->sta, wcid, skb); in mt76x02_tx() 138 enum mt76_txq_id qid, struct mt76_wcid *wcid, in mt76x02_tx_prepare_skb() argument 148 if (qid == MT_TXQ_PSD && wcid && wcid->idx < 128) in mt76x02_tx_prepare_skb() 149 mt76x02_mac_wcid_set_drop(dev, wcid->idx, false); in mt76x02_tx_prepare_skb() 153 mt76x02_mac_write_txwi(dev, txwi, tx_info->skb, wcid, sta, len); in mt76x02_tx_prepare_skb() 155 pid = mt76_tx_status_skb_add(mdev, wcid, tx_info->skb); in mt76x02_tx_prepare_skb() 172 if (!wcid || wcid->hw_key_idx == 0xff || wcid->sw_iv) in mt76x02_tx_prepare_skb()
|
H A D | mt76_connac_mac.c | 83 struct mt76_wcid *wcid) in mt76_connac_free_pending_tx_skbs() argument 89 if (wcid && pm->tx_q[i].wcid != wcid) in mt76_connac_free_pending_tx_skbs() 101 struct mt76_wcid *wcid, in mt76_connac_pm_queue_skb() argument 110 pm->tx_q[qid].wcid = wcid; in mt76_connac_pm_queue_skb() 127 struct mt76_wcid *wcid = pm->tx_q[i].wcid; in mt76_connac_pm_dequeue_skbs() local 133 if (wcid && wcid->sta) in mt76_connac_pm_dequeue_skbs() 134 sta = container_of((void *)wcid, struct ieee80211_sta, in mt76_connac_pm_dequeue_skbs() 137 mt76_tx(phy, sta, wcid, pm->tx_q[i].skb); in mt76_connac_pm_dequeue_skbs() 172 mt76_tx_complete_skb(mdev, e->wcid, e->skb); in mt76_connac_tx_complete_skb() 358 struct mt76_wcid *wcid) in mt76_connac2_mac_write_txwi_8023() argument [all …]
|
H A D | mt76x02_util.c | 253 msta->wcid.sta = 1; in mt76x02_sta_add() 254 msta->wcid.idx = idx; in mt76x02_sta_add() 255 msta->wcid.hw_key_idx = -1; in mt76x02_sta_add() 261 set_bit(MT_WCID_FLAG_CHECK_PS, &msta->wcid.flags); in mt76x02_sta_add() 271 struct mt76_wcid *wcid = (struct mt76_wcid *)sta->drv_priv; in mt76x02_sta_remove() local 272 int idx = wcid->idx; in mt76x02_sta_remove() 294 rcu_assign_pointer(dev->mt76.wcid[MT_VIF_WCID(idx)], &mvif->group_wcid); in mt76x02_vif_init() 295 mtxq->wcid = MT_VIF_WCID(idx); in mt76x02_vif_init() 348 rcu_assign_pointer(dev->mt76.wcid[mvif->group_wcid.idx], NULL); in mt76x02_remove_interface() 374 mt76_rx_aggr_start(&dev->mt76, &msta->wcid, tid, in mt76x02_ampdu_action() [all …]
|
H A D | trace.h | 27 #define TXID_ENTRY __field(u8, wcid) __field(u8, pktid) 28 #define TXID_ASSIGN __entry->wcid = wcid; __entry->pktid = pktid 30 #define TXID_PR_ARG __entry->wcid, __entry->pktid 83 TP_PROTO(struct mt76_dev *dev, u8 wcid, u8 pktid), 84 TP_ARGS(dev, wcid, pktid), 100 TP_PROTO(struct mt76_dev *dev, u8 wcid, u8 pktid), 101 TP_ARGS(dev, wcid, pktid)
|
H A D | mac80211.c | 1028 void mt76_wcid_key_setup(struct mt76_dev *dev, struct mt76_wcid *wcid, in mt76_wcid_key_setup() argument 1034 wcid->rx_check_pn = false; in mt76_wcid_key_setup() 1042 wcid->rx_check_pn = true; in mt76_wcid_key_setup() 1047 memcpy(wcid->rx_key_pn[i], seq.ccmp.pn, sizeof(seq.ccmp.pn)); in mt76_wcid_key_setup() 1052 memcpy(wcid->rx_key_pn[i], seq.ccmp.pn, sizeof(seq.ccmp.pn)); in mt76_wcid_key_setup() 1133 *sta = wcid_to_sta(mstat.wcid); in mt76_rx_convert() 1141 struct mt76_wcid *wcid = status->wcid; in mt76_check_ccmp_pn() local 1152 if (!wcid || !wcid->rx_check_pn) in mt76_check_ccmp_pn() 1181 BUILD_BUG_ON(sizeof(status->iv) != sizeof(wcid->rx_key_pn[0])); in mt76_check_ccmp_pn() 1182 ret = memcmp(status->iv, wcid->rx_key_pn[security_idx], in mt76_check_ccmp_pn() [all …]
|
H A D | agg-rx.c | 123 struct mt76_wcid *wcid = status->wcid; in mt76_rx_aggr_check_ctl() local 136 tid = rcu_dereference(wcid->aggr[tidno]); in mt76_rx_aggr_check_ctl() 151 struct mt76_wcid *wcid = status->wcid; in mt76_rx_aggr_reorder() local 161 sta = wcid_to_sta(wcid); in mt76_rx_aggr_reorder() 176 tid = rcu_dereference(wcid->aggr[tidno]); in mt76_rx_aggr_reorder() 242 int mt76_rx_aggr_start(struct mt76_dev *dev, struct mt76_wcid *wcid, u8 tidno, in mt76_rx_aggr_start() argument 247 mt76_rx_aggr_stop(dev, wcid, tidno); in mt76_rx_aggr_start() 260 rcu_assign_pointer(wcid->aggr[tidno], tid); in mt76_rx_aggr_start() 290 void mt76_rx_aggr_stop(struct mt76_dev *dev, struct mt76_wcid *wcid, u8 tidno) in mt76_rx_aggr_stop() argument 294 tid = rcu_replace_pointer(wcid->aggr[tidno], tid, in mt76_rx_aggr_stop()
|
H A D | mt76x02_mac.c | 228 void mt76x02_mac_wcid_set_rate(struct mt76x02_dev *dev, struct mt76_wcid *wcid, in mt76x02_mac_wcid_set_rate() argument 241 wcid->tx_info = tx_info; in mt76x02_mac_wcid_set_rate() 267 stat->wcid = FIELD_GET(MT_TX_STAT_FIFO_WCID, stat1); in mt76x02_mac_load_tx_status() 336 struct sk_buff *skb, struct mt76_wcid *wcid, in mt76x02_mac_write_txwi() argument 354 if (!info->control.hw_key && wcid && wcid->hw_key_idx != 0xff && in mt76x02_mac_write_txwi() 356 wcid = NULL; in mt76x02_mac_write_txwi() 361 if (wcid) in mt76x02_mac_write_txwi() 362 txwi->wcid = wcid->idx; in mt76x02_mac_write_txwi() 364 txwi->wcid = 0xff; in mt76x02_mac_write_txwi() 366 if (wcid && wcid->sw_iv && key) { in mt76x02_mac_write_txwi() [all …]
|
H A D | util.c | 73 struct mt76_wcid *wcid; in mt76_get_min_avg_rssi() local 94 wcid = rcu_dereference(dev->wcid[j]); in mt76_get_min_avg_rssi() 95 if (!wcid) in mt76_get_min_avg_rssi() 99 if (wcid->inactive_count++ < 5) in mt76_get_min_avg_rssi() 100 cur_rssi = -ewma_signal_read(&wcid->rssi); in mt76_get_min_avg_rssi()
|
H A D | mt76x02_usb_core.c | 21 mt76_tx_complete_skb(mdev, e->wcid, e->skb); in mt76x02u_tx_complete_skb() 65 enum mt76_txq_id qid, struct mt76_wcid *wcid, in mt76x02u_tx_prepare_skb() argument 80 mt76x02_mac_write_txwi(dev, txwi, tx_info->skb, wcid, sta, len); in mt76x02u_tx_prepare_skb() 83 pid = mt76_tx_status_skb_add(mdev, wcid, tx_info->skb); in mt76x02u_tx_prepare_skb() 101 if (!wcid || wcid->hw_key_idx == 0xff || wcid->sw_iv) in mt76x02u_tx_prepare_skb() 111 if (err && wcid) in mt76x02u_tx_prepare_skb() 113 idr_remove(&wcid->pktid, pid); in mt76x02u_tx_prepare_skb()
|
H A D | mt792x_core.c | 61 struct mt76_wcid *wcid = &dev->mt76.global_wcid; in mt792x_tx() local 68 wcid = &sta->wcid; in mt792x_tx() 75 wcid = &mvif->sta.wcid; in mt792x_tx() 79 mt76_tx(mphy, control->sta, wcid, skb); in mt792x_tx() 90 mt76_connac_pm_queue_skb(hw, &dev->pm, wcid, skb); in mt792x_tx() 101 int idx = msta->wcid.idx; in mt792x_remove_interface() 104 mt76_connac_free_pending_tx_skbs(&dev->pm, &msta->wcid); in mt792x_remove_interface() 105 mt76_connac_mcu_uni_add_dev(&dev->mphy, vif, &mvif->sta.wcid, false); in mt792x_remove_interface() 107 rcu_assign_pointer(dev->mt76.wcid[idx], NULL); in mt792x_remove_interface() 114 if (!list_empty(&msta->wcid.poll_list)) in mt792x_remove_interface() [all …]
|
H A D | mt76x02.h | 197 enum mt76_txq_id qid, struct mt76_wcid *wcid, 263 struct mt76_wcid *wcid; in mt76x02_rx_get_sta() local 268 wcid = rcu_dereference(dev->wcid[idx]); in mt76x02_rx_get_sta() 269 if (!wcid) in mt76x02_rx_get_sta() 272 return container_of(wcid, struct mt76x02_sta, wcid); in mt76x02_rx_get_sta() 282 return &sta->wcid; in mt76x02_rx_get_sta_wcid()
|
H A D | mt76x02_trace.h | 22 #define TXID_ENTRY __field(u8, wcid) __field(u8, pktid) 24 #define TXID_PR_ARG __entry->wcid, __entry->pktid 64 __entry->wcid = stat->wcid;
|
/freebsd/sys/contrib/dev/mediatek/mt76/mt7921/ |
H A D | mac.c | 71 struct mt792x_sta, wcid.poll_list); in mt7921_mac_sta_poll() 72 list_del_init(&msta->wcid.poll_list); in mt7921_mac_sta_poll() 75 idx = msta->wcid.idx; in mt7921_mac_sta_poll() 100 if (!msta->wcid.sta) in mt7921_mac_sta_poll() 123 rate = &msta->wcid.rate; in mt7921_mac_sta_poll() 217 status->wcid = mt792x_rx_get_wcid(dev, idx, unicast); in mt7921_mac_fill_rx() 219 if (status->wcid) { in mt7921_mac_fill_rx() 220 msta = container_of(status->wcid, struct mt792x_sta, wcid); in mt7921_mac_fill_rx() 222 if (list_empty(&msta->wcid.poll_list)) in mt7921_mac_fill_rx() 223 list_add_tail(&msta->wcid.poll_list, in mt7921_mac_fill_rx() [all …]
|
H A D | main.c | 306 ret = mt76_connac_mcu_uni_add_dev(&dev->mphy, vif, &mvif->sta.wcid, in mt7921_add_interface() 316 INIT_LIST_HEAD(&mvif->sta.wcid.poll_list); in mt7921_add_interface() 317 mvif->sta.wcid.idx = idx; in mt7921_add_interface() 318 mvif->sta.wcid.phy_idx = mvif->mt76.band_idx; in mt7921_add_interface() 319 mvif->sta.wcid.hw_key_idx = -1; in mt7921_add_interface() 320 mvif->sta.wcid.tx_info |= MT_WCID_TX_INFO_SET; in mt7921_add_interface() 321 mt76_packet_id_init(&mvif->sta.wcid); in mt7921_add_interface() 328 rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid); in mt7921_add_interface() 331 mtxq->wcid = idx; in mt7921_add_interface() 479 struct mt76_wcid *wcid = &msta->wcid; in mt7921_set_key() local [all …]
|
/freebsd/sys/contrib/dev/mediatek/mt76/mt7603/ |
H A D | main.c | 69 INIT_LIST_HEAD(&mvif->sta.wcid.poll_list); in mt7603_add_interface() 70 mvif->sta.wcid.idx = idx; in mt7603_add_interface() 71 mvif->sta.wcid.hw_key_idx = -1; in mt7603_add_interface() 73 mt76_packet_id_init(&mvif->sta.wcid); in mt7603_add_interface() 79 mtxq->wcid = idx; in mt7603_add_interface() 80 rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid); in mt7603_add_interface() 94 int idx = msta->wcid.idx; in mt7603_remove_interface() 102 rcu_assign_pointer(dev->mt76.wcid[idx], NULL); in mt7603_remove_interface() 105 if (!list_empty(&msta->wcid.poll_list)) in mt7603_remove_interface() 106 list_del_init(&msta->wcid.poll_list); in mt7603_remove_interface() [all …]
|
H A D | mac.c | 229 u32 addr = mt7603_wtbl1_addr(sta->wcid.idx); in mt7603_wtbl_set_smps() 241 int idx = sta->wcid.idx; in mt7603_wtbl_set_ps() 333 int idx = msta->wcid.idx; in mt7603_wtbl_update_cap() 379 void mt7603_mac_tx_ba_reset(struct mt7603_dev *dev, int wcid, int tid, in mt7603_mac_tx_ba_reset() argument 382 u32 addr = mt7603_wtbl2_addr(wcid); in mt7603_mac_tx_ba_reset() 433 struct mt7603_sta, wcid.poll_list); in mt7603_mac_sta_poll() 434 list_del_init(&msta->wcid.poll_list); in mt7603_mac_sta_poll() 437 addr = mt7603_wtbl4_addr(msta->wcid.idx); in mt7603_mac_sta_poll() 451 mt7603_wtbl_update(dev, msta->wcid.idx, in mt7603_mac_sta_poll() 457 if (!msta->wcid.sta) in mt7603_mac_sta_poll() [all …]
|
/freebsd/sys/contrib/dev/mediatek/mt76/mt7615/ |
H A D | usb_sdio.c | 44 mt7663_usb_sdio_write_txwi(struct mt7615_dev *dev, struct mt76_wcid *wcid, in mt7663_usb_sdio_write_txwi() argument 52 mt7615_mac_write_txwi(dev, txwi, skb, wcid, sta, pid, key, qid, false); in mt7663_usb_sdio_write_txwi() 72 addr = mt7615_mac_wtbl_addr(dev, sta->wcid.idx); in mt7663_usb_sdio_set_rates() 106 FIELD_PREP(MT_WTBL_UPDATE_WLAN_IDX, sta->wcid.idx) | in mt7663_usb_sdio_set_rates() 122 if (!(sta->wcid.tx_info & MT_WCID_TX_INFO_SET)) in mt7663_usb_sdio_set_rates() 126 sta->wcid.tx_info |= MT_WCID_TX_INFO_SET; in mt7663_usb_sdio_set_rates() 177 mt76_tx_complete_skb(mdev, e->wcid, e->skb); in mt7663_usb_sdio_tx_complete_skb() 182 enum mt76_txq_id qid, struct mt76_wcid *wcid, in mt7663_usb_sdio_tx_prepare_skb() argument 193 msta = wcid ? container_of(wcid, struct mt7615_sta, wcid) : NULL; in mt7663_usb_sdio_tx_prepare_skb() 194 if (!wcid) in mt7663_usb_sdio_tx_prepare_skb() [all …]
|
H A D | mac.c | 94 struct mt76_wcid *wcid; in mt7615_rx_get_wcid() local 99 wcid = rcu_dereference(dev->mt76.wcid[idx]); in mt7615_rx_get_wcid() 100 if (unicast || !wcid) in mt7615_rx_get_wcid() 101 return wcid; in mt7615_rx_get_wcid() 103 if (!wcid->sta) in mt7615_rx_get_wcid() 106 sta = container_of(wcid, struct mt7615_sta, wcid); in mt7615_rx_get_wcid() 110 return &sta->vif->sta.wcid; in mt7615_rx_get_wcid() 259 struct mt7615_sta *msta = (struct mt7615_sta *)status->wcid; in mt7615_reverse_frag0_hdr_trans() 387 status->wcid = mt7615_rx_get_wcid(dev, idx, unicast); in mt7615_mac_fill_rx() 389 if (status->wcid) { in mt7615_mac_fill_rx() [all …]
|
H A D | main.c | 225 INIT_LIST_HEAD(&mvif->sta.wcid.poll_list); in mt7615_add_interface() 226 mvif->sta.wcid.idx = idx; in mt7615_add_interface() 227 mvif->sta.wcid.phy_idx = mvif->mt76.band_idx; in mt7615_add_interface() 228 mvif->sta.wcid.hw_key_idx = -1; in mt7615_add_interface() 229 mt76_packet_id_init(&mvif->sta.wcid); in mt7615_add_interface() 234 rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid); in mt7615_add_interface() 237 mtxq->wcid = idx; in mt7615_add_interface() 254 int idx = msta->wcid.idx; in mt7615_remove_interface() 265 mt76_connac_free_pending_tx_skbs(&dev->pm, &msta->wcid); in mt7615_remove_interface() 269 rcu_assign_pointer(dev->mt76.wcid[idx], NULL); in mt7615_remove_interface() [all …]
|
H A D | pci_mac.c | 64 enum mt76_txq_id qid, struct mt76_wcid *wcid, in mt7615_tx_prepare_skb() argument 77 msta = wcid ? container_of(wcid, struct mt7615_sta, wcid) : NULL; in mt7615_tx_prepare_skb() 78 if (!wcid) in mt7615_tx_prepare_skb() 79 wcid = &dev->mt76.global_wcid; in mt7615_tx_prepare_skb() 101 pid = mt76_tx_status_skb_add(mdev, wcid, tx_info->skb); in mt7615_tx_prepare_skb() 102 mt7615_mac_write_txwi(dev, txwi_ptr, tx_info->skb, wcid, sta, in mt7615_tx_prepare_skb()
|
/freebsd/sys/contrib/dev/mediatek/mt76/mt7915/ |
H A D | main.c | 251 INIT_LIST_HEAD(&mvif->sta.wcid.poll_list); in mt7915_add_interface() 252 mvif->sta.wcid.idx = idx; in mt7915_add_interface() 253 mvif->sta.wcid.phy_idx = ext_phy; in mt7915_add_interface() 254 mvif->sta.wcid.hw_key_idx = -1; in mt7915_add_interface() 255 mvif->sta.wcid.tx_info |= MT_WCID_TX_INFO_SET; in mt7915_add_interface() 256 mt76_packet_id_init(&mvif->sta.wcid); in mt7915_add_interface() 263 mtxq->wcid = idx; in mt7915_add_interface() 276 rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid); in mt7915_add_interface() 291 int idx = msta->wcid.idx; in mt7915_remove_interface() 305 rcu_assign_pointer(dev->mt76.wcid[idx], NULL); in mt7915_remove_interface() [all …]
|
H A D | mac.c | 61 struct mt76_wcid *wcid; in mt7915_rx_get_wcid() local 63 if (idx >= ARRAY_SIZE(dev->mt76.wcid)) in mt7915_rx_get_wcid() 66 wcid = rcu_dereference(dev->mt76.wcid[idx]); in mt7915_rx_get_wcid() 67 if (unicast || !wcid) in mt7915_rx_get_wcid() 68 return wcid; in mt7915_rx_get_wcid() 70 if (!wcid->sta) in mt7915_rx_get_wcid() 73 sta = container_of(wcid, struct mt7915_sta, wcid); in mt7915_rx_get_wcid() 77 return &sta->vif->sta.wcid; in mt7915_rx_get_wcid() 89 u32 mt7915_mac_wtbl_lmac_addr(struct mt7915_dev *dev, u16 wcid, u8 dw) in mt7915_mac_wtbl_lmac_addr() argument 92 FIELD_PREP(MT_WTBLON_TOP_WDUCR_GROUP, (wcid >> 7))); in mt7915_mac_wtbl_lmac_addr() [all …]
|
/freebsd/sys/contrib/dev/mediatek/mt76/mt7996/ |
H A D | main.c | 205 INIT_LIST_HEAD(&mvif->sta.wcid.poll_list); in mt7996_add_interface() 206 mvif->sta.wcid.idx = idx; in mt7996_add_interface() 207 mvif->sta.wcid.phy_idx = band_idx; in mt7996_add_interface() 208 mvif->sta.wcid.hw_key_idx = -1; in mt7996_add_interface() 209 mvif->sta.wcid.tx_info |= MT_WCID_TX_INFO_SET; in mt7996_add_interface() 210 mt76_packet_id_init(&mvif->sta.wcid); in mt7996_add_interface() 217 mtxq->wcid = idx; in mt7996_add_interface() 234 rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid); in mt7996_add_interface() 249 int idx = msta->wcid.idx; in mt7996_remove_interface() 259 rcu_assign_pointer(dev->mt76.wcid[idx], NULL); in mt7996_remove_interface() [all …]
|
H A D | mac.c | 62 struct mt76_wcid *wcid; in mt7996_rx_get_wcid() local 64 if (idx >= ARRAY_SIZE(dev->mt76.wcid)) in mt7996_rx_get_wcid() 67 wcid = rcu_dereference(dev->mt76.wcid[idx]); in mt7996_rx_get_wcid() 68 if (unicast || !wcid) in mt7996_rx_get_wcid() 69 return wcid; in mt7996_rx_get_wcid() 71 if (!wcid->sta) in mt7996_rx_get_wcid() 74 sta = container_of(wcid, struct mt7996_sta, wcid); in mt7996_rx_get_wcid() 78 return &sta->vif->sta.wcid; in mt7996_rx_get_wcid() 90 u32 mt7996_mac_wtbl_lmac_addr(struct mt7996_dev *dev, u16 wcid, u8 dw) in mt7996_mac_wtbl_lmac_addr() argument 93 FIELD_PREP(MT_WTBLON_TOP_WDUCR_GROUP, (wcid >> 7))); in mt7996_mac_wtbl_lmac_addr() [all …]
|