]> err.no Git - linux-2.6/blobdiff - net/mac80211/iface.c
mac80211: pass scratch buffer directly, remove additional pointers
[linux-2.6] / net / mac80211 / iface.c
index 5a9a3c6ef4821f61c41f48fc3863de2866c05240..eeb16926aa7deb1068ab4d0720b25fc13737c257 100644 (file)
@@ -53,6 +53,15 @@ int ieee80211_if_add(struct net_device *dev, const char *name,
        if (!ndev)
                return -ENOMEM;
 
+       ndev->needed_headroom = local->tx_headroom +
+                               4*6 /* four MAC addresses */
+                               + 2 + 2 + 2 + 2 /* ctl, dur, seq, qos */
+                               + 6 /* mesh */
+                               + 8 /* rfc1042/bridge tunnel */
+                               - ETH_HLEN /* ethernet hard_header_len */
+                               + IEEE80211_ENCRYPT_HEADROOM;
+       ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM;
+
        ret = dev_alloc_name(ndev, ndev->name);
        if (ret < 0)
                goto fail;
@@ -159,7 +168,7 @@ void ieee80211_if_set_type(struct net_device *dev, int type)
                ifsta->flags |= IEEE80211_STA_CREATE_IBSS |
                        IEEE80211_STA_AUTO_BSSID_SEL |
                        IEEE80211_STA_AUTO_CHANNEL_SEL;
-               if (sdata->local->hw.queues >= 4)
+               if (ieee80211_num_regular_queues(&sdata->local->hw) >= 4)
                        ifsta->flags |= IEEE80211_STA_WMM_ENABLED;
 
                msdata = IEEE80211_DEV_TO_SUB_IF(sdata->local->mdev);
@@ -175,9 +184,9 @@ void ieee80211_if_set_type(struct net_device *dev, int type)
                sdata->u.mntr_flags = MONITOR_FLAG_CONTROL |
                                      MONITOR_FLAG_OTHER_BSS;
                break;
-       default:
-               printk(KERN_WARNING "%s: %s: Unknown interface type 0x%x",
-                      dev->name, __func__, type);
+       case IEEE80211_IF_TYPE_INVALID:
+               BUG();
+               break;
        }
        ieee80211_debugfs_change_if_type(sdata, oldtype);
 }