From owner-svn-src-all@freebsd.org Tue Sep 8 07:50:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 722669CC9C1; Tue, 8 Sep 2015 07:50:36 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6358E1C5C; Tue, 8 Sep 2015 07:50:36 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t887oa9S058369; Tue, 8 Sep 2015 07:50:36 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t887oZXx058367; Tue, 8 Sep 2015 07:50:35 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201509080750.t887oZXx058367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Tue, 8 Sep 2015 07:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r287552 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 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: Tue, 08 Sep 2015 07:50:36 -0000 Author: kevlo Date: Tue Sep 8 07:50:35 2015 New Revision: 287552 URL: https://svnweb.freebsd.org/changeset/base/287552 Log: - Remove empty key_update_* functions. - Hide "struct ieee80211_node *" -> "struct run_node *" casting behind RUN_NODE() macro. - Simplify IEEE80211_HAS_ADDR4 macro definition - Fix a comment (desn't -> doesn't) Submitted by: Andriy Voskoboinyk Differential Revision: https://reviews.freebsd.org/D3588 Modified: head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_runvar.h Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Tue Sep 8 07:15:10 2015 (r287551) +++ head/sys/dev/usb/wlan/if_run.c Tue Sep 8 07:50:35 2015 (r287552) @@ -88,8 +88,7 @@ SYSCTL_INT(_hw_usb_run, OID_AUTO, debug, "run debug level"); #endif -#define IEEE80211_HAS_ADDR4(wh) \ - (((wh)->i_fc[1] & IEEE80211_FC1_DIR_MASK) == IEEE80211_FC1_DIR_DSTODS) +#define IEEE80211_HAS_ADDR4(wh) IEEE80211_IS_DSTODS(wh) /* * Because of LOR in run_key_delete(), use atomic instead. @@ -382,8 +381,6 @@ static int run_media_change(struct ifnet static int run_newstate(struct ieee80211vap *, enum ieee80211_state, int); static int run_wme_update(struct ieee80211com *); static void run_wme_update_cb(void *); -static void run_key_update_begin(struct ieee80211vap *); -static void run_key_update_end(struct ieee80211vap *); static void run_key_set_cb(void *); static int run_key_set(struct ieee80211vap *, struct ieee80211_key *, const uint8_t mac[IEEE80211_ADDR_LEN]); @@ -926,8 +923,6 @@ run_vap_create(struct ieee80211com *ic, return (NULL); } - vap->iv_key_update_begin = run_key_update_begin; - vap->iv_key_update_end = run_key_update_end; vap->iv_update_beacon = run_update_beacon; vap->iv_max_aid = RT2870_WCID_MAX; /* @@ -2002,7 +1997,7 @@ run_media_change(struct ifnet *ifp) if (rt2860_rates[ridx].rate == rate) break; ni = ieee80211_ref_node(vap->iv_bss); - rn = (struct run_node *)ni; + rn = RUN_NODE(ni); rn->fix_ridx = ridx; DPRINTF("rate=%d, fix_ridx=%d\n", rate, rn->fix_ridx); ieee80211_free_node(ni); @@ -2227,27 +2222,11 @@ run_wme_update(struct ieee80211com *ic) run_wme_update_cb(ic); RUN_UNLOCK(sc); - /* return whatever, upper layer desn't care anyway */ + /* return whatever, upper layer doesn't care anyway */ return (0); } static void -run_key_update_begin(struct ieee80211vap *vap) -{ - /* - * To avoid out-of-order events, both run_key_set() and - * _delete() are deferred and handled by run_cmdq_cb(). - * So, there is nothing we need to do here. - */ -} - -static void -run_key_update_end(struct ieee80211vap *vap) -{ - /* null */ -} - -static void run_key_set_cb(void *arg) { struct run_cmdq *cmdq = arg; @@ -2576,7 +2555,7 @@ run_iter_func(void *arg, struct ieee8021 { struct run_softc *sc = arg; struct ieee80211vap *vap = ni->ni_vap; - struct run_node *rn = (void *)ni; + struct run_node *rn = RUN_NODE(ni); union run_stats sta[2]; uint16_t (*wstat)[3]; int txcnt, success, retrycnt, error; @@ -2650,7 +2629,7 @@ run_newassoc_cb(void *arg) static void run_newassoc(struct ieee80211_node *ni, int isnew) { - struct run_node *rn = (void *)ni; + struct run_node *rn = RUN_NODE(ni); struct ieee80211_rateset *rs = &ni->ni_rates; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = vap->iv_ic; @@ -3243,7 +3222,7 @@ run_tx(struct run_softc *sc, struct mbuf struct ieee80211_frame *wh; struct ieee80211_channel *chan; const struct ieee80211_txparam *tp; - struct run_node *rn = (void *)ni; + struct run_node *rn = RUN_NODE(ni); struct run_tx_data *data; struct rt2870_txd *txd; struct rt2860_txwi *txwi; @@ -3407,7 +3386,7 @@ static int run_tx_mgt(struct run_softc *sc, struct mbuf *m, struct ieee80211_node *ni) { struct ieee80211com *ic = &sc->sc_ic; - struct run_node *rn = (void *)ni; + struct run_node *rn = RUN_NODE(ni); struct run_tx_data *data; struct ieee80211_frame *wh; struct rt2870_txd *txd; Modified: head/sys/dev/usb/wlan/if_runvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_runvar.h Tue Sep 8 07:15:10 2015 (r287551) +++ head/sys/dev/usb/wlan/if_runvar.h Tue Sep 8 07:50:35 2015 (r287552) @@ -101,6 +101,7 @@ struct run_node { uint8_t mgt_ridx; uint8_t fix_ridx; }; +#define RUN_NODE(ni) ((struct run_node *)(ni)) struct run_cmdq { void *arg0;