blob: 84f1d265f657c27b57c62a1ac72e4c6f6b7cd310 [file] [log] [blame]
Michael Buesch6c1bb922009-01-31 16:52:29 +01001#ifndef B43_TABLES_LPPHY_H_
2#define B43_TABLES_LPPHY_H_
3
4
5#define B43_LPTAB_TYPEMASK 0xF0000000
6#define B43_LPTAB_8BIT 0x10000000
7#define B43_LPTAB_16BIT 0x20000000
8#define B43_LPTAB_32BIT 0x30000000
9#define B43_LPTAB8(table, offset) (((table) << 10) | (offset) | B43_LPTAB_8BIT)
10#define B43_LPTAB16(table, offset) (((table) << 10) | (offset) | B43_LPTAB_16BIT)
11#define B43_LPTAB32(table, offset) (((table) << 10) | (offset) | B43_LPTAB_32BIT)
12
13/* Table definitions */
14#define B43_LPTAB_TXPWR_R2PLUS B43_LPTAB32(0x07, 0) /* TX power lookup table (rev >= 2) */
15#define B43_LPTAB_TXPWR_R0_1 B43_LPTAB32(0xA0, 0) /* TX power lookup table (rev < 2) */
16
17u32 b43_lptab_read(struct b43_wldev *dev, u32 offset);
18void b43_lptab_write(struct b43_wldev *dev, u32 offset, u32 value);
19
Michael Bueschce1a9ee2009-02-04 19:55:22 +010020/* Bulk table access. Note that these functions return the bulk data in
21 * host endianness! The returned data is _not_ a bytearray, but an array
22 * consisting of nr_elements of the data type. */
23void b43_lptab_read_bulk(struct b43_wldev *dev, u32 offset,
24 unsigned int nr_elements, void *data);
25void b43_lptab_write_bulk(struct b43_wldev *dev, u32 offset,
26 unsigned int nr_elements, const void *data);
27
Michael Buesch24b5bcc2009-01-31 19:34:53 +010028void b2062_upload_init_table(struct b43_wldev *dev);
Gábor Stefanikc10e47f2009-08-04 23:57:32 +020029void b2063_upload_init_table(struct b43_wldev *dev);
Michael Buesch24b5bcc2009-01-31 19:34:53 +010030
Gábor Stefanik47583152009-08-11 22:24:22 +020031struct lpphy_tx_gain_table_entry {
32 u8 gm, pga, pad, dac, bb_mult;
33};
34
35void lpphy_write_gain_table(struct b43_wldev *dev, int offset,
36 struct lpphy_tx_gain_table_entry data);
37void lpphy_write_gain_table_bulk(struct b43_wldev *dev, int offset, int count,
38 struct lpphy_tx_gain_table_entry *table);
39
Gábor Stefanikc65d6fb2009-08-10 20:39:47 +020040void lpphy_rev0_1_table_init(struct b43_wldev *dev);
41void lpphy_rev2plus_table_init(struct b43_wldev *dev);
42void lpphy_init_tx_gain_table(struct b43_wldev *dev);
Michael Buesch6c1bb922009-01-31 16:52:29 +010043
44#endif /* B43_TABLES_LPPHY_H_ */