mac80211: push rx status into skb->cb
[safe/jmp/linux-2.6] / drivers / net / wireless / at76c50x-usb.c
index 744f4f4..13303fa 100644 (file)
@@ -1568,7 +1568,8 @@ static void at76_rx_tasklet(unsigned long param)
 
        at76_dbg(DBG_MAC80211, "calling ieee80211_rx_irqsafe(): %d/%d",
                 priv->rx_skb->len, priv->rx_skb->data_len);
-       ieee80211_rx_irqsafe(priv->hw, priv->rx_skb, &rx_status);
+       memcpy(IEEE80211_SKB_RXCB(priv->rx_skb), &rx_status, sizeof(rx_status));
+       ieee80211_rx_irqsafe(priv->hw, priv->rx_skb);
 
        /* Use a new skb for the next receive */
        priv->rx_skb = NULL;
@@ -1873,18 +1874,18 @@ static void at76_dwork_hw_scan(struct work_struct *work)
        if (ret != CMD_STATUS_COMPLETE) {
                queue_delayed_work(priv->hw->workqueue, &priv->dwork_hw_scan,
                                   SCAN_POLL_INTERVAL);
-               goto exit;
+               mutex_unlock(&priv->mtx);
+               return;
        }
 
-       ieee80211_scan_completed(priv->hw, false);
-
        if (is_valid_ether_addr(priv->bssid))
                at76_join(priv);
 
-       ieee80211_wake_queues(priv->hw);
-
-exit:
        mutex_unlock(&priv->mtx);
+
+       ieee80211_scan_completed(priv->hw, false);
+
+       ieee80211_wake_queues(priv->hw);
 }
 
 static int at76_hw_scan(struct ieee80211_hw *hw,
@@ -1965,13 +1966,18 @@ static int at76_config(struct ieee80211_hw *hw, u32 changed)
        return 0;
 }
 
-static int at76_config_interface(struct ieee80211_hw *hw,
-                                struct ieee80211_vif *vif,
-                                struct ieee80211_if_conf *conf)
+static void at76_bss_info_changed(struct ieee80211_hw *hw,
+                                 struct ieee80211_vif *vif,
+                                 struct ieee80211_bss_conf *conf,
+                                 u32 changed)
 {
        struct at76_priv *priv = hw->priv;
 
        at76_dbg(DBG_MAC80211, "%s():", __func__);
+
+       if (!(changed & BSS_CHANGED_BSSID))
+               return;
+
        at76_dbg_dump(DBG_MAC80211, conf->bssid, ETH_ALEN, "bssid:");
 
        mutex_lock(&priv->mtx);
@@ -1983,8 +1989,6 @@ static int at76_config_interface(struct ieee80211_hw *hw,
                at76_join(priv);
 
        mutex_unlock(&priv->mtx);
-
-       return 0;
 }
 
 /* must be atomic */
@@ -2076,7 +2080,7 @@ static const struct ieee80211_ops at76_ops = {
        .add_interface = at76_add_interface,
        .remove_interface = at76_remove_interface,
        .config = at76_config,
-       .config_interface = at76_config_interface,
+       .bss_info_changed = at76_bss_info_changed,
        .configure_filter = at76_configure_filter,
        .start = at76_mac80211_start,
        .stop = at76_mac80211_stop,
@@ -2250,6 +2254,7 @@ static int at76_init_new_device(struct at76_priv *priv,
 
        /* mac80211 initialisation */
        priv->hw->wiphy->max_scan_ssids = 1;
+       priv->hw->wiphy->max_scan_ie_len = 0;
        priv->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
        priv->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &at76_supported_band;
        priv->hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
@@ -2311,8 +2316,7 @@ static void at76_delete_device(struct at76_priv *priv)
 
        del_timer_sync(&ledtrig_tx_timer);
 
-       if (priv->rx_skb)
-               kfree_skb(priv->rx_skb);
+       kfree_skb(priv->rx_skb);
 
        usb_put_dev(priv->udev);