aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2008-09-06 10:21:47 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-11 15:53:32 -0400
commitc40c1129106ab20c90b0f1516e79d7b5e7e29904 (patch)
tree4c00ffc6b6a18926fc1ad6bed45642717f53f139 /drivers/net/wireless/b43
parent1b9975347e852c22a7c4c67b68814403ef16d2bd (diff)
b43: Fix QoS defaults
This fixes the initialization of the default QoS parameters. This got broken by "wireless: fix warnings from QoS patch". Reported-by: Lorenzo Nava Signed-off-by: Michael Buesch <mb@bu3sch.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r--drivers/net/wireless/b43/main.c56
1 files changed, 45 insertions, 11 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index c836beceb10d..79c25d6385ce 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3059,6 +3059,15 @@ static void b43_qos_params_upload(struct b43_wldev *dev,
3059 } 3059 }
3060} 3060}
3061 3061
3062/* Mapping of mac80211 queue numbers to b43 QoS SHM offsets. */
3063static const u16 b43_qos_shm_offsets[] = {
3064 /* [mac80211-queue-nr] = SHM_OFFSET, */
3065 [0] = B43_QOS_VOICE,
3066 [1] = B43_QOS_VIDEO,
3067 [2] = B43_QOS_BESTEFFORT,
3068 [3] = B43_QOS_BACKGROUND,
3069};
3070
3062/* Update the QOS parameters in hardware. */ 3071/* Update the QOS parameters in hardware. */
3063static void b43_qos_update(struct b43_wldev *dev) 3072static void b43_qos_update(struct b43_wldev *dev)
3064{ 3073{
@@ -3067,14 +3076,8 @@ static void b43_qos_update(struct b43_wldev *dev)
3067 unsigned long flags; 3076 unsigned long flags;
3068 unsigned int i; 3077 unsigned int i;
3069 3078
3070 /* Mapping of mac80211 queues to b43 SHM offsets. */ 3079 BUILD_BUG_ON(ARRAY_SIZE(b43_qos_shm_offsets) !=
3071 static const u16 qos_shm_offsets[] = { 3080 ARRAY_SIZE(wl->qos_params));
3072 [0] = B43_QOS_VOICE,
3073 [1] = B43_QOS_VIDEO,
3074 [2] = B43_QOS_BESTEFFORT,
3075 [3] = B43_QOS_BACKGROUND,
3076 };
3077 BUILD_BUG_ON(ARRAY_SIZE(qos_shm_offsets) != ARRAY_SIZE(wl->qos_params));
3078 3081
3079 b43_mac_suspend(dev); 3082 b43_mac_suspend(dev);
3080 spin_lock_irqsave(&wl->irq_lock, flags); 3083 spin_lock_irqsave(&wl->irq_lock, flags);
@@ -3083,7 +3086,7 @@ static void b43_qos_update(struct b43_wldev *dev)
3083 params = &(wl->qos_params[i]); 3086 params = &(wl->qos_params[i]);
3084 if (params->need_hw_update) { 3087 if (params->need_hw_update) {
3085 b43_qos_params_upload(dev, &(params->p), 3088 b43_qos_params_upload(dev, &(params->p),
3086 qos_shm_offsets[i]); 3089 b43_qos_shm_offsets[i]);
3087 params->need_hw_update = 0; 3090 params->need_hw_update = 0;
3088 } 3091 }
3089 } 3092 }
@@ -3097,11 +3100,42 @@ static void b43_qos_clear(struct b43_wl *wl)
3097 struct b43_qos_params *params; 3100 struct b43_qos_params *params;
3098 unsigned int i; 3101 unsigned int i;
3099 3102
3103 /* Initialize QoS parameters to sane defaults. */
3104
3105 BUILD_BUG_ON(ARRAY_SIZE(b43_qos_shm_offsets) !=
3106 ARRAY_SIZE(wl->qos_params));
3107
3100 for (i = 0; i < ARRAY_SIZE(wl->qos_params); i++) { 3108 for (i = 0; i < ARRAY_SIZE(wl->qos_params); i++) {
3101 params = &(wl->qos_params[i]); 3109 params = &(wl->qos_params[i]);
3102 3110
3103 memset(&(params->p), 0, sizeof(params->p)); 3111 switch (b43_qos_shm_offsets[i]) {
3104 params->p.aifs = -1; 3112 case B43_QOS_VOICE:
3113 params->p.txop = 0;
3114 params->p.aifs = 2;
3115 params->p.cw_min = 0x0001;
3116 params->p.cw_max = 0x0001;
3117 break;
3118 case B43_QOS_VIDEO:
3119 params->p.txop = 0;
3120 params->p.aifs = 2;
3121 params->p.cw_min = 0x0001;
3122 params->p.cw_max = 0x0001;
3123 break;
3124 case B43_QOS_BESTEFFORT:
3125 params->p.txop = 0;
3126 params->p.aifs = 3;
3127 params->p.cw_min = 0x0001;
3128 params->p.cw_max = 0x03FF;
3129 break;
3130 case B43_QOS_BACKGROUND:
3131 params->p.txop = 0;
3132 params->p.aifs = 7;
3133 params->p.cw_min = 0x0001;
3134 params->p.cw_max = 0x03FF;
3135 break;
3136 default:
3137 B43_WARN_ON(1);
3138 }
3105 params->need_hw_update = 1; 3139 params->need_hw_update = 1;
3106 } 3140 }
3107} 3141}