Merge branch 'for-next' into for-linus
[safe/jmp/linux-2.6] / drivers / net / wireless / ath / ar9170 / main.c
index 20f04ab..08dc42d 100644 (file)
@@ -394,7 +394,7 @@ static void ar9170_tx_fake_ampdu_status(struct ar9170 *ar)
                ieee80211_tx_status_irqsafe(ar->hw, skb);
        }
 
-       for_each_bit(i, &queue_bitmap, BITS_PER_BYTE) {
+       for_each_set_bit(i, &queue_bitmap, BITS_PER_BYTE) {
 #ifdef AR9170_QUEUE_STOP_DEBUG
                printk(KERN_DEBUG "%s: wake queue %d\n",
                       wiphy_name(ar->hw->wiphy), i);
@@ -1939,7 +1939,7 @@ err_free:
 }
 
 static int ar9170_op_add_interface(struct ieee80211_hw *hw,
-                                  struct ieee80211_if_init_conf *conf)
+                                  struct ieee80211_vif *vif)
 {
        struct ar9170 *ar = hw->priv;
        struct ath_common *common = &ar->common;
@@ -1952,8 +1952,8 @@ static int ar9170_op_add_interface(struct ieee80211_hw *hw,
                goto unlock;
        }
 
-       ar->vif = conf->vif;
-       memcpy(common->macaddr, conf->mac_addr, ETH_ALEN);
+       ar->vif = vif;
+       memcpy(common->macaddr, vif->addr, ETH_ALEN);
 
        if (modparam_nohwcrypt || (ar->vif->type != NL80211_IFTYPE_STATION)) {
                ar->rx_software_decryption = true;
@@ -1973,7 +1973,7 @@ unlock:
 }
 
 static void ar9170_op_remove_interface(struct ieee80211_hw *hw,
-                                      struct ieee80211_if_init_conf *conf)
+                                      struct ieee80211_vif *vif)
 {
        struct ar9170 *ar = hw->priv;
 
@@ -2329,54 +2329,55 @@ out:
        return err;
 }
 
-static void ar9170_sta_notify(struct ieee80211_hw *hw,
-                             struct ieee80211_vif *vif,
-                             enum sta_notify_cmd cmd,
-                             struct ieee80211_sta *sta)
+static int ar9170_sta_add(struct ieee80211_hw *hw,
+                         struct ieee80211_vif *vif,
+                         struct ieee80211_sta *sta)
 {
        struct ar9170 *ar = hw->priv;
        struct ar9170_sta_info *sta_info = (void *) sta->drv_priv;
        unsigned int i;
 
-       switch (cmd) {
-       case STA_NOTIFY_ADD:
-               memset(sta_info, 0, sizeof(*sta_info));
+       memset(sta_info, 0, sizeof(*sta_info));
 
-               if (!sta->ht_cap.ht_supported)
-                       break;
+       if (!sta->ht_cap.ht_supported)
+               return 0;
 
-               if (sta->ht_cap.ampdu_density > ar->global_ampdu_density)
-                       ar->global_ampdu_density = sta->ht_cap.ampdu_density;
+       if (sta->ht_cap.ampdu_density > ar->global_ampdu_density)
+               ar->global_ampdu_density = sta->ht_cap.ampdu_density;
 
-               if (sta->ht_cap.ampdu_factor < ar->global_ampdu_factor)
-                       ar->global_ampdu_factor = sta->ht_cap.ampdu_factor;
+       if (sta->ht_cap.ampdu_factor < ar->global_ampdu_factor)
+               ar->global_ampdu_factor = sta->ht_cap.ampdu_factor;
 
-               for (i = 0; i < AR9170_NUM_TID; i++) {
-                       sta_info->agg[i].state = AR9170_TID_STATE_SHUTDOWN;
-                       sta_info->agg[i].active = false;
-                       sta_info->agg[i].ssn = 0;
-                       sta_info->agg[i].tid = i;
-                       INIT_LIST_HEAD(&sta_info->agg[i].list);
-                       skb_queue_head_init(&sta_info->agg[i].queue);
-               }
+       for (i = 0; i < AR9170_NUM_TID; i++) {
+               sta_info->agg[i].state = AR9170_TID_STATE_SHUTDOWN;
+               sta_info->agg[i].active = false;
+               sta_info->agg[i].ssn = 0;
+               sta_info->agg[i].tid = i;
+               INIT_LIST_HEAD(&sta_info->agg[i].list);
+               skb_queue_head_init(&sta_info->agg[i].queue);
+       }
 
-               sta_info->ampdu_max_len = 1 << (3 + sta->ht_cap.ampdu_factor);
-               break;
+       sta_info->ampdu_max_len = 1 << (3 + sta->ht_cap.ampdu_factor);
 
-       case STA_NOTIFY_REMOVE:
-               if (!sta->ht_cap.ht_supported)
-                       break;
+       return 0;
+}
 
-               for (i = 0; i < AR9170_NUM_TID; i++) {
-                       sta_info->agg[i].state = AR9170_TID_STATE_INVALID;
-                       skb_queue_purge(&sta_info->agg[i].queue);
-               }
+static int ar9170_sta_remove(struct ieee80211_hw *hw,
+                            struct ieee80211_vif *vif,
+                            struct ieee80211_sta *sta)
+{
+       struct ar9170_sta_info *sta_info = (void *) sta->drv_priv;
+       unsigned int i;
 
-               break;
+       if (!sta->ht_cap.ht_supported)
+               return 0;
 
-       default:
-               break;
+       for (i = 0; i < AR9170_NUM_TID; i++) {
+               sta_info->agg[i].state = AR9170_TID_STATE_INVALID;
+               skb_queue_purge(&sta_info->agg[i].queue);
        }
+
+       return 0;
 }
 
 static int ar9170_get_stats(struct ieee80211_hw *hw,
@@ -2396,18 +2397,6 @@ static int ar9170_get_stats(struct ieee80211_hw *hw,
        return 0;
 }
 
-static int ar9170_get_tx_stats(struct ieee80211_hw *hw,
-                              struct ieee80211_tx_queue_stats *tx_stats)
-{
-       struct ar9170 *ar = hw->priv;
-
-       spin_lock_bh(&ar->tx_stats_lock);
-       memcpy(tx_stats, ar->tx_stats, sizeof(tx_stats[0]) * hw->queues);
-       spin_unlock_bh(&ar->tx_stats_lock);
-
-       return 0;
-}
-
 static int ar9170_conf_tx(struct ieee80211_hw *hw, u16 queue,
                          const struct ieee80211_tx_queue_params *param)
 {
@@ -2507,9 +2496,9 @@ static const struct ieee80211_ops ar9170_ops = {
        .bss_info_changed       = ar9170_op_bss_info_changed,
        .get_tsf                = ar9170_op_get_tsf,
        .set_key                = ar9170_set_key,
-       .sta_notify             = ar9170_sta_notify,
+       .sta_add                = ar9170_sta_add,
+       .sta_remove             = ar9170_sta_remove,
        .get_stats              = ar9170_get_stats,
-       .get_tx_stats           = ar9170_get_tx_stats,
        .ampdu_action           = ar9170_ampdu_action,
 };
 
@@ -2523,7 +2512,7 @@ void *ar9170_alloc(size_t priv_size)
        /*
         * this buffer is used for rx stream reconstruction.
         * Under heavy load this device (or the transport layer?)
-        * tends to split the streams into seperate rx descriptors.
+        * tends to split the streams into separate rx descriptors.
         */
 
        skb = __dev_alloc_skb(AR9170_MAX_RX_BUFFER_SIZE, GFP_KERNEL);