diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2007-03-14 16:06:22 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-04-28 11:00:59 -0400 |
commit | aa93c85d09295dcb269fc1a0690d9ddfb58f46cc (patch) | |
tree | aa0631c587cf037e7ecb55af60b550d61cb3faf6 /drivers/net/wireless/bcm43xx | |
parent | aec91028db71cae7efa1101cf2e38c407096f023 (diff) |
[PATCH] bcm43xx:Eliminate some 'G Mode Enable' magic numbers
In code manipulating the TM State Low register of 802.11 cores, two
different magic numbers are used to reference the 'G Mode Enable' bit.
One of these, 0x20000000, is clear, but the other, (0x800 << 18), is not.
This patch replaces both types with a defined constant. In addition, two
bits in the TM State High registers are given definitions to help in
following the code.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/bcm43xx')
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_main.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_phy.c | 8 |
3 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx.h b/drivers/net/wireless/bcm43xx/bcm43xx.h index 95ff175d8f33..f8483c179e4c 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx.h +++ b/drivers/net/wireless/bcm43xx/bcm43xx.h | |||
@@ -277,11 +277,14 @@ | |||
277 | #define BCM43xx_SBTMSTATELOW_REJECT 0x02 | 277 | #define BCM43xx_SBTMSTATELOW_REJECT 0x02 |
278 | #define BCM43xx_SBTMSTATELOW_CLOCK 0x10000 | 278 | #define BCM43xx_SBTMSTATELOW_CLOCK 0x10000 |
279 | #define BCM43xx_SBTMSTATELOW_FORCE_GATE_CLOCK 0x20000 | 279 | #define BCM43xx_SBTMSTATELOW_FORCE_GATE_CLOCK 0x20000 |
280 | #define BCM43xx_SBTMSTATELOW_G_MODE_ENABLE 0x20000000 | ||
280 | 281 | ||
281 | /* sbtmstatehigh state flags */ | 282 | /* sbtmstatehigh state flags */ |
282 | #define BCM43xx_SBTMSTATEHIGH_SERROR 0x00000001 | 283 | #define BCM43xx_SBTMSTATEHIGH_SERROR 0x00000001 |
283 | #define BCM43xx_SBTMSTATEHIGH_BUSY 0x00000004 | 284 | #define BCM43xx_SBTMSTATEHIGH_BUSY 0x00000004 |
284 | #define BCM43xx_SBTMSTATEHIGH_TIMEOUT 0x00000020 | 285 | #define BCM43xx_SBTMSTATEHIGH_TIMEOUT 0x00000020 |
286 | #define BCM43xx_SBTMSTATEHIGH_G_PHY_AVAIL 0x00010000 | ||
287 | #define BCM43xx_SBTMSTATEHIGH_A_PHY_AVAIL 0x00020000 | ||
285 | #define BCM43xx_SBTMSTATEHIGH_COREFLAGS 0x1FFF0000 | 288 | #define BCM43xx_SBTMSTATEHIGH_COREFLAGS 0x1FFF0000 |
286 | #define BCM43xx_SBTMSTATEHIGH_DMA64BIT 0x10000000 | 289 | #define BCM43xx_SBTMSTATEHIGH_DMA64BIT 0x10000000 |
287 | #define BCM43xx_SBTMSTATEHIGH_GATEDCLK 0x20000000 | 290 | #define BCM43xx_SBTMSTATEHIGH_GATEDCLK 0x20000000 |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c index a38e7eec0e62..5e96bca6730a 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c | |||
@@ -1407,7 +1407,7 @@ void bcm43xx_wireless_core_reset(struct bcm43xx_private *bcm, int connect_phy) | |||
1407 | & ~(BCM43xx_SBF_MAC_ENABLED | 0x00000002)); | 1407 | & ~(BCM43xx_SBF_MAC_ENABLED | 0x00000002)); |
1408 | } else { | 1408 | } else { |
1409 | if (connect_phy) | 1409 | if (connect_phy) |
1410 | flags |= 0x20000000; | 1410 | flags |= BCM43xx_SBTMSTATELOW_G_MODE_ENABLE; |
1411 | bcm43xx_phy_connect(bcm, connect_phy); | 1411 | bcm43xx_phy_connect(bcm, connect_phy); |
1412 | bcm43xx_core_enable(bcm, flags); | 1412 | bcm43xx_core_enable(bcm, flags); |
1413 | bcm43xx_write16(bcm, 0x03E6, 0x0000); | 1413 | bcm43xx_write16(bcm, 0x03E6, 0x0000); |
@@ -3604,7 +3604,7 @@ int bcm43xx_select_wireless_core(struct bcm43xx_private *bcm, | |||
3604 | u32 sbtmstatelow; | 3604 | u32 sbtmstatelow; |
3605 | 3605 | ||
3606 | sbtmstatelow = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATELOW); | 3606 | sbtmstatelow = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATELOW); |
3607 | sbtmstatelow |= 0x20000000; | 3607 | sbtmstatelow |= BCM43xx_SBTMSTATELOW_G_MODE_ENABLE; |
3608 | bcm43xx_write32(bcm, BCM43xx_CIR_SBTMSTATELOW, sbtmstatelow); | 3608 | bcm43xx_write32(bcm, BCM43xx_CIR_SBTMSTATELOW, sbtmstatelow); |
3609 | } | 3609 | } |
3610 | err = wireless_core_up(bcm, 1); | 3610 | err = wireless_core_up(bcm, 1); |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c index 72529a440f15..c47e19a9521a 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c | |||
@@ -168,16 +168,16 @@ int bcm43xx_phy_connect(struct bcm43xx_private *bcm, int connect) | |||
168 | 168 | ||
169 | flags = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATEHIGH); | 169 | flags = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATEHIGH); |
170 | if (connect) { | 170 | if (connect) { |
171 | if (!(flags & 0x00010000)) | 171 | if (!(flags & BCM43xx_SBTMSTATEHIGH_G_PHY_AVAIL)) |
172 | return -ENODEV; | 172 | return -ENODEV; |
173 | flags = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATELOW); | 173 | flags = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATELOW); |
174 | flags |= (0x800 << 18); | 174 | flags |= BCM43xx_SBTMSTATELOW_G_MODE_ENABLE; |
175 | bcm43xx_write32(bcm, BCM43xx_CIR_SBTMSTATELOW, flags); | 175 | bcm43xx_write32(bcm, BCM43xx_CIR_SBTMSTATELOW, flags); |
176 | } else { | 176 | } else { |
177 | if (!(flags & 0x00020000)) | 177 | if (!(flags & BCM43xx_SBTMSTATEHIGH_A_PHY_AVAIL)) |
178 | return -ENODEV; | 178 | return -ENODEV; |
179 | flags = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATELOW); | 179 | flags = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATELOW); |
180 | flags &= ~(0x800 << 18); | 180 | flags &= ~BCM43xx_SBTMSTATELOW_G_MODE_ENABLE; |
181 | bcm43xx_write32(bcm, BCM43xx_CIR_SBTMSTATELOW, flags); | 181 | bcm43xx_write32(bcm, BCM43xx_CIR_SBTMSTATELOW, flags); |
182 | } | 182 | } |
183 | out: | 183 | out: |