summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43/tables_nphy.c
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2010-01-18 00:21:35 +0100
committerJohn W. Linville <linville@tuxdriver.com>2010-01-19 16:47:46 -0500
commit9145834e84805f5efcca4706edfd641047af1d55 (patch)
tree3d06a690a42148d76200516484fa4eecf675f531 /drivers/net/wireless/b43/tables_nphy.c
parentc643a66ef5ccfd4d359327fb8afa9949f1abbfdd (diff)
downloadblackbird-op-linux-9145834e84805f5efcca4706edfd641047af1d55.tar.gz
blackbird-op-linux-9145834e84805f5efcca4706edfd641047af1d55.zip
b43: N-PHY: implement and add multi-dimensional table reading
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.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c
index b8aed456da1f..b8c9fc619ab1 100644
--- a/drivers/net/wireless/b43/tables_nphy.c
+++ b/drivers/net/wireless/b43/tables_nphy.c
@@ -2950,6 +2950,41 @@ u32 b43_ntab_read(struct b43_wldev *dev, u32 offset)
return value;
}
+void b43_ntab_read_bulk(struct b43_wldev *dev, u32 offset,
+ unsigned int nr_elements, void *_data)
+{
+ u32 type;
+ u8 *data = _data;
+ unsigned int i;
+
+ type = offset & B43_NTAB_TYPEMASK;
+ offset &= ~B43_NTAB_TYPEMASK;
+ B43_WARN_ON(offset > 0xFFFF);
+
+ b43_phy_write(dev, B43_NPHY_TABLE_ADDR, offset);
+
+ for (i = 0; i < nr_elements; i++) {
+ switch (type) {
+ case B43_NTAB_8BIT:
+ *data = b43_phy_read(dev, B43_NPHY_TABLE_DATALO) & 0xFF;
+ data++;
+ break;
+ case B43_NTAB_16BIT:
+ *((u16 *)data) = b43_phy_read(dev, B43_NPHY_TABLE_DATALO);
+ data += 2;
+ break;
+ case B43_NTAB_32BIT:
+ *((u32 *)data) = b43_phy_read(dev, B43_NPHY_TABLE_DATAHI);
+ *((u32 *)data) <<= 16;
+ *((u32 *)data) |= b43_phy_read(dev, B43_NPHY_TABLE_DATALO);
+ data += 4;
+ break;
+ default:
+ B43_WARN_ON(1);
+ }
+ }
+}
+
void b43_ntab_write(struct b43_wldev *dev, u32 offset, u32 value)
{
u32 type;
OpenPOWER on IntegriCloud