Author: bschmidt
Date: Sat Jun  4 11:43:09 2011
New Revision: 222679
URL: http://svn.freebsd.org/changeset/base/222679

Log:
  The firmware of 4965 series adapters seems to die while trying to send
  probe requests at 1Mbps while being associated on a 5GHz channel. Sending
  those at 6Mbps does work, so use that instead during a background scan.
  This workaround allows us to re-enable background scan support for the
  4965 adapters.
  
  Also, just enabling one antenna on 5GHz results in better reception of
  beacons:
  test            00:26:5a:c6:14:1a   40   54M -71:-95  200 E    WME HTCAP ATH
  vs
  test            00:26:5a:c6:14:1a   40   54M -92:-95  200 E    WME HTCAP ATH
  Due to roam:rssi thresholds set to 7 by default it might have been
  impossible to associate to that network. While here use
  IEEE80211_IS_CHAN_5GHZ() to determine the band.

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==============================================================================
--- head/sys/dev/iwn/if_iwn.c   Sat Jun  4 11:30:12 2011        (r222678)
+++ head/sys/dev/iwn/if_iwn.c   Sat Jun  4 11:43:09 2011        (r222679)
@@ -567,6 +567,7 @@ iwn_attach(device_t dev)
        ic->ic_caps =
                  IEEE80211_C_STA               /* station mode supported */
                | IEEE80211_C_MONITOR           /* monitor mode supported */
+               | IEEE80211_C_BGSCAN            /* background scanning */
                | IEEE80211_C_TXPMGT            /* tx power management */
                | IEEE80211_C_SHSLOT            /* short slot time supported */
                | IEEE80211_C_WPA
@@ -576,8 +577,6 @@ iwn_attach(device_t dev)
 #endif
                | IEEE80211_C_WME               /* WME */
                ;
-       if (sc->hw_type != IWN_HW_REV_TYPE_4965)
-               ic->ic_caps |= IEEE80211_C_BGSCAN; /* background scanning */
 
        /* Read MAC address, channels, etc from EEPROM. */
        if ((error = iwn_read_eeprom(sc, macaddr)) != 0) {
@@ -5161,7 +5160,7 @@ iwn_scan(struct iwn_softc *sc)
        if (IEEE80211_IS_CHAN_A(ic->ic_curchan) &&
            sc->hw_type == IWN_HW_REV_TYPE_4965) {
                /* Ant A must be avoided in 5GHz because of an HW bug. */
-               rxchain |= IWN_RXCHAIN_FORCE_SEL(IWN_ANT_BC);
+               rxchain |= IWN_RXCHAIN_FORCE_SEL(IWN_ANT_B);
        } else  /* Use all available RX antennas. */
                rxchain |= IWN_RXCHAIN_FORCE_SEL(sc->rxchainmask);
        hdr->rxchain = htole16(rxchain);
@@ -5172,14 +5171,19 @@ iwn_scan(struct iwn_softc *sc)
        tx->id = sc->broadcast_id;
        tx->lifetime = htole32(IWN_LIFETIME_INFINITE);
 
-       if (IEEE80211_IS_CHAN_A(ic->ic_curchan)) {
+       if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan)) {
                /* Send probe requests at 6Mbps. */
                tx->rate = htole32(0xd);
                rs = &ic->ic_sup_rates[IEEE80211_MODE_11A];
        } else {
                hdr->flags = htole32(IWN_RXON_24GHZ | IWN_RXON_AUTO);
-               /* Send probe requests at 1Mbps. */
-               tx->rate = htole32(10 | IWN_RFLAG_CCK);
+               if (sc->hw_type == IWN_HW_REV_TYPE_4965 &&
+                   sc->rxon.associd && sc->rxon.chan > 14)
+                       tx->rate = htole32(0xd);
+               else {
+                       /* Send probe requests at 1Mbps. */
+                       tx->rate = htole32(10 | IWN_RFLAG_CCK);
+               }
                rs = &ic->ic_sup_rates[IEEE80211_MODE_11G];
        }
        /* Use the first valid TX antenna. */
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to