diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2010-01-18 00:21:27 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-01-19 16:46:36 -0500 |
commit | c643a66ef5ccfd4d359327fb8afa9949f1abbfdd (patch) | |
tree | f0c787853ed3f0efbc0820c82c3e517c3e257d85 /drivers/net/wireless/b43/tables_nphy.c | |
parent | 2581b1434ccba6960e0b671927d87c83b5152c9d (diff) | |
download | blackbird-op-linux-c643a66ef5ccfd4d359327fb8afa9949f1abbfdd.tar.gz blackbird-op-linux-c643a66ef5ccfd4d359327fb8afa9949f1abbfdd.zip |
b43: N-PHY: implement and add reading one element tables
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43/tables_nphy.c')
-rw-r--r-- | drivers/net/wireless/b43/tables_nphy.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c index fc08be0b976e..b8aed456da1f 100644 --- a/drivers/net/wireless/b43/tables_nphy.c +++ b/drivers/net/wireless/b43/tables_nphy.c @@ -2919,6 +2919,37 @@ static inline void assert_ntab_array_sizes(void) #undef check } +u32 b43_ntab_read(struct b43_wldev *dev, u32 offset) +{ + u32 type, value; + + type = offset & B43_NTAB_TYPEMASK; + offset &= ~B43_NTAB_TYPEMASK; + B43_WARN_ON(offset > 0xFFFF); + + switch (type) { + case B43_NTAB_8BIT: + b43_phy_write(dev, B43_NPHY_TABLE_ADDR, offset); + value = b43_phy_read(dev, B43_NPHY_TABLE_DATALO) & 0xFF; + break; + case B43_NTAB_16BIT: + b43_phy_write(dev, B43_NPHY_TABLE_ADDR, offset); + value = b43_phy_read(dev, B43_NPHY_TABLE_DATALO); + break; + case B43_NTAB_32BIT: + b43_phy_write(dev, B43_NPHY_TABLE_ADDR, offset); + value = b43_phy_read(dev, B43_NPHY_TABLE_DATAHI); + value <<= 16; + value |= b43_phy_read(dev, B43_NPHY_TABLE_DATALO); + break; + default: + B43_WARN_ON(1); + value = 0; + } + + return value; +} + void b43_ntab_write(struct b43_wldev *dev, u32 offset, u32 value) { u32 type; |