]> git.ipfire.org Git - people/ms/linux.git/commitdiff
ath9k/mac80211: disallow fragmentation in ath9k, report to userspace
authorJohannes Berg <johannes@sipsolutions.net>
Thu, 16 Oct 2008 19:05:12 +0000 (19:05 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 22 Oct 2008 21:21:05 +0000 (14:21 -0700)
commit 4233df6b748193d45f79fb7448991a473061a65d upstream

As I've reported, ath9k currently fails utterly when fragmentation
is enabled. This makes ath9k "support" hardware fragmentation by
not supporting fragmentation at all to avoid the double-free issue.
The patch also changes mac80211 to report errors from the driver
operation to userspace.

That hack in ath9k should be removed once the rate control algorithm
it has is fixed, and we can at that time consider removing the hw
fragmentation support entirely since it's not used by any driver.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/wireless/ath9k/main.c
net/mac80211/wext.c

index acebdf1d20a842048ceaa1dcb5fcfbf117ce6fcc..b4c7174766ba736ab9cdf241806a84c65262fb42 100644 (file)
@@ -1007,6 +1007,11 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
        return ret;
 }
 
+static int ath9k_no_fragmentation(struct ieee80211_hw *hw, u32 value)
+{
+       return -EOPNOTSUPP;
+}
+
 static struct ieee80211_ops ath9k_ops = {
        .tx                 = ath9k_tx,
        .start              = ath9k_start,
@@ -1031,7 +1036,8 @@ static struct ieee80211_ops ath9k_ops = {
        .get_tsf            = ath9k_get_tsf,
        .reset_tsf          = ath9k_reset_tsf,
        .tx_last_beacon     = NULL,
-       .ampdu_action       = ath9k_ampdu_action
+       .ampdu_action       = ath9k_ampdu_action,
+       .set_frag_threshold = ath9k_no_fragmentation,
 };
 
 void ath_get_beaconconfig(struct ath_softc *sc,
index 34fa8ed1e784b4ec727a5d7f651ec5b105b53bb1..48db9bb5634aef9fad88858cbe16bf654410b2f7 100644 (file)
@@ -804,7 +804,7 @@ static int ieee80211_ioctl_siwfrag(struct net_device *dev,
         * configure it here */
 
        if (local->ops->set_frag_threshold)
-               local->ops->set_frag_threshold(
+               return local->ops->set_frag_threshold(
                        local_to_hw(local),
                        local->fragmentation_threshold);