aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-10-14 13:17:54 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-10-31 19:00:14 -0400
commit9124b07740c51cbc6e358dd0c4abc6ee8ded084d (patch)
tree5746885ca90399588f0735aa1a5511648f0be329 /net/mac80211
parent525181891fb5ed323b6ba0f141c422f1395acfb9 (diff)
mac80211: make retry limits part of hw config
Instead of having a separate callback, use the HW config callback with a new flag to change retry limits. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/debugfs.c4
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/main.c4
-rw-r--r--net/mac80211/tx.c4
-rw-r--r--net/mac80211/wext.c28
5 files changed, 18 insertions, 24 deletions
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index 767dbca50adb..2697a2fe608f 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -52,9 +52,9 @@ DEBUGFS_READONLY_FILE(rts_threshold, 20, "%d",
52DEBUGFS_READONLY_FILE(fragmentation_threshold, 20, "%d", 52DEBUGFS_READONLY_FILE(fragmentation_threshold, 20, "%d",
53 local->fragmentation_threshold); 53 local->fragmentation_threshold);
54DEBUGFS_READONLY_FILE(short_retry_limit, 20, "%d", 54DEBUGFS_READONLY_FILE(short_retry_limit, 20, "%d",
55 local->short_retry_limit); 55 local->hw.conf.short_frame_max_tx_count);
56DEBUGFS_READONLY_FILE(long_retry_limit, 20, "%d", 56DEBUGFS_READONLY_FILE(long_retry_limit, 20, "%d",
57 local->long_retry_limit); 57 local->hw.conf.long_frame_max_tx_count);
58DEBUGFS_READONLY_FILE(total_ps_buffered, 20, "%d", 58DEBUGFS_READONLY_FILE(total_ps_buffered, 20, "%d",
59 local->total_ps_buffered); 59 local->total_ps_buffered);
60DEBUGFS_READONLY_FILE(wep_iv, 20, "%#06x", 60DEBUGFS_READONLY_FILE(wep_iv, 20, "%#06x",
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 819844726dd4..f1ef522bfe07 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -635,8 +635,6 @@ struct ieee80211_local {
635 635
636 int rts_threshold; 636 int rts_threshold;
637 int fragmentation_threshold; 637 int fragmentation_threshold;
638 int short_retry_limit; /* dot11ShortRetryLimit */
639 int long_retry_limit; /* dot11LongRetryLimit */
640 638
641 struct crypto_blkcipher *wep_tx_tfm; 639 struct crypto_blkcipher *wep_tx_tfm;
642 struct crypto_blkcipher *wep_rx_tfm; 640 struct crypto_blkcipher *wep_rx_tfm;
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index c936017f6d48..59be9e782699 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -673,8 +673,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
673 673
674 local->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; 674 local->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD;
675 local->fragmentation_threshold = IEEE80211_MAX_FRAG_THRESHOLD; 675 local->fragmentation_threshold = IEEE80211_MAX_FRAG_THRESHOLD;
676 local->short_retry_limit = 7; 676 local->hw.conf.long_frame_max_tx_count = 4;
677 local->long_retry_limit = 4; 677 local->hw.conf.short_frame_max_tx_count = 7;
678 local->hw.conf.radio_enabled = true; 678 local->hw.conf.radio_enabled = true;
679 679
680 INIT_LIST_HEAD(&local->interfaces); 680 INIT_LIST_HEAD(&local->interfaces);
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 8bcabefa86e0..dd440a07634e 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -505,10 +505,10 @@ ieee80211_tx_h_misc(struct ieee80211_tx_data *tx)
505 info->flags |= 505 info->flags |=
506 IEEE80211_TX_CTL_LONG_RETRY_LIMIT; 506 IEEE80211_TX_CTL_LONG_RETRY_LIMIT;
507 info->control.retry_limit = 507 info->control.retry_limit =
508 tx->local->long_retry_limit; 508 tx->local->hw.conf.long_frame_max_tx_count - 1;
509 } else { 509 } else {
510 info->control.retry_limit = 510 info->control.retry_limit =
511 tx->local->short_retry_limit; 511 tx->local->hw.conf.short_frame_max_tx_count - 1;
512 } 512 }
513 } else { 513 } else {
514 info->control.retry_limit = 1; 514 info->control.retry_limit = 1;
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
index 94c4b35eeb14..f7e442f80a17 100644
--- a/net/mac80211/wext.c
+++ b/net/mac80211/wext.c
@@ -802,21 +802,16 @@ static int ieee80211_ioctl_siwretry(struct net_device *dev,
802 (retry->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT) 802 (retry->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT)
803 return -EINVAL; 803 return -EINVAL;
804 804
805 if (retry->flags & IW_RETRY_MAX) 805 if (retry->flags & IW_RETRY_MAX) {
806 local->long_retry_limit = retry->value; 806 local->hw.conf.long_frame_max_tx_count = retry->value;
807 else if (retry->flags & IW_RETRY_MIN) 807 } else if (retry->flags & IW_RETRY_MIN) {
808 local->short_retry_limit = retry->value; 808 local->hw.conf.short_frame_max_tx_count = retry->value;
809 else { 809 } else {
810 local->long_retry_limit = retry->value; 810 local->hw.conf.long_frame_max_tx_count = retry->value;
811 local->short_retry_limit = retry->value; 811 local->hw.conf.short_frame_max_tx_count = retry->value;
812 } 812 }
813 813
814 if (local->ops->set_retry_limit) { 814 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_RETRY_LIMITS);
815 return local->ops->set_retry_limit(
816 local_to_hw(local),
817 local->short_retry_limit,
818 local->long_retry_limit);
819 }
820 815
821 return 0; 816 return 0;
822} 817}
@@ -833,14 +828,15 @@ static int ieee80211_ioctl_giwretry(struct net_device *dev,
833 /* first return min value, iwconfig will ask max value 828 /* first return min value, iwconfig will ask max value
834 * later if needed */ 829 * later if needed */
835 retry->flags |= IW_RETRY_LIMIT; 830 retry->flags |= IW_RETRY_LIMIT;
836 retry->value = local->short_retry_limit; 831 retry->value = local->hw.conf.short_frame_max_tx_count;
837 if (local->long_retry_limit != local->short_retry_limit) 832 if (local->hw.conf.long_frame_max_tx_count !=
833 local->hw.conf.short_frame_max_tx_count)
838 retry->flags |= IW_RETRY_MIN; 834 retry->flags |= IW_RETRY_MIN;
839 return 0; 835 return 0;
840 } 836 }
841 if (retry->flags & IW_RETRY_MAX) { 837 if (retry->flags & IW_RETRY_MAX) {
842 retry->flags = IW_RETRY_LIMIT | IW_RETRY_MAX; 838 retry->flags = IW_RETRY_LIMIT | IW_RETRY_MAX;
843 retry->value = local->long_retry_limit; 839 retry->value = local->hw.conf.long_frame_max_tx_count;
844 } 840 }
845 841
846 return 0; 842 return 0;