]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/mac80211/main.c
MIPS: IP22: Make indy_sc_ops variable static
[linux-2.6-omap-h63xx.git] / net / mac80211 / main.c
index c532043c1a1c001eb41fe7c5ee1c94f125f80c65..ae62ad40ad63715bed2372be5344ce3c4e4889bc 100644 (file)
@@ -106,7 +106,8 @@ static const struct header_ops ieee80211_header_ops = {
 
 static int ieee80211_master_open(struct net_device *dev)
 {
-       struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+       struct ieee80211_master_priv *mpriv = netdev_priv(dev);
+       struct ieee80211_local *local = mpriv->local;
        struct ieee80211_sub_if_data *sdata;
        int res = -EOPNOTSUPP;
 
@@ -128,7 +129,8 @@ static int ieee80211_master_open(struct net_device *dev)
 
 static int ieee80211_master_stop(struct net_device *dev)
 {
-       struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+       struct ieee80211_master_priv *mpriv = netdev_priv(dev);
+       struct ieee80211_local *local = mpriv->local;
        struct ieee80211_sub_if_data *sdata;
 
        /* we hold the RTNL here so can safely walk the list */
@@ -141,7 +143,8 @@ static int ieee80211_master_stop(struct net_device *dev)
 
 static void ieee80211_master_set_multicast_list(struct net_device *dev)
 {
-       struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+       struct ieee80211_master_priv *mpriv = netdev_priv(dev);
+       struct ieee80211_local *local = mpriv->local;
 
        ieee80211_configure_filter(local);
 }
@@ -156,6 +159,9 @@ int ieee80211_if_config(struct ieee80211_sub_if_data *sdata, u32 changed)
        if (WARN_ON(!netif_running(sdata->dev)))
                return 0;
 
+       if (WARN_ON(sdata->vif.type == NL80211_IFTYPE_AP_VLAN))
+               return -EINVAL;
+
        if (!local->ops->config_interface)
                return 0;
 
@@ -321,6 +327,9 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
 {
        struct ieee80211_local *local = sdata->local;
 
+       if (WARN_ON(sdata->vif.type == NL80211_IFTYPE_AP_VLAN))
+               return;
+
        if (!changed)
                return;
 
@@ -533,6 +542,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
        struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
        u16 frag, type;
        __le16 fc;
+       struct ieee80211_supported_band *sband;
        struct ieee80211_tx_status_rtap_hdr *rthdr;
        struct ieee80211_sub_if_data *sdata;
        struct net_device *prev_dev = NULL;
@@ -540,29 +550,27 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
 
        rcu_read_lock();
 
-       if (info->status.excessive_retries) {
-               sta = sta_info_get(local, hdr->addr1);
-               if (sta) {
-                       if (test_sta_flags(sta, WLAN_STA_PS)) {
-                               /*
-                                * The STA is in power save mode, so assume
-                                * that this TX packet failed because of that.
-                                */
-                               ieee80211_handle_filtered_frame(local, sta, skb);
-                               rcu_read_unlock();
-                               return;
-                       }
+       sta = sta_info_get(local, hdr->addr1);
+
+       if (sta) {
+               if (info->status.excessive_retries &&
+                   test_sta_flags(sta, WLAN_STA_PS)) {
+                       /*
+                        * The STA is in power save mode, so assume
+                        * that this TX packet failed because of that.
+                        */
+                       ieee80211_handle_filtered_frame(local, sta, skb);
+                       rcu_read_unlock();
+                       return;
                }
-       }
 
-       fc = hdr->frame_control;
+               fc = hdr->frame_control;
+
+               if ((info->flags & IEEE80211_TX_STAT_AMPDU_NO_BACK) &&
+                   (ieee80211_is_data_qos(fc))) {
+                       u16 tid, ssn;
+                       u8 *qc;
 
-       if ((info->flags & IEEE80211_TX_STAT_AMPDU_NO_BACK) &&
-           (ieee80211_is_data_qos(fc))) {
-               u16 tid, ssn;
-               u8 *qc;
-               sta = sta_info_get(local, hdr->addr1);
-               if (sta) {
                        qc = ieee80211_get_qos_ctl(hdr);
                        tid = qc[0] & 0xf;
                        ssn = ((le16_to_cpu(hdr->seq_ctrl) + 0x10)
@@ -570,17 +578,20 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
                        ieee80211_send_bar(sta->sdata, hdr->addr1,
                                           tid, ssn);
                }
-       }
 
-       if (info->flags & IEEE80211_TX_STAT_TX_FILTERED) {
-               sta = sta_info_get(local, hdr->addr1);
-               if (sta) {
+               if (info->flags & IEEE80211_TX_STAT_TX_FILTERED) {
                        ieee80211_handle_filtered_frame(local, sta, skb);
                        rcu_read_unlock();
                        return;
+               } else {
+                       if (info->status.excessive_retries)
+                               sta->tx_retry_failed++;
+                       sta->tx_retry_count += info->status.retry_count;
                }
-       } else
-               rate_control_tx_status(local->mdev, skb);
+
+               sband = local->hw.wiphy->bands[info->band];
+               rate_control_tx_status(local, sband, sta, skb);
+       }
 
        rcu_read_unlock();
 
@@ -781,7 +792,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
        int result;
        enum ieee80211_band band;
        struct net_device *mdev;
-       struct wireless_dev *mwdev;
+       struct ieee80211_master_priv *mpriv;
 
        /*
         * generic code guarantees at least one band,
@@ -823,16 +834,14 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
        if (hw->queues < 4)
                hw->ampdu_queues = 0;
 
-       mdev = alloc_netdev_mq(sizeof(struct wireless_dev),
+       mdev = alloc_netdev_mq(sizeof(struct ieee80211_master_priv),
                               "wmaster%d", ether_setup,
                               ieee80211_num_queues(hw));
        if (!mdev)
                goto fail_mdev_alloc;
 
-       mwdev = netdev_priv(mdev);
-       mdev->ieee80211_ptr = mwdev;
-       mwdev->wiphy = local->hw.wiphy;
-
+       mpriv = netdev_priv(mdev);
+       mpriv->local = local;
        local->mdev = mdev;
 
        ieee80211_rx_bss_list_init(local);
@@ -1006,6 +1015,10 @@ static int __init ieee80211_init(void)
        BUILD_BUG_ON(offsetof(struct ieee80211_tx_info, driver_data) +
                     IEEE80211_TX_INFO_DRIVER_DATA_SIZE > sizeof(skb->cb));
 
+       ret = rc80211_minstrel_init();
+       if (ret)
+               return ret;
+
        ret = rc80211_pid_init();
        if (ret)
                return ret;
@@ -1018,6 +1031,7 @@ static int __init ieee80211_init(void)
 static void __exit ieee80211_exit(void)
 {
        rc80211_pid_exit();
+       rc80211_minstrel_exit();
 
        /*
         * For key todo, it'll be empty by now but the work