diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-07-15 05:08:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-15 05:08:24 -0400 |
commit | 0b57664cf2393bc1eff594ff7e5ff26533843fe6 (patch) | |
tree | ec83e7290e84fe7ca70c87c8ebff935076a5568f /drivers | |
parent | d3a8eab093aab9f309d2e8d06cd718a4cb20e626 (diff) |
wireless: fix warnings from QoS patch
When I removed the special "default" meaning from the QoS
parameters, I forgot to update drivers and this lead to
warnings because some drivers were checking for the special
values and putting in defaults. This fixes that by removing
the default special-casing completely.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/b43/main.c | 47 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00mac.c | 5 |
2 files changed, 8 insertions, 44 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 381dbd33dfc2..e78319aa47c1 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -3073,53 +3073,20 @@ static void b43_qos_params_upload(struct b43_wldev *dev, | |||
3073 | u16 shm_offset) | 3073 | u16 shm_offset) |
3074 | { | 3074 | { |
3075 | u16 params[B43_NR_QOSPARAMS]; | 3075 | u16 params[B43_NR_QOSPARAMS]; |
3076 | int cw_min, cw_max, aifs, bslots, tmp; | 3076 | int bslots, tmp; |
3077 | unsigned int i; | 3077 | unsigned int i; |
3078 | 3078 | ||
3079 | const u16 aCWmin = 0x0001; | 3079 | bslots = b43_read16(dev, B43_MMIO_RNG) & p->cw_min; |
3080 | const u16 aCWmax = 0x03FF; | ||
3081 | |||
3082 | /* Calculate the default values for the parameters, if needed. */ | ||
3083 | switch (shm_offset) { | ||
3084 | case B43_QOS_VOICE: | ||
3085 | aifs = (p->aifs == -1) ? 2 : p->aifs; | ||
3086 | cw_min = (p->cw_min == 0) ? ((aCWmin + 1) / 4 - 1) : p->cw_min; | ||
3087 | cw_max = (p->cw_max == 0) ? ((aCWmin + 1) / 2 - 1) : p->cw_max; | ||
3088 | break; | ||
3089 | case B43_QOS_VIDEO: | ||
3090 | aifs = (p->aifs == -1) ? 2 : p->aifs; | ||
3091 | cw_min = (p->cw_min == 0) ? ((aCWmin + 1) / 2 - 1) : p->cw_min; | ||
3092 | cw_max = (p->cw_max == 0) ? aCWmin : p->cw_max; | ||
3093 | break; | ||
3094 | case B43_QOS_BESTEFFORT: | ||
3095 | aifs = (p->aifs == -1) ? 3 : p->aifs; | ||
3096 | cw_min = (p->cw_min == 0) ? aCWmin : p->cw_min; | ||
3097 | cw_max = (p->cw_max == 0) ? aCWmax : p->cw_max; | ||
3098 | break; | ||
3099 | case B43_QOS_BACKGROUND: | ||
3100 | aifs = (p->aifs == -1) ? 7 : p->aifs; | ||
3101 | cw_min = (p->cw_min == 0) ? aCWmin : p->cw_min; | ||
3102 | cw_max = (p->cw_max == 0) ? aCWmax : p->cw_max; | ||
3103 | break; | ||
3104 | default: | ||
3105 | B43_WARN_ON(1); | ||
3106 | return; | ||
3107 | } | ||
3108 | if (cw_min <= 0) | ||
3109 | cw_min = aCWmin; | ||
3110 | if (cw_max <= 0) | ||
3111 | cw_max = aCWmin; | ||
3112 | bslots = b43_read16(dev, B43_MMIO_RNG) % cw_min; | ||
3113 | 3080 | ||
3114 | memset(¶ms, 0, sizeof(params)); | 3081 | memset(¶ms, 0, sizeof(params)); |
3115 | 3082 | ||
3116 | params[B43_QOSPARAM_TXOP] = p->txop * 32; | 3083 | params[B43_QOSPARAM_TXOP] = p->txop * 32; |
3117 | params[B43_QOSPARAM_CWMIN] = cw_min; | 3084 | params[B43_QOSPARAM_CWMIN] = p->cw_min; |
3118 | params[B43_QOSPARAM_CWMAX] = cw_max; | 3085 | params[B43_QOSPARAM_CWMAX] = p->cw_max; |
3119 | params[B43_QOSPARAM_CWCUR] = cw_min; | 3086 | params[B43_QOSPARAM_CWCUR] = p->cw_min; |
3120 | params[B43_QOSPARAM_AIFS] = aifs; | 3087 | params[B43_QOSPARAM_AIFS] = p->aifs; |
3121 | params[B43_QOSPARAM_BSLOTS] = bslots; | 3088 | params[B43_QOSPARAM_BSLOTS] = bslots; |
3122 | params[B43_QOSPARAM_REGGAP] = bslots + aifs; | 3089 | params[B43_QOSPARAM_REGGAP] = bslots + p->aifs; |
3123 | 3090 | ||
3124 | for (i = 0; i < ARRAY_SIZE(params); i++) { | 3091 | for (i = 0; i < ARRAY_SIZE(params); i++) { |
3125 | if (i == B43_QOSPARAM_STATUS) { | 3092 | if (i == B43_QOSPARAM_STATUS) { |
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index 77af1df5d899..f1dcbaa80c3c 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c | |||
@@ -554,10 +554,7 @@ int rt2x00mac_conf_tx(struct ieee80211_hw *hw, u16 queue_idx, | |||
554 | else | 554 | else |
555 | queue->cw_max = 10; /* cw_min: 2^10 = 1024. */ | 555 | queue->cw_max = 10; /* cw_min: 2^10 = 1024. */ |
556 | 556 | ||
557 | if (params->aifs >= 0) | 557 | queue->aifs = params->aifs; |
558 | queue->aifs = params->aifs; | ||
559 | else | ||
560 | queue->aifs = 2; | ||
561 | 558 | ||
562 | INFO(rt2x00dev, | 559 | INFO(rt2x00dev, |
563 | "Configured TX queue %d - CWmin: %d, CWmax: %d, Aifs: %d.\n", | 560 | "Configured TX queue %d - CWmin: %d, CWmax: %d, Aifs: %d.\n", |