From owner-p4-projects@FreeBSD.ORG Fri Apr 11 06:07:25 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 57A671065685; Fri, 11 Apr 2008 06:07:25 +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 1A5EF1065683 for ; Fri, 11 Apr 2008 06:07:25 +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 1019D8FC0C for ; Fri, 11 Apr 2008 06:07:25 +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 m3B67OHI032976 for ; Fri, 11 Apr 2008 06:07:24 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m3B67OXq032965 for perforce@freebsd.org; Fri, 11 Apr 2008 06:07:24 GMT (envelope-from sam@freebsd.org) Date: Fri, 11 Apr 2008 06:07:24 GMT Message-Id: <200804110607.m3B67OXq032965@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 139781 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: Fri, 11 Apr 2008 06:07:25 -0000 http://perforce.freebsd.org/chv.cgi?CH=139781 Change 139781 by sam@sam_ebb on 2008/04/11 06:07:07 o bounce beacon miss through a taskqueue to eliminate a LOR o hookup radio on/off to net80211 Affected files ... .. //depot/projects/vap/sys/dev/iwn/if_iwn.c#9 edit .. //depot/projects/vap/sys/dev/iwn/if_iwnvar.h#6 edit Differences ... ==== //depot/projects/vap/sys/dev/iwn/if_iwn.c#9 (text+kox) ==== @@ -130,6 +130,7 @@ void iwn_rx_statistics(struct iwn_softc *, struct iwn_rx_desc *); void iwn_tx_intr(struct iwn_softc *, struct iwn_rx_desc *); void iwn_cmd_intr(struct iwn_softc *, struct iwn_rx_desc *); +static void iwn_bmiss(void *, int); void iwn_notif_intr(struct iwn_softc *); void iwn_intr(void *); void iwn_read_eeprom(struct iwn_softc *); @@ -300,7 +301,8 @@ taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", device_get_nameunit(dev)); - TASK_INIT(&sc->sc_opstask, 0, iwn_ops, sc ); + TASK_INIT(&sc->sc_ops_task, 0, iwn_ops, sc ); + TASK_INIT(&sc->sc_bmiss_task, 0, iwn_bmiss, sc); /* * Put adapter into a known state. @@ -1647,6 +1649,15 @@ wakeup(&ring->cmd[desc->idx]); } +static void +iwn_bmiss(void *arg, int npending) +{ + struct iwn_softc *sc = arg; + struct ieee80211com *ic = sc->sc_ifp->if_l2com; + + ieee80211_beacon_miss(ic); +} + void iwn_notif_intr(struct iwn_softc *sc) { @@ -1707,7 +1718,8 @@ if (vap->iv_state == IEEE80211_S_RUN && misses > 5) (void) iwn_init_sensitivity(sc); if (misses >= vap->iv_bmissthreshold) - ieee80211_beacon_miss(ic); + taskqueue_enqueue(taskqueue_swi, + &sc->sc_bmiss_task); break; } case IWN_UC_READY: { @@ -1808,7 +1820,6 @@ iwn_queue_cmd(sc, IWN_RADIO_ENABLE, 0, IWN_QUEUE_CLEAR); else iwn_queue_cmd(sc, IWN_RADIO_DISABLE, 0, IWN_QUEUE_CLEAR); - } if (r1 & IWN_CT_REACHED) device_printf(sc->sc_dev, "critical temperature reached!\n"); @@ -4445,6 +4456,7 @@ break; iwn_stop_locked(sc); iwn_init(sc); + ieee80211_notify_radio(ic, 1); break; case IWN_RADIO_ENABLE: KASSERT(sc->fw_fp != NULL, @@ -4452,6 +4464,7 @@ iwn_init(sc); break; case IWN_RADIO_DISABLE: + ieee80211_notify_radio(ic, 0); iwn_stop_locked(sc); break; } @@ -4486,7 +4499,7 @@ sc->sc_cmd_arg[sc->sc_cmd_next] = arg; sc->sc_cmd_next = (sc->sc_cmd_next + 1) % IWN_CMD_MAXOPS; } - taskqueue_enqueue(sc->sc_tq, &sc->sc_opstask); + taskqueue_enqueue(sc->sc_tq, &sc->sc_ops_task); IWN_CMD_UNLOCK(sc); return 0; } ==== //depot/projects/vap/sys/dev/iwn/if_iwnvar.h#6 (text+kox) ==== @@ -204,7 +204,8 @@ struct taskqueue *sc_tq; /* Main command task queue */ /* Tasks used by the driver */ - struct task sc_opstask; /* operation handling task */ + struct task sc_ops_task; /* deferred ops */ + struct task sc_bmiss_task; /* beacon miss */ /* Thermal calibration */ int calib_cnt;