[PATCH 3/3] b43: LCN-PHY: load TX gain table on init
Rafał Miłecki
zajec5 at gmail.com
Sun Sep 4 02:31:47 EDT 2011
W dniu 3 września 2011 22:21 użytkownik Joe Perches <joe at perches.com> napisał:
> On Sat, 2011-09-03 at 21:01 +0200, Rafał Miłecki wrote:
>> Values and ops were taken from MMIO dump of wl. struct was copied from
>> brcmsmac.
> []
>> diff --git a/drivers/net/wireless/b43/tables_phy_lcn.c b/drivers/net/wireless/b43/tables_phy_lcn.c
> []
>> +const struct b43_lcntab_tx_gain_tbl_entry
>> + b43_lcntab_tx_gain_tbl_2ghz_ext_pa_rev0[] = {
>
> 128 entries follow...
OK, I'll fix that.
>> + { 0x03, 0x00, 0x1f, 0x0, 0x48 },
> [etc]
>> + { 0x03, 0x00, 0x01, 0x0, 0x39 },
>> +};
>
>> +void b43_phy_lcn_load_tx_gain_tab(struct b43_wldev *dev,
>> + const struct b43_lcntab_tx_gain_tbl_entry *gain_table)
>
> Are there multiple gain tables?
Yes, please check for the condition where we call
b43_phy_lcn_load_tx_gain_tab, and the table name. Different hardware
will need different table.
>> +{
>> + u32 i;
>> + u32 val;
>> +
>> + u16 pa_gain = 0x70;
>> + if (dev->dev->bus_sprom->boardflags_lo & B43_BFL_FEM)
>> + pa_gain = 0x10;
>> +
>> + for (i = 0; i < 128; i++) {
>
> Can this be a fixed table and ARRAY_SIZE?
Not trivial, as we accept multiple tables here. I could do
BUG_BUILD_ON(ARRAY_SIZE(tab1) != ARRAY_SIZE(tab2);
and then use ARRAY_SIZE(tab1)
Or maybe I'll just use a define... Probably a better idea.
--
Rafał
More information about the b43-dev
mailing list