On Wed, Jan 6, 2010 at 10:09 PM, Rafał Miłecki <[email protected]> wrote:
> I've decided to made LP-PHY init code review for compatibility with specs
> and found some issues.
>
> We lack some code for higher PHY revisions (up from 2/3) and for some
> specific boards. Also I've found little mistake in specs which Larry just
> corrected.
>
> Gábor: could you care for this parts of LP-PHY code?
>
> So far I've only checked
> lpphy_read_band_sprom(dev);
> and
> lpphy_baseband_init(dev);
>
> I check for all conditions and operations (registers, masks, values). So far
> didn't notice anything more serious than what's exposed by patch, so good
> work Gábor :)
>
>
>
>
> diff --git a/drivers/net/wireless/b43/phy_lp.c
> b/drivers/net/wireless/b43/phy_lp.c
> index 1e318d8..43a9fcc 100644
> --- a/drivers/net/wireless/b43/phy_lp.c
> +++ b/drivers/net/wireless/b43/phy_lp.c
> @@ -198,6 +198,17 @@ static void lpphy_table_init(struct b43_wldev *dev)
>
>        lpphy_init_tx_gain_table(dev);
>
> +       if (dev->phy.rev >=2) {
> +               int i;
> +               for (i = 0; i < 128; ++i) {

Two style comments:
1. Declare i at the beginning of the function.
2. The preferred style in b43 is i++.

> +                       /* TODO
> +                       Set the table offset to 576 + the loop index
> +                       Set the table data pointer to a u32 containing 127 -
> loop index
> +                       Write the table
> +                       */

This can be implemented like this:
b43_lptab_write(dev, B43_LPTAB32(?, 576 + i), 127 - i);

Larry, what is the correct value for the "?" (i.e. the table index)?
Please update the specs, this is missing.

> +               }
> +       }
> +
>        if (dev->phy.rev < 2)
>                lpphy_adjust_gain_table(dev, freq);
>  }
> diff --git a/drivers/net/wireless/b43/tables_lpphy.c
> b/drivers/net/wireless/b43/tables_lpphy.c
> index 61027ee..cb233e6 100644
> --- a/drivers/net/wireless/b43/tables_lpphy.c
> +++ b/drivers/net/wireless/b43/tables_lpphy.c
> @@ -2312,34 +2312,42 @@ void lpphy_rev2plus_table_init(struct b43_wldev
> *dev)
>        for (i = 0; i < 704; i++)
>                b43_lptab_write(dev, B43_LPTAB32(7, i), 0);
>
> -       b43_lptab_write_bulk(dev, B43_LPTAB8(2, 0),
> -               ARRAY_SIZE(lpphy_min_sig_sq_table), lpphy_min_sig_sq_table);
> -       b43_lptab_write_bulk(dev, B43_LPTAB16(1, 0),
> -               ARRAY_SIZE(lpphy_rev2plus_noise_scale_table),
> lpphy_rev2plus_noise_scale_table);
> -       b43_lptab_write_bulk(dev, B43_LPTAB32(11, 0),
> -               ARRAY_SIZE(lpphy_rev2plus_filter_control_table),
> lpphy_rev2plus_filter_control_table);
> -       b43_lptab_write_bulk(dev, B43_LPTAB32(12, 0),
> -               ARRAY_SIZE(lpphy_rev2plus_ps_control_table),
> lpphy_rev2plus_ps_control_table);
> -       b43_lptab_write_bulk(dev, B43_LPTAB32(13, 0),
> -               ARRAY_SIZE(lpphy_gain_idx_table), lpphy_gain_idx_table);
> -       b43_lptab_write_bulk(dev, B43_LPTAB16(14, 0),
> -               ARRAY_SIZE(lpphy_aux_gain_idx_table),
> lpphy_aux_gain_idx_table);
> -       b43_lptab_write_bulk(dev, B43_LPTAB16(15, 0),
> -               ARRAY_SIZE(lpphy_sw_control_table), lpphy_sw_control_table);
> -       b43_lptab_write_bulk(dev, B43_LPTAB8(16, 0),
> -               ARRAY_SIZE(lpphy_hf_table), lpphy_hf_table);
> -       b43_lptab_write_bulk(dev, B43_LPTAB32(17, 0),
> -               ARRAY_SIZE(lpphy_gain_value_table), lpphy_gain_value_table);
> -       b43_lptab_write_bulk(dev, B43_LPTAB16(18, 0),
> -               ARRAY_SIZE(lpphy_gain_table), lpphy_gain_table);
> -       b43_lptab_write_bulk(dev, B43_LPTAB8(6, 0),
> -               ARRAY_SIZE(lpphy_pll_fraction_table),
> lpphy_pll_fraction_table);
> -       b43_lptab_write_bulk(dev, B43_LPTAB16(0, 0),
> -               ARRAY_SIZE(lpphy_iqlo_cal_table), lpphy_iqlo_cal_table);
> -       b43_lptab_write_bulk(dev, B43_LPTAB32(9, 0),
> -               ARRAY_SIZE(lpphy_papd_eps_table), lpphy_papd_eps_table);
> -       b43_lptab_write_bulk(dev, B43_LPTAB32(10, 0),
> -               ARRAY_SIZE(lpphy_papd_mult_table), lpphy_papd_mult_table);
> +       if (dev->phy.rev >= 3) {
> +               /* TODO */
> +       } else {
> +               b43_lptab_write_bulk(dev, B43_LPTAB8(2, 0),
> +                       ARRAY_SIZE(lpphy_min_sig_sq_table),
> lpphy_min_sig_sq_table);
> +               b43_lptab_write_bulk(dev, B43_LPTAB16(1, 0),
> +                       ARRAY_SIZE(lpphy_rev2plus_noise_scale_table),
> lpphy_rev2plus_noise_scale_table);
> +               b43_lptab_write_bulk(dev, B43_LPTAB32(11, 0),
> +                       ARRAY_SIZE(lpphy_rev2plus_filter_control_table),
> lpphy_rev2plus_filter_control_table);
> +               b43_lptab_write_bulk(dev, B43_LPTAB32(12, 0),
> +                       ARRAY_SIZE(lpphy_rev2plus_ps_control_table),
> lpphy_rev2plus_ps_control_table);
> +               b43_lptab_write_bulk(dev, B43_LPTAB32(13, 0),
> +                       ARRAY_SIZE(lpphy_gain_idx_table),
> lpphy_gain_idx_table);
> +               b43_lptab_write_bulk(dev, B43_LPTAB16(14, 0),
> +                       ARRAY_SIZE(lpphy_aux_gain_idx_table),
> lpphy_aux_gain_idx_table);
> +               b43_lptab_write_bulk(dev, B43_LPTAB16(15, 0),
> +                       ARRAY_SIZE(lpphy_sw_control_table),
> lpphy_sw_control_table);
> +               b43_lptab_write_bulk(dev, B43_LPTAB8(16, 0),
> +                       ARRAY_SIZE(lpphy_hf_table), lpphy_hf_table);
> +               b43_lptab_write_bulk(dev, B43_LPTAB32(17, 0),
> +                       ARRAY_SIZE(lpphy_gain_value_table),
> lpphy_gain_value_table);
> +               b43_lptab_write_bulk(dev, B43_LPTAB16(18, 0),
> +                       ARRAY_SIZE(lpphy_gain_table), lpphy_gain_table);
> +               b43_lptab_write_bulk(dev, B43_LPTAB8(6, 0),
> +                       ARRAY_SIZE(lpphy_pll_fraction_table),
> lpphy_pll_fraction_table);
> +               b43_lptab_write_bulk(dev, B43_LPTAB16(0, 0),
> +                       ARRAY_SIZE(lpphy_iqlo_cal_table),
> lpphy_iqlo_cal_table);
> +               b43_lptab_write_bulk(dev, B43_LPTAB32(9, 0),
> +                       ARRAY_SIZE(lpphy_papd_eps_table),
> lpphy_papd_eps_table);
> +               b43_lptab_write_bulk(dev, B43_LPTAB32(10, 0),
> +                       ARRAY_SIZE(lpphy_papd_mult_table),
> lpphy_papd_mult_table);
> +       }
> +
> +       if (bus->boardinfo.type == 0x04AA && bus->boardinfo.rev <= 0x10) {
> +               /* TODO */
> +       }
>
>        if ((bus->chip_id == 0x4325) && (bus->chip_rev == 0)) {
>                b43_lptab_write_bulk(dev, B43_LPTAB32(13, 0),
> @@ -2421,7 +2429,7 @@ void lpphy_init_tx_gain_table(struct b43_wldev *dev)
>        switch (dev->phy.rev) {
>        case 0:
>                if ((bus->sprom.boardflags_hi & B43_BFH_NOPA) ||
> -                   (bus->sprom.boardflags_lo & B43_BFL_HGPA))
> +                   (bus->sprom.boardflags_hi & B43_BFH_RSSIINV))
>                        lpphy_write_gain_table_bulk(dev, 0, 128,
>                                        lpphy_rev0_nopa_tx_gain_table);
>                else if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
> @@ -2433,7 +2441,7 @@ void lpphy_init_tx_gain_table(struct b43_wldev *dev)
>                break;
>        case 1:
>                if ((bus->sprom.boardflags_hi & B43_BFH_NOPA) ||
> -                   (bus->sprom.boardflags_lo & B43_BFL_HGPA))
> +                   (bus->sprom.boardflags_hi & B43_BFH_RSSIINV))
>                        lpphy_write_gain_table_bulk(dev, 0, 128,
>                                        lpphy_rev1_nopa_tx_gain_table);
>                else if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ)
>



-- 
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
_______________________________________________
Bcm43xx-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev

Reply via email to