ath9k/mac80211: disallow fragmentation in ath9k, report to userspace
authorJohannes Berg <johannes@sipsolutions.net>
Mon, 13 Oct 2008 11:35:05 +0000 (13:35 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 15 Oct 2008 01:12:37 +0000 (21:12 -0400)
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>
Cc: stable@kernel.org
Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath9k/main.c
net/mac80211/wext.c

index 74726990d59e0ae1851fe0d587032f355dabecbf..f05f584ab7bc960f9e8ba5ea29207ec63582bd2c 100644 (file)
@@ -1640,6 +1640,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,
@@ -1664,7 +1669,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,
 };
 
 static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
index 7e0d53abde24bb9e10b86e55d1112b76eaa63331..742f811ca416e5b16701ce2ae49f582ed32317a6 100644 (file)
@@ -775,7 +775,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);