Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Apr 2008 23:30:37 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 139484 for review
Message-ID:  <200804062330.m36NUbIO034141@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=139484

Change 139484 by sam@sam_ebb on 2008/04/06 23:29:52

	Handle beacon miss: we cannot use the 802.11 layer to do the
	right thing; instead we need to tell the firmware to disassociate
	so we clear state and on completion we then kick the state machine.

Affected files ...

.. //depot/projects/vap/sys/dev/iwi/if_iwi.c#20 edit
.. //depot/projects/vap/sys/dev/iwi/if_iwivar.h#13 edit

Differences ...

==== //depot/projects/vap/sys/dev/iwi/if_iwi.c#20 (text+ko) ====

@@ -157,7 +157,6 @@
 static uint16_t	iwi_read_prom_word(struct iwi_softc *, uint8_t);
 static void	iwi_frame_intr(struct iwi_softc *, struct iwi_rx_data *, int,
 		    struct iwi_frame *);
-static void	iwi_bmiss(void *, int);
 static void	iwi_authsuccess(void *, int);
 static void	iwi_assocsuccess(void *, int);
 static void	iwi_assocfailed(void *, int);
@@ -371,8 +370,6 @@
 
 	iwi_wme_init(sc);
 
-	TASK_INIT(&sc->sc_bmiss_task, 0, iwi_bmiss, ic);
-
 	ifp->if_softc = sc;
 	if_initname(ifp, device_get_name(dev), device_get_unit(dev));
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
@@ -1392,14 +1389,7 @@
 /*
  * Task queue callbacks for iwi_notification_intr used to avoid LOR's.
  */
-static void
-iwi_bmiss(void *arg, int npending)
-{
-	struct ieee80211com *ic = arg;
 
-	ieee80211_beacon_miss(ic);
-}
-
 static void
 iwi_authsuccess(void *arg, int npending)
 {
@@ -1519,6 +1509,7 @@
 			    &IWI_VAP(vap)->iwi_assocsuccess_task);
 			break;
 		case IWI_ASSOC_INIT:
+			sc->flags &= ~IWI_FLAG_ASSOCIATED;
 			switch (sc->fw_state) {
 			case IWI_FW_ASSOCIATING:
 				DPRINTFN(2, ("Association failed\n"));
@@ -1530,10 +1521,10 @@
 			case IWI_FW_DISASSOCIATING:
 				DPRINTFN(2, ("Dissassociated\n"));
 				IWI_STATE_END(sc, IWI_FW_DISASSOCIATING);
-				/* XXX what next? */
+				taskqueue_enqueue(taskqueue_swi,
+				    &IWI_VAP(vap)->iwi_assocfailed_task);
 				break;
 			}
-			sc->flags &= ~IWI_FLAG_ASSOCIATED;
 			break;
 		default:
 			device_printf(sc->sc_dev,
@@ -1561,8 +1552,15 @@
 				DPRINTF(("Beacon miss: %u >= %u\n",
 				    le32toh(beacon->number),
 				    vap->iv_bmissthreshold));
-				taskqueue_enqueue(taskqueue_swi,
-				    &sc->sc_bmiss_task);
+				/*
+				 * It's pointless to notify the 802.11 layer
+				 * as it'll try to send a probe request (which
+				 * we'll discard) and then timeout and drop us
+				 * into scan state.  Instead tell the firmware
+				 * to disassociate and then on completion we'll
+				 * kick the state machine to scan.
+				 */
+				iwi_queue_cmd(sc, IWI_DISASSOC, 1);
 			}
 		}
 		break;

==== //depot/projects/vap/sys/dev/iwi/if_iwivar.h#13 (text+ko) ====

@@ -198,7 +198,6 @@
 	struct task		sc_scanaborttask;	/* cancel active scan */
 	struct task		sc_restarttask;	/* restart adapter processing */
 	struct task		sc_opstask;	/* scan / auth processing */
-	struct task		sc_bmiss_task;	/* beacon miss processing */
 
 	unsigned int		sc_softled : 1,	/* enable LED gpio status */
 				sc_ledstate: 1,	/* LED on/off state */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804062330.m36NUbIO034141>