Browse Source

qcacld-3.0: Add support for NDI del virtual intf

Currently host driver deletes NDI interfaces using
vendor command. With the kernel 5.12 version onwards,
interface deletion is not allowed using vendor commands
as it leads to deadlock when driver tries to acquire
the RTNL_LOCK at the time of netdev register/unregister.

With this change, support both del_virtual intf and ndi
delete vendor cmd to stop and deinit adapter.
Now, with NDI delete vendor subcmd, NDI is down as stop adapter
and deinit adapter is executed and del virtual intf will clean
up(stop, deint and close) the adapter.
Since ndi delete vendor cmd already comes with the rtnl lock
and driver does not need to take the rtnl lock again
which will help to avoid the above issue.

Change-Id: I0fe69b1648dc76b902b8eea1fc4aef695d1bd152
CRs-Fixed: 3170293
Rahul Gusain 2 years ago
parent
commit
e0c46cf74e
1 changed files with 13 additions and 0 deletions
  1. 13 0
      core/hdd/src/wlan_hdd_nan_datapath.c

+ 13 - 0
core/hdd/src/wlan_hdd_nan_datapath.c

@@ -845,6 +845,19 @@ err_handler:
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0))
 static int hdd_delete_ndi_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
 {
+	struct net_device *dev = wdev->netdev;
+	struct hdd_context *hdd_ctx = (struct hdd_context *)wiphy_priv(wiphy);
+	struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
+
+	hdd_enter_dev(dev);
+
+	wlan_hdd_release_intf_addr(hdd_ctx,
+				   adapter->mac_addr.bytes);
+	hdd_stop_adapter(hdd_ctx, adapter);
+	hdd_deinit_adapter(hdd_ctx, adapter, true);
+
+	hdd_exit();
+
 	return 0;
 }
 #else