mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7921: introduce remain_on_channel support
Introduce remain_on_channel support. Additionally, we add mt7921_check_offload_capability to disable .remain_on_channel and .cancel_remain_on_channel and related configuration because those operations would rely on the fundamental MCU commands that will be only supported with newer firmware. Co-developed-by: Deren Wu <[email protected]> Signed-off-by: Deren Wu <[email protected]> Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+11
-1
@@ -13,7 +13,8 @@
|
||||
#include "mac.h"
|
||||
|
||||
static const struct usb_device_id mt7921u_device_table[] = {
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(0x0e8d, 0x7961, 0xff, 0xff, 0xff) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(0x0e8d, 0x7961, 0xff, 0xff, 0xff),
|
||||
.driver_info = (kernel_ulong_t)MT7921_FIRMWARE_WM },
|
||||
{ },
|
||||
};
|
||||
|
||||
@@ -204,13 +205,21 @@ static int mt7921u_probe(struct usb_interface *usb_intf,
|
||||
struct ieee80211_hw *hw;
|
||||
struct mt7921_dev *dev;
|
||||
struct mt76_dev *mdev;
|
||||
u8 features;
|
||||
int ret;
|
||||
|
||||
features = mt7921_check_offload_capability(&usb_intf->dev, (const char *)
|
||||
id->driver_info);
|
||||
ops = devm_kmemdup(&usb_intf->dev, &mt7921_ops, sizeof(mt7921_ops),
|
||||
GFP_KERNEL);
|
||||
if (!ops)
|
||||
return -ENOMEM;
|
||||
|
||||
if (!(features & MT7921_FW_CAP_CNM)) {
|
||||
ops->remain_on_channel = NULL;
|
||||
ops->cancel_remain_on_channel = NULL;
|
||||
}
|
||||
|
||||
ops->stop = mt7921u_stop;
|
||||
|
||||
mdev = mt76_alloc_device(&usb_intf->dev, sizeof(*dev), ops, &drv_ops);
|
||||
@@ -218,6 +227,7 @@ static int mt7921u_probe(struct usb_interface *usb_intf,
|
||||
return -ENOMEM;
|
||||
|
||||
dev = container_of(mdev, struct mt7921_dev, mt76);
|
||||
dev->fw_features = features;
|
||||
dev->hif_ops = &hif_ops;
|
||||
|
||||
udev = usb_get_dev(udev);
|
||||
|
||||
Reference in New Issue
Block a user