Commit Graph
2587 Commits
Author SHA1 Message Date
Ryder LeeandFelix Fietkau e578b4b8d5 mt76: mt7615: fix .add_beacon_offload()
ieee80211_beacon_get_template() returns NULL when beacon state is disabled,
so beacon_offload cannot be disabled for some devices.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-04 10:37:33 +02:00
Lorenzo BianconiandFelix Fietkau 6ee4770de0 mt76: mt7921: rework mt7921_mcu_debug_msg_event routine
Rework mt7921_mcu_debug_msg_event routing removing unnecessary
assignments and relying on wiphy_info

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-04 10:37:33 +02:00
Lorenzo BianconiandFelix Fietkau 38f656768a mt76: mt7921: always wake the device in mt7921_remove_interface
Make sure the mcu is not in sleep mode before sending mcu messages in
mt7921_remove_interface routine.

Fixes: 1d8efc741df80 ("mt76: mt7921: introduce Runtime PM support")
Co-developed-by: Sean Wang <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Co-developed-by: Leon Yen <[email protected]>
Signed-off-by: Leon Yen <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-04 10:37:33 +02:00
Lorenzo BianconiandFelix Fietkau e66a0b9b8d mt76: mt7615: always wake the device in mt7615_remove_interface
Similar to mt7921 driver, make sure the mcu is not in sleep mode before
sending mcu messages in mt7615_remove_interface routine.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-04 10:37:33 +02:00
Shayne ChenandFelix Fietkau 4e22f0dc93 mt76: mt7915: fix txpower init for TSSI off chips
Fix incorrect txpower init value for TSSI off chips which causes
too small txpower.

Signed-off-by: Shayne Chen <[email protected]>
2021-04-01 21:28:05 +02:00
Lorenzo BianconiandFelix Fietkau be1ab3b9ae mt76: mt7921: fix typo in mt7921_pci_resume
Return proper error code from mt7921_mcu_drv_pmctrl in mt7921_pci_resume
routine.

Fixes: 8db9c79f230d6 ("mt76: mt7921: fix suspend/resume sequence")
Signed-off-by: Lorenzo Bianconi <[email protected]>
2021-04-01 21:27:47 +02:00
Guobin HuangandFelix Fietkau 113ba8a81d mt76: mt7615: remove redundant dev_err call in mt7622_wmac_probe()
There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Guobin Huang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-04-01 21:27:47 +02:00
Felix Fietkau 0ff3a336a8 mt7615,mt7915: fix a compiler warning
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-27 23:47:09 +01:00
Lorenzo BianconiandFelix Fietkau 62b13f5352 mt76: mt7921: fix key set/delete issue
Similar to the mt7915 driver, deleting a key with the previous key index
deletes the current key. Rework the code to better keep track of
multiple keys and check for the key index before deleting the current
key

Signed-off-by: Lorenzo Bianconi <[email protected]>
2021-03-27 23:39:09 +01:00
Felix Fietkau 465dda65ee mt7615,mt7915: replace fw log 0-terminating code with wiphy info length limit
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-27 20:29:16 +01:00
Felix Fietkau b860906689 mt76: mt7615: fix chip reset on MT7622 and MT7663e
After chip reset, the DMA scheduler needs to be initialized as well.
Since the code is PCI/SoC specific, move it to pci_mac.c, so that it
can depend on a function in dma.c

Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 21:54:26 +01:00
Felix Fietkau 4a22f2ffae mt76: mt7915: 0-terminate firmware log messages
Avoid including garbage from previous rx data in the printk messages

Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 21:54:18 +01:00
Felix Fietkau a519c49a6a mt76: mt7615: 0-terminate firmware log messages
Avoid including garbage from previous rx data in the printk messages

Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 21:54:09 +01:00
Ryder LeeandFelix Fietkau 57432e701d mt76: mt7915: cleanup mcu tx queue in mt7915_dma_reset()
Cleanup mcu queues in mt7915_mac_reset_work().

Fixes: mt76: e637763b606 ("move mcu queues to mt76_dev q_mcu array")
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:24:03 +01:00
Ryder LeeandFelix Fietkau 115b742823 mt76: mt7915: keep mcu_add_bss_info enabled till interface removal
The same as mt7615. Keep BSS_INFO_BASIC enabled throughout interfaces
life cycle.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:24:03 +01:00
Ryder LeeandFelix Fietkau bf6d9ee4ac mt76: mt7615: keep mcu_add_bss_info enabled till interface removal
BSS_INFO_BASIC is never called alone with inactive state, which always
follows beacon offload disable, so keep it enabled throughout interfaces
life cycle. Inactive state also removes sta record of all connected
stations, thurs causes connection lost which defeats the purpose of CSA.

Lastly, this is especially an unexpected behavior that keeping mt7622
failing beacon buffer recyled when scanning channels.

bss_conf change is updated with active state only, so just overwrite it.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:24:03 +01:00
Ryder LeeandFelix Fietkau 3bd285424e mt76: mt7622: trigger hif interrupt for system reset
hif interrupt needs to be triggered after MT_MCU_INT_EVENT.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:24:03 +01:00
Ryder LeeandFelix Fietkau 9a98b1a6f9 mt76: mt7615: cleanup mcu tx queue in mt7615_dma_reset()
With this patch, mt7615_mac_reset_work() can recover system back.

Fixes: e637763b606b ("mt76: move mcu queues to mt76_dev q_mcu array")
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:24:03 +01:00
Ryder LeeandFelix Fietkau ee29cd5f3a mt76: mt7615: only enable DFS test knobs for mt7615
DFS knobs should not be visible to non-DFS devices.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:24:03 +01:00
Lorenzo BianconiandFelix Fietkau 035e2f6f1d mt76: mt7921: get rid of mt7921_mac_wtbl_lmac_addr
Get rid of mt7921_mac_wtbl_lmac_addr routine since mt7921 wtbl size is
19 entries

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:17:07 +01:00
Felix Fietkau f66f8f41d4 mt76: mt7915: refresh repeater entry MAC address when setting BSSID
When disassociating and clearing the BSSID of a repeater entry used by a client
mode interface, the corresponding MAC address entry can get lost too, causing
the client interface to not be able to associate anymore.
Fix this by also refreshing the MAC address when setting the BSSID

Signed-off-by: Felix Fietkau <[email protected]>
2021-03-26 09:16:06 +01:00
Felix Fietkau 09a1befde4 mt76: fix potential DMA mapping leak
With buf uninitialized in mt76_dma_tx_queue_skb_raw, its field skip_unmap
could potentially inherit a non-zero value from stack garbage.
If this happens, it will cause DMA mappings for MCU command frames to not be
unmapped after completion

Fixes: 27d5c528a7ca ("mt76: fix double DMA unmap of the first buffer on 7615/7915")
Cc: [email protected]
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-23 22:47:59 +01:00
Felix Fietkau be2f67e8d3 mt76: mt7915: fix key set/delete issue
Deleting a key with the previous key index deletes the current key
Rework the code to better keep track of multiple keys and check for the
key index before deleting the current key

Signed-off-by: Felix Fietkau <[email protected]>
2021-03-22 21:39:57 +01:00
Lorenzo BianconiandFelix Fietkau e4d5227768 mt76: mt7921: fix airtime reporting
Fix {tx,rx}_airtime reporting for mt7921 driver. Wrong register definitions
trigger a tx hangs before resetting airtime stats.

Fixes: 163f4d22c118d ("mt76: mt7921: add MAC support")
Tested-by: Leon Yen <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
Acked-by: Felix Fietkau <[email protected]>
2021-03-22 18:43:35 +01:00
Lorenzo BianconiandFelix Fietkau e529e8afe2 mt76: mt7921: properly configure rcpi adding a sta to the fw
Properly configure rcpi based on association process rssi. rcpi is used
by rate controller embedded into the fw to initialize amsdu size.

Signed-off-by: Lorenzo Bianconi <[email protected]>
2021-03-20 18:31:03 +01:00
Lorenzo BianconiandFelix Fietkau 6886b57a15 mt76: connac: introcuce mt76_sta_cmd_info data structure
Introduce mt76_sta_cmd_info data structure to contain parameters passed
to mt76_sta_cmd_info routine. This is preliminary patch to properly
configure rcpi for mt7921 devices.

Signed-off-by: Lorenzo Bianconi <[email protected]>
2021-03-20 18:31:00 +01:00
Lorenzo BianconiandFelix Fietkau fbef8bba03 mt76: mt7921: remove duplicated macros in mcu.h
Remove mcu definitions already available in mt76_connac_mcu.h

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-18 10:48:36 +01:00
Ryder LeeandFelix Fietkau 48a905e237 mt76: mt7615: fix CSA event format
Fix format changes among the firmware versions.

Fixes: f9390c251868 ("mt76: mt7615: fix CSA notification for DBDC")
Signed-off-by: Ryder Lee <[email protected]>
2021-03-18 10:44:48 +01:00
Lorenzo BianconiandFelix Fietkau 0b6c9a043f mt76: move de-amsdu buffer per-phy
mt7615d users report the following crash running both phy concurrently:

[  147.273909] CPU 1 Unable to handle kernel paging request at virtual address 00000000, epc == 8e4f288c, ra == 8e58a968
[  147.284570] Oops[#1]:
[  147.286854] CPU: 1 PID: 3724 Comm: kworker/u9:3 Not tainted 5.4.105 #0
[  147.293403] Workqueue: napi_workq napi_workfn
[  147.297742] $ 0   : 00000000 00000001 8e595ec0 00000000
[  147.302950] $ 4   : 8e595ec0 00000000 8e5ca600 00000000
[  147.308161] $ 8   : 00000000 000004c1 80808080 fefefeff
[  147.313370] $12   : 00000000 00000000 80704f1c 00000040
[  147.323781] $20   : 00000050 00000044 00000011 01ce9502
[  147.334195] $28   : 8e004000 8e005d18 8ddf2020 8e58a968
[  147.342266] Lo    : 00000000
[  147.350397] ra    : 8e58a968 mt7615_queue_rx_skb+0x94c/0xd0c [mt7615_common]
[  147.361580] Cause : 4080000c (ExcCode 03)
[  147.368434] PrId  : 0001992f (MIPS 1004Kc)
[  147.456965] Process kworker/u9:3 (pid: 3724, threadinfo=9ece68d6, task=b16d155f, tls=00000000)
[  147.473857]         0001ce95 00004188 00000000 00000080 00004c10 00000002 8074a2b8 80043dcc
[  147.490505]         00000000 8e4f0110 8069ddf4 806ab148 8dfc0000 00001000 00000000 00000050
[  147.507150]         ...
[  147.512033] [<8e4f288c>] mt76_rx+0x124/0x320 [mt76]
[  147.526633]
[  147.528512] ---[ end trace 3d137e75bb109149 ]---

The issue has been introduce enabling hw rx de-amsdu since the hw can
interleave amsdu frames from both phy. Fix the issue moving the de-amsdu
buffer per-phy.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Acked-by: Ryder Lee <[email protected]>
2021-03-18 10:44:42 +01:00
Sean WangandFelix Fietkau ca22cc221a linux-firmware: add firmware for MT7921
Add binary firmware for MT7921 based devices

File: firmware/WIFI_MT7961_patch_mcu_1_2_hdr.bin
Version: 20210122002654a
File: firmware/WIFI_RAM_CODE_MT7961_1.bin
Version: 20210122002730

Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Josh Boyer <[email protected]>
2021-03-15 12:55:13 +01:00
Colin Ian KingandFelix Fietkau cc933b3669 mt76: mt7921: remove redundant check on type
Currently in the switch statement case where type is
NL80211_IFTYPE_STATION there is a check to see if type
is not NL80211_IFTYPE_STATION.  This check is always false
and is redundant dead code that can be removed.

Addresses-Coverity: ("Logically dead code")
Fixes: e0f9fdda81bd ("mt76: mt7921: add ieee80211_ops")
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-15 00:07:35 +01:00
Lorenzo BianconiandFelix Fietkau 87e09e8482 mt76: mt7921: remove leftovers from dbdc configuration
Remove leftovers from dbdc configuration since mt7921
does not support it.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:39:22 +01:00
Lorenzo BianconiandFelix Fietkau e0708e296e mt76: mt7921: add wifi reset support
Introduce wifi chip reset support for mt7921 device to recover mcu
hangs.

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]>
2021-03-14 23:39:22 +01:00
Lorenzo BianconiandFelix Fietkau a80e50098b mt76: dma: export mt76_dma_rx_cleanup routine
Export mt76_dma_rx_cleanup routine in mt76_queue_ops data structure.
This is a preliminary patch to introduce mt7921 chip reset support.

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]>
2021-03-14 23:39:22 +01:00
Lorenzo BianconiandFelix Fietkau 7b56d5bf6e mt76: dma: introduce mt76_dma_queue_reset routine
Introduce mt76_dma_queue_reset utility routine to reset a given hw
queue. This is a preliminary patch to introduce mt7921 chip reset
support.

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]>
2021-03-14 23:39:22 +01:00
Lorenzo BianconiandFelix Fietkau e12c44a7e1 mt76: mt7921: introduce __mt7921_start utility routine
This is a preliminary patch to introduce mt7921 chip reset support.

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]>
2021-03-14 23:39:22 +01:00
Lorenzo BianconiandFelix Fietkau 9af9622df5 mt76: mt7921: introduce mt7921_run_firmware utility routine.
This is a preliminary patch to introduce chip reset for mt7921 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]>
2021-03-14 23:39:22 +01:00
Lorenzo BianconiandFelix Fietkau 3cf5afc029 mt76: introduce mcu_reset function pointer in mt76_mcu_ops structure
Introduce mcu_reset function pointer in mt76_mcu_ops structure in order
to run hw related reset function for the mcu running on the chipset.
This is a preliminary patch to introduce chip reset for mt7921 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]>
2021-03-14 23:39:22 +01:00
Lorenzo BianconiandFelix Fietkau 6e2b9d2583 mt76: mt7921: reduce mcu timeouts for suspend, offload and hif_ctrl msg
Reduce mcu timeout for the following uni mcu commands:
- MCU_UNI_CMD_SUSPEND
- MCU_UNI_CMD_OFFLOAD
- MCU_UNI_CMD_HIF_CTRL

This is a preliminary patch to introduce chip reset support

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]>
2021-03-14 23:39:22 +01:00
Ryder LeeandFelix Fietkau 2303e1844a mt76: mt7915: fix possible deadlock while mt7915_register_ext_phy()
ieee80211_register_hw() is called with rtnl_lock held, and this could be
caused lockdep from a work item that's on a workqueue that is flushed
with the rtnl held.

Move mt7915_register_ext_phy() outside the init_work().

Signed-off-by: Evelyn Tsai <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:39:22 +01:00
Ryder LeeandFelix Fietkau 00628061b5 mt76: mt7615: add missing capabilities for DBDC
This improves performance for second phy.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:39:10 +01:00
Sean WangandFelix Fietkau 0d5b1a7027 mt76: mt7663s: fix the possible device hang in high traffic
Use the additional memory barrier to ensure the skb list up-to-date
between the skb producer and consumer to avoid the invalid skb content
written into sdio controller and then cause device hang due to mcu assert
caught by WR_TIMEOUT_INT.

Fixes: 1522ff731f84 ("mt76: mt7663s: introduce sdio tx aggregation")
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:39:10 +01:00
Sean WangandFelix Fietkau aafe972e95 mt76: mt7663s: make all of packets 4-bytes aligned in sdio tx aggregation
Each packet should be padded with the additional zero to become 4-bytes
alignment in sdio tx aggregation.

Fixes: 1522ff731f84 ("mt76: mt7663s: introduce sdio tx aggregation")
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:39:10 +01:00
Sean WangandFelix Fietkau 975cccfa96 mt76: mt7663: fix when beacon filter is being applied
HW beacon filter command is being applied until we're in associated state
because the command would rely on the associated access point's beacon
interval and DTIM information.

Fixes: 7124198ab1a4 ("mt76: mt7615: enable beacon filtering by default for offload fw")
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:39:10 +01:00
Ryder LeeandFelix Fietkau 638b112188 mt76: mt7615: check mcu returned values in mt7615_ops
Properly check returned values from mcu utility routines in
mt7615_ops.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:39:10 +01:00
Ryder LeeandFelix Fietkau 256f324f8f mt76: mt7915: check mcu returned values in mt7915_ops
Properly check returned values from mcu utility routines in
mt7915_ops.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:39:10 +01:00
Ryder LeeandFelix Fietkau a4307e6ba0 mt76: mt7915: fix txrate reporting
Properly check rate_info to fix unexpected reporting.

[ 1215.161863] Call trace:
[ 1215.164307]  cfg80211_calculate_bitrate+0x124/0x200 [cfg80211]
[ 1215.170139]  ieee80211s_update_metric+0x80/0xc0 [mac80211]
[ 1215.175624]  ieee80211_tx_status_ext+0x508/0x838 [mac80211]
[ 1215.181190]  mt7915_mcu_get_rx_rate+0x28c/0x8d0 [mt7915e]
[ 1215.186580]  mt7915_mac_tx_free+0x324/0x7c0 [mt7915e]
[ 1215.191623]  mt7915_queue_rx_skb+0xa8/0xd0 [mt7915e]
[ 1215.196582]  mt76_dma_cleanup+0x7b0/0x11d0 [mt76]
[ 1215.201276]  __napi_poll+0x38/0xf8
[ 1215.204668]  napi_workfn+0x40/0x80
[ 1215.208062]  process_one_work+0x1fc/0x390
[ 1215.212062]  worker_thread+0x48/0x4d0
[ 1215.215715]  kthread+0x120/0x128
[ 1215.218935]  ret_from_fork+0x10/0x1c

Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
Fixes: e4c5ead632ff ("mt76: mt7915: rename mt7915_mcu_get_rate_info to mt7915_mcu_get_tx_rate")
Reported-by: Evelyn Tsai <[email protected]>
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:39:10 +01:00
Ryder LeeandFelix Fietkau 29a04583ae mt76: mt7915: fix rxrate reporting
Avoid directly updating sinfo->rxrate from firmware since rate_info might
be overwritten by wrong results even mt7915_mcu_get_rx_rate() fails check.

Add more error handlings accordingly.

Fixes: 11553d88d0b9 ("mt76: mt7915: query station rx rate from firmware")
Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:39:10 +01:00
Eric Y.Y. WongandFelix Fietkau 37b4dc0f75 mt76: mt76x0u: Add support for TP-Link T2UHP(UN) v1
There are two variants of TP-Link Archer T2UHP V1, which are US and UN:

https://www.tp-link.com/us/support/download/archer-t2uhp/
https://www.tp-link.com/hk/support/download/archer-t2uhp/v1/

From the driver source code provided by the vendor:

https://www.tp-link.com/hk/support/download/archer-t2uhp/v1/#Driver

eric@eric-VirtualBox:~/src$ grep -n USB_DEVICE.*0x2357 DPA_mt7610u_wifi_sta_v3004_rev1_20140529/NETIF/common/rtusb_dev_id.c
45:	{USB_DEVICE(0x2357,0x0105)}, /* T1Uv1 */
46:	{USB_DEVICE(0x2357,0x010B)}, /* T2UHP_UN_v1 */
47:	{USB_DEVICE(0x2357,0x0123)}, /* T2UHP_US_v1 */

eric@eric-VirtualBox:~/src$ lsusb -d 2357:
Bus 001 Device 003: ID 2357:010b TP-Link WiFi
eric@eric-VirtualBox:~/src$ sudo modprobe mt76x0u
eric@eric-VirtualBox:~/src$ sudo sh -c "echo 2357 010b > /sys/bus/usb/drivers/mt76x0u/new_id"

[snip]

eric@eric-VirtualBox:~/src$ ifconfig -a
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 08:00:27:74:d9:ee  txqueuelen 1000  (Ethernet)
        RX packets 78  bytes 16146 (16.1 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 75  bytes 8413 (8.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 56  bytes 5496 (5.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 56  bytes 5496 (5.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlx18d6c71b6e3e: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.106  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::21c7:2d90:e47d:ee48  prefixlen 64  scopeid 0x20<link>
        ether 18:d6:c7:1b:6e:3e  txqueuelen 1000  (Ethernet)
        RX packets 37  bytes 5345 (5.3 KB)
        RX errors 0  dropped 7  overruns 0  frame 0
        TX packets 77  bytes 10513 (10.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eric@eric-VirtualBox:~/src$ dmesg | tail -n 30
               12:51:25.551584 main     Log opened 2021-03-01T12:51:25.551572000Z
[   46.855763] 12:51:25.551995 main     OS Product: Linux
[   46.855838] 12:51:25.552075 main     OS Release: 5.4.0-66-generic
[   46.855897] 12:51:25.552150 main     OS Version: #74-Ubuntu SMP Wed Jan 27 22:54:38 UTC 2021
[   46.855971] 12:51:25.552207 main     Executable: /opt/VBoxGuestAdditions-6.1.16/sbin/VBoxService
               12:51:25.552208 main     Process ID: 898
               12:51:25.552209 main     Package type: LINUX_64BITS_GENERIC
[   46.858699] 12:51:25.554921 main     6.1.16 r140961 started. Verbose level = 0
[   46.863116] 12:51:25.559319 main     vbglR3GuestCtrlDetectPeekGetCancelSupport: Supported (#1)
[  140.687550] usb 1-2: new high-speed USB device number 3 using xhci_hcd
[  140.838279] usb 1-2: New USB device found, idVendor=2357, idProduct=010b, bcdDevice= 1.00
[  140.838281] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  140.838283] usb 1-2: Product: WiFi
[  140.838284] usb 1-2: Manufacturer: MediaTek
[  140.838285] usb 1-2: SerialNumber: 1.0
[  178.374187] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[  178.378370] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[  178.417507] usbcore: registered new interface driver mt76x0u
[  178.557165] usb 1-2: reset high-speed USB device number 3 using xhci_hcd
[  178.720436] mt76x0u 1-2:1.0: ASIC revision: 76100002 MAC revision: 76502000
[  180.156077] mt76x0u 1-2:1.0: EEPROM ver:02 fae:04
[  181.190558] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[  181.225560] mt76x0u 1-2:1.0 wlx18d6c71b6e3e: renamed from wlan0
[  188.660826] wlx18d6c71b6e3e: authenticate with d0:17:c2:e0:d7:9c
[  189.447781] wlx18d6c71b6e3e: send auth to d0:17:c2:e0:d7:9c (try 1/3)
[  189.618282] wlx18d6c71b6e3e: authenticated
[  189.619008] wlx18d6c71b6e3e: associate with d0:17:c2:e0:d7:9c (try 1/3)
[  189.715268] wlx18d6c71b6e3e: RX AssocResp from d0:17:c2:e0:d7:9c (capab=0x1011 status=0 aid=8)
[  189.734720] wlx18d6c71b6e3e: associated
[  190.233239] IPv6: ADDRCONF(NETDEV_CHANGE): wlx18d6c71b6e3e: link becomes ready

Signed-off-by: Eric Y.Y. Wong <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:39:10 +01:00
Ryder LeeandFelix Fietkau 477b783018 mt76: mt7915: fix PHY mode for DBDC
Fix PHY mode configuration for DBDC.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-03-14 23:39:10 +01:00