| 1 |
/* SPDX-License-Identifier: BSD-3-Clause-Clear */ |
| 2 |
/* Copyright (C) 2019 MediaTek Inc. */ |
| 3 |
|
| 4 |
#ifndef __MT7615_H |
| 5 |
#define __MT7615_H |
| 6 |
|
| 7 |
#include <linux/completion.h> |
| 8 |
#include <linux/hex.h> |
| 9 |
#include <linux/interrupt.h> |
| 10 |
#include <linux/ktime.h> |
| 11 |
#include <linux/regmap.h> |
| 12 |
#include "../mt76_connac_mcu.h" |
| 13 |
#include "regs.h" |
| 14 |
|
| 15 |
#define MT7615_MAX_INTERFACES 16 |
| 16 |
#define MT7615_MAX_WMM_SETS 4 |
| 17 |
#define MT7663_WTBL_SIZE 32 |
| 18 |
#define MT7615_WTBL_SIZE 128 |
| 19 |
#define MT7615_WTBL_RESERVED (mt7615_wtbl_size(dev) - 1) |
| 20 |
#define MT7615_WTBL_STA (MT7615_WTBL_RESERVED - \ |
| 21 |
MT7615_MAX_INTERFACES) |
| 22 |
|
| 23 |
#define MT7615_PM_TIMEOUT (HZ / 12) |
| 24 |
#define MT7615_HW_SCAN_TIMEOUT (HZ / 10) |
| 25 |
#define MT7615_RESET_TIMEOUT (30 * HZ) |
| 26 |
#define MT7615_RATE_RETRY 2 |
| 27 |
|
| 28 |
#define MT7615_TX_RING_SIZE 1024 |
| 29 |
#define MT7615_TX_MGMT_RING_SIZE 128 |
| 30 |
#define MT7615_TX_MCU_RING_SIZE 128 |
| 31 |
#define MT7615_TX_FWDL_RING_SIZE 128 |
| 32 |
|
| 33 |
#define MT7615_RX_RING_SIZE 1024 |
| 34 |
#define MT7615_RX_MCU_RING_SIZE 512 |
| 35 |
|
| 36 |
#define MT7615_DRV_OWN_RETRY_COUNT 10 |
| 37 |
|
| 38 |
#define MT7615_FIRMWARE_CR4 "mediatek/mt7615_cr4.bin" |
| 39 |
#define MT7615_FIRMWARE_N9 "mediatek/mt7615_n9.bin" |
| 40 |
#define MT7615_ROM_PATCH "mediatek/mt7615_rom_patch.bin" |
| 41 |
|
| 42 |
#define MT7622_FIRMWARE_N9 "mediatek/mt7622_n9.bin" |
| 43 |
#define MT7622_ROM_PATCH "mediatek/mt7622_rom_patch.bin" |
| 44 |
|
| 45 |
#define MT7615_FIRMWARE_V1 1 |
| 46 |
#define MT7615_FIRMWARE_V2 2 |
| 47 |
#define MT7615_FIRMWARE_V3 3 |
| 48 |
|
| 49 |
#define MT7663_OFFLOAD_ROM_PATCH "mediatek/mt7663pr2h.bin" |
| 50 |
#define MT7663_OFFLOAD_FIRMWARE_N9 "mediatek/mt7663_n9_v3.bin" |
| 51 |
#define MT7663_ROM_PATCH "mediatek/mt7663pr2h_rebb.bin" |
| 52 |
#define MT7663_FIRMWARE_N9 "mediatek/mt7663_n9_rebb.bin" |
| 53 |
|
| 54 |
#define MT7615_EEPROM_SIZE 1024 |
| 55 |
#define MT7663_EEPROM_SIZE 1536 |
| 56 |
#define MT7615_TOKEN_SIZE 4096 |
| 57 |
|
| 58 |
#define MT_FRAC_SCALE 12 |
| 59 |
#define MT_FRAC(val, div) (((val) << MT_FRAC_SCALE) / (div)) |
| 60 |
|
| 61 |
#define MT_CHFREQ_VALID BIT(7) |
| 62 |
#define MT_CHFREQ_DBDC_IDX BIT(6) |
| 63 |
#define MT_CHFREQ_SEQ GENMASK(5, 0) |
| 64 |
|
| 65 |
#define MT7615_BAR_RATE_DEFAULT 0x4b /* OFDM 6M */ |
| 66 |
#define MT7615_CFEND_RATE_DEFAULT 0x49 /* OFDM 24M */ |
| 67 |
#define MT7615_CFEND_RATE_11B 0x03 /* 11B LP, 11M */ |
| 68 |
|
| 69 |
struct mt7615_vif; |
| 70 |
struct mt7615_sta; |
| 71 |
struct mt7615_dfs_pulse; |
| 72 |
struct mt7615_dfs_pattern; |
| 73 |
enum mt7615_cipher_type; |
| 74 |
|
| 75 |
enum mt7615_hw_txq_id { |
| 76 |
MT7615_TXQ_MAIN, |
| 77 |
MT7615_TXQ_EXT, |
| 78 |
MT7615_TXQ_MCU, |
| 79 |
MT7615_TXQ_FWDL, |
| 80 |
}; |
| 81 |
|
| 82 |
enum mt7622_hw_txq_id { |
| 83 |
MT7622_TXQ_AC0, |
| 84 |
MT7622_TXQ_AC1, |
| 85 |
MT7622_TXQ_AC2, |
| 86 |
MT7622_TXQ_FWDL = MT7615_TXQ_FWDL, |
| 87 |
MT7622_TXQ_AC3, |
| 88 |
MT7622_TXQ_MGMT, |
| 89 |
MT7622_TXQ_MCU = 15, |
| 90 |
}; |
| 91 |
|
| 92 |
struct mt7615_rate_set { |
| 93 |
struct ieee80211_tx_rate probe_rate; |
| 94 |
struct ieee80211_tx_rate rates[4]; |
| 95 |
}; |
| 96 |
|
| 97 |
struct mt7615_rate_desc { |
| 98 |
bool rateset; |
| 99 |
u16 probe_val; |
| 100 |
u16 val[4]; |
| 101 |
u8 bw_idx; |
| 102 |
u8 bw; |
| 103 |
}; |
| 104 |
|
| 105 |
struct mt7615_wtbl_rate_desc { |
| 106 |
struct list_head node; |
| 107 |
|
| 108 |
struct mt7615_rate_desc rate; |
| 109 |
struct mt7615_sta *sta; |
| 110 |
}; |
| 111 |
|
| 112 |
struct mt7663s_intr { |
| 113 |
u32 isr; |
| 114 |
struct { |
| 115 |
u32 wtqcr[8]; |
| 116 |
} tx; |
| 117 |
struct { |
| 118 |
u16 num[2]; |
| 119 |
u16 len[2][16]; |
| 120 |
} rx; |
| 121 |
u32 rec_mb[2]; |
| 122 |
} __packed; |
| 123 |
|
| 124 |
struct mt7615_sta { |
| 125 |
struct mt76_wcid wcid; /* must be first */ |
| 126 |
|
| 127 |
struct mt7615_vif *vif; |
| 128 |
|
| 129 |
u32 airtime_ac[8]; |
| 130 |
|
| 131 |
struct ieee80211_tx_rate rates[4]; |
| 132 |
|
| 133 |
struct mt7615_rate_set rateset[2]; |
| 134 |
u32 rate_set_tsf; |
| 135 |
|
| 136 |
u8 rate_count; |
| 137 |
u8 n_rates; |
| 138 |
|
| 139 |
u8 rate_probe; |
| 140 |
}; |
| 141 |
|
| 142 |
struct mt7615_vif { |
| 143 |
struct mt76_vif_link mt76; /* must be first */ |
| 144 |
struct mt7615_sta sta; |
| 145 |
bool sta_added; |
| 146 |
}; |
| 147 |
|
| 148 |
struct mib_stats { |
| 149 |
u32 ack_fail_cnt; |
| 150 |
u32 fcs_err_cnt; |
| 151 |
u32 rts_cnt; |
| 152 |
u32 rts_retries_cnt; |
| 153 |
u32 ba_miss_cnt; |
| 154 |
unsigned long aggr_per; |
| 155 |
}; |
| 156 |
|
| 157 |
struct mt7615_phy { |
| 158 |
struct mt76_phy *mt76; |
| 159 |
struct mt7615_dev *dev; |
| 160 |
|
| 161 |
struct ieee80211_vif *monitor_vif; |
| 162 |
|
| 163 |
u8 n_beacon_vif; |
| 164 |
|
| 165 |
u32 rxfilter; |
| 166 |
u64 omac_mask; |
| 167 |
|
| 168 |
u16 noise; |
| 169 |
|
| 170 |
bool scs_en; |
| 171 |
|
| 172 |
unsigned long last_cca_adj; |
| 173 |
int false_cca_ofdm, false_cca_cck; |
| 174 |
s8 ofdm_sensitivity; |
| 175 |
s8 cck_sensitivity; |
| 176 |
|
| 177 |
s16 coverage_class; |
| 178 |
u8 slottime; |
| 179 |
|
| 180 |
u8 chfreq; |
| 181 |
u8 rdd_state; |
| 182 |
|
| 183 |
u32 rx_ampdu_ts; |
| 184 |
u32 ampdu_ref; |
| 185 |
|
| 186 |
struct mib_stats mib; |
| 187 |
|
| 188 |
struct sk_buff_head scan_event_list; |
| 189 |
struct delayed_work scan_work; |
| 190 |
|
| 191 |
struct work_struct roc_work; |
| 192 |
struct timer_list roc_timer; |
| 193 |
wait_queue_head_t roc_wait; |
| 194 |
bool roc_grant; |
| 195 |
|
| 196 |
#ifdef CONFIG_NL80211_TESTMODE |
| 197 |
struct { |
| 198 |
u32 *reg_backup; |
| 199 |
|
| 200 |
s16 last_freq_offset; |
| 201 |
u8 last_rcpi[4]; |
| 202 |
s8 last_ib_rssi[4]; |
| 203 |
s8 last_wb_rssi[4]; |
| 204 |
} test; |
| 205 |
#endif |
| 206 |
}; |
| 207 |
|
| 208 |
#define mt7615_mcu_add_tx_ba(dev, ...) (dev)->mcu_ops->add_tx_ba((dev), __VA_ARGS__) |
| 209 |
#define mt7615_mcu_add_rx_ba(dev, ...) (dev)->mcu_ops->add_rx_ba((dev), __VA_ARGS__) |
| 210 |
#define mt7615_mcu_sta_add(phy, ...) ((phy)->dev)->mcu_ops->sta_add((phy), __VA_ARGS__) |
| 211 |
#define mt7615_mcu_add_dev_info(phy, ...) ((phy)->dev)->mcu_ops->add_dev_info((phy), __VA_ARGS__) |
| 212 |
#define mt7615_mcu_add_bss_info(phy, ...) ((phy)->dev)->mcu_ops->add_bss_info((phy), __VA_ARGS__) |
| 213 |
#define mt7615_mcu_add_beacon(dev, ...) (dev)->mcu_ops->add_beacon_offload((dev), __VA_ARGS__) |
| 214 |
#define mt7615_mcu_set_pm(dev, ...) (dev)->mcu_ops->set_pm_state((dev), __VA_ARGS__) |
| 215 |
#define mt7615_mcu_set_drv_ctrl(dev) (dev)->mcu_ops->set_drv_ctrl((dev)) |
| 216 |
#define mt7615_mcu_set_fw_ctrl(dev) (dev)->mcu_ops->set_fw_ctrl((dev)) |
| 217 |
#define mt7615_mcu_set_sta_decap_offload(dev, ...) (dev)->mcu_ops->set_sta_decap_offload((dev), __VA_ARGS__) |
| 218 |
struct mt7615_mcu_ops { |
| 219 |
int (*add_tx_ba)(struct mt7615_dev *dev, |
| 220 |
struct ieee80211_ampdu_params *params, |
| 221 |
bool enable); |
| 222 |
int (*add_rx_ba)(struct mt7615_dev *dev, |
| 223 |
struct ieee80211_ampdu_params *params, |
| 224 |
bool enable); |
| 225 |
int (*sta_add)(struct mt7615_phy *phy, struct ieee80211_vif *vif, |
| 226 |
struct ieee80211_sta *sta, bool enable); |
| 227 |
int (*add_dev_info)(struct mt7615_phy *phy, struct ieee80211_vif *vif, |
| 228 |
bool enable); |
| 229 |
int (*add_bss_info)(struct mt7615_phy *phy, struct ieee80211_vif *vif, |
| 230 |
struct ieee80211_sta *sta, bool enable); |
| 231 |
int (*add_beacon_offload)(struct mt7615_dev *dev, |
| 232 |
struct ieee80211_hw *hw, |
| 233 |
struct ieee80211_vif *vif, bool enable); |
| 234 |
int (*set_pm_state)(struct mt7615_dev *dev, int band, int state); |
| 235 |
int (*set_drv_ctrl)(struct mt7615_dev *dev); |
| 236 |
int (*set_fw_ctrl)(struct mt7615_dev *dev); |
| 237 |
int (*set_sta_decap_offload)(struct mt7615_dev *dev, |
| 238 |
struct ieee80211_vif *vif, |
| 239 |
struct ieee80211_sta *sta); |
| 240 |
}; |
| 241 |
|
| 242 |
struct mt7615_dev { |
| 243 |
union { /* must be first */ |
| 244 |
struct mt76_dev mt76; |
| 245 |
struct mt76_phy mphy; |
| 246 |
}; |
| 247 |
|
| 248 |
const struct mt76_bus_ops *bus_ops; |
| 249 |
struct mt7615_phy phy; |
| 250 |
u64 omac_mask; |
| 251 |
|
| 252 |
u16 chainmask; |
| 253 |
|
| 254 |
struct ieee80211_ops *ops; |
| 255 |
const struct mt7615_mcu_ops *mcu_ops; |
| 256 |
struct regmap *infracfg; |
| 257 |
const u32 *reg_map; |
| 258 |
|
| 259 |
struct work_struct mcu_work; |
| 260 |
|
| 261 |
struct work_struct reset_work; |
| 262 |
wait_queue_head_t reset_wait; |
| 263 |
u32 reset_state; |
| 264 |
|
| 265 |
struct { |
| 266 |
u8 n_pulses; |
| 267 |
u32 period; |
| 268 |
u16 width; |
| 269 |
s16 power; |
| 270 |
} radar_pattern; |
| 271 |
u32 hw_pattern; |
| 272 |
|
| 273 |
bool fw_debug; |
| 274 |
bool flash_eeprom; |
| 275 |
bool dbdc_support; |
| 276 |
|
| 277 |
u8 fw_ver; |
| 278 |
|
| 279 |
struct work_struct rate_work; |
| 280 |
struct list_head wrd_head; |
| 281 |
|
| 282 |
u32 debugfs_rf_wf; |
| 283 |
u32 debugfs_rf_reg; |
| 284 |
|
| 285 |
u32 muar_mask; |
| 286 |
|
| 287 |
struct mt76_connac_pm pm; |
| 288 |
struct mt76_connac_coredump coredump; |
| 289 |
}; |
| 290 |
|
| 291 |
enum tx_pkt_queue_idx { |
| 292 |
MT_LMAC_AC00, |
| 293 |
MT_LMAC_AC01, |
| 294 |
MT_LMAC_AC02, |
| 295 |
MT_LMAC_AC03, |
| 296 |
MT_LMAC_ALTX0 = 0x10, |
| 297 |
MT_LMAC_BMC0, |
| 298 |
MT_LMAC_BCN0, |
| 299 |
MT_LMAC_PSMP0, |
| 300 |
MT_LMAC_ALTX1, |
| 301 |
MT_LMAC_BMC1, |
| 302 |
MT_LMAC_BCN1, |
| 303 |
MT_LMAC_PSMP1, |
| 304 |
}; |
| 305 |
|
| 306 |
enum { |
| 307 |
MT_RX_SEL0, |
| 308 |
MT_RX_SEL1, |
| 309 |
}; |
| 310 |
|
| 311 |
enum mt7615_rdd_cmd { |
| 312 |
RDD_STOP, |
| 313 |
RDD_START, |
| 314 |
RDD_DET_MODE, |
| 315 |
RDD_DET_STOP, |
| 316 |
RDD_CAC_START, |
| 317 |
RDD_CAC_END, |
| 318 |
RDD_NORMAL_START, |
| 319 |
RDD_DISABLE_DFS_CAL, |
| 320 |
RDD_PULSE_DBG, |
| 321 |
RDD_READ_PULSE, |
| 322 |
RDD_RESUME_BF, |
| 323 |
}; |
| 324 |
|
| 325 |
static inline struct mt7615_phy * |
| 326 |
mt7615_hw_phy(struct ieee80211_hw *hw) |
| 327 |
{ |
| 328 |
struct mt76_phy *phy = hw->priv; |
| 329 |
|
| 330 |
return phy->priv; |
| 331 |
} |
| 332 |
|
| 333 |
static inline struct mt7615_dev * |
| 334 |
mt7615_hw_dev(struct ieee80211_hw *hw) |
| 335 |
{ |
| 336 |
struct mt76_phy *phy = hw->priv; |
| 337 |
|
| 338 |
return container_of(phy->dev, struct mt7615_dev, mt76); |
| 339 |
} |
| 340 |
|
| 341 |
static inline struct mt7615_phy * |
| 342 |
mt7615_ext_phy(struct mt7615_dev *dev) |
| 343 |
{ |
| 344 |
struct mt76_phy *phy = dev->mt76.phys[MT_BAND1]; |
| 345 |
|
| 346 |
if (!phy) |
| 347 |
return NULL; |
| 348 |
|
| 349 |
return phy->priv; |
| 350 |
} |
| 351 |
|
| 352 |
extern struct ieee80211_rate mt7615_rates[12]; |
| 353 |
extern const struct ieee80211_ops mt7615_ops; |
| 354 |
extern const u32 mt7615e_reg_map[__MT_BASE_MAX]; |
| 355 |
extern const u32 mt7663e_reg_map[__MT_BASE_MAX]; |
| 356 |
extern const u32 mt7663_usb_sdio_reg_map[__MT_BASE_MAX]; |
| 357 |
extern struct pci_driver mt7615_pci_driver; |
| 358 |
extern struct platform_driver mt7622_wmac_driver; |
| 359 |
extern const struct mt76_testmode_ops mt7615_testmode_ops; |
| 360 |
|
| 361 |
#ifdef CONFIG_MT7622_WMAC |
| 362 |
int mt7622_wmac_init(struct mt7615_dev *dev); |
| 363 |
#else |
| 364 |
static inline int mt7622_wmac_init(struct mt7615_dev *dev) |
| 365 |
{ |
| 366 |
return 0; |
| 367 |
} |
| 368 |
#endif |
| 369 |
|
| 370 |
int mt7615_thermal_init(struct mt7615_dev *dev); |
| 371 |
int mt7615_mmio_probe(struct device *pdev, void __iomem *mem_base, |
| 372 |
int irq, const u32 *map); |
| 373 |
u32 mt7615_reg_map(struct mt7615_dev *dev, u32 addr); |
| 374 |
|
| 375 |
u32 mt7615_reg_map(struct mt7615_dev *dev, u32 addr); |
| 376 |
int mt7615_led_set_blink(struct led_classdev *led_cdev, |
| 377 |
unsigned long *delay_on, |
| 378 |
unsigned long *delay_off); |
| 379 |
void mt7615_led_set_brightness(struct led_classdev *led_cdev, |
| 380 |
enum led_brightness brightness); |
| 381 |
void mt7615_init_device(struct mt7615_dev *dev); |
| 382 |
int mt7615_register_device(struct mt7615_dev *dev); |
| 383 |
void mt7615_unregister_device(struct mt7615_dev *dev); |
| 384 |
int mt7615_register_ext_phy(struct mt7615_dev *dev); |
| 385 |
void mt7615_unregister_ext_phy(struct mt7615_dev *dev); |
| 386 |
int mt7615_eeprom_init(struct mt7615_dev *dev, u32 addr); |
| 387 |
int mt7615_eeprom_get_target_power_index(struct mt7615_dev *dev, |
| 388 |
struct ieee80211_channel *chan, |
| 389 |
u8 chain_idx); |
| 390 |
int mt7615_eeprom_get_power_delta_index(struct mt7615_dev *dev, |
| 391 |
enum nl80211_band band); |
| 392 |
int mt7615_wait_pdma_busy(struct mt7615_dev *dev); |
| 393 |
int mt7615_dma_init(struct mt7615_dev *dev); |
| 394 |
void mt7615_dma_start(struct mt7615_dev *dev); |
| 395 |
void mt7615_dma_cleanup(struct mt7615_dev *dev); |
| 396 |
int mt7615_mcu_init(struct mt7615_dev *dev); |
| 397 |
bool mt7615_wait_for_mcu_init(struct mt7615_dev *dev); |
| 398 |
void mt7615_mac_set_rates(struct mt7615_phy *phy, struct mt7615_sta *sta, |
| 399 |
struct ieee80211_tx_rate *probe_rate, |
| 400 |
struct ieee80211_tx_rate *rates); |
| 401 |
void mt7615_pm_wake_work(struct work_struct *work); |
| 402 |
void mt7615_pm_power_save_work(struct work_struct *work); |
| 403 |
int mt7615_mcu_set_chan_info(struct mt7615_phy *phy, int cmd); |
| 404 |
int mt7615_mcu_set_wmm(struct mt7615_dev *dev, u8 queue, |
| 405 |
const struct ieee80211_tx_queue_params *params); |
| 406 |
void mt7615_mcu_rx_event(struct mt7615_dev *dev, struct sk_buff *skb); |
| 407 |
int mt7615_mcu_rdd_send_pattern(struct mt7615_dev *dev); |
| 408 |
int mt7615_mcu_fw_log_2_host(struct mt7615_dev *dev, u8 ctrl); |
| 409 |
|
| 410 |
static inline bool mt7615_firmware_offload(struct mt7615_dev *dev) |
| 411 |
{ |
| 412 |
return dev->fw_ver > MT7615_FIRMWARE_V2; |
| 413 |
} |
| 414 |
|
| 415 |
static inline u16 mt7615_wtbl_size(struct mt7615_dev *dev) |
| 416 |
{ |
| 417 |
if (is_mt7663(&dev->mt76) && mt7615_firmware_offload(dev)) |
| 418 |
return MT7663_WTBL_SIZE; |
| 419 |
else |
| 420 |
return MT7615_WTBL_SIZE; |
| 421 |
} |
| 422 |
|
| 423 |
#define mt7615_mutex_acquire(dev) \ |
| 424 |
mt76_connac_mutex_acquire(&(dev)->mt76, &(dev)->pm) |
| 425 |
#define mt7615_mutex_release(dev) \ |
| 426 |
mt76_connac_mutex_release(&(dev)->mt76, &(dev)->pm) |
| 427 |
|
| 428 |
static inline u8 mt7615_lmac_mapping(struct mt7615_dev *dev, u8 ac) |
| 429 |
{ |
| 430 |
static const u8 lmac_queue_map[] = { |
| 431 |
[IEEE80211_AC_BK] = MT_LMAC_AC00, |
| 432 |
[IEEE80211_AC_BE] = MT_LMAC_AC01, |
| 433 |
[IEEE80211_AC_VI] = MT_LMAC_AC02, |
| 434 |
[IEEE80211_AC_VO] = MT_LMAC_AC03, |
| 435 |
}; |
| 436 |
|
| 437 |
if (WARN_ON_ONCE(ac >= ARRAY_SIZE(lmac_queue_map))) |
| 438 |
return MT_LMAC_AC01; /* BE */ |
| 439 |
|
| 440 |
return lmac_queue_map[ac]; |
| 441 |
} |
| 442 |
|
| 443 |
static inline u32 mt7615_tx_mcu_int_mask(struct mt7615_dev *dev) |
| 444 |
{ |
| 445 |
return MT_INT_TX_DONE(dev->mt76.q_mcu[MT_MCUQ_WM]->hw_idx); |
| 446 |
} |
| 447 |
|
| 448 |
static inline unsigned long |
| 449 |
mt7615_get_macwork_timeout(struct mt7615_dev *dev) |
| 450 |
{ |
| 451 |
return dev->pm.enable ? HZ / 3 : HZ / 10; |
| 452 |
} |
| 453 |
|
| 454 |
void mt7615_dma_reset(struct mt7615_dev *dev); |
| 455 |
void mt7615_scan_work(struct work_struct *work); |
| 456 |
void mt7615_roc_work(struct work_struct *work); |
| 457 |
void mt7615_roc_timer(struct timer_list *timer); |
| 458 |
void mt7615_init_txpower(struct mt7615_dev *dev, |
| 459 |
struct ieee80211_supported_band *sband); |
| 460 |
int mt7615_set_channel(struct mt76_phy *mphy); |
| 461 |
void mt7615_init_work(struct mt7615_dev *dev); |
| 462 |
|
| 463 |
int mt7615_mcu_restart(struct mt76_dev *dev); |
| 464 |
void mt7615_update_channel(struct mt76_phy *mphy); |
| 465 |
bool mt7615_mac_wtbl_update(struct mt7615_dev *dev, int idx, u32 mask); |
| 466 |
void mt7615_mac_reset_counters(struct mt7615_phy *phy); |
| 467 |
void mt7615_mac_cca_stats_reset(struct mt7615_phy *phy); |
| 468 |
void mt7615_mac_set_scs(struct mt7615_phy *phy, bool enable); |
| 469 |
void mt7615_mac_enable_nf(struct mt7615_dev *dev, bool ext_phy); |
| 470 |
void mt7615_mac_sta_poll(struct mt7615_dev *dev); |
| 471 |
int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi, |
| 472 |
struct sk_buff *skb, struct mt76_wcid *wcid, |
| 473 |
struct ieee80211_sta *sta, int pid, |
| 474 |
struct ieee80211_key_conf *key, |
| 475 |
enum mt76_txq_id qid, bool beacon); |
| 476 |
void mt7615_mac_set_timing(struct mt7615_phy *phy); |
| 477 |
int __mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, |
| 478 |
struct mt76_wcid *wcid, |
| 479 |
struct ieee80211_key_conf *key); |
| 480 |
int mt7615_mac_wtbl_set_key(struct mt7615_dev *dev, struct mt76_wcid *wcid, |
| 481 |
struct ieee80211_key_conf *key); |
| 482 |
void mt7615_mac_reset_work(struct work_struct *work); |
| 483 |
u32 mt7615_mac_get_sta_tid_sn(struct mt7615_dev *dev, int wcid, u8 tid); |
| 484 |
|
| 485 |
int mt7615_mcu_parse_response(struct mt76_dev *mdev, int cmd, |
| 486 |
struct sk_buff *skb, int seq); |
| 487 |
u32 mt7615_rf_rr(struct mt7615_dev *dev, u32 wf, u32 reg); |
| 488 |
int mt7615_rf_wr(struct mt7615_dev *dev, u32 wf, u32 reg, u32 val); |
| 489 |
int mt7615_mcu_set_dbdc(struct mt7615_dev *dev); |
| 490 |
int mt7615_mcu_set_eeprom(struct mt7615_dev *dev); |
| 491 |
int mt7615_mcu_get_temperature(struct mt7615_dev *dev); |
| 492 |
int mt7615_mcu_set_tx_power(struct mt7615_phy *phy); |
| 493 |
void mt7615_mcu_exit(struct mt7615_dev *dev); |
| 494 |
void mt7615_mcu_fill_msg(struct mt7615_dev *dev, struct sk_buff *skb, |
| 495 |
int cmd, int *wait_seq); |
| 496 |
|
| 497 |
int mt7615_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, |
| 498 |
enum mt76_txq_id qid, struct mt76_wcid *wcid, |
| 499 |
struct ieee80211_sta *sta, |
| 500 |
struct mt76_tx_info *tx_info); |
| 501 |
|
| 502 |
void mt7615_tx_worker(struct mt76_worker *w); |
| 503 |
void mt7615_tx_token_put(struct mt7615_dev *dev); |
| 504 |
bool mt7615_rx_check(struct mt76_dev *mdev, void *data, int len); |
| 505 |
void mt7615_queue_rx_skb(struct mt76_dev *mdev, enum mt76_rxq_id q, |
| 506 |
struct sk_buff *skb, u32 *info); |
| 507 |
int mt7615_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif, |
| 508 |
struct ieee80211_sta *sta); |
| 509 |
void mt7615_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif, |
| 510 |
struct ieee80211_sta *sta); |
| 511 |
void mt7615_mac_work(struct work_struct *work); |
| 512 |
int mt7615_mcu_set_rx_hdr_trans_blacklist(struct mt7615_dev *dev); |
| 513 |
int mt7615_mcu_set_fcc5_lpn(struct mt7615_dev *dev, int val); |
| 514 |
int mt7615_mcu_set_pulse_th(struct mt7615_dev *dev, |
| 515 |
const struct mt7615_dfs_pulse *pulse); |
| 516 |
int mt7615_mcu_set_radar_th(struct mt7615_dev *dev, int index, |
| 517 |
const struct mt7615_dfs_pattern *pattern); |
| 518 |
int mt7615_mcu_set_test_param(struct mt7615_dev *dev, u8 param, bool test_mode, |
| 519 |
u32 val); |
| 520 |
int mt7615_mcu_set_sku_en(struct mt7615_phy *phy, bool enable); |
| 521 |
int mt7615_mcu_apply_rx_dcoc(struct mt7615_phy *phy); |
| 522 |
int mt7615_mcu_apply_tx_dpd(struct mt7615_phy *phy); |
| 523 |
int mt7615_dfs_init_radar_detector(struct mt7615_phy *phy); |
| 524 |
int mt7615_mcu_set_protection(struct mt7615_phy *phy, struct ieee80211_vif *vif, |
| 525 |
u8 ht_mode, bool use_cts_prot); |
| 526 |
int mt7615_mcu_set_roc(struct mt7615_phy *phy, struct ieee80211_vif *vif, |
| 527 |
struct ieee80211_channel *chan, int duration); |
| 528 |
|
| 529 |
int mt7615_init_debugfs(struct mt7615_dev *dev); |
| 530 |
int mt7615_mcu_wait_response(struct mt7615_dev *dev, int cmd, int seq); |
| 531 |
|
| 532 |
int mt7615_mac_set_beacon_filter(struct mt7615_phy *phy, |
| 533 |
struct ieee80211_vif *vif, |
| 534 |
bool enable); |
| 535 |
int mt7615_mcu_set_bss_pm(struct mt7615_dev *dev, struct ieee80211_vif *vif, |
| 536 |
bool enable); |
| 537 |
int __mt7663_load_firmware(struct mt7615_dev *dev); |
| 538 |
void mt7615_coredump_work(struct work_struct *work); |
| 539 |
|
| 540 |
void mt7622_trigger_hif_int(struct mt7615_dev *dev, bool en); |
| 541 |
|
| 542 |
/* usb */ |
| 543 |
int mt7663_usb_sdio_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, |
| 544 |
enum mt76_txq_id qid, struct mt76_wcid *wcid, |
| 545 |
struct ieee80211_sta *sta, |
| 546 |
struct mt76_tx_info *tx_info); |
| 547 |
bool mt7663_usb_sdio_tx_status_data(struct mt76_dev *mdev, u8 *update); |
| 548 |
void mt7663_usb_sdio_tx_complete_skb(struct mt76_dev *mdev, |
| 549 |
struct mt76_queue_entry *e); |
| 550 |
int mt7663_usb_sdio_register_device(struct mt7615_dev *dev); |
| 551 |
int mt7663u_mcu_init(struct mt7615_dev *dev); |
| 552 |
int mt7663u_mcu_power_on(struct mt7615_dev *dev); |
| 553 |
|
| 554 |
/* sdio */ |
| 555 |
int mt7663s_mcu_init(struct mt7615_dev *dev); |
| 556 |
|
| 557 |
#endif |