From owner-svn-src-head@freebsd.org Sun Feb 28 23:48:35 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 9F83FAB754E; Sun, 28 Feb 2016 23:48:35 +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 6E0A01243; Sun, 28 Feb 2016 23:48:35 +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 u1SNmYHR016134; Sun, 28 Feb 2016 23:48:34 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1SNmYAS016133; Sun, 28 Feb 2016 23:48:34 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201602282348.u1SNmYAS016133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 28 Feb 2016 23:48:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296170 - 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: Sun, 28 Feb 2016 23:48:35 -0000 Author: avos Date: Sun Feb 28 23:48:34 2016 New Revision: 296170 URL: https://svnweb.freebsd.org/changeset/base/296170 Log: net80211: remove redundant locking. All callers of ieee80211_promisc()/ieee80211_allmulti() (ieee80211_vap_detach(), ieee80211_ioctl(), ap_start() and ap_end()) already hold the com_lock while calling them. Tested with RTL8188EU, STA mode. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D5475 Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sun Feb 28 23:35:03 2016 (r296169) +++ head/sys/net80211/ieee80211.c Sun Feb 28 23:48:34 2016 (r296170) @@ -714,7 +714,8 @@ ieee80211_promisc(struct ieee80211vap *v (vap->iv_caps & IEEE80211_C_TDMA) == 0))) return; - IEEE80211_LOCK(ic); + IEEE80211_LOCK_ASSERT(ic); + if (on) { if (++ic->ic_promisc == 1) ieee80211_runtask(ic, &ic->ic_promisc_task); @@ -724,7 +725,6 @@ ieee80211_promisc(struct ieee80211vap *v if (--ic->ic_promisc == 0) ieee80211_runtask(ic, &ic->ic_promisc_task); } - IEEE80211_UNLOCK(ic); } /* @@ -736,7 +736,8 @@ ieee80211_allmulti(struct ieee80211vap * { struct ieee80211com *ic = vap->iv_ic; - IEEE80211_LOCK(ic); + IEEE80211_LOCK_ASSERT(ic); + if (on) { if (++ic->ic_allmulti == 1) ieee80211_runtask(ic, &ic->ic_mcast_task); @@ -746,7 +747,6 @@ ieee80211_allmulti(struct ieee80211vap * if (--ic->ic_allmulti == 0) ieee80211_runtask(ic, &ic->ic_mcast_task); } - IEEE80211_UNLOCK(ic); } /*