static struct wireless_dev *ath6kl_cfg80211_add_iface(struct wiphy *wiphy,
                                                      const char *name,
+                                                     unsigned char name_assign_type,
                                                      enum nl80211_iftype type,
                                                      u32 *flags,
                                                      struct vif_params *params)
                return ERR_PTR(-EINVAL);
        }
 
-       wdev = ath6kl_interface_add(ar, name, type, if_idx, nw_type);
+       wdev = ath6kl_interface_add(ar, name, name_assign_type, type, if_idx, nw_type);
        if (!wdev)
                return ERR_PTR(-ENOMEM);
 
 }
 
 struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name,
+                                         unsigned char name_assign_type,
                                          enum nl80211_iftype type,
                                          u8 fw_vif_idx, u8 nw_type)
 {
        struct net_device *ndev;
        struct ath6kl_vif *vif;
 
-       ndev = alloc_netdev(sizeof(*vif), name, NET_NAME_UNKNOWN, ether_setup);
+       ndev = alloc_netdev(sizeof(*vif), name, name_assign_type, ether_setup);
        if (!ndev)
                return NULL;
 
 
 };
 
 struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name,
+                                         unsigned char name_assign_type,
                                          enum nl80211_iftype type,
                                          u8 fw_vif_idx, u8 nw_type);
 void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq,
 
        rtnl_lock();
 
        /* Add an initial station interface */
-       wdev = ath6kl_interface_add(ar, "wlan%d", NL80211_IFTYPE_STATION, 0,
-                                   INFRA_NETWORK);
+       wdev = ath6kl_interface_add(ar, "wlan%d", NET_NAME_ENUM,
+                                   NL80211_IFTYPE_STATION, 0, INFRA_NETWORK);
 
        rtnl_unlock();
 
 
 
 static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy,
                                                     const char *name,
+                                                    unsigned char name_assign_type,
                                                     enum nl80211_iftype type,
                                                     u32 *flags,
                                                     struct vif_params *params)
        case NL80211_IFTYPE_P2P_CLIENT:
        case NL80211_IFTYPE_P2P_GO:
        case NL80211_IFTYPE_P2P_DEVICE:
-               wdev = brcmf_p2p_add_vif(wiphy, name, type, flags, params);
+               wdev = brcmf_p2p_add_vif(wiphy, name, name_assign_type, type, flags, params);
                if (!IS_ERR(wdev))
                        brcmf_cfg80211_update_proto_addr_mode(wdev);
                return wdev;
 
  *
  * @wiphy: wiphy device of new interface.
  * @name: name of the new interface.
+ * @name_assign_type: origin of the interface name
  * @type: nl80211 interface type.
  * @flags: not used.
  * @params: contains mac address for P2P device.
  */
 struct wireless_dev *brcmf_p2p_add_vif(struct wiphy *wiphy, const char *name,
+                                      unsigned char name_assign_type,
                                       enum nl80211_iftype type, u32 *flags,
                                       struct vif_params *params)
 {
        }
 
        strncpy(ifp->ndev->name, name, sizeof(ifp->ndev->name) - 1);
+       ifp->ndev->name_assign_type = name_assign_type;
        err = brcmf_net_attach(ifp, true);
        if (err) {
                brcmf_err("Registering netdevice failed\n");
 
 s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg);
 void brcmf_p2p_detach(struct brcmf_p2p_info *p2p);
 struct wireless_dev *brcmf_p2p_add_vif(struct wiphy *wiphy, const char *name,
+                                      unsigned char name_assign_type,
                                       enum nl80211_iftype type, u32 *flags,
                                       struct vif_params *params);
 int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev);
 
 
 #define MWIFIEX_MAX_WQ_LEN  30
 /*
- *  create a new virtual interface with the given name
+ *  create a new virtual interface with the given name and name assign type
  */
 struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
                                              const char *name,
+                                             unsigned char name_assign_type,
                                              enum nl80211_iftype type,
                                              u32 *flags,
                                              struct vif_params *params)
        }
 
        dev = alloc_netdev_mqs(sizeof(struct mwifiex_private *), name,
-                              NET_NAME_UNKNOWN, ether_setup,
+                              name_assign_type, ether_setup,
                               IEEE80211_NUM_ACS, 1);
        if (!dev) {
                wiphy_err(wiphy, "no memory available for netdevice\n");
 
 
        rtnl_lock();
        /* Create station interface by default */
-       wdev = mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d",
+       wdev = mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d", NET_NAME_ENUM,
                                        NL80211_IFTYPE_STATION, NULL, NULL);
        if (IS_ERR(wdev)) {
                dev_err(adapter->dev, "cannot create default STA interface\n");
        }
 
        if (driver_mode & MWIFIEX_DRIVER_MODE_UAP) {
-               wdev = mwifiex_add_virtual_intf(adapter->wiphy, "uap%d",
+               wdev = mwifiex_add_virtual_intf(adapter->wiphy, "uap%d", NET_NAME_ENUM,
                                                NL80211_IFTYPE_AP, NULL, NULL);
                if (IS_ERR(wdev)) {
                        dev_err(adapter->dev, "cannot create AP interface\n");
        }
 
        if (driver_mode & MWIFIEX_DRIVER_MODE_P2P) {
-               wdev = mwifiex_add_virtual_intf(adapter->wiphy, "p2p%d",
+               wdev = mwifiex_add_virtual_intf(adapter->wiphy, "p2p%d", NET_NAME_ENUM,
                                                NL80211_IFTYPE_P2P_CLIENT, NULL,
                                                NULL);
                if (IS_ERR(wdev)) {
 
 
 struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
                                              const char *name,
+                                             unsigned char name_assign_type,
                                              enum nl80211_iftype type,
                                              u32 *flags,
                                              struct vif_params *params);
 
 };
 
 static int rtw_cfg80211_add_monitor_if(struct rtw_adapter *padapter, char *name,
+                                      unsigned char name_assign_type,
                                       struct net_device **ndev)
 {
        int ret = 0;
        mon_ndev->type = ARPHRD_IEEE80211_RADIOTAP;
        strncpy(mon_ndev->name, name, IFNAMSIZ);
        mon_ndev->name[IFNAMSIZ - 1] = 0;
+       mon_ndev->name_assign_type = name_assign_type;
        mon_ndev->destructor = rtw_ndev_destructor;
 
        mon_ndev->netdev_ops = &rtw_cfg80211_monitor_if_ops;
 
 static struct wireless_dev *
 cfg80211_rtw_add_virtual_intf(struct wiphy *wiphy, const char *name,
+                             unsigned char name_assign_type,
                              enum nl80211_iftype type, u32 *flags,
                              struct vif_params *params)
 {
                break;
        case NL80211_IFTYPE_MONITOR:
                ret =
-                   rtw_cfg80211_add_monitor_if(padapter, (char *)name, &ndev);
+                   rtw_cfg80211_add_monitor_if(padapter, (char *)name,
+                                               name_assign_type, &ndev);
                break;
 
        case NL80211_IFTYPE_P2P_CLIENT:
 
 
        struct wireless_dev * (*add_virtual_intf)(struct wiphy *wiphy,
                                                  const char *name,
+                                                 unsigned char name_assign_type,
                                                  enum nl80211_iftype type,
                                                  u32 *flags,
                                                  struct vif_params *params);
 
 
 static struct wireless_dev *ieee80211_add_iface(struct wiphy *wiphy,
                                                const char *name,
+                                               unsigned char name_assign_type,
                                                enum nl80211_iftype type,
                                                u32 *flags,
                                                struct vif_params *params)
        struct ieee80211_sub_if_data *sdata;
        int err;
 
-       err = ieee80211_if_add(local, name, &wdev, type, params);
+       err = ieee80211_if_add(local, name, name_assign_type, &wdev, type, params);
        if (err)
                return ERR_PTR(err);
 
 
 int ieee80211_iface_init(void);
 void ieee80211_iface_exit(void);
 int ieee80211_if_add(struct ieee80211_local *local, const char *name,
+                    unsigned char name_assign_type,
                     struct wireless_dev **new_wdev, enum nl80211_iftype type,
                     struct vif_params *params);
 int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata,
 
 }
 
 int ieee80211_if_add(struct ieee80211_local *local, const char *name,
+                    unsigned char name_assign_type,
                     struct wireless_dev **new_wdev, enum nl80211_iftype type,
                     struct vif_params *params)
 {
                        txqs = IEEE80211_NUM_ACS;
 
                ndev = alloc_netdev_mqs(sizeof(*sdata) + local->hw.vif_data_size,
-                                       name, NET_NAME_UNKNOWN,
+                                       name, name_assign_type,
                                        ieee80211_if_setup, txqs, 1);
                if (!ndev)
                        return -ENOMEM;
 
        /* add one default STA interface if supported */
        if (local->hw.wiphy->interface_modes & BIT(NL80211_IFTYPE_STATION) &&
            !(hw->flags & IEEE80211_HW_NO_AUTO_VIF)) {
-               result = ieee80211_if_add(local, "wlan%d", NULL,
+               result = ieee80211_if_add(local, "wlan%d", NET_NAME_ENUM, NULL,
                                          NL80211_IFTYPE_STATION, NULL);
                if (result)
                        wiphy_warn(local->hw.wiphy,
 
 
        wdev = rdev_add_virtual_intf(rdev,
                                nla_data(info->attrs[NL80211_ATTR_IFNAME]),
-                               type, err ? NULL : &flags, ¶ms);
+                               NET_NAME_USER, type, err ? NULL : &flags,
+                               ¶ms);
        if (WARN_ON(!wdev)) {
                nlmsg_free(msg);
                return -EPROTO;
 
 
 static inline struct wireless_dev
 *rdev_add_virtual_intf(struct cfg80211_registered_device *rdev, char *name,
+                      unsigned char name_assign_type,
                       enum nl80211_iftype type, u32 *flags,
                       struct vif_params *params)
 {
        struct wireless_dev *ret;
        trace_rdev_add_virtual_intf(&rdev->wiphy, name, type);
-       ret = rdev->ops->add_virtual_intf(&rdev->wiphy, name, type, flags,
-                                         params);
+       ret = rdev->ops->add_virtual_intf(&rdev->wiphy, name, name_assign_type,
+                                         type, flags, params);
        trace_rdev_return_wdev(&rdev->wiphy, ret);
        return ret;
 }