PERFORCE change 124440 for review
Andrew Thompson
thompsa at FreeBSD.org
Tue Jul 31 21:46:04 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=124440
Change 124440 by thompsa at thompsa_heff on 2007/07/31 21:46:02
Drop in the latest state of the ipw changes. The driver still has
stability problems.
Affected files ...
.. //depot/projects/wifi/sys/dev/ipw/if_ipw.c#24 edit
.. //depot/projects/wifi/sys/dev/ipw/if_ipwreg.h#5 edit
.. //depot/projects/wifi/sys/dev/ipw/if_ipwvar.h#7 edit
Differences ...
==== //depot/projects/wifi/sys/dev/ipw/if_ipw.c#24 (text+ko) ====
@@ -1,5 +1,3 @@
-/* $FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.29 2007/07/05 15:06:49 avatar Exp $ */
-
/*-
* Copyright (c) 2004-2006
* Damien Bergamini <damien.bergamini at free.fr>. All rights reserved.
@@ -83,7 +81,7 @@
#ifdef IPW_DEBUG
#define DPRINTF(x) do { if (ipw_debug > 0) printf x; } while (0)
#define DPRINTFN(n, x) do { if (ipw_debug >= (n)) printf x; } while (0)
-int ipw_debug = 4;
+int ipw_debug = 40;
SYSCTL_INT(_debug, OID_AUTO, ipw, CTLFLAG_RW, &ipw_debug, 0, "ipw debug level");
#else
#define DPRINTF(x)
@@ -347,6 +345,7 @@
c->ic_ieee = i;
}
}
+ DPRINTF(("%s: added %d channels\n", __func__, ic->ic_nchans));
/* check support for radio transmitter switch in EEPROM */
if (!(ipw_read_prom_word(sc, IPW_EEPROM_RADIO) & 8))
@@ -931,6 +930,8 @@
*/
if (sc->flags & IPW_FLAG_ASSOCIATED)
ieee80211_beacon_miss(ic);
+
+ sc->sc_state_timer = 3; /* fw is still alive */
break;
case IPW_STATE_SCAN_COMPLETE:
@@ -952,7 +953,6 @@
/* Only update the scan module if we were actaully scanning */
if (sc->fw_state == IPW_FW_SCANNING) {
- sc->sc_scan_timer = 0;
sc->flags &= ~IPW_FLAG_SCANNING;
IPW_STATE_END(sc, IPW_FW_SCANNING);
ieee80211_scan_done(ic);
@@ -1697,8 +1697,8 @@
sc->sc_rfkill_timer = 2;
}
}
- if (sc->sc_scan_timer > 0) {
- if (--sc->sc_scan_timer == 0) {
+ if (sc->sc_state_timer > 0) {
+ if (--sc->sc_state_timer == 0) {
if (sc->flags & IPW_FLAG_SCANNING) {
if_printf(ifp, "scan stuck\n");
taskqueue_enqueue(sc->sc_tq, &sc->sc_restarttask);
@@ -2033,7 +2033,11 @@
*
* XXX should get from lladdr instead of arpcom but that's more work
*/
- /* XXX _SET_MAC_ADDRESS */
+ DPRINTF(("Setting MAC address to %6D\n", ic->ic_myaddr, ":"));
+ error = ipw_cmd(sc, IPW_CMD_SET_MAC_ADDRESS, ic->ic_myaddr,
+ IEEE80211_ADDR_LEN);
+ if (error != 0)
+ return error;
config.flags = htole32(IPW_CFG_BSS_MASK | IPW_CFG_IBSS_MASK |
IPW_CFG_PREAMBLE_AUTO | IPW_CFG_802_1x_ENABLE);
@@ -2100,16 +2104,7 @@
if (error != 0)
return error;
-#ifdef IPW_DEBUG
- if (ipw_debug > 0) {
- printf("Setting ESSID to ");
- ieee80211_print_essid(ic->ic_des_ssid[0].ssid,
- ic->ic_des_ssid[0].len);
- printf("\n");
- }
-#endif
- error = ipw_cmd(sc, IPW_CMD_SET_ESSID, ic->ic_des_ssid[0].ssid,
- ic->ic_des_ssid[0].len);
+ error = ipw_setbssid(sc, NULL);
if (error != 0)
return error;
@@ -2180,6 +2175,7 @@
DPRINTF(("%s: flags 0x%x\n", __func__, sc->flags));
IPW_STATE_BEGIN(sc, IPW_FW_SCANNING);
+ sc->flags |= IPW_FLAG_SCANNING | IPW_FLAG_HACK;
/* NB: IPW_SCAN_DO_NOT_ASSOCIATE does not work (we set it anyway) */
error = ipw_setscanopts(sc, sc->chanmask, IPW_SCAN_DO_NOT_ASSOCIATE);
@@ -2196,13 +2192,6 @@
goto done;
/*
- * With 100ms/channel dwell time and a max of 14 channels
- * 5 seconds is generous.
- */
- sc->sc_scan_timer = 5; /* secs to complete */
- sc->flags |= IPW_FLAG_SCANNING | IPW_FLAG_HACK;
-
- /*
* NB: the adapter may be disabled on association lost;
* if so just re-enable it to kick off scanning.
*/
@@ -2214,9 +2203,8 @@
error = ipw_enable(sc);
done:
if (error != 0) {
- sc->sc_scan_timer = 0;
sc->flags &= ~(IPW_FLAG_SCANNING | IPW_FLAG_HACK);
- IPW_STATE_BEGIN(sc, IPW_FW_SCANNING);
+ IPW_STATE_END(sc, IPW_FW_SCANNING);
}
return (error);
}
@@ -2424,7 +2412,7 @@
* get us going again.
*/
if (ic->ic_roaming != IEEE80211_ROAMING_MANUAL || force)
- ieee80211_new_state(ic, IEEE80211_S_SCAN, -1);
+ ieee80211_new_state(ic, IEEE80211_S_SCAN, 0);
} else
ieee80211_new_state(ic, IEEE80211_S_RUN, -1);
@@ -2467,8 +2455,9 @@
sc->sc_tx_timer = 0;
sc->sc_rfkill_timer = 0;
- sc->sc_scan_timer = 0;
+ sc->sc_state_timer = 0;
sc->flags &= ~(IPW_FLAG_SCANNING | IPW_FLAG_ASSOCIATED);
+ sc->fw_state = IPW_FW_IDLE;
ieee80211_new_state(ic, IEEE80211_S_INIT, -1);
}
==== //depot/projects/wifi/sys/dev/ipw/if_ipwreg.h#5 (text+ko) ====
==== //depot/projects/wifi/sys/dev/ipw/if_ipwvar.h#7 (text+ko) ====
@@ -174,7 +174,6 @@
int sc_tx_timer;
int sc_rfkill_timer;/* poll for rfkill change */
- int sc_scan_timer; /* scan request timeout */
int sc_state_timer;
#define IPW_SCAN_START (1 << 0)
More information about the p4-projects
mailing list