1
0
Fork 0
Commit Graph

21 Commits (f4ec7fdf7f83701dd980d6cd60c81f79dab85133)

Author SHA1 Message Date
Ryder Lee f4ec7fdf7f mt76: mt7615: enable support for mesh
Enable NL80211_IFTYPE_MESH_POINT and update its path.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-27 12:58:13 +02:00
Lorenzo Bianconi 61d368247e 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 <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-27 12:58:13 +02:00
Lorenzo Bianconi b28248ec91 mt7615: mcu: run __mt76_mcu_send_msg in mt7615_mcu_send_firmware
Run __mt76_mcu_send_msg instead of __mt7615_mcu_msg_send and remove
duplicated code.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25 12:55:26 +02:00
Lorenzo Bianconi 5d15f2ea16 mt7615: mcu: init mcu_restart function pointer
Use common function wrapper in mt7615_mcu_exit since the code is shared
with m7603 driver

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25 12:55:26 +02:00
Lorenzo Bianconi a3a2c2e79c mt7615: initialize mt76_mcu_ops data structure
Use __mt76_mcu_send_msg wrapper instead of mt7615_mcu_msg_send.
This is a preliminary patch for mt7615-mt7603 mcu code unification

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25 12:55:26 +02:00
Lorenzo Bianconi 516c3e3805 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 <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25 12:55:26 +02:00
Lorenzo Bianconi 1ca8089a55 mt7615: mcu: do not use function pointers whenever possible
Remove function pointers in mt7615_mcu_set_bss_info and run function
directly. Moreover remove __mt7615_mcu_set_bss_info since it is run just
by mt7615_mcu_set_bss_info and remove duplicated istructions

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25 12:55:26 +02:00
Lorenzo Bianconi fddc827ffc mt7615: mcu: unify __mt7615_mcu_set_dev_info and mt7615_mcu_set_dev_info
Unify mt7615_mcu_set_dev_info and __mt7615_mcu_set_dev_info since the
latter is run just by mt7615_mcu_set_dev_info

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25 12:55:26 +02:00
Lorenzo Bianconi 893369b769 mt7615: mcu: remove skb_ret from mt7615_mcu_msg_send
Remove skb_ret parameter from mt7615_mcu_msg_send signature since it is
actually used just by mt7615_mcu_patch_sem_ctrl. This is a prelimanry
patch to use mt76 common mcu API

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25 12:55:26 +02:00
Lorenzo Bianconi 33d9ed728e mt7615: remove dest from mt7615_mcu_msg_send signature
Remove dest parameter from mt7615_mcu_msg_send/__mt7615_mcu_msg_send
routine signature since it can is always set to MCU_S2D_H2N

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25 12:55:26 +02:00
Lorenzo Bianconi 27da3bfd31 mt7615: remove query from mt7615_mcu_msg_send signature
Remove query parameter from mt7615_mcu_msg_send routine signature since
it can be obtained from cmd value

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25 12:55:26 +02:00
Lorenzo Bianconi b1722925d2 mt7615: mcu: remove unused parameter in mt7615_mcu_del_wtbl
Remove unused vif parameter in mt7615_mcu_del_wtbl signature

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25 12:55:26 +02:00
Lorenzo Bianconi 598a44344f mt7615: mcu: unify mt7615_mcu_add_wtbl_bmc and mt7615_mcu_del_wtbl_bmc
Remove duplicated code in mt7615_bss_info_changed

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25 12:55:26 +02:00
Lorenzo Bianconi d7228bcf7b mt7615: mcu: use proper msg size in mt7615_mcu_add_wtbl
Use proper mcu message size in mt7615_mcu_add_wtbl and do not
allocate a huge buffer. Moreover use stack memory instead of heap one

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25 12:55:26 +02:00
Lorenzo Bianconi 77eaa281c2 mt7615: mcu: use proper msg size in mt7615_mcu_add_wtbl_bmc
Use proper mcu message size in mt7615_mcu_add_wtbl_bmc and do not
allocate a huge buffer. Moreover use stack memory instead of heap one

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25 12:55:26 +02:00
Lorenzo Bianconi b876457c6a mt7615: mcu: remove bss_info_convert_vif_type routine
Remove bss_info_convert_vif_type routine since it is run just in
mt7615_mcu_set_bss_info and the switch over vif->type is already there.
Simplify mt7615_mcu_set_bss_info routine

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25 12:55:25 +02:00
Lorenzo Bianconi 0467448d2e mt7615: mcu: simplify __mt7615_mcu_set_sta_rec
Do not loop over cmd payload in __mt7615_mcu_set_sta_rec since it is
already done in before running __mt7615_mcu_set_sta_rec (e.g.
mt7615_mcu_set_sta_rec)

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25 12:55:25 +02:00
Lorenzo Bianconi 8e309f7dc7 mt7615: mcu: simplify __mt7615_mcu_set_wtbl
Do not loop over cmd payload in __mt7615_mcu_set_wtbl since it is
already done in before running __mt7615_mcu_set_wtbl (e.g.
mt7615_mcu_set_wtbl_key)

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25 12:55:25 +02:00
Dan Carpenter 9db1aec0c2 mt76: mt7615: Use after free in mt7615_mcu_set_bcn()
We dereference "skb" when we assign:

	req.pkt_len = cpu_to_le16(MT_TXD_SIZE + skb->len);
                                                ^^^^^^^^
So this patch just moves the dev_kfree_skb() down a bit to avoid the
use after free.

Fixes: 04b8e65922 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-06-25 12:55:25 +02:00
Felix Fietkau b28e22bd9c mt76: mt7615: use sizeof instead of sizeof_field
It is simpler in this case

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01 13:03:59 +02:00
Ryder Lee 04b8e65922 mt76: add mac80211 driver for MT7615 PCIe-based chipsets
This driver is for a newer generation of MediaTek MT7615 4x4 802.11ac
PCIe-based chipsets, which support wave2 MU-MIMO up to 4 users/group
and also support up to 160MHz bandwidth.

The driver fully supports AP, station and monitor mode.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Roy Luo <royluo@google.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01 13:03:58 +02:00