From owner-freebsd-wireless@FreeBSD.ORG Fri Jul 27 19:33:14 2012 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FAD910657CE for ; Fri, 27 Jul 2012 19:33:14 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-gh0-f182.google.com (mail-gh0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id EC6F48FC0C for ; Fri, 27 Jul 2012 19:33:13 +0000 (UTC) Received: by ghbz22 with SMTP id z22so4243721ghb.13 for ; Fri, 27 Jul 2012 12:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=g0f6Rf7dG9c6QHfcziANhkqZBC1qvpltpteWyJlph1w=; b=xrHumGP8U/VdJmdNm2lz+gCBXFzZC8sjQPm6csFRs7+BIMU+4wxD+IVltAve/OXKuy amyqc/iKl2wvSHEsR0zHpTZq9QIuz1eJrfykjH5qU8yi0N71AfX0lRUIiEutIsObQDYN 2m/DDe4g0W0X4uVb8yeTYT2Naq4v1WV+aRatB82pV8JTp4zbeU9GsJH+hpdXeO2gR8Y8 uUIxyksy15PtgGPIJyV8rvyQLVl3cl01JA13ZLvldmlE3UWoHC60SDu9f3/mPB8p/oyh It79GKeaXDcPdl+KEoFKSTVN++19+fdoaKeo57hM7c/xMkPNK5dT6AiWkuKIU2/BHENK FWiQ== MIME-Version: 1.0 Received: by 10.66.73.70 with SMTP id j6mr7847908pav.5.1343417593074; Fri, 27 Jul 2012 12:33:13 -0700 (PDT) Received: by 10.68.66.136 with HTTP; Fri, 27 Jul 2012 12:33:13 -0700 (PDT) In-Reply-To: References: Date: Fri, 27 Jul 2012 12:33:13 -0700 Message-ID: From: Adrian Chadd To: Kim Culhan Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org Subject: Re: ath lor X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2012 19:33:14 -0000 .. hm, so. This is quite annoying, really. ieee80211_iterate_nodes() is called from hostap_newstate() to do a bunch of things, including: * calling sta_diassoc() on each STA; * handling CSA for each STA (for DFS channel change) via sta_csa(); * dropping stations when doing a CSA (via sta_drop()); Now, at this point the _newstate() routine has the comlock (IEEE80211_LOCK()) held. So, any function that is passed to ieee80211_iterate_nodes() that also tries to grab the comlock is going to silently fail. It may _be_ that the only sensible thing to do here is to force the comlock is held before calling ieee80211_iterate_nodes(), and then update all the functions that it calls to require the comlock be held. So, that'd currently be (in net80211, ignoring what are in drivers atm): * sta_leave() * load_ucastkey() * sta_disassoc() * sta_csa() * sta_drop() * get_sta_space() * get_sta_info() * domlme() * mesh_vdetach_peers() * mesh_checkid() * get_adhoc_rssi() * get_hostap_rssi() * get_mesh_rssi() .. and that's kind of scary, because a lot of those will call into the driver and do things like transmit frames; and we absolutely can't hold the comlock when doing that or all kinds of bad LORs will occur. Fixing this is going to take a little more time/patience. I'm open to other ideas/suggestions on this. Adrian