From owner-svn-src-all@FreeBSD.ORG Fri Feb 13 21:45:20 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59815106566B; Fri, 13 Feb 2009 21:45:20 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D0598FC14; Fri, 13 Feb 2009 21:45:20 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1DLjKvf000104; Fri, 13 Feb 2009 21:45:20 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1DLjK2i000103; Fri, 13 Feb 2009 21:45:20 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200902132145.n1DLjK2i000103@svn.freebsd.org> From: Andrew Thompson Date: Fri, 13 Feb 2009 21:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188601 - head/sys/dev/usb2/wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2009 21:45:20 -0000 Author: thompsa Date: Fri Feb 13 21:45:19 2009 New Revision: 188601 URL: http://svn.freebsd.org/changeset/base/188601 Log: - ieee80211_chan2ieee returns an int - set ic_update_promisc to the same callback as mcast - avoid null deref in zyd_detach Obtained from: //depot/projects/usb Modified: head/sys/dev/usb2/wlan/if_zyd2.c Modified: head/sys/dev/usb2/wlan/if_zyd2.c ============================================================================== --- head/sys/dev/usb2/wlan/if_zyd2.c Fri Feb 13 20:57:43 2009 (r188600) +++ head/sys/dev/usb2/wlan/if_zyd2.c Fri Feb 13 21:45:19 2009 (r188601) @@ -104,7 +104,7 @@ static struct ieee80211_node *zyd_node_a const uint8_t mac[IEEE80211_ADDR_LEN]); static int zyd_newstate(struct ieee80211vap *, enum ieee80211_state, int); static int zyd_cmd(struct zyd_softc *, uint16_t, const void *, int, - void *, int, u_int); + void *, int, int); static int zyd_read16(struct zyd_softc *, uint16_t, uint16_t *); static int zyd_read32(struct zyd_softc *, uint16_t, uint32_t *); static int zyd_write16(struct zyd_softc *, uint16_t, uint16_t); @@ -419,6 +419,7 @@ zyd_attach_post(struct usb2_proc_msg *pm ic->ic_vap_create = zyd_vap_create; ic->ic_vap_delete = zyd_vap_delete; ic->ic_update_mcast = zyd_update_mcast; + ic->ic_update_promisc = zyd_update_mcast; bpfattach(ifp, DLT_IEEE802_11_RADIO, sizeof(struct ieee80211_frame) + sizeof(sc->sc_txtap)); @@ -440,7 +441,7 @@ zyd_detach(device_t dev) { struct zyd_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic; /* wait for any post attach or other command to complete */ usb2_proc_drain(&sc->sc_tq); @@ -453,6 +454,7 @@ zyd_detach(device_t dev) zyd_unsetup_tx_list(sc); if (ifp) { + ic = ifp->if_l2com; bpfdetach(ifp); ieee80211_ifdetach(ic); if_free(ifp); @@ -810,7 +812,7 @@ tr_setup: static int zyd_cmd(struct zyd_softc *sc, uint16_t code, const void *idata, int ilen, - void *odata, int olen, u_int flags) + void *odata, int olen, int flags) { struct zyd_cmd cmd; struct zyd_rq rq; @@ -1260,7 +1262,7 @@ zyd_al2230_bandedge6(struct zyd_rf *rf, struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct zyd_phy_pair r[] = ZYD_AL2230_PHY_BANDEDGE6; - u_int chan = ieee80211_chan2ieee(ic, c); + int chan = ieee80211_chan2ieee(ic, c); if (chan == 1 || chan == 11) r[0].val = 0x12; @@ -2085,7 +2087,7 @@ zyd_set_chan(struct zyd_softc *sc, struc struct ieee80211com *ic = ifp->if_l2com; struct zyd_rf *rf = &sc->sc_rf; uint32_t tmp; - u_int chan; + int chan; chan = ieee80211_chan2ieee(ic, c); if (chan == 0 || chan == IEEE80211_CHAN_ANY) {