Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Mar 2014 23:41:54 -0800
From:      Adrian Chadd <adrian@freebsd.org>
To:        Alexandr <shuriku@shurik.kiev.ua>
Cc:        "freebsd-wireless@freebsd.org" <freebsd-wireless@freebsd.org>
Subject:   Re: Fwd: svn commit: r262729 - head/sys/dev/iwn
Message-ID:  <CAJ-VmoktEsk2ESeOw_StY0KJdcOOP9s%2BxA6Mz7yH6pa14UVTLA@mail.gmail.com>
In-Reply-To: <53182646.3010004@shurik.kiev.ua>
References:  <201403040801.s2481uAc088743@svn.freebsd.org> <CAJ-Vmo=8jjkgtd4p5L7XmDX-__W-QRjopcacyfzVNmqjZtSavw@mail.gmail.com> <53182646.3010004@shurik.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Your intel 2230 problems aren't calibration related.

My intel 2230 and intel 2200 both work fine everywhere I use them, but
I don't have a laptop with it in there all the time.


-a

On 5 March 2014 23:39, Alexandr <shuriku@shurik.kiev.ua> wrote:
> My 2230 still not working in 11n
>
> 04.03.2014 10:09, Adrian Chadd =D0=BF=D0=B8=D1=88=D0=B5=D1=82:
>> If you have a Centrino 100, 2200, 2230, then please update to the
>> latest -HEAD. This may fix some calibration issues.
>>
>>
>> -a
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: Adrian Chadd <adrian@freebsd.org>
>> Date: 4 March 2014 00:01
>> Subject: svn commit: r262729 - head/sys/dev/iwn
>> To: src-committers@freebsd.org, svn-src-all@freebsd.org,
>> svn-src-head@freebsd.org
>>
>>
>> Author: adrian
>> Date: Tue Mar  4 08:01:56 2014
>> New Revision: 262729
>> URL: http://svnweb.freebsd.org/changeset/base/262729
>>
>> Log:
>>   Handle the newer-style bluetooth message format from the (at least)
>>   Centrino 2230 firmware.
>>
>>   This fixes the general statistics block to be actually valid.
>>
>>   I've verified this by contrasting the output of iwnstats before and
>>   after the change.  The general block is now correct.
>>
>>   Tested:
>>
>>   * Intel 5100 (old format stats message)
>>   * Intel 2230 (new format stats message)
>>
>> Modified:
>>   head/sys/dev/iwn/if_iwn.c
>>
>> Modified: head/sys/dev/iwn/if_iwn.c
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
>> --- head/sys/dev/iwn/if_iwn.c   Tue Mar  4 06:55:54 2014        (r262728=
)
>> +++ head/sys/dev/iwn/if_iwn.c   Tue Mar  4 08:01:56 2014        (r262729=
)
>> @@ -685,6 +685,13 @@ iwn_attach(device_t dev)
>>                 goto fail;
>>         }
>>
>> +#if 0
>> +       device_printf(sc->sc_dev, "%s: rx_stats=3D%d, rx_stats_bt=3D%d\n=
",
>> +           __func__,
>> +           sizeof(struct iwn_stats),
>> +           sizeof(struct iwn_stats_bt));
>> +#endif
>> +
>>         if (bootverbose)
>>                 ieee80211_announce(ic);
>>         DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);
>> @@ -3143,11 +3150,62 @@ iwn5000_rx_calib_results(struct iwn_soft
>>
>>  static void
>>  iwn_stats_update(struct iwn_softc *sc, struct iwn_calib_state *calib,
>> -    struct iwn_stats *stats)
>> +    struct iwn_stats *stats, int len)
>>  {
>> +       struct iwn_stats_bt *stats_bt;
>> +       struct iwn_stats *lstats;
>> +
>> +       /*
>> +        * First - check whether the length is the bluetooth or normal.
>> +        *
>> +        * If it's normal - just copy it and bump out.
>> +        * Otherwise we have to convert things.
>> +        */
>> +
>> +       if (len =3D=3D sizeof(struct iwn_stats) + 4) {
>> +               memcpy(&sc->last_stat, stats, sizeof(struct iwn_stats));
>> +               sc->last_stat_valid =3D 1;
>> +               return;
>> +       }
>>
>> -       /* XXX lock assert */
>> -       memcpy(&sc->last_stat, stats, sizeof(struct iwn_stats));
>> +       /*
>> +        * If it's not the bluetooth size - log, then just copy.
>> +        */
>> +       if (len !=3D sizeof(struct iwn_stats_bt) + 4) {
>> +               DPRINTF(sc, IWN_DEBUG_STATS,
>> +                   "%s: size of rx statistics (%d) not an expected size=
!\n",
>> +                   __func__,
>> +                   len);
>> +               memcpy(&sc->last_stat, stats, sizeof(struct iwn_stats));
>> +               sc->last_stat_valid =3D 1;
>> +               return;
>> +       }
>> +
>> +       /*
>> +        * Ok. Time to copy.
>> +        */
>> +       stats_bt =3D (struct iwn_stats_bt *) stats;
>> +       lstats =3D &sc->last_stat;
>> +
>> +       /* flags */
>> +       lstats->flags =3D stats_bt->flags;
>> +       /* rx_bt */
>> +       memcpy(&lstats->rx.ofdm, &stats_bt->rx_bt.ofdm,
>> +           sizeof(struct iwn_rx_phy_stats));
>> +       memcpy(&lstats->rx.cck, &stats_bt->rx_bt.cck,
>> +           sizeof(struct iwn_rx_phy_stats));
>> +       memcpy(&lstats->rx.general, &stats_bt->rx_bt.general_bt.common,
>> +           sizeof(struct iwn_rx_general_stats));
>> +       memcpy(&lstats->rx.ht, &stats_bt->rx_bt.ht,
>> +           sizeof(struct iwn_rx_ht_phy_stats));
>> +       /* tx */
>> +       memcpy(&lstats->tx, &stats_bt->tx,
>> +           sizeof(struct iwn_tx_stats));
>> +       /* general */
>> +       memcpy(&lstats->general, &stats_bt->general,
>> +           sizeof(struct iwn_general_stats));
>> +
>> +       /* XXX TODO: Squirrel away the extra bluetooth stats somewhere *=
/
>>         sc->last_stat_valid =3D 1;
>>  }
>>
>> @@ -3165,6 +3223,7 @@ iwn_rx_statistics(struct iwn_softc *sc,
>>         struct ieee80211vap *vap =3D TAILQ_FIRST(&ic->ic_vaps);
>>         struct iwn_calib_state *calib =3D &sc->calib;
>>         struct iwn_stats *stats =3D (struct iwn_stats *)(desc + 1);
>> +       struct iwn_stats *lstats;
>>         int temp;
>>
>>         DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);
>> @@ -3179,15 +3238,26 @@ iwn_rx_statistics(struct iwn_softc *sc,
>>
>>         bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTRE=
AD);
>>
>> -       DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: received statistics, cmd %=
d\n",
>> -           __func__, desc->type);
>> +       DPRINTF(sc, IWN_DEBUG_CALIBRATE | IWN_DEBUG_STATS,
>> +           "%s: received statistics, cmd %d, len %d\n",
>> +           __func__, desc->type, le16toh(desc->len));
>>         sc->calib_cnt =3D 0;      /* Reset TX power calibration timeout.=
 */
>>
>> -       /* Collect/track general statistics for reporting */
>> -       iwn_stats_update(sc, calib, stats);
>> +       /*
>> +        * Collect/track general statistics for reporting.
>> +        *
>> +        * This takes care of ensuring that the bluetooth sized message
>> +        * will be correctly converted to the legacy sized message.
>> +        */
>> +       iwn_stats_update(sc, calib, stats, le16toh(desc->len));
>> +
>> +       /*
>> +        * And now, let's take a reference of it to use!
>> +        */
>> +       lstats =3D &sc->last_stat;
>>
>>         /* Test if temperature has changed. */
>> -       if (stats->general.temp !=3D sc->rawtemp) {
>> +       if (lstats->general.temp !=3D sc->rawtemp) {
>>                 /* Convert "raw" temperature to degC. */
>>                 sc->rawtemp =3D stats->general.temp;
>>                 temp =3D ops->get_temperature(sc);
>> @@ -3202,25 +3272,25 @@ iwn_rx_statistics(struct iwn_softc *sc,
>>         if (desc->type !=3D IWN_BEACON_STATISTICS)
>>                 return; /* Reply to a statistics request. */
>>
>> -       sc->noise =3D iwn_get_noise(&stats->rx.general);
>> +       sc->noise =3D iwn_get_noise(&lstats->rx.general);
>>         DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: noise %d\n", __func__, sc-=
>noise);
>>
>>         /* Test that RSSI and noise are present in stats report. */
>> -       if (le32toh(stats->rx.general.flags) !=3D 1) {
>> +       if (le32toh(lstats->rx.general.flags) !=3D 1) {
>>                 DPRINTF(sc, IWN_DEBUG_ANY, "%s\n",
>>                     "received statistics without RSSI");
>>                 return;
>>         }
>>
>>         if (calib->state =3D=3D IWN_CALIB_STATE_ASSOC)
>> -               iwn_collect_noise(sc, &stats->rx.general);
>> +               iwn_collect_noise(sc, &lstats->rx.general);
>>         else if (calib->state =3D=3D IWN_CALIB_STATE_RUN) {
>> -               iwn_tune_sensitivity(sc, &stats->rx);
>> +               iwn_tune_sensitivity(sc, &lstats->rx);
>>                 /*
>>                  * XXX TODO: Only run the RX recovery if we're associate=
d!
>>                  */
>> -               iwn_check_rx_recovery(sc, stats);
>> -               iwn_save_stats_counters(sc, stats);
>> +               iwn_check_rx_recovery(sc, lstats);
>> +               iwn_save_stats_counters(sc, lstats);
>>         }
>>
>>         DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);
>> _______________________________________________
>> freebsd-wireless@freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
>> To unsubscribe, send any mail to "freebsd-wireless-unsubscribe@freebsd.o=
rg"
>
> _______________________________________________
> freebsd-wireless@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
> To unsubscribe, send any mail to "freebsd-wireless-unsubscribe@freebsd.or=
g"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-VmoktEsk2ESeOw_StY0KJdcOOP9s%2BxA6Mz7yH6pa14UVTLA>