Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cfg80211: unify sending NL80211_CMD_NEW_INTERFACE

There isn't really any need for us to be sending this from
two different places - move cfg80211_init_wdev() later and
send the notification from there, removing it from the non-
netdev case.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>

+3 -11
+3 -2
net/wireless/core.c
··· 1186 1186 wdev->identifier = ++rdev->wdev_id; 1187 1187 list_add_rcu(&wdev->list, &rdev->wiphy.wdev_list); 1188 1188 rdev->devlist_generation++; 1189 + 1190 + nl80211_notify_iface(rdev, wdev, NL80211_CMD_NEW_INTERFACE); 1189 1191 } 1190 1192 1191 1193 static int cfg80211_netdev_notifier_call(struct notifier_block *nb, ··· 1215 1213 * called within code protected by it when interfaces 1216 1214 * are added with nl80211. 1217 1215 */ 1218 - cfg80211_init_wdev(rdev, wdev); 1219 1216 /* can only change netns with wiphy */ 1220 1217 dev->features |= NETIF_F_NETNS_LOCAL; 1221 1218 ··· 1243 1242 1244 1243 INIT_WORK(&wdev->disconnect_wk, cfg80211_autodisconnect_wk); 1245 1244 1246 - nl80211_notify_iface(rdev, wdev, NL80211_CMD_NEW_INTERFACE); 1245 + cfg80211_init_wdev(rdev, wdev); 1247 1246 break; 1248 1247 case NETDEV_GOING_DOWN: 1249 1248 cfg80211_leave(rdev, wdev);
-9
net/wireless/nl80211.c
··· 3295 3295 return -ENOBUFS; 3296 3296 } 3297 3297 3298 - /* 3299 - * For wdevs which have no associated netdev object (e.g. of type 3300 - * NL80211_IFTYPE_P2P_DEVICE), emit the NEW_INTERFACE event here. 3301 - * For all other types, the event will be generated from the 3302 - * netdev notifier 3303 - */ 3304 - if (!wdev->netdev) 3305 - nl80211_notify_iface(rdev, wdev, NL80211_CMD_NEW_INTERFACE); 3306 - 3307 3298 return genlmsg_reply(msg, info); 3308 3299 } 3309 3300