Merge branch 'master' of git://git.infradead.org/users/linville/wireless-next into...
authorJohn W. Linville <linville@tuxdriver.com>
Mon, 17 Oct 2011 19:05:26 +0000 (15:05 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 17 Oct 2011 19:05:26 +0000 (15:05 -0400)
1  2 
drivers/net/wireless/libertas/main.c
drivers/net/wireless/mwifiex/main.c
net/mac80211/cfg.c
net/mac80211/sta_info.c

@@@ -99,6 -99,32 +99,32 @@@ u8 lbs_data_rate_to_fw_index(u32 rate
        return 0;
  }
  
+ int lbs_set_iface_type(struct lbs_private *priv, enum nl80211_iftype type)
+ {
+       int ret = 0;
+       switch (type) {
+       case NL80211_IFTYPE_MONITOR:
+               ret = lbs_set_monitor_mode(priv, 1);
+               break;
+       case NL80211_IFTYPE_STATION:
+               if (priv->wdev->iftype == NL80211_IFTYPE_MONITOR)
+                       ret = lbs_set_monitor_mode(priv, 0);
+               if (!ret)
+                       ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_BSS_TYPE, 1);
+               break;
+       case NL80211_IFTYPE_ADHOC:
+               if (priv->wdev->iftype == NL80211_IFTYPE_MONITOR)
+                       ret = lbs_set_monitor_mode(priv, 0);
+               if (!ret)
+                       ret = lbs_set_snmp_mib(priv, SNMP_MIB_OID_BSS_TYPE, 2);
+               break;
+       default:
+               ret = -ENOTSUPP;
+       }
+       return ret;
+ }
  int lbs_start_iface(struct lbs_private *priv)
  {
        struct cmd_ds_802_11_mac_address cmd;
                goto err;
        }
  
+       ret = lbs_set_iface_type(priv, priv->wdev->iftype);
+       if (ret) {
+               lbs_deb_net("set iface type failed\n");
+               goto err;
+       }
        lbs_update_channel(priv);
  
        priv->iface_running = true;
@@@ -902,7 -934,7 +934,7 @@@ static const struct net_device_ops lbs_
        .ndo_stop               = lbs_eth_stop,
        .ndo_start_xmit         = lbs_hard_start_xmit,
        .ndo_set_mac_address    = lbs_set_mac_address,
 -      .ndo_set_multicast_list = lbs_set_multicast_list,
 +      .ndo_set_rx_mode        = lbs_set_multicast_list,
        .ndo_change_mtu         = eth_change_mtu,
        .ndo_validate_addr      = eth_validate_addr,
  };
@@@ -555,7 -555,7 +555,7 @@@ static const struct net_device_ops mwif
        .ndo_set_mac_address = mwifiex_set_mac_address,
        .ndo_tx_timeout = mwifiex_tx_timeout,
        .ndo_get_stats = mwifiex_get_stats,
 -      .ndo_set_multicast_list = mwifiex_set_multicast_list,
 +      .ndo_set_rx_mode = mwifiex_set_multicast_list,
  };
  
  /*
@@@ -661,7 -661,7 +661,7 @@@ mwifiex_terminate_workqueue(struct mwif
   */
  int
  mwifiex_add_card(void *card, struct semaphore *sem,
-                struct mwifiex_if_ops *if_ops)
+                struct mwifiex_if_ops *if_ops, u8 iface_type)
  {
        struct mwifiex_adapter *adapter;
        char fmt[64];
                goto err_init_sw;
        }
  
+       adapter->iface_type = iface_type;
        adapter->hw_status = MWIFIEX_HW_STATUS_INITIALIZING;
        adapter->surprise_removed = false;
        init_waitqueue_head(&adapter->init_wait_q);
        init_waitqueue_head(&adapter->hs_activate_wait_q);
        adapter->cmd_wait_q_required = false;
        init_waitqueue_head(&adapter->cmd_wait_q.wait);
-       adapter->cmd_wait_q.condition = false;
        adapter->cmd_wait_q.status = 0;
+       adapter->scan_wait_q_woken = false;
  
        adapter->workqueue = create_workqueue("MWIFIEX_WORK_QUEUE");
        if (!adapter->workqueue)
@@@ -825,6 -827,10 +827,10 @@@ int mwifiex_remove_card(struct mwifiex_
                rtnl_unlock();
        }
  
+       priv = adapter->priv[0];
+       if (!priv)
+               goto exit_remove;
        wiphy_unregister(priv->wdev->wiphy);
        wiphy_free(priv->wdev->wiphy);
        kfree(priv->wdev);
diff --combined net/mac80211/cfg.c
@@@ -63,7 -63,7 +63,7 @@@ static int ieee80211_change_iface(struc
  
        if (type == NL80211_IFTYPE_AP_VLAN &&
            params && params->use_4addr == 0)
 -              rcu_assign_pointer(sdata->u.vlan.sta, NULL);
 +              RCU_INIT_POINTER(sdata->u.vlan.sta, NULL);
        else if (type == NL80211_IFTYPE_STATION &&
                 params && params->use_4addr >= 0)
                sdata->u.mgd.use_4addr = params->use_4addr;
@@@ -344,7 -344,8 +344,8 @@@ static void sta_set_sinfo(struct sta_in
                        STATION_INFO_RX_BITRATE |
                        STATION_INFO_RX_DROP_MISC |
                        STATION_INFO_BSS_PARAM |
-                       STATION_INFO_CONNECTED_TIME;
+                       STATION_INFO_CONNECTED_TIME |
+                       STATION_INFO_STA_FLAGS;
  
        do_posix_clock_monotonic_gettime(&uptime);
        sinfo->connected_time = uptime.tv_sec - sta->last_connected;
                sinfo->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_SLOT_TIME;
        sinfo->bss_param.dtim_period = sdata->local->hw.conf.ps_dtim_period;
        sinfo->bss_param.beacon_interval = sdata->vif.bss_conf.beacon_int;
+       sinfo->sta_flags.set = 0;
+       sinfo->sta_flags.mask = BIT(NL80211_STA_FLAG_AUTHORIZED) |
+                               BIT(NL80211_STA_FLAG_SHORT_PREAMBLE) |
+                               BIT(NL80211_STA_FLAG_WME) |
+                               BIT(NL80211_STA_FLAG_MFP) |
+                               BIT(NL80211_STA_FLAG_AUTHENTICATED);
+       if (test_sta_flag(sta, WLAN_STA_AUTHORIZED))
+               sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_AUTHORIZED);
+       if (test_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE))
+               sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_SHORT_PREAMBLE);
+       if (test_sta_flag(sta, WLAN_STA_WME))
+               sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_WME);
+       if (test_sta_flag(sta, WLAN_STA_MFP))
+               sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_MFP);
+       if (test_sta_flag(sta, WLAN_STA_AUTH))
+               sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_AUTHENTICATED);
  }
  
  
@@@ -557,7 -575,7 +575,7 @@@ static int ieee80211_config_beacon(stru
  
        sdata->vif.bss_conf.dtim_period = new->dtim_period;
  
 -      rcu_assign_pointer(sdata->u.ap.beacon, new);
 +      RCU_INIT_POINTER(sdata->u.ap.beacon, new);
  
        synchronize_rcu();
  
@@@ -612,7 -630,7 +630,7 @@@ static int ieee80211_del_beacon(struct 
        if (!old)
                return -ENOENT;
  
 -      rcu_assign_pointer(sdata->u.ap.beacon, NULL);
 +      RCU_INIT_POINTER(sdata->u.ap.beacon, NULL);
        synchronize_rcu();
        kfree(old);
  
@@@ -904,7 -922,7 +922,7 @@@ static int ieee80211_change_station(str
                                return -EBUSY;
                        }
  
 -                      rcu_assign_pointer(vlansdata->u.vlan.sta, sta);
 +                      RCU_INIT_POINTER(vlansdata->u.vlan.sta, sta);
                }
  
                sta->sdata = vlansdata;
@@@ -1886,7 -1904,7 +1904,7 @@@ ieee80211_offchan_tx_done(struct ieee80
         * so in that case userspace will have to deal with it.
         */
  
-       if (wk->offchan_tx.wait && wk->offchan_tx.frame)
+       if (wk->offchan_tx.wait && !wk->offchan_tx.status)
                cfg80211_mgmt_tx_status(wk->sdata->dev,
                                        (unsigned long) wk->offchan_tx.frame,
                                        wk->ie, wk->ie_len, false, GFP_KERNEL);
diff --combined net/mac80211/sta_info.c
@@@ -73,7 -73,7 +73,7 @@@ static int sta_info_hash_del(struct iee
        if (!s)
                return -ENOENT;
        if (s == sta) {
 -              rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)],
 +              RCU_INIT_POINTER(local->sta_hash[STA_HASH(sta->sta.addr)],
                                   s->hnext);
                return 0;
        }
@@@ -83,7 -83,7 +83,7 @@@
                s = rcu_dereference_protected(s->hnext,
                                        lockdep_is_held(&local->sta_lock));
        if (rcu_access_pointer(s->hnext)) {
 -              rcu_assign_pointer(s->hnext, sta->hnext);
 +              RCU_INIT_POINTER(s->hnext, sta->hnext);
                return 0;
        }
  
@@@ -232,7 -232,7 +232,7 @@@ static void sta_info_hash_add(struct ie
                              struct sta_info *sta)
  {
        sta->hnext = local->sta_hash[STA_HASH(sta->sta.addr)];
 -      rcu_assign_pointer(local->sta_hash[STA_HASH(sta->sta.addr)], sta);
 +      RCU_INIT_POINTER(local->sta_hash[STA_HASH(sta->sta.addr)], sta);
  }
  
  static void sta_unblock(struct work_struct *wk)
@@@ -906,7 -906,7 +906,7 @@@ static int __must_check __sta_info_dest
        local->sta_generation++;
  
        if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
 -              rcu_assign_pointer(sdata->u.vlan.sta, NULL);
 +              RCU_INIT_POINTER(sdata->u.vlan.sta, NULL);
  
        if (sta->uploaded) {
                if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
@@@ -1203,11 -1203,9 +1203,9 @@@ static void ieee80211_send_null_respons
        memcpy(nullfunc->addr2, sdata->vif.addr, ETH_ALEN);
        memcpy(nullfunc->addr3, sdata->vif.addr, ETH_ALEN);
  
+       skb->priority = tid;
+       skb_set_queue_mapping(skb, ieee802_1d_to_ac[tid]);
        if (qos) {
-               skb->priority = tid;
-               skb_set_queue_mapping(skb, ieee802_1d_to_ac[tid]);
                nullfunc->qos_ctrl = cpu_to_le16(tid);
  
                if (reason == IEEE80211_FRAME_RELEASE_UAPSD)