52 Commits
Author SHA1 Message Date
Ryder LeeandFelix Fietkau cd79526761 mt76: mt7615: support 16 interfaces
When looking for a MAC address slot, start by using main BSSID slots 1-3,
afterwards use 16 repeater mode BSSID slots, then start using the slots
usually used for AP mode.

This search order should prevent unnecessary conflicts with AP mode interfaces
on the same PHY.

Note that two PHYs share global 32 omac slots with each other.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-11-10 13:55:37 +01:00
Sean WangandFelix Fietkau 0aee499990 mt76: mt7663s: introduce WoW support via GPIO
SDIO-based WiFi would rely on an additional GPIO pin to wake up the host.

Co-developed-by: YN Chen <[email protected]>
Signed-off-by: YN Chen <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
2020-11-10 13:19:53 +01:00
Sean WangandFelix Fietkau aa97be8e02 mt76: mt7615: introduce mt7663s support
Introduce support for mt7663s 802.11ac 2x2:2 chipset to mt7615 driver.

Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
2020-07-15 16:14:51 +02:00
Felix Fietkau d7467bc018 mt76: mt7615: implement testmode support
Supports sending a configurable number of packets with a specific rate
and configurable tx power levels / antenna settings, as well as displaying
rx statistics.

Signed-off-by: Felix Fietkau <[email protected]>
2020-06-22 21:32:02 +02:00
Felix Fietkau 46bc8a0b53 mt76: mt7615: add support for accessing RF registers via MCU
Includes debugfs files for testing it.
Will be used for testmode support.

Signed-off-by: Felix Fietkau <[email protected]>
2020-06-22 21:28:35 +02:00
Lorenzo BianconiandFelix Fietkau d6d9a7ea42 mt76: add U-APSD support on AP side
Introduce U-APSD support in mt76 driver for AP interface

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-06-16 22:05:14 +02:00
Sean WangandFelix Fietkau 90fc1d8614 mt76: mt7663: introduce ARP filter offload
Introduce ARP filter offload

Co-developed-by: Wan-Feng Jiang <[email protected]>
Signed-off-by: Wan-Feng Jiang <[email protected]>
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-06-16 11:44:32 +02:00
Sean WangandFelix Fietkau 5396a61cec mt76: mt7615: fix hw_scan with ssid_type for specified SSID only
Fix hw_scan with ssid_type for specified SSID only

The definition for ssid_type in current firmware is that
ssid_type BIT(2) set actually for specified SSID + wildcard SSID.
ssid_type BIT(2) and ssid_type_ext BIT(0) both set actually for
specified SSID only;

Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-22 14:42:27 +02:00
Lorenzo BianconiandFelix Fietkau fa81da5bb4 mt76: mt7615: introduce remain_on_channel support
Introduce remain_on_channel support to mt7615 driver if the device is
running offload firmware

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-20 10:37:17 +02:00
Sean WangandFelix Fietkau 1ea444d0e8 mt76: mt7615: configure bss info adding the interface
Introduce essential bss information for multiple vifs hw_scan in
mt7615_mcu_uni_add_dev adding the interface

Signed-off-by: Sean Wang <[email protected]>
Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-20 10:37:11 +02:00
Lorenzo BianconiandFelix Fietkau 8bd88a1b18 mt76: enable p2p support
Introduce p2p-go/p2p-client suppor to mt76 driver

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-20 10:37:11 +02:00
Sean WangandFelix Fietkau 891136ab99 mt76: mt7663: add support to sched scan with randomise addr
Add support to sched scan with randomise addr

Co-developed-by: Wan-Feng Jiang <[email protected]>
Signed-off-by: Wan-Feng Jiang <[email protected]>
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-07 16:17:16 +02:00
Lorenzo BianconiandFelix Fietkau 50d377a825 mt76: mt7615: introduce beacon_loss mcu event
If device has enabled beacon hw filter rx beacons are not reported to
the host. Introduce beacon_loss mcu event to trigger mac80211 mlme
connection state machine in this configuration.
IEEE80211_VIF_BEACON_FILTER has not set in vif flags since hw beacon
filter is not enabled yet

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:06 +02:00
Lorenzo BianconiandFelix Fietkau 523716bba5 mt76: mt7615: add gtk rekey offload support
Add KCK and KEK offload support to mt7615 driver in order to
support GTK rekeying during PM suspend

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Co-developed-by: Wan-Feng Jiang <[email protected]>
Signed-off-by: Wan-Feng Jiang <[email protected]>
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:06 +02:00
Lorenzo BianconiandFelix Fietkau db45460510 mt76: mt7615: add WoW support
Introduce WoW support to mt7615 driver.
Current supported trigger are:
- magic-packet
- disconnect
- user-pattern

Co-developed-by: Wan-Feng Jiang <[email protected]>
Signed-off-by: Wan-Feng Jiang <[email protected]>
Co-developed-by: Soul Huang <[email protected]>
Signed-off-by: Soul Huang <[email protected]>
Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:06 +02:00
Sean WangandFelix Fietkau f2c760177b mt76: mt7615: introduce mt7615_mcu_set_hif_suspend mcu command
Introduce the mt7615_mcu_set_hif_suspend mcu command, which is usually
used to configure the interface including PCIe, USB or SDIO to the right
state during operation suspend / resume.

Signed-off-by: Sean Wang <[email protected]>
Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:06 +02:00
Lorenzo BianconiandFelix Fietkau 8fddbf6390 mt76: mt7615: introduce support for hardware beacon filter
Introduce support for hw beacon filter if available in the firmware

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-05-05 17:54:06 +02:00
Lorenzo BianconiandFelix Fietkau da329ef776 mt76: mt7615: parse mcu return code for unified commands
Add return code parsing for the following unified commands:
- MCU_UNI_CMD_DEV_INFO_UPDATE
- MCU_UNI_CMD_BSS_INFO_UPDATE
- MCU_UNI_CMD_STA_REC_UPDATE

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-22 18:02:07 +02:00
Lorenzo BianconiandFelix Fietkau ea133325fa mt76: mt7663: introduce 802.11 PS support in sta mode
Enable 802.11 power-save support available in mt7663 firmware

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-17 14:46:00 +02:00
Lorenzo BianconiandFelix Fietkau 94827d2033 mt76: mt7615: introduce mt7663u support
Introduce support for mt7663u 802.11ac 2x2:2 chipset to mt7615 driver.
Main difference respect to pcie code base is the usb code needs to
configure wtbl from non-atomic context

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-17 14:46:00 +02:00
Felix Fietkau 55198aafb7 mt76: mt7615: add support for applying tx DPD calibration from EEPROM
When the EEPROM data is read from flash, it can contain tx DPD calibration
data. Add support for sending the data to the firmware.

Signed-off-by: Felix Fietkau <[email protected]>
2020-04-06 12:20:17 +02:00
Felix Fietkau 2b58998bb5 mt76: mt7615: add support for applying DC offset calibration from EEPROM
When the EEPROM data is read from flash, it can contain DC offset calibration
data. Add support for sending the data to the firmware.

Signed-off-by: Felix Fietkau <[email protected]>
2020-04-06 12:20:17 +02:00
Lorenzo BianconiandFelix Fietkau 72c9380e70 mt76: add headroom and tailroom to mt76_mcu_ops data structure
Introduce headroom and tailroom to mt76_mcu_ops data structure in order
to unify the routine used for mcu message allocation. This is a
preliminary patch to add mt7663u support

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-06 12:20:12 +02:00
Lorenzo BianconiandFelix Fietkau f208a94300 mt76: mt7615: introduce rlm tlv in bss_info mcu command
Introduce rlm tlv header in bss_info mcu command in order to
inform the mcu about operating channel. Rlm header is necessary only if
the mcu is running low power functionalities (e.g offloaded scan)

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-06 12:20:11 +02:00
Sean WangandFelix Fietkau f6ab0bee31 mt76: mt7615: introduce BSS absence event
Introduce BSS absence event that is reported when the fw
is leaving or entering current operational channel.

Signed-off-by: Sean Wang <[email protected]>
Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-06 12:20:11 +02:00
Lorenzo BianconiandFelix Fietkau 12ecd5ba21 mt76: mt7615: introduce scheduled scan support
Introduce scheduled scan support for mt7663e devices

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-06 12:20:11 +02:00
Lorenzo BianconiandFelix Fietkau e6a3f3ffe5 mt76: mt7615: introduce hw scan support
Introduce hw scan support to mt7663e driver

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-06 12:20:11 +02:00
Lorenzo BianconiandFelix Fietkau 96e07ef111 mt76: mt7615: introduce mt7615_mcu_set_channel_domain mcu command
Introduce mt7615_mcu_set_channel_domain routines in order to instruct
the mcu about supported band/channels. This is a preliminary patch to
add hw scan support to mt7663e driver

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-06 12:20:11 +02:00
Lorenzo BianconiandFelix Fietkau 21ee7da00f mt76: mt7615: get rid of sta_rec_wtbl data structure
Sobstitute sta_rec_wtbl data structure with tlv one

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-03-17 17:50:15 +01:00
Sean WangandFelix Fietkau 9e5c76d231 mt76: mt7615: add more uni mcu commands
Introduce mt7615_mcu_uni_set_bss, mt7615_mcu_uni_set_dev and
mt7615_mcu_uni_set_beacon_offload uni mcu commands. This is a
preliminary patch to add mt7663e support

Signed-off-by: Sean Wang <[email protected]>
Co-developed-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-03-17 17:50:15 +01:00
Lorenzo BianconiandFelix Fietkau c4171728cf mt76: mt7615: introduce set_bmc and st_sta for uni commands
Introduce mt7615_mcu_uni_set_bmc and mt7615_mcu_uni_set_sta routines for
mt7663e commands.

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-03-17 17:50:15 +01:00
Lorenzo BianconiandFelix Fietkau 23ca7acfc8 mt76: mt7615: introduce uni cmd command types
Introduce mcu uni command type. Uni commands rely on a stripped verions
of mt7615_mcu_txd data strutture. Split mt7615_mcu_txd_common and
mt7615_mcu_txd. Uni commands will be use by mt7663e driver

Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-03-17 17:50:15 +01:00
Lorenzo BianconiandFelix Fietkau 7a6285e63d mt76: mt7615: introduce MCU_FW_PREFIX for fw mcu commands
Currently fw commands rely on negative cmds since they need different
mcu msg metadata. Extend this approach introducing MCU_FW_PREFIX.
This is a preliminary patch to support new mt7663e firmware commands

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-03-17 17:50:15 +01:00
Lorenzo BianconiandFelix Fietkau 2e991f3e8c mt76: mt7615: move mt7615_mcu_set_sta in mt7615_mcu_ops
Move mt7615_mcu_set_sta for fw version 1 and version 2 in mt7615_mcu_ops
data structure. This is a preliminary patch to properly support mt7663e
firmware.
Rework utility routines to rely on skb APIs for msg parsing

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-03-17 17:50:15 +01:00
Lorenzo BianconiandFelix Fietkau 2a4132a55a mt76: mt7615: add mt7615_mcu_ops data structure
Introduce mt7615_mcu_ops data structure in order to support multiple
mcu ops API.
Move mt7615_mcu_set_{tx,rx}_ba to mt7615_mcu_ops differentiating between
fw v1 and v2. This is a preliminary patch to properly support mt7663e
firmware.
Rework utility routines to rely on skb APIs for msg parsing

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-03-17 17:50:15 +01:00
Ryder LeeandFelix Fietkau 170b21f9ec mt76: mt7615: use new tag sta_rec_wtbl
In order to reduce command/event times, newer firmware adds a tag
sta_rec_wtbl to take care of WTBL operations.

MCU_EXT_CMD_WTBL_UPDATE is deprecated.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Shayne Chen <[email protected]>
Tested-by: Sean Wang <[email protected]>
2020-02-02 17:19:07 +01:00
Felix Fietkau 7882bbd25c mt76: mt7615: fix and rework tx power handling
Setting the tx power by manipulating EEPROM may in some cases not be enough,
since it only covers the base target power and not per-rate offsets.
In other cases, it could limit tx power of rates too much, possibly reducing
throughput or range.
Use firmware support for applying per-rate limit and power offsets for
different values of Nss.

Signed-off-by: Felix Fietkau <[email protected]>
2020-01-30 14:12:44 +01:00
Lorenzo BianconiandFelix Fietkau 0394715025 mt76: mt7615: initialize radar specs from host driver
Introduce dfs radar pattern specs in mt7615 driver in order to make
dfs debugging easier. Radar pulse/pattern thresholds are taken from
vendor SDK.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-01-27 17:47:51 +01:00
Felix Fietkau 8f33a1e936 mt76: mt7615: report firmware log event messages
Useful for debugging firmware issues. Can be turned on via the "fw_debug"
debugfs file

Signed-off-by: Felix Fietkau <[email protected]>
2020-01-13 22:17:00 +01:00
Felix Fietkau c5585a7358 mt76: mt7615: initialize dbdc settings on interface add
Use the first two WMM slots for the primary phy and the second two for the
secondary phy.

Signed-off-by: Felix Fietkau <[email protected]>
2019-12-03 20:04:12 +01:00
Felix Fietkau 705a0fcdc3 mt76: mt7615: add multiple wiphy support to the dfs support code
There are two DFS detectors on the chip. When using 160 MHz channel bandwidth
(not supported in dual-wiphy mode), both are used. Otherwise, one detector is
used per wiphy.
Rework the code to start/stop them separately per phy and to indicate the
radar event on the right phy based on the detector index

Signed-off-by: Felix Fietkau <[email protected]>
2019-12-03 20:04:12 +01:00
Lorenzo BianconiandFelix Fietkau c7f82146ef mt76: mt7615: add support to read temperature from mcu
Introduce debugfs entry to read device temperature and related cmu
command. Introduce mt7615_mcu_parse_response to parse mcu response
messages and refactor mt7615_mcu_msg_send routine

Signed-off-by: Lorenzo Bianconi <[email protected]>
2019-09-05 17:51:19 +02:00
Lorenzo BianconiandFelix Fietkau d998b90c4b mt76: mt7615: remove wtbl_sec_key definition
Get rid of wtbl_sec_key definition since it is no longer used

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-08-20 15:21:27 +02:00
Lorenzo BianconiandFelix Fietkau 8e495245ab mt76: mt7615: move mt7615_mac_get_key_info in mac.c
This is a preliminary patch to update wtbl key directly from host
processor

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-08-20 15:21:27 +02:00
Lorenzo BianconiandFelix Fietkau 8919516006 mt76: mt7615: add radar pattern test knob to debugfs
Introduce mt7615_mcu_rdd_send_pattern routine to trigger a radar pattern
detection. Moreover move debugfs related routines in a dedicated source
file.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-07-01 14:09:17 +02:00
Lorenzo BianconiandFelix Fietkau 6afc952196 mt76: mt7615: add csa support
Add Channel Switch Announcement support to mt7615 driver updating beacon
template with CSA IE received from mac80211

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-07-01 14:09:17 +02:00
Lorenzo BianconiandFelix Fietkau 901a4c7b7f mt76: mt7615: add hw dfs pattern detector support
Add hw radar detection support to mt7615 driver in order to
unlock dfs channels on 5GHz band

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-07-01 14:09:17 +02:00
Ryder LeeandFelix Fietkau f072c7ba21 mt76: mt7615: enable support for mesh
Enable NL80211_IFTYPE_MESH_POINT and update its path.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-06-07 19:00:05 +02:00
Lorenzo BianconiandFelix Fietkau 514fb04492 mt76: mt7615: add the capability to configure tx power
Introduce mt7615_mcu_set_tx_power routine in order to cap tx power
according to the value configured by the user

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-06-07 19:00:05 +02:00
Lorenzo BianconiandFelix Fietkau a8834a233f mt7615: mcu: use standard signature for mt7615_mcu_msg_send
Use mt76 common signature for mt7615_mcu_msg_send. Move skb allocation
in mt7615_mcu_msg_send and remove duplicated code. Remove
__mt7615_mcu_set_wtbl and __mt7615_mcu_set_sta_rec since now are used
just to send mcu msgs.  This is a preliminary patch for mt7615-mt7603 mcu
code unification

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-05-11 15:57:46 +02:00