From owner-p4-projects@FreeBSD.ORG Sun Apr 6 23:30:38 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 203B41065677; Sun, 6 Apr 2008 23:30:38 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6E281065671 for ; Sun, 6 Apr 2008 23:30:37 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C33F28FC0C for ; Sun, 6 Apr 2008 23:30:37 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m36NUbYT034143 for ; Sun, 6 Apr 2008 23:30:37 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m36NUbIO034141 for perforce@freebsd.org; Sun, 6 Apr 2008 23:30:37 GMT (envelope-from sam@freebsd.org) Date: Sun, 6 Apr 2008 23:30:37 GMT Message-Id: <200804062330.m36NUbIO034141@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 139484 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2008 23:30:38 -0000 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 */