summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/mt7615
AgeCommit message (Collapse)AuthorFilesLines
2019-11-20mt76: store current channel survey_state in struct mt76_devFelix Fietkau1-1/+1
Move mt76_channel_state() from mt76.h to mac80211.c Preparation for updating channel state from more places in the drivers/core Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: rename mt76_driver_ops txwi_flags to drv_flags and include tx aligned4Felix Fietkau1-1/+1
This reduces the struct size and is useful for adding more flags later Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: report rx a-mpdu subframe statusFelix Fietkau2-0/+16
This can be used in monitor mode to figure out which subframes were sent as part of which A-MPDU Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt7615: collect aggregation statsLorenzo Bianconi5-0/+66
Introduce ampdu_stat entry in mt7615 debugfs in order to dump 802.11 aggr cumulative statistics Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt7615: add queue entry in debugfsLorenzo Bianconi2-0/+72
Introduce mt7615_queues_read routine to dump hw queue related info. Add hw ac queues statistics in mt7615 debugfs Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt7615: enable SCS by defaultLorenzo Bianconi1-1/+1
Enable Smart Carrier Sense algorithm by default in order to improve performances in a noisy environment Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-11-20mt76: mt7615: fix control frame rx in monitor modeFelix Fietkau3-1/+38
Adjust filters and ensure frames don't get sent to MCU instead of host Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-10-04mac80211: simplify TX aggregation startJohannes Berg1-2/+1
There really is no need to make drivers call the ieee80211_start_tx_ba_cb_irqsafe() function and then schedule the worker if all we want is to set a bit. Add a new return value (that was previously considered invalid) to indicate that the driver is immediately ready for the session, and make drivers use it. The only drivers that remain different are the Intel ones as they need to negotiate more with the firmware. Link: https://lore.kernel.org/r/1570007543-I152912660131cbab2e5d80b4218238c20f8a06e5@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-09-24mt76: mt7615: fix mt7615 firmware path definitionsLorenzo Bianconi2-10/+7
mt7615 patch/n9/cr4 firmwares are available in mediatek folder in linux-firmware repository. Because of this mt7615 won't work on regular distributions like Ubuntu. Fix path definitions. Moreover remove useless firmware name pointers and use definitions directly Fixes: 04b8e65922f6 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets") Cc: stable@vger.kernel.org Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-09-05mt76: mt7615: add support to read temperature from mcuLorenzo Bianconi4-11/+59
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 <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: introduce mt7615_txwi_to_txp utility routineLorenzo Bianconi2-6/+15
Introduce mt7615_txwi_to_txp utility routine to convert mt76_txwi_cache into mt7615_txp and remove duplicated code Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: do not send BAR frame on tx aggregation flush stopFelix Fietkau1-1/+0
There is no need to send a BAR frame after stopping aggregation, and doing so could lead to sending class 3 frames after deauthentication from an AP Signed-off-by: Balakrishna Bandi <b.balakrishna@globaledgesoft.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: apply calibration-free data from OTPFelix Fietkau1-0/+38
MT7615 chips usually come pre-calibrated, even when used on embedded boards. In that case, the on-flash EEPROM data needs to be merged with some data from OTP ROM. Run this merge if the external EEPROM data is valid and OTP has valid fields. Tested-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: add default implementation for mt76_sw_scan/mt76_sw_scan_completeLorenzo Bianconi1-19/+2
Introduce a default implementation for mt76_sw_scan and mt76_sw_scan_complete in mt76 module and remove duplicated code since most of the drivers share the same implementation Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: fix some checkpatch warningsRyder Lee1-1/+2
This fixes the following checkpatch warnings: CHECK: Alignment should match open parenthesis CHECK: No space is necessary after a cast Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: add BIP_CMAC_128 cipher supportLorenzo Bianconi2-45/+131
Refactor mt7615_mac_wtbl_set_key and introduce the following routines in order to configure wtbl entries and properly add hw support to BIP_CMAC_128 cipher: - mt7615_mac_wtbl_update_cipher - mt7615_mac_wtbl_update_pk - mt7615_mac_wtbl_update_key Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: move mt76_tx_tasklet in mt76 moduleLorenzo Bianconi1-10/+0
Move mt76{15,03}_tx_tasklet in mt76_alloc_device in order to be used as default tx_tasklet initialization. Remove duplicated code in mt7603/mt7615 drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: enable survey supportLorenzo Bianconi5-0/+34
Introduce channel survey support for mt7615 driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: add Smart Carrier Sense supportLorenzo Bianconi6-0/+270
Introduce Smart Carrier Sense support in order to tune device sensitivity according to RTS error rate and False CCA reported by the radio Tested-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: rework locking scheme for mt7615_set_channelLorenzo Bianconi1-6/+8
As already done for mt7603 driver, move mt76.mutex lock inside mt7615_set_channel since we need to grab mt76.mutex in mt7615_mac_work. This is a preliminary patch to add Smart Carrier Sense (SCS) support Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: fix some checkpatch warningsRyder Lee3-5/+3
This fixes the following checkpatch warnings: WARNING: Improper SPDX comment style Fix blank lines. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: Add paragraphs to describe the config symbols fullyRyder Lee1-1/+6
Update the help text to fix a checkpatch warning: WARNING: please write a paragraph that describes the config symbol fully Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: update cw_min/max related settingsRyder Lee1-9/+9
Add default values of cw_min/max and use fls() for configuration. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: add 4 WMM sets supportRyder Lee3-12/+10
Hardware supports 4 sets of WMM that should be put to good use. And fix incorrect queue mapping in mt7615_conf_tx(). Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: fix MT7615_WATCHDOG_TIME definitionLorenzo Bianconi1-1/+1
Express watchdog timeout in jiffies since it is used directly in ieee80211_queue_delayed_work Fixes: 04b8e65922f6 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: add set_key_cmd and mt76_wcid to mt7615_mac_wtbl_set_key signatureLorenzo Bianconi3-18/+21
Introduce set_key_cmd and mt76_wcid pointer to mt7615_mac_wtbl_set_key signature and do not set key to NULL if cmd is DISABLE_KEY. This is a preliminary patch to add BIP_CMAC_128 hw support to mt7615 driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: remove wtbl_sec_key definitionLorenzo Bianconi1-14/+0
Get rid of wtbl_sec_key definition since it is no longer used Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: introduce mt7615_mac_wtbl_set_key routineLorenzo Bianconi6-48/+63
Add mt7615_mac_wtbl_set_key routine to configure wtbl key parameter directly from host cpu. This is a preliminary patch to add BIP_CMAC_128 hw support. Moreover add static qualifier to mt7615_mac_get_key_info routine Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: add mt7615_mac_wtbl_addr routineLorenzo Bianconi1-1/+6
Introduce mt7615_mac_wtbl_addr rouinte to compute sta wtbl address. This is a preliminary patch to update wtbl key directly from host processor Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: move mt7615_mac_get_key_info in mac.cLorenzo Bianconi4-49/+55
This is a preliminary patch to update wtbl key directly from host processor Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: add missing register initializationFelix Fietkau2-4/+31
- initialize CCA signal source - initialize clock for band 1 (7615D) - initialize BAR rate Reviewed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: use params->ssn value directlyStanislaw Gruszka1-3/+3
There is no point to use pointer to params->ssn. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: fix invalid fallback ratesFelix Fietkau1-0/+3
Only decrement the rate index on duplicate rates if it is not already 0 Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: fix PS buffering of action framesFelix Fietkau1-1/+1
Bufferable management frames need to be put in the data queue, otherwise they will not be buffered when the receiver is asleep. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: fix using VHT STBC ratesFelix Fietkau1-6/+12
The hardware expects MT_TX_RATE_NSS to be filled with the number of space/time streams. For non-STBC rates, this is equal to nss. For 1-stream STBC, this needs to be set to 2. This is relevant for VHT rates only, on HT, the value is derived from MCS internally. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: sync with mt7603 rate control changesFelix Fietkau4-44/+124
- Store the previous and current rate set in the driver + the TSF value at the time of the switch. - Use the tx status TSF value to determine which rate set needs to be used as reference. - Report only short or long GI rates for a single status event, not a mix. - The hardware reports the last used rate index. Use it along with the retry count to figure out what rate was used for the first attempt. - Use the same retry count value for all rate slots to make this calculation work. - Derive the probe rate from the current rateset instead of the skb cb - Do not wait for a status report for the probe frame before removing the probe rate from the rate table. Do it immediately after it was referenced in a tx status report. - Use the first half of the first rate retry budget for the probe rate in order to avoid using too many retries on that rate - Switch from lower rates to higher rates more conservatively - enable hardware rate up/down selection Reviewed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: reset rate index/counters on rate table updateFelix Fietkau2-1/+8
These values must be initialized to zero, otherwise the hardware could reuse previous values, especially the rate index Reviewed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: move mt7615_mcu_set_rates to mac.cFelix Fietkau4-98/+97
It bypasses the MCU, so it does not belong in mcu.c Also make mt7615_mac_tx_rate_val static Reviewed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: introduce mt7615_mcu_send_ram_firmware routineLorenzo Bianconi1-48/+42
Add mt7615_mcu_send_ram_firmware routine since mt7615_load_ram runs the same code to send ram firmware to cr4 and n9 mcus. Moreover rename gen_dl_mode in mt7615_mcu_gen_dl_mode. This patch does not introduce any behaviour change, it is just code refactor. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: always release sem in mt7615_load_patchLorenzo Bianconi1-3/+3
Release patch semaphore even if request_firmware fails in mt7615_load_patch Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: fall back to sw encryption for unsupported ciphersLorenzo Bianconi1-0/+15
Fix following warning falling back to sw encryption for unsupported ciphers WARNING: CPU: 2 PID: 1495 at backports-4.19.32-1/net/mac80211/key.c:1023 mt76_wcid_key_setup+0x68/0xbc [mt76] CPU: 2 PID: 1495 Comm: hostapd Not tainted 4.14.131 #0 Stack : 00000000 8f0f8bc0 00000000 8007ccec 805f0000 8058ec18 00000000 00000000 80559788 8dca79bc 8fefb10c 805c89c7 805545c8 00000001 8dca7960 53261662 00000000 00000000 80640000 00004668 00000000 000000e9 00000007 00000000 00000000 805d0000 00072537 00000000 80000000 00000000 805f0000 8f1e70d0 8e8fa098 000003ff 805c0000 8f0f8bc0 00000001 802d4340 00000008 80630008 [<800108d0>] show_stack+0x58/0x100 [<8049214c>] dump_stack+0x9c/0xe0 [<80033998>] __warn+0xe0/0x138 [<80033a80>] warn_slowpath_null+0x1c/0x2c [<8e8fa098>] mt76_wcid_key_setup+0x68/0xbc [mt76] [<8e889930>] mt7615_eeprom_init+0x7c0/0xe14 [mt7615e] Suggested-by: Sebastian Gottschall <s.gottschall@newmedia-net.de> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: clean up FWDL TXQ during/after firmware uploadFelix Fietkau1-0/+3
Since we don't clean that tx queue from the tx tasklet, we need to do it after the firmware upload is done. This patch also adds a cleanup step during the upload, to help reclaim memory faster. Fixes unprocessed queued frames eating up memory long after the firmware upload has already completed Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: add radar pattern test knob to debugfsLorenzo Bianconi6-14/+81
Introduce mt7615_mcu_rdd_send_pattern routine to trigger a radar pattern detection. Moreover move debugfs related routines in a dedicated source file. Suggested-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: add csa supportLorenzo Bianconi4-5/+36
Add Channel Switch Announcement support to mt7615 driver updating beacon template with CSA IE received from mac80211 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: do not perform txcalibration before cac is complitedLorenzo Bianconi1-10/+15
Delay channel calibration after Channel Availability Check. Add some code cleanup to mt7615_mcu_set_channel Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: add hw dfs pattern detector supportLorenzo Bianconi7-1/+245
Add hw radar detection support to mt7615 driver in order to unlock dfs channels on 5GHz band Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: introduce mt7615_regd_notifierLorenzo Bianconi1-0/+11
Introduce mt7615_regd_notifier callback. This is a preliminary patch to add radar detection support to mt7615 driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: mt7615: fix sparse warnings: warning: restricted __le16 degrades to ↵Lorenzo Bianconi1-1/+1
integer Fix the following sparse warning in __mt7615_mcu_msg_send: drivers/net/wireless/mediatek/mt76/mt7615/mcu.c:78:15: sparse: warning: restricted __le16 degrades to integer drivers/net/wireless/mediatek/mt76/mt7615/mcu.c:78:15: sparse: warning: cast from restricted __le16 Fixes: 04b8e65922f6 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-27mt76: mt7615: fix sparse warnings: warning: cast from restricted __le16Lorenzo Bianconi1-4/+2
Do not convert {tx,rx}_mcs_map to little-endian since it is already done by mac80211. This patch fix the following sparse warning: drivers/net/wireless/mediatek/mt76/mt7615/mcu.c:1497:25: sparse: warning: cast from restricted __le16 drivers/net/wireless/mediatek/mt76/mt7615/mcu.c:1499:25: sparse: warning: cast from restricted __le16 Fixes: 04b8e65922f6 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets") Fixes: 3ca0a6f6e9df ("mt7615: mcu: use standard signature for mt7615_mcu_msg_send") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-27mt76: mt7615: fix sparse warnings: incorrect type in assignment (different ↵Lorenzo Bianconi1-2/+3
base types) Fix the following sparse warning in mt7615_mcu_bss_info_ext_header: drivers/net/wireless/mediatek/mt76/mt7615/mcu.c:728:30: sparse: sparse: incorrect type in assignment (different base types) drivers/net/wireless/mediatek/mt76/mt7615/mcu.c:728:30: sparse: expected restricted __le32 [usertype] mbss_tsf_offset Reported-by: kbuild test robot <lkp@intel.com> Fixes: 04b8e65922f6 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets") Fixes: 7339fbc0caa5 ("mt7615: mcu: do not use function pointers whenever possible") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>