Skip to content

Commit

Permalink
cfg80211: change netdev registration/unregistration semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
ntzb committed Jun 6, 2024
1 parent 08a0c2b commit 891e3db
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions os_dep/linux/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -4956,7 +4956,7 @@ static int rtw_cfg80211_add_monitor_if(_adapter *padapter, char *name, struct ne
mon_wdev->iftype = NL80211_IFTYPE_MONITOR;
mon_ndev->ieee80211_ptr = mon_wdev;

ret = register_netdevice(mon_ndev);
ret = cfg80211_register_netdevice(mon_ndev);
if (ret)
goto out;

Expand Down Expand Up @@ -5110,7 +5110,7 @@ static int cfg80211_rtw_del_virtual_intf(struct wiphy *wiphy,
pwdev_priv = adapter_wdev_data(adapter);

if (ndev == pwdev_priv->pmon_ndev) {
unregister_netdevice(ndev);
cfg80211_unregister_netdevice(ndev);
pwdev_priv->pmon_ndev = NULL;
pwdev_priv->ifname_mon[0] = '\0';
RTW_INFO(FUNC_NDEV_FMT" remove monitor ndev\n", FUNC_NDEV_ARG(ndev));
Expand Down
4 changes: 2 additions & 2 deletions os_dep/linux/os_intfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ int rtw_os_ndev_register(_adapter *adapter, const char *name)
if (rtnl_lock_needed)
ret = (register_netdev(ndev) == 0) ? _SUCCESS : _FAIL;
else
ret = (register_netdevice(ndev) == 0) ? _SUCCESS : _FAIL;
ret = (cfg80211_register_netdevice(ndev) == 0) ? _SUCCESS : _FAIL;

if (ret == _SUCCESS)
adapter->registered = 1;
Expand Down Expand Up @@ -705,7 +705,7 @@ void rtw_os_ndev_unregister(_adapter *adapter)
if (rtnl_lock_needed)
unregister_netdev(netdev);
else
unregister_netdevice(netdev);
cfg80211_unregister_netdevice(netdev);
}

adapter->registered = 0;
Expand Down
4 changes: 2 additions & 2 deletions os_dep/linux/wifi_regd.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static struct wireless_dev *rtw_regd_alloc_du_wdev(struct wiphy *wiphy)
wdev->iftype = NL80211_IFTYPE_AP;
ndev->ieee80211_ptr = wdev;

ret = register_netdevice(ndev);
ret = cfg80211_register_netdevice(ndev);

out:
if (ret && wdev) {
Expand All @@ -125,7 +125,7 @@ void rtw_regd_free_du_wdev(struct wiphy *wiphy)
if (rtnl_lock_needed)
rtnl_lock();

unregister_netdevice(wiphy_data->du_wdev->netdev);
cfg80211_unregister_netdevice(wiphy_data->du_wdev->netdev);

if (rtnl_lock_needed)
rtnl_unlock();
Expand Down
4 changes: 2 additions & 2 deletions os_dep/osdep_service_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname)
if (rtnl_lock_needed)
unregister_netdev(cur_pnetdev);
else
unregister_netdevice(cur_pnetdev);
cfg80211_unregister_netdevice(cur_pnetdev);

rereg_priv->old_pnetdev = cur_pnetdev;

Expand All @@ -892,7 +892,7 @@ int rtw_change_ifname(_adapter *padapter, const char *ifname)
if (rtnl_lock_needed)
ret = register_netdev(pnetdev);
else
ret = register_netdevice(pnetdev);
ret = cfg80211_register_netdevice(pnetdev);

if (ret != 0) {
goto error;
Expand Down

0 comments on commit 891e3db

Please sign in to comment.