Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111612
b: refs/heads/master
c: c40c112
h: refs/heads/master
v: v3
  • Loading branch information
Michael Buesch authored and John W. Linville committed Sep 11, 2008
1 parent 645ae58 commit 72dd945
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1b9975347e852c22a7c4c67b68814403ef16d2bd
refs/heads/master: c40c1129106ab20c90b0f1516e79d7b5e7e29904
56 changes: 45 additions & 11 deletions trunk/drivers/net/wireless/b43/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3059,6 +3059,15 @@ static void b43_qos_params_upload(struct b43_wldev *dev,
}
}

/* Mapping of mac80211 queue numbers to b43 QoS SHM offsets. */
static const u16 b43_qos_shm_offsets[] = {
/* [mac80211-queue-nr] = SHM_OFFSET, */
[0] = B43_QOS_VOICE,
[1] = B43_QOS_VIDEO,
[2] = B43_QOS_BESTEFFORT,
[3] = B43_QOS_BACKGROUND,
};

/* Update the QOS parameters in hardware. */
static void b43_qos_update(struct b43_wldev *dev)
{
Expand All @@ -3067,14 +3076,8 @@ static void b43_qos_update(struct b43_wldev *dev)
unsigned long flags;
unsigned int i;

/* Mapping of mac80211 queues to b43 SHM offsets. */
static const u16 qos_shm_offsets[] = {
[0] = B43_QOS_VOICE,
[1] = B43_QOS_VIDEO,
[2] = B43_QOS_BESTEFFORT,
[3] = B43_QOS_BACKGROUND,
};
BUILD_BUG_ON(ARRAY_SIZE(qos_shm_offsets) != ARRAY_SIZE(wl->qos_params));
BUILD_BUG_ON(ARRAY_SIZE(b43_qos_shm_offsets) !=
ARRAY_SIZE(wl->qos_params));

b43_mac_suspend(dev);
spin_lock_irqsave(&wl->irq_lock, flags);
Expand All @@ -3083,7 +3086,7 @@ static void b43_qos_update(struct b43_wldev *dev)
params = &(wl->qos_params[i]);
if (params->need_hw_update) {
b43_qos_params_upload(dev, &(params->p),
qos_shm_offsets[i]);
b43_qos_shm_offsets[i]);
params->need_hw_update = 0;
}
}
Expand All @@ -3097,11 +3100,42 @@ static void b43_qos_clear(struct b43_wl *wl)
struct b43_qos_params *params;
unsigned int i;

/* Initialize QoS parameters to sane defaults. */

BUILD_BUG_ON(ARRAY_SIZE(b43_qos_shm_offsets) !=
ARRAY_SIZE(wl->qos_params));

for (i = 0; i < ARRAY_SIZE(wl->qos_params); i++) {
params = &(wl->qos_params[i]);

memset(&(params->p), 0, sizeof(params->p));
params->p.aifs = -1;
switch (b43_qos_shm_offsets[i]) {
case B43_QOS_VOICE:
params->p.txop = 0;
params->p.aifs = 2;
params->p.cw_min = 0x0001;
params->p.cw_max = 0x0001;
break;
case B43_QOS_VIDEO:
params->p.txop = 0;
params->p.aifs = 2;
params->p.cw_min = 0x0001;
params->p.cw_max = 0x0001;
break;
case B43_QOS_BESTEFFORT:
params->p.txop = 0;
params->p.aifs = 3;
params->p.cw_min = 0x0001;
params->p.cw_max = 0x03FF;
break;
case B43_QOS_BACKGROUND:
params->p.txop = 0;
params->p.aifs = 7;
params->p.cw_min = 0x0001;
params->p.cw_max = 0x03FF;
break;
default:
B43_WARN_ON(1);
}
params->need_hw_update = 1;
}
}
Expand Down

0 comments on commit 72dd945

Please sign in to comment.