You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
John W. Linville
parent
525181891f
commit
9124b07740
@@ -52,9 +52,9 @@ DEBUGFS_READONLY_FILE(rts_threshold, 20, "%d",
|
||||
DEBUGFS_READONLY_FILE(fragmentation_threshold, 20, "%d",
|
||||
local->fragmentation_threshold);
|
||||
DEBUGFS_READONLY_FILE(short_retry_limit, 20, "%d",
|
||||
local->short_retry_limit);
|
||||
local->hw.conf.short_frame_max_tx_count);
|
||||
DEBUGFS_READONLY_FILE(long_retry_limit, 20, "%d",
|
||||
local->long_retry_limit);
|
||||
local->hw.conf.long_frame_max_tx_count);
|
||||
DEBUGFS_READONLY_FILE(total_ps_buffered, 20, "%d",
|
||||
local->total_ps_buffered);
|
||||
DEBUGFS_READONLY_FILE(wep_iv, 20, "%#06x",
|
||||
|
||||
@@ -635,8 +635,6 @@ struct ieee80211_local {
|
||||
|
||||
int rts_threshold;
|
||||
int fragmentation_threshold;
|
||||
int short_retry_limit; /* dot11ShortRetryLimit */
|
||||
int long_retry_limit; /* dot11LongRetryLimit */
|
||||
|
||||
struct crypto_blkcipher *wep_tx_tfm;
|
||||
struct crypto_blkcipher *wep_rx_tfm;
|
||||
|
||||
+2
-2
@@ -673,8 +673,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
|
||||
|
||||
local->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD;
|
||||
local->fragmentation_threshold = IEEE80211_MAX_FRAG_THRESHOLD;
|
||||
local->short_retry_limit = 7;
|
||||
local->long_retry_limit = 4;
|
||||
local->hw.conf.long_frame_max_tx_count = 4;
|
||||
local->hw.conf.short_frame_max_tx_count = 7;
|
||||
local->hw.conf.radio_enabled = true;
|
||||
|
||||
INIT_LIST_HEAD(&local->interfaces);
|
||||
|
||||
+2
-2
@@ -505,10 +505,10 @@ ieee80211_tx_h_misc(struct ieee80211_tx_data *tx)
|
||||
info->flags |=
|
||||
IEEE80211_TX_CTL_LONG_RETRY_LIMIT;
|
||||
info->control.retry_limit =
|
||||
tx->local->long_retry_limit;
|
||||
tx->local->hw.conf.long_frame_max_tx_count - 1;
|
||||
} else {
|
||||
info->control.retry_limit =
|
||||
tx->local->short_retry_limit;
|
||||
tx->local->hw.conf.short_frame_max_tx_count - 1;
|
||||
}
|
||||
} else {
|
||||
info->control.retry_limit = 1;
|
||||
|
||||
+12
-16
@@ -802,21 +802,16 @@ static int ieee80211_ioctl_siwretry(struct net_device *dev,
|
||||
(retry->flags & IW_RETRY_TYPE) != IW_RETRY_LIMIT)
|
||||
return -EINVAL;
|
||||
|
||||
if (retry->flags & IW_RETRY_MAX)
|
||||
local->long_retry_limit = retry->value;
|
||||
else if (retry->flags & IW_RETRY_MIN)
|
||||
local->short_retry_limit = retry->value;
|
||||
else {
|
||||
local->long_retry_limit = retry->value;
|
||||
local->short_retry_limit = retry->value;
|
||||
if (retry->flags & IW_RETRY_MAX) {
|
||||
local->hw.conf.long_frame_max_tx_count = retry->value;
|
||||
} else if (retry->flags & IW_RETRY_MIN) {
|
||||
local->hw.conf.short_frame_max_tx_count = retry->value;
|
||||
} else {
|
||||
local->hw.conf.long_frame_max_tx_count = retry->value;
|
||||
local->hw.conf.short_frame_max_tx_count = retry->value;
|
||||
}
|
||||
|
||||
if (local->ops->set_retry_limit) {
|
||||
return local->ops->set_retry_limit(
|
||||
local_to_hw(local),
|
||||
local->short_retry_limit,
|
||||
local->long_retry_limit);
|
||||
}
|
||||
ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_RETRY_LIMITS);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -833,14 +828,15 @@ static int ieee80211_ioctl_giwretry(struct net_device *dev,
|
||||
/* first return min value, iwconfig will ask max value
|
||||
* later if needed */
|
||||
retry->flags |= IW_RETRY_LIMIT;
|
||||
retry->value = local->short_retry_limit;
|
||||
if (local->long_retry_limit != local->short_retry_limit)
|
||||
retry->value = local->hw.conf.short_frame_max_tx_count;
|
||||
if (local->hw.conf.long_frame_max_tx_count !=
|
||||
local->hw.conf.short_frame_max_tx_count)
|
||||
retry->flags |= IW_RETRY_MIN;
|
||||
return 0;
|
||||
}
|
||||
if (retry->flags & IW_RETRY_MAX) {
|
||||
retry->flags = IW_RETRY_LIMIT | IW_RETRY_MAX;
|
||||
retry->value = local->long_retry_limit;
|
||||
retry->value = local->hw.conf.long_frame_max_tx_count;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user