Commit 5c1da23b authored by Hauke Mehrtens's avatar Hauke Mehrtens Committed by John W. Linville

b43: use constants

Instead of defining the magic values in the code use constants.
Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent c0880a29
...@@ -285,7 +285,9 @@ enum { ...@@ -285,7 +285,9 @@ enum {
#define B43_SHM_SH_DTIMPER 0x0012 /* DTIM period */ #define B43_SHM_SH_DTIMPER 0x0012 /* DTIM period */
#define B43_SHM_SH_NOSLPZNATDTIM 0x004C /* NOSLPZNAT DTIM */ #define B43_SHM_SH_NOSLPZNATDTIM 0x004C /* NOSLPZNAT DTIM */
/* SHM_SHARED beacon/AP variables */ /* SHM_SHARED beacon/AP variables */
#define B43_SHM_SH_BT_BASE0 0x0068 /* Beacon template base 0 */
#define B43_SHM_SH_BTL0 0x0018 /* Beacon template length 0 */ #define B43_SHM_SH_BTL0 0x0018 /* Beacon template length 0 */
#define B43_SHM_SH_BT_BASE1 0x0468 /* Beacon template base 1 */
#define B43_SHM_SH_BTL1 0x001A /* Beacon template length 1 */ #define B43_SHM_SH_BTL1 0x001A /* Beacon template length 1 */
#define B43_SHM_SH_BTSFOFF 0x001C /* Beacon TSF offset */ #define B43_SHM_SH_BTSFOFF 0x001C /* Beacon TSF offset */
#define B43_SHM_SH_TIMBPOS 0x001E /* TIM B position in beacon */ #define B43_SHM_SH_TIMBPOS 0x001E /* TIM B position in beacon */
......
...@@ -1310,17 +1310,19 @@ static u32 b43_jssi_read(struct b43_wldev *dev) ...@@ -1310,17 +1310,19 @@ static u32 b43_jssi_read(struct b43_wldev *dev)
{ {
u32 val = 0; u32 val = 0;
val = b43_shm_read16(dev, B43_SHM_SHARED, 0x08A); val = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_JSSI1);
val <<= 16; val <<= 16;
val |= b43_shm_read16(dev, B43_SHM_SHARED, 0x088); val |= b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_JSSI0);
return val; return val;
} }
static void b43_jssi_write(struct b43_wldev *dev, u32 jssi) static void b43_jssi_write(struct b43_wldev *dev, u32 jssi)
{ {
b43_shm_write16(dev, B43_SHM_SHARED, 0x088, (jssi & 0x0000FFFF)); b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_JSSI0,
b43_shm_write16(dev, B43_SHM_SHARED, 0x08A, (jssi & 0xFFFF0000) >> 16); (jssi & 0x0000FFFF));
b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_JSSI1,
(jssi & 0xFFFF0000) >> 16);
} }
static void b43_generate_noise_sample(struct b43_wldev *dev) static void b43_generate_noise_sample(struct b43_wldev *dev)
...@@ -1623,7 +1625,7 @@ static void b43_upload_beacon0(struct b43_wldev *dev) ...@@ -1623,7 +1625,7 @@ static void b43_upload_beacon0(struct b43_wldev *dev)
if (wl->beacon0_uploaded) if (wl->beacon0_uploaded)
return; return;
b43_write_beacon_template(dev, 0x68, 0x18); b43_write_beacon_template(dev, B43_SHM_SH_BT_BASE0, B43_SHM_SH_BTL0);
wl->beacon0_uploaded = true; wl->beacon0_uploaded = true;
} }
...@@ -1633,7 +1635,7 @@ static void b43_upload_beacon1(struct b43_wldev *dev) ...@@ -1633,7 +1635,7 @@ static void b43_upload_beacon1(struct b43_wldev *dev)
if (wl->beacon1_uploaded) if (wl->beacon1_uploaded)
return; return;
b43_write_beacon_template(dev, 0x468, 0x1A); b43_write_beacon_template(dev, B43_SHM_SH_BT_BASE1, B43_SHM_SH_BTL1);
wl->beacon1_uploaded = true; wl->beacon1_uploaded = true;
} }
...@@ -3113,7 +3115,7 @@ static int b43_chip_init(struct b43_wldev *dev) ...@@ -3113,7 +3115,7 @@ static int b43_chip_init(struct b43_wldev *dev)
/* Probe Response Timeout value */ /* Probe Response Timeout value */
/* FIXME: Default to 0, has to be set by ioctl probably... :-/ */ /* FIXME: Default to 0, has to be set by ioctl probably... :-/ */
b43_shm_write16(dev, B43_SHM_SHARED, 0x0074, 0x0000); b43_shm_write16(dev, B43_SHM_SHARED, B43_SHM_SH_PRMAXTIME, 0);
/* Initially set the wireless operation mode. */ /* Initially set the wireless operation mode. */
b43_adjust_opmode(dev); b43_adjust_opmode(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment