aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/ieee80211.c')
-rw-r--r--net/mac80211/ieee80211.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 773a103ee3a1..fe32a2d16053 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -2605,8 +2605,7 @@ static void ieee80211_start_hard_monitor(struct ieee80211_local *local)
2605 struct ieee80211_if_init_conf conf; 2605 struct ieee80211_if_init_conf conf;
2606 2606
2607 if (local->open_count && local->open_count == local->monitors && 2607 if (local->open_count && local->open_count == local->monitors &&
2608 !(local->hw.flags & IEEE80211_HW_MONITOR_DURING_OPER) && 2608 !(local->hw.flags & IEEE80211_HW_MONITOR_DURING_OPER)) {
2609 local->ops->add_interface) {
2610 conf.if_id = -1; 2609 conf.if_id = -1;
2611 conf.type = IEEE80211_IF_TYPE_MNTR; 2610 conf.type = IEEE80211_IF_TYPE_MNTR;
2612 conf.mac_addr = NULL; 2611 conf.mac_addr = NULL;
@@ -2649,21 +2648,14 @@ static int ieee80211_open(struct net_device *dev)
2649 } 2648 }
2650 ieee80211_start_soft_monitor(local); 2649 ieee80211_start_soft_monitor(local);
2651 2650
2652 if (local->ops->add_interface) { 2651 conf.if_id = dev->ifindex;
2653 conf.if_id = dev->ifindex; 2652 conf.type = sdata->type;
2654 conf.type = sdata->type; 2653 conf.mac_addr = dev->dev_addr;
2655 conf.mac_addr = dev->dev_addr; 2654 res = local->ops->add_interface(local_to_hw(local), &conf);
2656 res = local->ops->add_interface(local_to_hw(local), &conf); 2655 if (res) {
2657 if (res) { 2656 if (sdata->type == IEEE80211_IF_TYPE_MNTR)
2658 if (sdata->type == IEEE80211_IF_TYPE_MNTR) 2657 ieee80211_start_hard_monitor(local);
2659 ieee80211_start_hard_monitor(local); 2658 return res;
2660 return res;
2661 }
2662 } else {
2663 if (sdata->type != IEEE80211_IF_TYPE_STA)
2664 return -EOPNOTSUPP;
2665 if (local->open_count > 0)
2666 return -ENOBUFS;
2667 } 2659 }
2668 2660
2669 if (local->open_count == 0) { 2661 if (local->open_count == 0) {
@@ -4896,6 +4888,9 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
4896 ((sizeof(struct ieee80211_local) + 4888 ((sizeof(struct ieee80211_local) +
4897 NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST); 4889 NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST);
4898 4890
4891 BUG_ON(!ops->tx);
4892 BUG_ON(!ops->config);
4893 BUG_ON(!ops->add_interface);
4899 local->ops = ops; 4894 local->ops = ops;
4900 4895
4901 /* for now, mdev needs sub_if_data :/ */ 4896 /* for now, mdev needs sub_if_data :/ */