Lines Matching full:struct

56 struct mt76_dev;
57 struct mt76_phy;
58 struct mt76_wcid;
59 struct mt76s_intr;
60 struct mt76_chanctx;
61 struct mt76_vif_link;
63 struct mt76_reg_pair {
83 struct mt76_bus_ops {
84 u32 (*rr)(struct mt76_dev *dev, u32 offset);
85 void (*wr)(struct mt76_dev *dev, u32 offset, u32 val);
86 u32 (*rmw)(struct mt76_dev *dev, u32 offset, u32 mask, u32 val);
87 void (*write_copy)(struct mt76_dev *dev, u32 offset, const void *data,
89 void (*read_copy)(struct mt76_dev *dev, u32 offset, void *data,
91 int (*wr_rp)(struct mt76_dev *dev, u32 base,
92 const struct mt76_reg_pair *rp, int len);
93 int (*rd_rp)(struct mt76_dev *dev, u32 base,
94 struct mt76_reg_pair *rp, int len);
173 struct mt76_scan_rnr_param {
182 struct mt76_queue_buf {
188 struct mt76_tx_info {
189 struct mt76_queue_buf buf[32];
190 struct sk_buff *skb;
195 struct mt76_queue_entry {
198 struct sk_buff *skb;
201 struct mt76_txwi_cache *txwi;
202 struct urb *urb;
213 struct mt76_queue_regs {
220 struct mt76_queue {
221 struct mt76_queue_regs __iomem *regs;
225 struct mt76_queue_entry *entry;
226 struct mt76_rro_desc *rro_desc;
227 struct mt76_desc *desc;
243 struct mtk_wed_device *wed;
247 struct sk_buff *rx_head;
248 struct page_pool *page_pool;
251 struct mt76_mcu_ops {
256 int (*mcu_send_msg)(struct mt76_dev *dev, int cmd, const void *data,
258 int (*mcu_skb_prepare_msg)(struct mt76_dev *dev, struct sk_buff *skb,
260 int (*mcu_skb_send_msg)(struct mt76_dev *dev, struct sk_buff *skb,
262 int (*mcu_parse_response)(struct mt76_dev *dev, int cmd,
263 struct sk_buff *skb, int seq);
264 u32 (*mcu_rr)(struct mt76_dev *dev, u32 offset);
265 void (*mcu_wr)(struct mt76_dev *dev, u32 offset, u32 val);
266 int (*mcu_wr_rp)(struct mt76_dev *dev, u32 base,
267 const struct mt76_reg_pair *rp, int len);
268 int (*mcu_rd_rp)(struct mt76_dev *dev, u32 base,
269 struct mt76_reg_pair *rp, int len);
270 int (*mcu_restart)(struct mt76_dev *dev);
273 struct mt76_queue_ops {
274 int (*init)(struct mt76_dev *dev,
275 int (*poll)(struct napi_struct *napi, int budget));
277 int (*alloc)(struct mt76_dev *dev, struct mt76_queue *q,
281 int (*tx_queue_skb)(struct mt76_phy *phy, struct mt76_queue *q,
282 enum mt76_txq_id qid, struct sk_buff *skb,
283 struct mt76_wcid *wcid, struct ieee80211_sta *sta);
285 int (*tx_queue_skb_raw)(struct mt76_dev *dev, struct mt76_queue *q,
286 struct sk_buff *skb, u32 tx_info);
288 void *(*dequeue)(struct mt76_dev *dev, struct mt76_queue *q, bool flush,
291 void (*rx_reset)(struct mt76_dev *dev, enum mt76_rxq_id qid);
293 void (*tx_cleanup)(struct mt76_dev *dev, struct mt76_queue *q,
296 void (*rx_cleanup)(struct mt76_dev *dev, struct mt76_queue *q);
298 void (*kick)(struct mt76_dev *dev, struct mt76_queue *q);
300 void (*reset_q)(struct mt76_dev *dev, struct mt76_queue *q);
319 struct mt76_sta_stats {
355 struct mt76_wcid {
356 struct mt76_rx_tid __rcu *aggr[IEEE80211_NUM_TIDS];
361 struct ewma_signal rssi;
364 struct rate_info rate;
386 struct list_head tx_list;
387 struct sk_buff_head tx_pending;
388 struct sk_buff_head tx_offchannel;
390 struct list_head list;
391 struct idr pktid;
393 struct mt76_sta_stats stats;
395 struct list_head poll_list;
397 struct mt76_wcid *def_wcid;
400 struct mt76_txq {
408 struct mt76_wed_rro_ind {
419 struct mt76_txwi_cache {
420 struct list_head list;
424 struct sk_buff *skb;
429 struct mt76_rx_tid {
430 struct rcu_head rcu_head;
432 struct mt76_dev *dev;
435 struct delayed_work reorder_work;
446 struct sk_buff *reorder_buf[] __counted_by(size);
467 struct mt76_tx_cb {
500 struct mt76_hw_cap {
514 struct mt76_driver_ops {
523 void (*update_survey)(struct mt76_phy *phy);
524 int (*set_channel)(struct mt76_phy *phy);
526 int (*tx_prepare_skb)(struct mt76_dev *dev, void *txwi_ptr,
527 enum mt76_txq_id qid, struct mt76_wcid *wcid,
528 struct ieee80211_sta *sta,
529 struct mt76_tx_info *tx_info);
531 void (*tx_complete_skb)(struct mt76_dev *dev,
532 struct mt76_queue_entry *e);
534 bool (*tx_status_data)(struct mt76_dev *dev, u8 *update);
536 bool (*rx_check)(struct mt76_dev *dev, void *data, int len);
538 void (*rx_skb)(struct mt76_dev *dev, enum mt76_rxq_id q,
539 struct sk_buff *skb, u32 *info);
541 void (*rx_poll_complete)(struct mt76_dev *dev, enum mt76_rxq_id q);
543 void (*sta_ps)(struct mt76_dev *dev, struct ieee80211_sta *sta,
546 int (*sta_add)(struct mt76_dev *dev, struct ieee80211_vif *vif,
547 struct ieee80211_sta *sta);
549 int (*sta_event)(struct mt76_dev *dev, struct ieee80211_vif *vif,
550 struct ieee80211_sta *sta, enum mt76_sta_event ev);
552 void (*sta_remove)(struct mt76_dev *dev, struct ieee80211_vif *vif,
553 struct ieee80211_sta *sta);
555 int (*vif_link_add)(struct mt76_phy *phy, struct ieee80211_vif *vif,
556 struct ieee80211_bss_conf *link_conf,
557 struct mt76_vif_link *mlink);
559 void (*vif_link_remove)(struct mt76_phy *phy,
560 struct ieee80211_vif *vif,
561 struct ieee80211_bss_conf *link_conf,
562 struct mt76_vif_link *mlink);
565 struct mt76_channel_state {
575 struct mt76_sband {
576 struct ieee80211_supported_band sband;
577 struct mt76_channel_state *chan;
617 struct mt76_mcu {
618 struct mutex mutex;
622 struct sk_buff_head res_q;
631 struct mt76_usb {
632 struct mutex usb_ctrl_mtx;
636 struct mt76_worker status_worker;
637 struct mt76_worker rx_worker;
639 struct work_struct stat_work;
645 struct mt76u_mcu {
648 struct mt76_reg_pair *rp;
657 struct mt76_sdio {
658 struct mt76_worker txrx_worker;
659 struct mt76_worker status_worker;
660 struct mt76_worker net_worker;
661 struct mt76_worker stat_worker;
666 struct sdio_func *func;
672 struct {
680 int (*parse_irq)(struct mt76_dev *dev, struct mt76s_intr *intr);
683 struct mt76_mmio {
688 struct mtk_wed_device wed;
689 struct mtk_wed_device wed_hif2;
690 struct completion wed_reset;
691 struct completion wed_reset_complete;
694 struct mt76_rx_status {
696 struct mt76_wcid *wcid;
717 struct {
722 struct {
736 struct mt76_freq_range_power {
737 const struct cfg80211_sar_freq_ranges *range;
741 struct mt76_testmode_ops {
742 int (*set_state)(struct mt76_phy *phy, enum mt76_testmode_state state);
743 int (*set_params)(struct mt76_phy *phy, struct nlattr **tb,
745 int (*dump_stats)(struct mt76_phy *phy, struct sk_buff *msg);
748 struct mt76_testmode_data {
752 struct sk_buff *tx_skb;
783 struct {
789 struct mt76_vif_link {
801 struct ieee80211_chanctx_conf *ctx;
802 struct mt76_wcid *wcid;
803 struct mt76_vif_data *mvif;
804 struct rcu_head rcu_head;
807 struct mt76_vif_data {
808 struct mt76_vif_link __rcu *link[IEEE80211_MLD_MAX_NUM_LINKS];
809 struct mt76_vif_link __rcu *offchannel_link;
811 struct mt76_phy *roc_phy;
816 struct mt76_phy {
817 struct ieee80211_hw *hw;
818 struct mt76_dev *dev;
826 struct list_head tx_list;
827 struct mt76_queue *q_tx[__MT_TXQ_MAX];
829 struct cfg80211_chan_def chandef;
830 struct cfg80211_chan_def main_chandef;
834 struct delayed_work roc_work;
835 struct ieee80211_vif *roc_vif;
836 struct mt76_vif_link *roc_link;
838 struct mt76_chanctx *chanctx;
840 struct mt76_channel_state *chan_state;
846 struct mt76_hw_cap cap;
847 struct mt76_sband sband_2g;
848 struct mt76_sband sband_5g;
849 struct mt76_sband sband_6g;
858 struct mt76_testmode_data test;
861 struct delayed_work mac_work;
864 struct {
865 struct sk_buff *head;
866 struct sk_buff **tail;
870 struct mt76_freq_range_power *frp;
872 struct {
873 struct led_classdev cdev;
880 struct mt76_dev {
881 struct mt76_phy phy; /* must be first */
882 struct mt76_phy *phys[__MT_MAX_BAND];
883 struct mt76_phy *band_phys[NUM_NL80211_BANDS];
885 struct ieee80211_hw *hw;
893 struct mt76_rx_status rx_ampdu_status;
897 struct mutex mutex;
899 const struct mt76_bus_ops *bus;
900 const struct mt76_driver_ops *drv;
901 const struct mt76_mcu_ops *mcu_ops;
902 struct device *dev;
903 struct device *dma_dev;
905 struct mt76_mcu mcu;
907 struct net_device *napi_dev;
908 struct net_device *tx_napi_dev;
910 struct napi_struct napi[__MT_RXQ_MAX];
911 struct sk_buff_head rx_skb[__MT_RXQ_MAX];
912 struct tasklet_struct irq_tasklet;
914 struct list_head txwi_cache;
915 struct list_head rxwi_cache;
916 struct mt76_queue *q_mcu[__MT_MCUQ_MAX];
917 struct mt76_queue q_rx[__MT_RXQ_MAX];
918 const struct mt76_queue_ops *queue_ops;
921 struct mt76_worker tx_worker;
922 struct napi_struct tx_napi;
925 struct idr token;
931 struct idr rx_token;
942 struct mt76_wcid global_wcid;
943 struct mt76_wcid __rcu *wcid[MT76_N_WCIDS];
944 struct list_head wcid_list;
946 struct list_head sta_poll_list;
951 struct tasklet_struct pre_tbtt_tasklet;
955 struct debugfs_blob_wrapper eeprom;
956 struct debugfs_blob_wrapper otp;
961 struct mt76_scan_rnr_param rnr;
969 struct delayed_work scan_work;
970 struct {
971 struct cfg80211_scan_request *req;
972 struct ieee80211_channel *chan;
973 struct ieee80211_vif *vif;
974 struct mt76_vif_link *mlink;
975 struct mt76_phy *phy;
980 const struct mt76_testmode_ops *test_ops;
981 struct {
986 struct workqueue_struct *wq;
989 struct mt76_mmio mmio;
990 struct mt76_usb usb;
991 struct mt76_sdio sdio;
998 struct mt76_mib_stats {
1092 struct mt76_power_limits {
1100 struct mt76_ethtool_worker_info {
1108 struct mt76_chanctx {
1109 struct mt76_phy *phy;
1125 extern struct ieee80211_rate mt76_rates[12];
1161 bool __mt76_poll(struct mt76_dev *dev, u32 offset, u32 mask, u32 val,
1166 bool ____mt76_poll_msec(struct mt76_dev *dev, u32 offset, u32 mask, u32 val,
1172 void mt76_mmio_init(struct mt76_dev *dev, void __iomem *regs);
1173 void mt76_pci_disable_aspm(struct pci_dev *pdev);
1174 bool mt76_pci_aspm_supported(struct pci_dev *pdev);
1176 static inline u16 mt76_chip(struct mt76_dev *dev) in mt76_chip()
1181 static inline u16 mt76_rev(struct mt76_dev *dev) in mt76_rev()
1186 void mt76_wed_release_rx_buf(struct mtk_wed_device *wed);
1187 void mt76_wed_offload_disable(struct mtk_wed_device *wed);
1188 void mt76_wed_reset_complete(struct mtk_wed_device *wed);
1189 void mt76_wed_dma_reset(struct mt76_dev *dev);
1190 int mt76_wed_net_setup_tc(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1191 struct net_device *netdev, enum tc_setup_type type,
1194 u32 mt76_wed_init_rx_buf(struct mtk_wed_device *wed, int size);
1195 int mt76_wed_offload_enable(struct mtk_wed_device *wed);
1196 int mt76_wed_dma_setup(struct mt76_dev *dev, struct mt76_queue *q, bool reset);
1198 static inline u32 mt76_wed_init_rx_buf(struct mtk_wed_device *wed, int size) in mt76_wed_init_rx_buf()
1203 static inline int mt76_wed_offload_enable(struct mtk_wed_device *wed) in mt76_wed_offload_enable()
1208 static inline int mt76_wed_dma_setup(struct mt76_dev *dev, struct mt76_queue *q, in mt76_wed_dma_setup()
1236 static inline struct mt76_wcid *
1237 __mt76_wcid_ptr(struct mt76_dev *dev, u16 idx) in __mt76_wcid_ptr()
1246 struct mt76_dev *mt76_alloc_device(struct device *pdev, unsigned int size,
1247 const struct ieee80211_ops *ops,
1248 const struct mt76_driver_ops *drv_ops);
1249 int mt76_register_device(struct mt76_dev *dev, bool vht,
1250 struct ieee80211_rate *rates, int n_rates);
1251 void mt76_unregister_device(struct mt76_dev *dev);
1252 void mt76_free_device(struct mt76_dev *dev);
1253 void mt76_reset_device(struct mt76_dev *dev);
1254 void mt76_unregister_phy(struct mt76_phy *phy);
1256 struct mt76_phy *mt76_alloc_radio_phy(struct mt76_dev *dev, unsigned int size,
1258 struct mt76_phy *mt76_alloc_phy(struct mt76_dev *dev, unsigned int size,
1259 const struct ieee80211_ops *ops,
1261 int mt76_register_phy(struct mt76_phy *phy, bool vht,
1262 struct ieee80211_rate *rates, int n_rates);
1263 struct mt76_phy *mt76_vif_phy(struct ieee80211_hw *hw,
1264 struct ieee80211_vif *vif);
1266 struct dentry *mt76_register_debugfs_fops(struct mt76_phy *phy,
1267 const struct file_operations *ops);
1268 static inline struct dentry *mt76_register_debugfs(struct mt76_dev *dev) in mt76_register_debugfs()
1273 int mt76_queues_read(struct seq_file *s, void *data);
1274 void mt76_seq_puts_array(struct seq_file *file, const char *str,
1277 int mt76_eeprom_init(struct mt76_dev *dev, int len);
1278 void mt76_eeprom_override(struct mt76_phy *phy);
1279 int mt76_get_of_data_from_mtd(struct mt76_dev *dev, void *eep, int offset, int len);
1280 int mt76_get_of_data_from_nvmem(struct mt76_dev *dev, void *eep,
1283 struct mt76_queue *
1284 mt76_init_queue(struct mt76_dev *dev, int qid, int idx, int n_desc,
1286 static inline int mt76_init_tx_queue(struct mt76_phy *phy, int qid, int idx, in mt76_init_tx_queue()
1290 struct mt76_queue *q; in mt76_init_tx_queue()
1301 static inline int mt76_init_mcu_queue(struct mt76_dev *dev, int qid, int idx, in mt76_init_mcu_queue()
1304 struct mt76_queue *q; in mt76_init_mcu_queue()
1315 static inline struct mt76_phy *
1316 mt76_dev_phy(struct mt76_dev *dev, u8 phy_idx) in mt76_dev_phy()
1325 static inline struct ieee80211_hw *
1326 mt76_phy_hw(struct mt76_dev *dev, u8 phy_idx) in mt76_phy_hw()
1332 mt76_get_txwi_ptr(struct mt76_dev *dev, struct mt76_txwi_cache *t) in mt76_get_txwi_ptr()
1351 static inline struct ieee80211_txq *
1352 mtxq_to_txq(struct mt76_txq *mtxq) in mtxq_to_txq()
1356 return container_of(ptr, struct ieee80211_txq, drv_priv); in mtxq_to_txq()
1359 static inline struct ieee80211_sta *
1360 wcid_to_sta(struct mt76_wcid *wcid) in wcid_to_sta()
1370 return container_of(ptr, struct ieee80211_sta, drv_priv); in wcid_to_sta()
1373 static inline struct mt76_tx_cb *mt76_tx_skb_cb(struct sk_buff *skb) in mt76_tx_skb_cb()
1375 BUILD_BUG_ON(sizeof(struct mt76_tx_cb) > in mt76_tx_skb_cb()
1380 static inline void *mt76_skb_get_hdr(struct sk_buff *skb) in mt76_skb_get_hdr()
1382 struct mt76_rx_status mstat; in mt76_skb_get_hdr()
1386 BUILD_BUG_ON(sizeof(struct ieee80211_radiotap_he) % 4); in mt76_skb_get_hdr()
1387 BUILD_BUG_ON(sizeof(struct ieee80211_radiotap_he_mu) % 4); in mt76_skb_get_hdr()
1389 mstat = *((struct mt76_rx_status *)skb->cb); in mt76_skb_get_hdr()
1392 data += sizeof(struct ieee80211_radiotap_he); in mt76_skb_get_hdr()
1394 data += sizeof(struct ieee80211_radiotap_he_mu); in mt76_skb_get_hdr()
1399 static inline void mt76_insert_hdr_pad(struct sk_buff *skb) in mt76_insert_hdr_pad()
1429 static inline bool mt76_testmode_enabled(struct mt76_phy *phy) in mt76_testmode_enabled()
1438 static inline bool mt76_is_testmode_skb(struct mt76_dev *dev, in mt76_is_testmode_skb()
1439 struct sk_buff *skb, in mt76_is_testmode_skb()
1440 struct ieee80211_hw **hw) in mt76_is_testmode_skb()
1446 struct mt76_phy *phy = dev->phys[i]; in mt76_is_testmode_skb()
1459 void mt76_rx(struct mt76_dev *dev, enum mt76_rxq_id q, struct sk_buff *skb);
1460 void mt76_tx(struct mt76_phy *dev, struct ieee80211_sta *sta,
1461 struct mt76_wcid *wcid, struct sk_buff *skb);
1462 void mt76_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq);
1463 void mt76_stop_tx_queues(struct mt76_phy *phy, struct ieee80211_sta *sta,
1465 void mt76_tx_check_agg_ssn(struct ieee80211_sta *sta, struct sk_buff *skb);
1466 void mt76_txq_schedule(struct mt76_phy *phy, enum mt76_txq_id qid);
1467 void mt76_txq_schedule_all(struct mt76_phy *phy);
1468 void mt76_tx_worker_run(struct mt76_dev *dev);
1469 void mt76_tx_worker(struct mt76_worker *w);
1470 void mt76_release_buffered_frames(struct ieee80211_hw *hw,
1471 struct ieee80211_sta *sta,
1475 bool mt76_has_tx_pending(struct mt76_phy *phy);
1476 int mt76_update_channel(struct mt76_phy *phy);
1477 void mt76_update_survey(struct mt76_phy *phy);
1478 void mt76_update_survey_active_time(struct mt76_phy *phy, ktime_t time);
1479 int mt76_get_survey(struct ieee80211_hw *hw, int idx,
1480 struct survey_info *survey);
1482 void mt76_set_stream_caps(struct mt76_phy *phy, bool vht);
1484 int mt76_rx_aggr_start(struct mt76_dev *dev, struct mt76_wcid *wcid, u8 tid,
1486 void mt76_rx_aggr_stop(struct mt76_dev *dev, struct mt76_wcid *wcid, u8 tid);
1488 void mt76_wcid_key_setup(struct mt76_dev *dev, struct mt76_wcid *wcid,
1489 struct ieee80211_key_conf *key);
1491 void mt76_tx_status_lock(struct mt76_dev *dev, struct sk_buff_head *list)
1493 void mt76_tx_status_unlock(struct mt76_dev *dev, struct sk_buff_head *list)
1496 int mt76_tx_status_skb_add(struct mt76_dev *dev, struct mt76_wcid *wcid,
1497 struct sk_buff *skb);
1498 struct sk_buff *mt76_tx_status_skb_get(struct mt76_dev *dev,
1499 struct mt76_wcid *wcid, int pktid,
1500 struct sk_buff_head *list);
1501 void mt76_tx_status_skb_done(struct mt76_dev *dev, struct sk_buff *skb,
1502 struct sk_buff_head *list);
1503 void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid, struct sk_buff *skb,
1504 struct list_head *free_list);
1506 mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid, struct sk_buff *skb) in mt76_tx_complete_skb()
1511 void mt76_tx_status_check(struct mt76_dev *dev, bool flush);
1512 int mt76_sta_state(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1513 struct ieee80211_sta *sta,
1516 void __mt76_sta_remove(struct mt76_phy *phy, struct ieee80211_vif *vif,
1517 struct ieee80211_sta *sta);
1518 void mt76_sta_pre_rcu_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1519 struct ieee80211_sta *sta);
1521 int mt76_get_min_avg_rssi(struct mt76_dev *dev, u8 phy_idx);
1523 s8 mt76_get_power_bound(struct mt76_phy *phy, s8 txpower);
1525 int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1527 int mt76_init_sar_power(struct ieee80211_hw *hw,
1528 const struct cfg80211_sar_specs *sar);
1529 int mt76_get_sar_power(struct mt76_phy *phy,
1530 struct ieee80211_channel *chan,
1533 void mt76_csa_check(struct mt76_dev *dev);
1534 void mt76_csa_finish(struct mt76_dev *dev);
1536 int mt76_get_antenna(struct ieee80211_hw *hw, int radio_idx, u32 *tx_ant,
1538 int mt76_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set);
1539 void mt76_insert_ccmp_hdr(struct sk_buff *skb, u8 key_id);
1540 int mt76_get_rate(struct mt76_dev *dev,
1541 struct ieee80211_supported_band *sband,
1543 int mt76_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1544 struct ieee80211_scan_request *hw_req);
1545 void mt76_cancel_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
1546 void mt76_sw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1548 void mt76_sw_scan_complete(struct ieee80211_hw *hw,
1549 struct ieee80211_vif *vif);
1550 enum mt76_dfs_state mt76_phy_dfs_state(struct mt76_phy *phy);
1551 int mt76_add_chanctx(struct ieee80211_hw *hw,
1552 struct ieee80211_chanctx_conf *conf);
1553 void mt76_remove_chanctx(struct ieee80211_hw *hw,
1554 struct ieee80211_chanctx_conf *conf);
1555 void mt76_change_chanctx(struct ieee80211_hw *hw,
1556 struct ieee80211_chanctx_conf *conf,
1558 int mt76_assign_vif_chanctx(struct ieee80211_hw *hw,
1559 struct ieee80211_vif *vif,
1560 struct ieee80211_bss_conf *link_conf,
1561 struct ieee80211_chanctx_conf *conf);
1562 void mt76_unassign_vif_chanctx(struct ieee80211_hw *hw,
1563 struct ieee80211_vif *vif,
1564 struct ieee80211_bss_conf *link_conf,
1565 struct ieee80211_chanctx_conf *conf);
1566 int mt76_switch_vif_chanctx(struct ieee80211_hw *hw,
1567 struct ieee80211_vif_chanctx_switch *vifs,
1570 int mt76_remain_on_channel(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1571 struct ieee80211_channel *chan, int duration,
1573 int mt76_cancel_remain_on_channel(struct ieee80211_hw *hw,
1574 struct ieee80211_vif *vif);
1575 int mt76_testmode_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1577 int mt76_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *skb,
1578 struct netlink_callback *cb, void *data, int len);
1579 int mt76_testmode_set_state(struct mt76_phy *phy, enum mt76_testmode_state state);
1580 int mt76_testmode_alloc_skb(struct mt76_phy *phy, u32 len);
1582 static inline void mt76_testmode_reset(struct mt76_phy *phy, bool disable) in mt76_testmode_reset()
1596 static inline struct ieee80211_hw *
1597 mt76_tx_status_get_hw(struct mt76_dev *dev, struct sk_buff *skb) in mt76_tx_status_get_hw()
1599 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); in mt76_tx_status_get_hw()
1601 struct ieee80211_hw *hw = mt76_phy_hw(dev, phy_idx); in mt76_tx_status_get_hw()
1608 void mt76_put_txwi(struct mt76_dev *dev, struct mt76_txwi_cache *t);
1609 void mt76_put_rxwi(struct mt76_dev *dev, struct mt76_txwi_cache *t);
1610 struct mt76_txwi_cache *mt76_get_rxwi(struct mt76_dev *dev);
1611 void mt76_free_pending_rxwi(struct mt76_dev *dev);
1612 void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
1613 struct napi_struct *napi);
1614 void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,
1615 struct napi_struct *napi);
1616 void mt76_rx_aggr_reorder(struct sk_buff *skb, struct sk_buff_head *frames);
1617 void mt76_testmode_tx_pending(struct mt76_phy *phy);
1618 void mt76_queue_tx_complete(struct mt76_dev *dev, struct mt76_queue *q,
1619 struct mt76_queue_entry *e);
1620 int __mt76_set_channel(struct mt76_phy *phy, struct cfg80211_chan_def *chandef,
1622 int mt76_set_channel(struct mt76_phy *phy, struct cfg80211_chan_def *chandef,
1624 void mt76_scan_work(struct work_struct *work);
1625 void mt76_abort_scan(struct mt76_dev *dev);
1626 void mt76_roc_complete_work(struct work_struct *work);
1627 void mt76_abort_roc(struct mt76_phy *phy);
1628 struct mt76_vif_link *mt76_get_vif_phy_link(struct mt76_phy *phy,
1629 struct ieee80211_vif *vif);
1630 void mt76_put_vif_phy_link(struct mt76_phy *phy, struct ieee80211_vif *vif,
1631 struct mt76_vif_link *mlink);
1634 static inline bool mt76u_urb_error(struct urb *urb) in mt76u_urb_error()
1643 mt76u_bulk_msg(struct mt76_dev *dev, void *data, int len, int *actual_len, in mt76u_bulk_msg()
1649 struct usb_interface *uintf = to_usb_interface(dev->dev); in mt76u_bulk_msg()
1650 struct usb_device *udev = interface_to_usbdev(uintf); in mt76u_bulk_msg()
1651 struct mt76_usb *usb = &dev->usb; in mt76u_bulk_msg()
1663 void mt76_ethtool_page_pool_stats(struct mt76_dev *dev, u64 *data, int *index);
1664 void mt76_ethtool_worker(struct mt76_ethtool_worker_info *wi,
1665 struct mt76_sta_stats *stats, bool eht);
1666 int mt76_skb_adjust_pad(struct sk_buff *skb, int pad);
1667 int __mt76u_vendor_request(struct mt76_dev *dev, u8 req, u8 req_type,
1669 int mt76u_vendor_request(struct mt76_dev *dev, u8 req,
1672 void mt76u_single_wr(struct mt76_dev *dev, const u8 req,
1674 void mt76u_read_copy(struct mt76_dev *dev, u32 offset,
1676 u32 ___mt76u_rr(struct mt76_dev *dev, u8 req, u8 req_type, u32 addr);
1677 void ___mt76u_wr(struct mt76_dev *dev, u8 req, u8 req_type,
1679 int __mt76u_init(struct mt76_dev *dev, struct usb_interface *intf,
1680 struct mt76_bus_ops *ops);
1681 int mt76u_init(struct mt76_dev *dev, struct usb_interface *intf);
1682 int mt76u_alloc_mcu_queue(struct mt76_dev *dev);
1683 int mt76u_alloc_queues(struct mt76_dev *dev);
1684 void mt76u_stop_tx(struct mt76_dev *dev);
1685 void mt76u_stop_rx(struct mt76_dev *dev);
1686 int mt76u_resume_rx(struct mt76_dev *dev);
1687 void mt76u_queues_deinit(struct mt76_dev *dev);
1689 int mt76s_init(struct mt76_dev *dev, struct sdio_func *func,
1690 const struct mt76_bus_ops *bus_ops);
1691 int mt76s_alloc_rx_queue(struct mt76_dev *dev, enum mt76_rxq_id qid);
1692 int mt76s_alloc_tx(struct mt76_dev *dev);
1693 void mt76s_deinit(struct mt76_dev *dev);
1694 void mt76s_sdio_irq(struct sdio_func *func);
1695 void mt76s_txrx_worker(struct mt76_sdio *sdio);
1696 bool mt76s_txqs_empty(struct mt76_dev *dev);
1697 int mt76s_hw_init(struct mt76_dev *dev, struct sdio_func *func,
1699 u32 mt76s_rr(struct mt76_dev *dev, u32 offset);
1700 void mt76s_wr(struct mt76_dev *dev, u32 offset, u32 val);
1701 u32 mt76s_rmw(struct mt76_dev *dev, u32 offset, u32 mask, u32 val);
1702 u32 mt76s_read_pcr(struct mt76_dev *dev);
1703 void mt76s_write_copy(struct mt76_dev *dev, u32 offset,
1705 void mt76s_read_copy(struct mt76_dev *dev, u32 offset,
1707 int mt76s_wr_rp(struct mt76_dev *dev, u32 base,
1708 const struct mt76_reg_pair *data,
1710 int mt76s_rd_rp(struct mt76_dev *dev, u32 base,
1711 struct mt76_reg_pair *data, int len);
1713 struct sk_buff *
1714 __mt76_mcu_msg_alloc(struct mt76_dev *dev, const void *data,
1716 static inline struct sk_buff *
1717 mt76_mcu_msg_alloc(struct mt76_dev *dev, const void *data, in mt76_mcu_msg_alloc()
1723 void mt76_mcu_rx_event(struct mt76_dev *dev, struct sk_buff *skb);
1724 struct sk_buff *mt76_mcu_get_response(struct mt76_dev *dev,
1726 int mt76_mcu_send_and_get_msg(struct mt76_dev *dev, int cmd, const void *data,
1727 int len, bool wait_resp, struct sk_buff **ret);
1728 int mt76_mcu_skb_send_and_get_msg(struct mt76_dev *dev, struct sk_buff *skb,
1729 int cmd, bool wait_resp, struct sk_buff **ret);
1731 int __mt76_mcu_send_firmware(struct mt76_dev *dev, int cmd, const void *data,
1733 int __mt76_mcu_send_firmware(struct mt76_dev *dev, int cmd, const u8 *data,
1737 mt76_mcu_send_firmware(struct mt76_dev *dev, int cmd, const void *data, in mt76_mcu_send_firmware()
1746 mt76_mcu_send_msg(struct mt76_dev *dev, int cmd, const void *data, int len, in mt76_mcu_send_msg()
1753 mt76_mcu_skb_send_msg(struct mt76_dev *dev, struct sk_buff *skb, int cmd, in mt76_mcu_skb_send_msg()
1759 void mt76_set_irq_mask(struct mt76_dev *dev, u32 addr, u32 clear, u32 set);
1761 struct device_node *
1762 mt76_find_power_limits_node(struct mt76_dev *dev);
1763 struct device_node *
1764 mt76_find_channel_node(struct device_node *np, struct ieee80211_channel *chan);
1766 s8 mt76_get_rate_power_limits(struct mt76_phy *phy,
1767 struct ieee80211_channel *chan,
1768 struct mt76_power_limits *dest,
1771 static inline bool mt76_queue_is_rx(struct mt76_dev *dev, struct mt76_queue *q) in mt76_queue_is_rx()
1783 static inline bool mt76_queue_is_wed_tx_free(struct mt76_queue *q) in mt76_queue_is_wed_tx_free()
1789 static inline bool mt76_queue_is_wed_rro(struct mt76_queue *q) in mt76_queue_is_wed_rro()
1794 static inline bool mt76_queue_is_wed_rro_ind(struct mt76_queue *q) in mt76_queue_is_wed_rro_ind()
1800 static inline bool mt76_queue_is_wed_rro_data(struct mt76_queue *q) in mt76_queue_is_wed_rro_data()
1807 static inline bool mt76_queue_is_wed_rx(struct mt76_queue *q) in mt76_queue_is_wed_rx()
1817 struct mt76_txwi_cache *
1818 mt76_token_release(struct mt76_dev *dev, int token, bool *wake);
1819 int mt76_token_consume(struct mt76_dev *dev, struct mt76_txwi_cache **ptxwi);
1820 void __mt76_set_tx_blocked(struct mt76_dev *dev, bool blocked);
1821 struct mt76_txwi_cache *mt76_rx_token_release(struct mt76_dev *dev, int token);
1822 int mt76_rx_token_consume(struct mt76_dev *dev, void *ptr,
1823 struct mt76_txwi_cache *r, dma_addr_t phys);
1824 int mt76_create_page_pool(struct mt76_dev *dev, struct mt76_queue *q);
1827 struct page *page = virt_to_head_page(buf); in mt76_put_page_pool_buf()
1834 mt76_get_page_pool_buf(struct mt76_queue *q, u32 *offset, u32 size) in mt76_get_page_pool_buf()
1836 struct page *page; in mt76_get_page_pool_buf()
1849 static inline void mt76_set_tx_blocked(struct mt76_dev *dev, bool blocked) in mt76_set_tx_blocked()
1857 mt76_token_get(struct mt76_dev *dev, struct mt76_txwi_cache **ptxwi) in mt76_token_get()
1868 static inline struct mt76_txwi_cache *
1869 mt76_token_put(struct mt76_dev *dev, int token) in mt76_token_put()
1871 struct mt76_txwi_cache *txwi; in mt76_token_put()
1880 void mt76_wcid_init(struct mt76_wcid *wcid, u8 band_idx);
1881 void mt76_wcid_cleanup(struct mt76_dev *dev, struct mt76_wcid *wcid);
1882 void mt76_wcid_add_poll(struct mt76_dev *dev, struct mt76_wcid *wcid);
1885 mt76_vif_init(struct ieee80211_vif *vif, struct mt76_vif_data *mvif) in mt76_vif_init()
1887 struct mt76_vif_link *mlink = (struct mt76_vif_link *)vif->drv_priv; in mt76_vif_init()
1893 void mt76_vif_cleanup(struct mt76_dev *dev, struct ieee80211_vif *vif);
1895 static inline struct mt76_vif_link *
1896 mt76_vif_link(struct mt76_dev *dev, struct ieee80211_vif *vif, int link_id) in mt76_vif_link()
1898 struct mt76_vif_link *mlink = (struct mt76_vif_link *)vif->drv_priv; in mt76_vif_link()
1899 struct mt76_vif_data *mvif = mlink->mvif; in mt76_vif_link()
1907 static inline struct mt76_vif_link *
1908 mt76_vif_conf_link(struct mt76_dev *dev, struct ieee80211_vif *vif, in mt76_vif_conf_link()
1909 struct ieee80211_bss_conf *link_conf) in mt76_vif_conf_link()
1911 struct mt76_vif_link *mlink = (struct mt76_vif_link *)vif->drv_priv; in mt76_vif_conf_link()
1912 struct mt76_vif_data *mvif = mlink->mvif; in mt76_vif_conf_link()
1920 static inline struct mt76_phy *
1921 mt76_vif_link_phy(struct mt76_vif_link *mlink) in mt76_vif_link_phy()
1923 struct mt76_chanctx *ctx; in mt76_vif_link_phy()
1928 ctx = (struct mt76_chanctx *)mlink->ctx->drv_priv; in mt76_vif_link_phy()