Merge remote-tracking branch 'wireless-next/master' into mac80211-next
authorJohannes Berg <johannes.berg@intel.com>
Thu, 20 Feb 2014 10:55:12 +0000 (11:55 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 20 Feb 2014 10:55:12 +0000 (11:55 +0100)
14 files changed:
drivers/net/wireless/mac80211_hwsim.c
drivers/net/wireless/mac80211_hwsim.h
include/net/mac80211.h
include/uapi/linux/nl80211.h
net/mac80211/cfg.c
net/mac80211/debugfs_netdev.c
net/mac80211/ieee80211_i.h
net/mac80211/iface.c
net/mac80211/main.c
net/mac80211/mlme.c
net/mac80211/rx.c
net/mac80211/scan.c
net/wireless/chan.c
net/wireless/nl80211.c

index f7e3562..9d7a52f 100644 (file)
@@ -411,6 +411,7 @@ struct mac80211_hwsim_data {
 
        struct mac_address addresses[2];
        int channels, idx;
+       bool use_chanctx;
 
        struct ieee80211_channel *tmp_chan;
        struct delayed_work roc_done;
@@ -1088,7 +1089,7 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw,
                return;
        }
 
-       if (data->channels == 1) {
+       if (!data->use_chanctx) {
                channel = data->channel;
        } else if (txi->hw_queue == 4) {
                channel = data->tmp_chan;
@@ -1354,7 +1355,7 @@ static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed)
 
        data->channel = conf->chandef.chan;
 
-       WARN_ON(data->channel && data->channels > 1);
+       WARN_ON(data->channel && data->use_chanctx);
 
        data->power_level = conf->power_level;
        if (!data->started || !data->beacon_int)
@@ -1940,7 +1941,8 @@ static struct ieee80211_ops mac80211_hwsim_mchan_ops;
 
 static int mac80211_hwsim_create_radio(int channels, const char *reg_alpha2,
                                       const struct ieee80211_regdomain *regd,
-                                      bool reg_strict, bool p2p_device)
+                                      bool reg_strict, bool p2p_device,
+                                      bool use_chanctx)
 {
        int err;
        u8 addr[ETH_ALEN];
@@ -1950,11 +1952,14 @@ static int mac80211_hwsim_create_radio(int channels, const char *reg_alpha2,
        const struct ieee80211_ops *ops = &mac80211_hwsim_ops;
        int idx;
 
+       if (WARN_ON(channels > 1 && !use_chanctx))
+               return -EINVAL;
+
        spin_lock_bh(&hwsim_radio_lock);
        idx = hwsim_radio_idx++;
        spin_unlock_bh(&hwsim_radio_lock);
 
-       if (channels > 1)
+       if (use_chanctx)
                ops = &mac80211_hwsim_mchan_ops;
        hw = ieee80211_alloc_hw(sizeof(*data), ops);
        if (!hw) {
@@ -1995,20 +2000,21 @@ static int mac80211_hwsim_create_radio(int channels, const char *reg_alpha2,
        hw->wiphy->addresses = data->addresses;
 
        data->channels = channels;
+       data->use_chanctx = use_chanctx;
        data->idx = idx;
 
-       if (data->channels > 1) {
+       if (data->use_chanctx) {
                hw->wiphy->max_scan_ssids = 255;
                hw->wiphy->max_scan_ie_len = IEEE80211_MAX_DATA_LEN;
                hw->wiphy->max_remain_on_channel_duration = 1000;
                /* For channels > 1 DFS is not allowed */
                hw->wiphy->n_iface_combinations = 1;
                hw->wiphy->iface_combinations = &data->if_combination;
-               data->if_combination.num_different_channels = data->channels;
                if (p2p_device)
                        data->if_combination = hwsim_if_comb_p2p_dev[0];
                else
                        data->if_combination = hwsim_if_comb[0];
+               data->if_combination.num_different_channels = data->channels;
        } else if (p2p_device) {
                hw->wiphy->iface_combinations = hwsim_if_comb_p2p_dev;
                hw->wiphy->n_iface_combinations =
@@ -2156,7 +2162,7 @@ static int mac80211_hwsim_create_radio(int channels, const char *reg_alpha2,
        debugfs_create_file("ps", 0666, data->debugfs, data, &hwsim_fops_ps);
        debugfs_create_file("group", 0666, data->debugfs, data,
                            &hwsim_fops_group);
-       if (data->channels == 1)
+       if (!data->use_chanctx)
                debugfs_create_file("dfs_simulate_radar", 0222,
                                    data->debugfs,
                                    data, &hwsim_simulate_radar);
@@ -2423,10 +2429,16 @@ static int hwsim_create_radio_nl(struct sk_buff *msg, struct genl_info *info)
        const struct ieee80211_regdomain *regd = NULL;
        bool reg_strict = info->attrs[HWSIM_ATTR_REG_STRICT_REG];
        bool p2p_device = info->attrs[HWSIM_ATTR_SUPPORT_P2P_DEVICE];
+       bool use_chanctx;
 
        if (info->attrs[HWSIM_ATTR_CHANNELS])
                chans = nla_get_u32(info->attrs[HWSIM_ATTR_CHANNELS]);
 
+       if (info->attrs[HWSIM_ATTR_USE_CHANCTX])
+               use_chanctx = true;
+       else
+               use_chanctx = (chans > 1);
+
        if (info->attrs[HWSIM_ATTR_REG_HINT_ALPHA2])
                alpha2 = nla_data(info->attrs[HWSIM_ATTR_REG_HINT_ALPHA2]);
 
@@ -2439,7 +2451,7 @@ static int hwsim_create_radio_nl(struct sk_buff *msg, struct genl_info *info)
        }
 
        return mac80211_hwsim_create_radio(chans, alpha2, regd, reg_strict,
-                                          p2p_device);
+                                          p2p_device, use_chanctx);
 }
 
 static int hwsim_destroy_radio_nl(struct sk_buff *msg, struct genl_info *info)
@@ -2658,7 +2670,8 @@ static int __init init_mac80211_hwsim(void)
 
                err = mac80211_hwsim_create_radio(channels, reg_alpha2,
                                                  regd, reg_strict,
-                                                 support_p2p_device);
+                                                 support_p2p_device,
+                                                 channels > 1);
                if (err < 0)
                        goto out_free_radios;
        }
index 6e72996..c9d0315 100644 (file)
@@ -108,6 +108,9 @@ enum {
  * @HWSIM_ATTR_REG_CUSTOM_REG: custom regulatory domain index (u32 attribute)
  * @HWSIM_ATTR_REG_STRICT_REG: request REGULATORY_STRICT_REG (flag attribute)
  * @HWSIM_ATTR_SUPPORT_P2P_DEVICE: support P2P Device virtual interface (flag)
+ * @HWSIM_ATTR_USE_CHANCTX: used with the %HWSIM_CMD_CREATE_RADIO
+ *     command to force use of channel contexts even when only a
+ *     single channel is supported
  * @__HWSIM_ATTR_MAX: enum limit
  */
 
@@ -128,6 +131,7 @@ enum {
        HWSIM_ATTR_REG_CUSTOM_REG,
        HWSIM_ATTR_REG_STRICT_REG,
        HWSIM_ATTR_SUPPORT_P2P_DEVICE,
+       HWSIM_ATTR_USE_CHANCTX,
        __HWSIM_ATTR_MAX,
 };
 #define HWSIM_ATTR_MAX (__HWSIM_ATTR_MAX - 1)
index 4f0f29d..a6bcc39 100644 (file)
  *
  * Secondly, when the hardware handles fragmentation, the frame handed to
  * the driver from mac80211 is the MSDU, not the MPDU.
- *
- * Finally, for received frames, the driver is able to indicate that it has
- * filled a radiotap header and put that in front of the frame; if it does
- * not do so then mac80211 may add this under certain circumstances.
  */
 
 /**
@@ -1507,8 +1503,6 @@ struct ieee80211_tx_control {
  * @IEEE80211_HW_CONNECTION_MONITOR:
  *     The hardware performs its own connection monitoring, including
  *     periodic keep-alives to the AP and probing the AP on beacon loss.
- *     When this flag is set, signaling beacon-loss will cause an immediate
- *     change to disassociated state.
  *
  * @IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC:
  *     This device needs to get data from beacon before association (i.e.
@@ -1644,10 +1638,6 @@ enum ieee80211_hw_flags {
  *     the hw can report back.
  * @max_rate_tries: maximum number of tries for each stage
  *
- * @napi_weight: weight used for NAPI polling.  You must specify an
- *     appropriate value here if a napi_poll operation is provided
- *     by your driver.
- *
  * @max_rx_aggregation_subframes: maximum buffer size (number of
  *     sub-frames) to be used for A-MPDU block ack receiver
  *     aggregation.
@@ -1701,7 +1691,6 @@ struct ieee80211_hw {
        int vif_data_size;
        int sta_data_size;
        int chanctx_data_size;
-       int napi_weight;
        u16 queues;
        u16 max_listen_interval;
        s8 max_signal;
@@ -2624,8 +2613,6 @@ enum ieee80211_roc_type {
  *     callback. They must then call ieee80211_chswitch_done() to indicate
  *     completion of the channel switch.
  *
- * @napi_poll: Poll Rx queue for incoming data frames.
- *
  * @set_antenna: Set antenna configuration (tx_ant, rx_ant) on the device.
  *     Parameters are bitmaps of allowed antennas to use for TX/RX. Drivers may
  *     reject TX/RX mask combinations they cannot support by returning -EINVAL
@@ -2884,7 +2871,6 @@ struct ieee80211_ops {
        void (*flush)(struct ieee80211_hw *hw, u32 queues, bool drop);
        void (*channel_switch)(struct ieee80211_hw *hw,
                               struct ieee80211_channel_switch *ch_switch);
-       int (*napi_poll)(struct ieee80211_hw *hw, int budget);
        int (*set_antenna)(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant);
        int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant);
 
@@ -3166,21 +3152,21 @@ void ieee80211_free_hw(struct ieee80211_hw *hw);
  */
 void ieee80211_restart_hw(struct ieee80211_hw *hw);
 
-/** ieee80211_napi_schedule - schedule NAPI poll
- *
- * Use this function to schedule NAPI polling on a device.
- *
- * @hw: the hardware to start polling
- */
-void ieee80211_napi_schedule(struct ieee80211_hw *hw);
-
-/** ieee80211_napi_complete - complete NAPI polling
- *
- * Use this function to finish NAPI polling on a device.
+/**
+ * ieee80211_napi_add - initialize mac80211 NAPI context
+ * @hw: the hardware to initialize the NAPI context on
+ * @napi: the NAPI context to initialize
+ * @napi_dev: dummy NAPI netdevice, here to not waste the space if the
+ *     driver doesn't use NAPI
+ * @poll: poll function
+ * @weight: default weight
  *
- * @hw: the hardware to stop polling
+ * See also netif_napi_add().
  */
-void ieee80211_napi_complete(struct ieee80211_hw *hw);
+void ieee80211_napi_add(struct ieee80211_hw *hw, struct napi_struct *napi,
+                       struct net_device *napi_dev,
+                       int (*poll)(struct napi_struct *, int),
+                       int weight);
 
 /**
  * ieee80211_rx - receive frame
index a12e6ca..ba1f762 100644 (file)
@@ -3843,11 +3843,6 @@ enum nl80211_ap_sme_features {
  * @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested
  *     to work properly to suppport receiving regulatory hints from
  *     cellular base stations.
- * @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: If this is set, an active
- *     P2P Device (%NL80211_IFTYPE_P2P_DEVICE) requires its own channel
- *     in the interface combinations, even when it's only used for scan
- *     and remain-on-channel. This could be due to, for example, the
- *     remain-on-channel implementation requiring a channel context.
  * @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of
  *     equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station
  *     mode
@@ -3889,7 +3884,7 @@ enum nl80211_feature_flags {
        NL80211_FEATURE_HT_IBSS                         = 1 << 1,
        NL80211_FEATURE_INACTIVITY_TIMER                = 1 << 2,
        NL80211_FEATURE_CELL_BASE_REG_HINTS             = 1 << 3,
-       NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL        = 1 << 4,
+       /* bit 4 is reserved - don't use */
        NL80211_FEATURE_SAE                             = 1 << 5,
        NL80211_FEATURE_LOW_PRIORITY_SCAN               = 1 << 6,
        NL80211_FEATURE_SCAN_FLUSH                      = 1 << 7,
index 363d19b..3849fd0 100644 (file)
@@ -1347,9 +1347,6 @@ static int sta_apply_parameters(struct ieee80211_local *local,
                                                    params->vht_capa, sta);
 
        if (params->opmode_notif_used) {
-               enum ieee80211_band band =
-                       ieee80211_get_sdata_band(sdata);
-
                /* returned value is only needed for rc update, but the
                 * rc isn't initialized here yet, so ignore it
                 */
index ebf80f3..40a6489 100644 (file)
@@ -358,6 +358,18 @@ static ssize_t ieee80211_if_parse_tkip_mic_test(
 }
 IEEE80211_IF_FILE_W(tkip_mic_test);
 
+static ssize_t ieee80211_if_parse_beacon_loss(
+       struct ieee80211_sub_if_data *sdata, const char *buf, int buflen)
+{
+       if (!ieee80211_sdata_running(sdata) || !sdata->vif.bss_conf.assoc)
+               return -ENOTCONN;
+
+       ieee80211_beacon_loss(&sdata->vif);
+
+       return buflen;
+}
+IEEE80211_IF_FILE_W(beacon_loss);
+
 static ssize_t ieee80211_if_fmt_uapsd_queues(
        const struct ieee80211_sub_if_data *sdata, char *buf, int buflen)
 {
@@ -569,6 +581,7 @@ static void add_sta_files(struct ieee80211_sub_if_data *sdata)
        DEBUGFS_ADD(beacon_timeout);
        DEBUGFS_ADD_MODE(smps, 0600);
        DEBUGFS_ADD_MODE(tkip_mic_test, 0200);
+       DEBUGFS_ADD_MODE(beacon_loss, 0200);
        DEBUGFS_ADD_MODE(uapsd_queues, 0600);
        DEBUGFS_ADD_MODE(uapsd_max_sp_len, 0600);
 }
index 0014b53..8603dfb 100644 (file)
@@ -1242,6 +1242,8 @@ struct ieee80211_local {
 
        struct ieee80211_sub_if_data __rcu *p2p_sdata;
 
+       struct napi_struct *napi;
+
        /* virtual monitor interface */
        struct ieee80211_sub_if_data __rcu *monitor_sdata;
        struct cfg80211_chan_def monitor_chandef;
index 96518ad..be198f4 100644 (file)
@@ -101,9 +101,8 @@ static u32 __ieee80211_idle_on(struct ieee80211_local *local)
 static u32 __ieee80211_recalc_idle(struct ieee80211_local *local,
                                   bool force_active)
 {
-       bool working = false, scanning, active;
+       bool working, scanning, active;
        unsigned int led_trig_start = 0, led_trig_stop = 0;
-       struct ieee80211_roc_work *roc;
 
        lockdep_assert_held(&local->mtx);
 
@@ -111,12 +110,8 @@ static u32 __ieee80211_recalc_idle(struct ieee80211_local *local,
                 !list_empty(&local->chanctx_list) ||
                 local->monitors;
 
-       if (!local->ops->remain_on_channel) {
-               list_for_each_entry(roc, &local->roc_list, list) {
-                       working = true;
-                       break;
-               }
-       }
+       working = !local->ops->remain_on_channel &&
+                 !list_empty(&local->roc_list);
 
        scanning = test_bit(SCAN_SW_SCANNING, &local->scanning) ||
                   test_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning);
index 1f7d842..b055f6a 100644 (file)
@@ -1076,6 +1076,18 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 }
 EXPORT_SYMBOL(ieee80211_register_hw);
 
+void ieee80211_napi_add(struct ieee80211_hw *hw, struct napi_struct *napi,
+                       struct net_device *napi_dev,
+                       int (*poll)(struct napi_struct *, int),
+                       int weight)
+{
+       struct ieee80211_local *local = hw_to_local(hw);
+
+       netif_napi_add(napi_dev, napi, poll, weight);
+       local->napi = napi;
+}
+EXPORT_SYMBOL_GPL(ieee80211_napi_add);
+
 void ieee80211_unregister_hw(struct ieee80211_hw *hw)
 {
        struct ieee80211_local *local = hw_to_local(hw);
index 6160483..46b62bb 100644 (file)
@@ -131,13 +131,13 @@ void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata)
        if (unlikely(!sdata->u.mgd.associated))
                return;
 
+       ifmgd->probe_send_count = 0;
+
        if (sdata->local->hw.flags & IEEE80211_HW_CONNECTION_MONITOR)
                return;
 
        mod_timer(&sdata->u.mgd.conn_mon_timer,
                  round_jiffies_up(jiffies + IEEE80211_CONNECTION_IDLE_TIME));
-
-       ifmgd->probe_send_count = 0;
 }
 
 static int ecw2cw(int ecw)
@@ -2249,6 +2249,62 @@ static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,
        /* ignore frame -- wait for timeout */
 }
 
+#define case_WLAN(type) \
+       case WLAN_REASON_##type: return #type
+
+static const char *ieee80211_get_reason_code_string(u16 reason_code)
+{
+       switch (reason_code) {
+       case_WLAN(UNSPECIFIED);
+       case_WLAN(PREV_AUTH_NOT_VALID);
+       case_WLAN(DEAUTH_LEAVING);
+       case_WLAN(DISASSOC_DUE_TO_INACTIVITY);
+       case_WLAN(DISASSOC_AP_BUSY);
+       case_WLAN(CLASS2_FRAME_FROM_NONAUTH_STA);
+       case_WLAN(CLASS3_FRAME_FROM_NONASSOC_STA);
+       case_WLAN(DISASSOC_STA_HAS_LEFT);
+       case_WLAN(STA_REQ_ASSOC_WITHOUT_AUTH);
+       case_WLAN(DISASSOC_BAD_POWER);
+       case_WLAN(DISASSOC_BAD_SUPP_CHAN);
+       case_WLAN(INVALID_IE);
+       case_WLAN(MIC_FAILURE);
+       case_WLAN(4WAY_HANDSHAKE_TIMEOUT);
+       case_WLAN(GROUP_KEY_HANDSHAKE_TIMEOUT);
+       case_WLAN(IE_DIFFERENT);
+       case_WLAN(INVALID_GROUP_CIPHER);
+       case_WLAN(INVALID_PAIRWISE_CIPHER);
+       case_WLAN(INVALID_AKMP);
+       case_WLAN(UNSUPP_RSN_VERSION);
+       case_WLAN(INVALID_RSN_IE_CAP);
+       case_WLAN(IEEE8021X_FAILED);
+       case_WLAN(CIPHER_SUITE_REJECTED);
+       case_WLAN(DISASSOC_UNSPECIFIED_QOS);
+       case_WLAN(DISASSOC_QAP_NO_BANDWIDTH);
+       case_WLAN(DISASSOC_LOW_ACK);
+       case_WLAN(DISASSOC_QAP_EXCEED_TXOP);
+       case_WLAN(QSTA_LEAVE_QBSS);
+       case_WLAN(QSTA_NOT_USE);
+       case_WLAN(QSTA_REQUIRE_SETUP);
+       case_WLAN(QSTA_TIMEOUT);
+       case_WLAN(QSTA_CIPHER_NOT_SUPP);
+       case_WLAN(MESH_PEER_CANCELED);
+       case_WLAN(MESH_MAX_PEERS);
+       case_WLAN(MESH_CONFIG);
+       case_WLAN(MESH_CLOSE);
+       case_WLAN(MESH_MAX_RETRIES);
+       case_WLAN(MESH_CONFIRM_TIMEOUT);
+       case_WLAN(MESH_INVALID_GTK);
+       case_WLAN(MESH_INCONSISTENT_PARAM);
+       case_WLAN(MESH_INVALID_SECURITY);
+       case_WLAN(MESH_PATH_ERROR);
+       case_WLAN(MESH_PATH_NOFORWARD);
+       case_WLAN(MESH_PATH_DEST_UNREACHABLE);
+       case_WLAN(MAC_EXISTS_IN_MBSS);
+       case_WLAN(MESH_CHAN_REGULATORY);
+       case_WLAN(MESH_CHAN);
+       default: return "<unknown>";
+       }
+}
 
 static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata,
                                     struct ieee80211_mgmt *mgmt, size_t len)
@@ -2270,8 +2326,8 @@ static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata,
 
        reason_code = le16_to_cpu(mgmt->u.deauth.reason_code);
 
-       sdata_info(sdata, "deauthenticated from %pM (Reason: %u)\n",
-                  bssid, reason_code);
+       sdata_info(sdata, "deauthenticated from %pM (Reason: %u=%s)\n",
+                  bssid, reason_code, ieee80211_get_reason_code_string(reason_code));
 
        ieee80211_set_disassoc(sdata, 0, 0, false, NULL);
 
@@ -4340,8 +4396,8 @@ int ieee80211_mgd_deauth(struct ieee80211_sub_if_data *sdata,
        bool report_frame = false;
 
        sdata_info(sdata,
-                  "deauthenticating from %pM by local choice (reason=%d)\n",
-                  req->bssid, req->reason_code);
+                  "deauthenticating from %pM by local choice (Reason: %u=%s)\n",
+                  req->bssid, req->reason_code, ieee80211_get_reason_code_string(req->reason_code));
 
        if (ifmgd->auth_data) {
                drv_mgd_prepare_tx(sdata->local, sdata);
@@ -4387,8 +4443,8 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
                return -ENOLINK;
 
        sdata_info(sdata,
-                  "disassociating from %pM by local choice (reason=%d)\n",
-                  req->bss->bssid, req->reason_code);
+                  "disassociating from %pM by local choice (Reason: %u=%s)\n",
+                  req->bss->bssid, req->reason_code, ieee80211_get_reason_code_string(req->reason_code));
 
        memcpy(bssid, req->bss->bssid, ETH_ALEN);
        ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DISASSOC,
index 5930621..58e4b70 100644 (file)
@@ -1954,7 +1954,10 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
                /* deliver to local stack */
                skb->protocol = eth_type_trans(skb, dev);
                memset(skb->cb, 0, sizeof(skb->cb));
-               netif_receive_skb(skb);
+               if (rx->local->napi)
+                       napi_gro_receive(rx->local->napi, skb);
+               else
+                       netif_receive_skb(skb);
        }
 
        if (xmit_skb) {
index 88c8161..b211e41 100644 (file)
@@ -472,9 +472,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
        if (local->ops->hw_scan) {
                u8 *ies;
 
-               local->hw_scan_ies_bufsize = 2 + IEEE80211_MAX_SSID_LEN +
-                                            local->scan_ies_len +
-                                            req->ie_len;
+               local->hw_scan_ies_bufsize = local->scan_ies_len + req->ie_len;
                local->hw_scan_req = kmalloc(
                                sizeof(*local->hw_scan_req) +
                                req->n_channels * sizeof(req->channels[0]) +
@@ -979,8 +977,7 @@ int __ieee80211_request_sched_scan_start(struct ieee80211_sub_if_data *sdata,
        struct cfg80211_chan_def chandef;
        int ret, i, iebufsz;
 
-       iebufsz = 2 + IEEE80211_MAX_SSID_LEN +
-                 local->scan_ies_len + req->ie_len;
+       iebufsz = local->scan_ies_len + req->ie_len;
 
        lockdep_assert_held(&local->mtx);
 
index f8ab7df..5946450 100644 (file)
@@ -705,12 +705,8 @@ cfg80211_get_chan_state(struct wireless_dev *wdev,
        case NL80211_IFTYPE_MONITOR:
        case NL80211_IFTYPE_AP_VLAN:
        case NL80211_IFTYPE_WDS:
-               /* these interface types don't really have a channel */
-               return;
        case NL80211_IFTYPE_P2P_DEVICE:
-               if (wdev->wiphy->features &
-                               NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL)
-                       *chanmode = CHAN_MODE_EXCLUSIVE;
+               /* these interface types don't really have a channel */
                return;
        case NL80211_IFTYPE_UNSPECIFIED:
        case NUM_NL80211_IFTYPES:
index 8e6b6a2..058aa0e 100644 (file)
@@ -5710,8 +5710,8 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
                request->min_rssi_thold = NL80211_SCAN_RSSI_THOLD_OFF;
        }
 
-       if (info->attrs[NL80211_ATTR_IE]) {
-               request->ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
+       if (ie_len) {
+               request->ie_len = ie_len;
                memcpy((void *)request->ie,
                       nla_data(info->attrs[NL80211_ATTR_IE]),
                       request->ie_len);