diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2010-01-17 18:21:27 -0500 |
---|---|---|
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) |
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) | |||
2919 | #undef check | 2919 | #undef check |
2920 | } | 2920 | } |
2921 | 2921 | ||
2922 | u32 b43_ntab_read(struct b43_wldev *dev, u32 offset) | ||
2923 | { | ||
2924 | u32 type, value; | ||
2925 | |||
2926 | type = offset & B43_NTAB_TYPEMASK; | ||
2927 | offset &= ~B43_NTAB_TYPEMASK; | ||
2928 | B43_WARN_ON(offset > 0xFFFF); | ||
2929 | |||
2930 | switch (type) { | ||
2931 | case B43_NTAB_8BIT: | ||
2932 | b43_phy_write(dev, B43_NPHY_TABLE_ADDR, offset); | ||
2933 | value = b43_phy_read(dev, B43_NPHY_TABLE_DATALO) & 0xFF; | ||
2934 | break; | ||
2935 | case B43_NTAB_16BIT: | ||
2936 | b43_phy_write(dev, B43_NPHY_TABLE_ADDR, offset); | ||
2937 | value = b43_phy_read(dev, B43_NPHY_TABLE_DATALO); | ||
2938 | break; | ||
2939 | case B43_NTAB_32BIT: | ||
2940 | b43_phy_write(dev, B43_NPHY_TABLE_ADDR, offset); | ||
2941 | value = b43_phy_read(dev, B43_NPHY_TABLE_DATAHI); | ||
2942 | value <<= 16; | ||
2943 | value |= b43_phy_read(dev, B43_NPHY_TABLE_DATALO); | ||
2944 | break; | ||
2945 | default: | ||
2946 | B43_WARN_ON(1); | ||
2947 | value = 0; | ||
2948 | } | ||
2949 | |||
2950 | return value; | ||
2951 | } | ||
2952 | |||
2922 | void b43_ntab_write(struct b43_wldev *dev, u32 offset, u32 value) | 2953 | void b43_ntab_write(struct b43_wldev *dev, u32 offset, u32 value) |
2923 | { | 2954 | { |
2924 | u32 type; | 2955 | u32 type; |