wifi: mt76: mt7921: do not support one stream on secondary antenna only
authorDeren Wu <deren.wu@mediatek.com>
Wed, 10 May 2023 06:51:13 +0000 (14:51 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Sep 2023 20:27:01 +0000 (21:27 +0100)
commit74ceef6e6925a99a5f79087d791f5eb828dd04d0
tree09eef383b3293b374434a1218870c68ec88ca40f
parent179c65828593aff1f444e15debd40a477cb23cf4
wifi: mt76: mt7921: do not support one stream on secondary antenna only

commit d616d3680264beb9a9d2c4fc681064b06f447eeb upstream.

mt7921 support following antenna combiantions only.
* primary + secondary (2x2)
* primary only        (1x1)

Since we cannot work on secondary antenna only, return error if the
antenna bitmap is 0x2 in .set_antenna().

For example:
iw phy0 set antenna 3 3 /* valid */
iw phy0 set antenna 1 1 /* valid */
iw phy0 set antenna 2 2 /* invalid */

Cc: stable@vger.kernel.org
Fixes: e0f9fdda81bd ("mt76: mt7921: add ieee80211_ops")
Suggested-by: Knox Chiou <knoxchiou@google.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/mediatek/mt76/mt7921/main.c