|
@@ -6237,7 +6237,32 @@ free_net_dev:
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
-static QDF_STATUS hdd_register_interface(struct hdd_adapter *adapter, bool rtnl_held)
|
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)
|
|
|
+static int
|
|
|
+hdd_register_netdevice(struct hdd_adapter *adapter, struct net_device *dev,
|
|
|
+ struct hdd_adapter_create_param *params)
|
|
|
+{
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ if (params->is_add_virtual_iface)
|
|
|
+ ret = wlan_cfg80211_register_netdevice(dev);
|
|
|
+ else
|
|
|
+ ret = register_netdevice(dev);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+#else
|
|
|
+static int
|
|
|
+hdd_register_netdevice(struct hdd_adapter *adapter, struct net_device *dev,
|
|
|
+ struct hdd_adapter_create_param *params)
|
|
|
+{
|
|
|
+ return register_netdevice(dev);
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
+static QDF_STATUS
|
|
|
+hdd_register_interface(struct hdd_adapter *adapter, bool rtnl_held,
|
|
|
+ struct hdd_adapter_create_param *params)
|
|
|
{
|
|
|
struct net_device *dev = adapter->dev;
|
|
|
int ret;
|
|
@@ -6256,7 +6281,7 @@ static QDF_STATUS hdd_register_interface(struct hdd_adapter *adapter, bool rtnl_
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- ret = register_netdevice(dev);
|
|
|
+ ret = hdd_register_netdevice(adapter, dev, params);
|
|
|
if (ret) {
|
|
|
hdd_err("register_netdevice(%s) failed, err = 0x%x",
|
|
|
dev->name, ret);
|
|
@@ -6971,6 +6996,25 @@ void hdd_sta_destroy_ctx_all(struct hdd_context *hdd_ctx)
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)
|
|
|
+static void
|
|
|
+hdd_unregister_netdevice(struct hdd_adapter *adapter, struct net_device *dev)
|
|
|
+{
|
|
|
+ if (adapter->is_virtual_iface) {
|
|
|
+ wlan_cfg80211_unregister_netdevice(dev);
|
|
|
+ adapter->is_virtual_iface = false;
|
|
|
+ } else {
|
|
|
+ unregister_netdevice(dev);
|
|
|
+ }
|
|
|
+}
|
|
|
+#else
|
|
|
+static void
|
|
|
+hdd_unregister_netdevice(struct hdd_adapter *adapter, struct net_device *dev)
|
|
|
+{
|
|
|
+ unregister_netdevice(dev);
|
|
|
+}
|
|
|
+#endif
|
|
|
+
|
|
|
static void hdd_cleanup_adapter(struct hdd_context *hdd_ctx,
|
|
|
struct hdd_adapter *adapter,
|
|
|
bool rtnl_held)
|
|
@@ -7009,7 +7053,7 @@ static void hdd_cleanup_adapter(struct hdd_context *hdd_ctx,
|
|
|
|
|
|
if (test_bit(NET_DEVICE_REGISTERED, &adapter->event_flags)) {
|
|
|
if (rtnl_held)
|
|
|
- unregister_netdevice(dev);
|
|
|
+ hdd_unregister_netdevice(adapter, dev);
|
|
|
else
|
|
|
unregister_netdev(dev);
|
|
|
/*
|
|
@@ -7644,7 +7688,7 @@ struct hdd_adapter *hdd_open_adapter(struct hdd_context *hdd_ctx,
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- status = hdd_register_interface(adapter, rtnl_held);
|
|
|
+ status = hdd_register_interface(adapter, rtnl_held, params);
|
|
|
if (QDF_STATUS_SUCCESS != status)
|
|
|
goto err_free_netdev;
|
|
|
|
|
@@ -7680,7 +7724,7 @@ struct hdd_adapter *hdd_open_adapter(struct hdd_context *hdd_ctx,
|
|
|
NL80211_IFTYPE_P2P_GO;
|
|
|
adapter->device_mode = session_type;
|
|
|
|
|
|
- status = hdd_register_interface(adapter, rtnl_held);
|
|
|
+ status = hdd_register_interface(adapter, rtnl_held, params);
|
|
|
if (QDF_STATUS_SUCCESS != status)
|
|
|
goto err_free_netdev;
|
|
|
|
|
@@ -7721,7 +7765,7 @@ struct hdd_adapter *hdd_open_adapter(struct hdd_context *hdd_ctx,
|
|
|
|
|
|
adapter->wdev.iftype = NL80211_IFTYPE_STATION;
|
|
|
adapter->device_mode = session_type;
|
|
|
- status = hdd_register_interface(adapter, rtnl_held);
|
|
|
+ status = hdd_register_interface(adapter, rtnl_held, params);
|
|
|
if (QDF_STATUS_SUCCESS != status)
|
|
|
goto err_free_netdev;
|
|
|
|