From owner-svn-src-head@freebsd.org Mon Feb 29 21:03:56 2016 Return-Path: Delivered-To: svn-src-head@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 06228AB7560; Mon, 29 Feb 2016 21:03:56 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 D4B761E05; Mon, 29 Feb 2016 21:03:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1TL3sYA092935; Mon, 29 Feb 2016 21:03:54 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1TL3sjW092934; Mon, 29 Feb 2016 21:03:54 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201602292103.u1TL3sjW092934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 29 Feb 2016 21:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296235 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Feb 2016 21:03:56 -0000 Author: avos Date: Mon Feb 29 21:03:54 2016 New Revision: 296235 URL: https://svnweb.freebsd.org/changeset/base/296235 Log: net80211: cleanup ieee80211_scan_sw.c Make it look more consistently. No functional changes. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5152 Modified: head/sys/net80211/ieee80211_scan_sw.c Modified: head/sys/net80211/ieee80211_scan_sw.c ============================================================================== --- head/sys/net80211/ieee80211_scan_sw.c Mon Feb 29 21:00:10 2016 (r296234) +++ head/sys/net80211/ieee80211_scan_sw.c Mon Feb 29 21:03:54 2016 (r296235) @@ -54,17 +54,18 @@ __FBSDID("$FreeBSD$"); struct scan_state { struct ieee80211_scan_state base; /* public state */ - u_int ss_iflags; /* flags used internally */ -#define ISCAN_MINDWELL 0x0001 /* min dwell time reached */ -#define ISCAN_DISCARD 0x0002 /* discard rx'd frames */ -#define ISCAN_CANCEL 0x0004 /* cancel current scan */ -#define ISCAN_ABORT 0x0008 /* end the scan immediately */ -#define ISCAN_RUNNING 0x0010 /* scan was started */ - unsigned long ss_chanmindwell; /* min dwell on curchan */ - unsigned long ss_scanend; /* time scan must stop */ - u_int ss_duration; /* duration for next scan */ - struct task ss_scan_start; /* scan start */ - struct timeout_task ss_scan_curchan; /* scan execution */ + u_int ss_iflags; /* flags used internally */ +#define ISCAN_MINDWELL 0x0001 /* min dwell time reached */ +#define ISCAN_DISCARD 0x0002 /* discard rx'd frames */ +#define ISCAN_CANCEL 0x0004 /* cancel current scan */ +#define ISCAN_ABORT 0x0008 /* end the scan immediately */ +#define ISCAN_RUNNING 0x0010 /* scan was started */ + + unsigned long ss_chanmindwell; /* min dwell on curchan */ + unsigned long ss_scanend; /* time scan must stop */ + u_int ss_duration; /* duration for next scan */ + struct task ss_scan_start; /* scan start */ + struct timeout_task ss_scan_curchan; /* scan execution */ }; #define SCAN_PRIVATE(ss) ((struct scan_state *) ss) @@ -150,14 +151,13 @@ static void ieee80211_swscan_vdetach(struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; - struct ieee80211_scan_state *ss; + struct ieee80211_scan_state *ss = ic->ic_scan; IEEE80211_LOCK_ASSERT(ic); - ss = ic->ic_scan; - if (ss != NULL && ss->ss_vap == vap) { - if (ic->ic_flags & IEEE80211_F_SCAN) - scan_signal_locked(ss, ISCAN_ABORT); - } + + if (ss != NULL && ss->ss_vap == vap && + (ic->ic_flags & IEEE80211_F_SCAN)) + scan_signal_locked(ss, ISCAN_ABORT); } static void @@ -498,11 +498,10 @@ static void ieee80211_swscan_scan_done(struct ieee80211vap *vap) { struct ieee80211com *ic = vap->iv_ic; - struct ieee80211_scan_state *ss; + struct ieee80211_scan_state *ss = ic->ic_scan; IEEE80211_LOCK_ASSERT(ic); - ss = ic->ic_scan; scan_signal_locked(ss, 0); } @@ -547,17 +546,18 @@ static void scan_curchan(struct ieee80211_scan_state *ss, unsigned long maxdwell) { struct ieee80211vap *vap = ss->ss_vap; + struct ieee80211com *ic = ss->ss_ic; IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN, "%s: calling; maxdwell=%lu\n", __func__, maxdwell); - IEEE80211_LOCK(vap->iv_ic); + IEEE80211_LOCK(ic); if (ss->ss_flags & IEEE80211_SCAN_ACTIVE) ieee80211_probe_curchan(vap, 0); - taskqueue_enqueue_timeout(vap->iv_ic->ic_tq, + taskqueue_enqueue_timeout(ic->ic_tq, &SCAN_PRIVATE(ss)->ss_scan_curchan, maxdwell); - IEEE80211_UNLOCK(vap->iv_ic); + IEEE80211_UNLOCK(ic); } static void