Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102580
b: refs/heads/master
c: 6dcdc19
h: refs/heads/master
v: v3
  • Loading branch information
Harvey Harrison authored and John W. Linville committed May 14, 2008
1 parent 2b1b3a0 commit 75ae55f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 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: d6894b5be1d674a31a94ed8f057c9f7d98c53999
refs/heads/master: 6dcdc19e4ba4e6a9ccd733fdb745ad062cf3ea0a
27 changes: 6 additions & 21 deletions trunk/drivers/net/wireless/b43/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/types.h>
#include <linux/bitrev.h>

#include "b43.h"
#include "phy.h"
Expand Down Expand Up @@ -83,25 +84,9 @@ const u8 b43_radio_channel_codes_bg[] = {
72, 84,
};

#define bitrev4(tmp) (bitrev8(tmp) >> 4)
static void b43_phy_initg(struct b43_wldev *dev);

/* Reverse the bits of a 4bit value.
* Example: 1101 is flipped 1011
*/
static u16 flip_4bit(u16 value)
{
u16 flipped = 0x0000;

B43_WARN_ON(value & ~0x000F);

flipped |= (value & 0x0001) << 3;
flipped |= (value & 0x0002) << 1;
flipped |= (value & 0x0004) >> 1;
flipped |= (value & 0x0008) >> 3;

return flipped;
}

static void generate_rfatt_list(struct b43_wldev *dev,
struct b43_rfatt_list *list)
{
Expand Down Expand Up @@ -2891,13 +2876,13 @@ b43_radio_interference_mitigation_enable(struct b43_wldev *dev, int mode)
}
radio_stacksave(0x0078);
tmp = (b43_radio_read16(dev, 0x0078) & 0x001E);
flipped = flip_4bit(tmp);
B43_WARN_ON(tmp > 15);
flipped = bitrev4(tmp);
if (flipped < 10 && flipped >= 8)
flipped = 7;
else if (flipped >= 10)
flipped -= 3;
flipped = flip_4bit(flipped);
flipped = (flipped << 1) | 0x0020;
flipped = (bitrev4(flipped) << 1) | 0x0020;
b43_radio_write16(dev, 0x0078, flipped);

b43_calc_nrssi_threshold(dev);
Expand Down Expand Up @@ -3530,7 +3515,7 @@ u16 b43_radio_init2050(struct b43_wldev *dev)
tmp1 >>= 9;

for (i = 0; i < 16; i++) {
radio78 = ((flip_4bit(i) << 1) | 0x20);
radio78 = (bitrev4(i) << 1) | 0x0020;
b43_radio_write16(dev, 0x78, radio78);
udelay(10);
for (j = 0; j < 16; j++) {
Expand Down

0 comments on commit 75ae55f

Please sign in to comment.