summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76
Commit message (Collapse)AuthorAgeFilesLines
* mt76: unify sta_rate_tbl_update and related helpersStanislaw Gruszka2018-09-1918-288/+155
| | | | | | | | | Use common sta_rate_tbl_update on mt76x0 and mt76x2. mt76x0 do not have support TPC (transmision power control) implmented, msta->wcid.max_txpwr_adj is only set for mt76x2. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify add_interfaceStanislaw Gruszka2018-09-194-42/+34
| | | | | | | | | | | Make common add_interface for mt76x0 and mt76x2e. This change behavior for mt76x0, but it should work with the new implementation. mt76x2u has different implementation. Maybe it can use common one, but for now leave it as is. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify remove_interfaceStanislaw Gruszka2018-09-196-20/+14
| | | | | | | Use common remove_interface callback in mt76x0 and mt76x2. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: remove vif_maskStanislaw Gruszka2018-09-192-12/+1
| | | | | | | Make remove_interface more similar to mt76x2. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify conf_txStanislaw Gruszka2018-09-198-107/+49
| | | | | | | | Use one conf_tx implementation in mt76x0 and mt76x2. Note this change conf_tx for mt76x0, but it should work with mt76x2 version. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify AC to hw queue mappingStanislaw Gruszka2018-09-195-18/+22
| | | | | | | | Use the same AC to hardware queue mappings for all subdrivers. Note: this change BK and BE mappings for USB drivers. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: remove empty sta_notifyStanislaw Gruszka2018-09-191-7/+0
| | | | | | | Remove empty implementation of sta_notify. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify set_keyStanislaw Gruszka2018-09-197-108/+74
| | | | | | | Merge mt76x0 and mt76x2 set_key mac80211 callback. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify ampdu_actionStanislaw Gruszka2018-09-198-99/+59
| | | | | | | | Use mt76x2_ampdu_action as common function, mt76x0 ampdu_action was diffrent, but mt76x2 version should work for this driver as well. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: pratially unify add_interfaceStanislaw Gruszka2018-09-198-31/+21
| | | | | | | | Create common mt76x02_vif_init function and use int on drivers add_interface callback. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify sta_add / sta_removeStanislaw Gruszka2018-09-196-126/+73
| | | | | | | | | | Merge mt76x0 and mt76x0 sta add/remove callback. We drop mt76x0_mac_set_ampdu_factor() for now. Need to consider to add it to common code, but mt76x2 don't do it so perhaps mt76x0 don't need it as well. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move wcid fields to common mt76_dev structStanislaw Gruszka2018-09-1912-46/+39
| | | | | | | | All current MT devices including new MT7603 type chips support 128 WCIDs, we can unify wcid data in common mt76_dev structure. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* Merge wireless-drivers into wireless-drivers-nextKalle Valo2018-09-171-2/+1
|\ | | | | | | | | Solve the conflict in main.c early on as there will be a lot more mt76 patches in the queue.
| * mt76x0: fix remove_interfaceStanislaw Gruszka2018-09-171-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We wrongly use wcid_mask instead of vif_mask. This creates problems when the interface is removed more than 8 times, for example with iw: iw dev <devname> interface add <name> type <type> iw dev <name> del This caused 'ifconfig up' to fail with error: SIOCSIFFLAGS: No space left on device Fixes: 95e444098a7b ("mt76x0: main file") Reported-and-tested-by: Sid Hayn <sidhayn@gmail.com> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: Enable NL80211_EXT_FEATURE_CQM_RSSI_LISTKristian Evensen2018-09-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable the use of CQM_RSSI_LIST with mt76-devices. The change has been tested with the mt7602, mt7603 and mt7621 PCI wifi-cards. I passed a list of RSSI thresholds to the driver, and when disconnecting/connecting the antenna(s) I got an event each time the RSSI went above/below a threshold. While I have not been able to test the change with any of the mt76 USB-devices (no access to a device), the RX RSSI management code is shared between the two device types. Thus, CQM should also work with the mt76 USB-devices. Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76x0: remove unused routines for usb_buff alloc/freeLorenzo Bianconi2018-09-042-54/+0
| | | | | | | | | | | | | | | | | | | | | | Remove the following unused routines for usb buffer allocation/free/submit: - mt76x0_usb_alloc_buf - mt76x0_usb_free_buf - mt76x0_usb_submit_buf Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76x0: use mt76u_mcu_fw_send_data for fw uploadingLorenzo Bianconi2018-09-041-82/+6
| | | | | | | | | | | | | | | | Use mt76u_mcu_fw_send_data utility routine for firmware uploading and remove unused __mt76x0_dma_fw/mt76x0_dma_fw functions Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76x0: remove unused mt76x0_mcu structureLorenzo Bianconi2018-09-042-17/+0
| | | | | | | | | | | | | | Remove no longer used mt76x0_mcu data structure Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76x0: use mt76u_mcu_send_msg utility routine to send fw cmdsLorenzo Bianconi2018-09-043-200/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use mt76u_mcu_send_msg/__mt76u_mcu_send_msg utility routines to send commands to usb mcu. Remove following unused routines: - mt76x0_mcu_wait_resp - __mt76x0_mcu_msg_send - mt76x0_mcu_msg_send - mt76x0_dma_skb_wrap_cmd - trace_mt_mcu_msg_send_cs - mt76x0_mcu_cmd_deinit Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76x0: remove unused mt76x0_wait_asic_ready routineLorenzo Bianconi2018-09-042-35/+1
| | | | | | | | | | | | | | | | Delete core.c source file since, removing mt76x0_wait_asic_ready routine, it is no longer needed Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76x0: remove mt76x0_vendor_request routineLorenzo Bianconi2018-09-043-37/+3
| | | | | | | | | | | | | | | | | | Remove mt76x0_vendor_request routine and use mt76u_vendor_request utility function from mt76-usb layer in mt76x0_upload_firmware Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76x0: remove mt76x0_complete_urb routineLorenzo Bianconi2018-09-043-11/+3
| | | | | | | | | | | | | | | | Remove mt76x0_complete_urb routine and use mt76u_mcu_complete_urb utility function as usb mcu completion handler Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76x0: use shared mt76 usb mcu completionLorenzo Bianconi2018-09-042-6/+6
| | | | | | | | | | | | | | | | | | Use mt76 usb shared completion data structure in mt76x0_mcu_wait_resp routine and remove mt76x0 private one Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76x0: remove mt76x0_mcu_msg_alloc routineLorenzo Bianconi2018-09-041-17/+2
| | | | | | | | | | | | | | | | Remove mt76x0_mcu_msg_alloc duplicated routine and use mt76u_mcu_msg_alloc utility function for usb mcu message allocation Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76x0: remove mt76x0_vendor_single_wr routineLorenzo Bianconi2018-09-043-29/+5
| | | | | | | | | | | | | | | | Remove mt76x0_vendor_single_wr routine and use mt76u_single_wr utility function for mcu firmware loading Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76x0: remove mt76x0_vendor_reset routineLorenzo Bianconi2018-09-043-8/+1
| | | | | | | | | | | | | | | | Remove mt76x0_vendor_reset duplicated routine and use mt76u_mcu_fw_reset utility function for mcu fw reset Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76x0: use mt76u_init for bus initializationLorenzo Bianconi2018-09-044-109/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | Use mt76u_init utility routine for usb initialization. Moreover remove following unused routines: - mt76x0_rr - mt76x0_wr - mt76x0_rmw - mt76x0_wr_copy - mt76x0_assign_pipes Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: add multiple regs read support to usb_mcu layerLorenzo Bianconi2018-09-042-1/+44
| | | | | | | | | | | | | | | | | | Introduce multiple regs read support to mcu layer in mt76-usb module. Multiple regs read will be reused by mt76x0 driver in usb mcu layer unification between mt76x0 and mt76x2u drivers Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: move mt76x2u_mcu_deinit routine in mt76-usb moduleLorenzo Bianconi2018-09-045-10/+11
| | | | | | | | | | | | | | | | | | Move mt76x2u_mcu_deinit routine in usb_mcu layer in order to be reused by mt76x0 driver in usb mcu layer unification between mt76x0 and mt76x2u drivers Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: split __mt76u_mcu_send_msg and mt76u_mcu_send_msg routinesLorenzo Bianconi2018-09-042-9/+20
| | | | | | | | | | | | | | | | | | Split __mt76u_mcu_send_msg and mt76u_mcu_send_msg in order to be reused by mt76x0 driver in usb mcu layer unification between mt76x0 and mt76x2u drivers Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: move mt76_reg_pair definition in mt76.hLorenzo Bianconi2018-09-043-13/+8
| | | | | | | | | | | | | | | | Move common definition of mt76_reg_pair in mt76.h and remove duplicated code in mt76x2_init_common.c Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76x0: use mt76x02_sta and mt76x02_tx_statusStanislaw Gruszka2018-09-047-42/+28
| | | | | | | | | | | | | | Use common mt76x02_sta and mt76x02_tx_status structures in mt76x0 sub-driver. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76x0: initalize custom tx queuesStanislaw Gruszka2018-09-041-0/+8
| | | | | | | | | | Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: unify sta structure part 2Stanislaw Gruszka2018-09-0413-54/+36
| | | | | | | | | | | | | | Second part of unifying mt76x02_sta structure between mt76x0 and mt76x2. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: unify sta structure part 1Stanislaw Gruszka2018-09-045-27/+49
| | | | | | | | | | | | | | First part of unifying mt76x02_sta structure between mt76x0 and mt76x2. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: unify mt76x02_vif structStanislaw Gruszka2018-09-0413-33/+27
| | | | | | | | | | | | | | Private vif structures definitions are the same for mt76x2 and mt76x0. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76x0: use mt76_wcid_free in mt76x0Stanislaw Gruszka2018-09-041-1/+1
| | | | | | | | | | | | | | Use helper from util instead of custom code. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: use mac_wcid_set_drop in mt76x0Stanislaw Gruszka2018-09-048-17/+18
| | | | | | | | | | | | | | Move mt76x02_mac_wcid_set_drop to common code and use it in mt76x0. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: unify mac_wcid_setupStanislaw Gruszka2018-09-049-50/+31
| | | | | | | | | | | | | | Merge mt76x{0,2}_mac_wcid_setup into common code. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: unify mac_wcid_set_keyStanislaw Gruszka2018-09-049-78/+38
| | | | | | | | | | | | | | Merge mt76x{0,2}_mac_wcid_set_key into common code. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: unify mac_shared_key_setupStanislaw Gruszka2018-09-049-55/+29
| | | | | | | | | | | | | | Merge mt76x{0,2} mac_shared_key_setup into common code. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: add helpers for register access with mt76_dev structStanislaw Gruszka2018-09-041-0/+5
| | | | | | | | | | | | | | Add helpers for register access from common code. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: unify mac_get_key_infoStanislaw Gruszka2018-09-045-57/+54
| | | | | | | | | | | | | | Merge mt76x{0,2} mac_get_key_info into new mt76x02_mac.c file. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: create new mt76x02-lib module for common mt76x{0,2} codeStanislaw Gruszka2018-09-0416-141/+152
| | | | | | | | | | | | | | | | | | Move rxfilter and mutex to common structure. Create mt76x02-lib.ko for mt76x0 and mt76x2 common functions and create new unified mt76x02_configure_filter() function there. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: merge mt76x0/regs.h into mt76x02_regs.hStanislaw Gruszka2018-09-048-676/+91
| | | | | | | | | | | | | | | | | | Add missed definitions for mt76x0 into mt76x02_regs.h. Remove mt76x0/regs.h and fixup mt76x0 code to adjust to some diffrent registers/fields names. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: rename mt76x2_regs.hStanislaw Gruszka2018-09-042-3/+3
| | | | | | | | | | | | | | | | MAC registers are the same for mt76x0 and mt76x2. Rename mt76x2_regs.h file to reflect that. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: unify wait_for_macStanislaw Gruszka2018-09-048-28/+57
| | | | | | | | | | | | | | | | Create new mt76x02_mac.h for common mac functions of mt76x0 and mt76x2 and unity wait_for_mac for both drivers. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: verify evt type in usb mcu responseLorenzo Bianconi2018-08-312-1/+12
| | | | | | | | | | | | | | | | | | Verify if evt field is set to EVT_CMD_DONE in usb mcu response messages. This is a preliminary patch for usb_mcu layer unification between mt76x0u and mt76x2u driver. Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76x2u: run device cleanup routine if resume failsLorenzo Bianconi2018-08-311-3/+11
| | | | | | | | | | | | | | | | Cleanup {tx,rx} and mcu queues if resume operation fails Fixes: ee676cd5017c ("mt76: add driver code for MT76x2u based devices") Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* | mt76: Fix comparisons with invalid hardware key indexGeert Uytterhoeven2018-08-312-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With gcc 4.1.2: drivers/net/wireless/mediatek/mt76/mt76x0/tx.c: In function ‘mt76x0_tx’: drivers/net/wireless/mediatek/mt76/mt76x0/tx.c:169: warning: comparison is always true due to limited range of data type drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c: In function ‘mt76x2_tx’: drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c:35: warning: comparison is always true due to limited range of data type While assigning -1 to a u8 works fine, comparing with -1 does not work as expected. Fix this by comparing with 0xff, like is already done in some other places. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
OpenPOWER on IntegriCloud