From patchwork Sat Nov 19 12:39:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 126568 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id AA7B9B7235 for ; Sat, 19 Nov 2011 23:41:32 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 4D1E89D1E4; Sat, 19 Nov 2011 07:41:30 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sUMRRTXAGv35; Sat, 19 Nov 2011 07:41:30 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 1199F9C202; Sat, 19 Nov 2011 07:41:13 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 0BDC09C1FF for ; Sat, 19 Nov 2011 07:41:12 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hrjB5mVAW25S for ; Sat, 19 Nov 2011 07:41:07 -0500 (EST) Received: from sipsolutions.net (he.sipsolutions.net [78.46.109.217]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 52C599C152 for ; Sat, 19 Nov 2011 07:41:07 -0500 (EST) Received: by sipsolutions.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.77) (envelope-from ) id 1RRkEE-0002cB-9Q for hostap@lists.shmoo.com; Sat, 19 Nov 2011 13:41:06 +0100 Message-Id: <20111119123949.681759399@sipsolutions.net> User-Agent: quilt/0.48-1 Date: Sat, 19 Nov 2011 13:39:11 +0100 From: Johannes Berg To: hostap@lists.shmoo.com Subject: [PATCH v3 01/15] driver_nl80211: move preq NL handle into BSS References: <20111119123910.783418920@sipsolutions.net> Content-Disposition: inline; filename=0001-driver_nl80211-move-preq-NL-handle-into-BSS.patch Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: Johannes Berg Signed-hostap: Johannes Berg --- src/drivers/driver_nl80211.c | 24 +++++++++++++----------- 1 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index f42011a..a3b0e0e 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -167,6 +167,8 @@ struct i802_bss { unsigned int beacon_set:1; unsigned int added_if_into_bridge:1; unsigned int added_bridge:1; + + struct nl80211_handles nl_preq; }; struct wpa_driver_nl80211_data { @@ -187,7 +189,7 @@ struct wpa_driver_nl80211_data { int scan_complete_events; - struct nl80211_handles nl_event, nl_preq; + struct nl80211_handles nl_event; u8 auth_bssid[ETH_ALEN]; u8 bssid[ETH_ALEN]; @@ -2542,7 +2544,7 @@ static void wpa_driver_nl80211_deinit(void *priv) close(drv->eapol_tx_sock); #endif /* CONFIG_AP */ - if (drv->nl_preq.handle) + if (bss->nl_preq.handle) wpa_driver_nl80211_probe_req_report(bss, 0); if (bss->added_if_into_bridge) { if (linux_br_del_if(drv->global->ioctl_sock, bss->brname, @@ -7047,37 +7049,37 @@ static int wpa_driver_nl80211_probe_req_report(void *priv, int report) struct wpa_driver_nl80211_data *drv = bss->drv; if (!report) { - if (drv->nl_preq.handle) { + if (bss->nl_preq.handle) { eloop_unregister_read_sock( - nl_socket_get_fd(drv->nl_preq.handle)); - nl_destroy_handles(&drv->nl_preq); + nl_socket_get_fd(bss->nl_preq.handle)); + nl_destroy_handles(&bss->nl_preq); } return 0; } - if (drv->nl_preq.handle) { + if (bss->nl_preq.handle) { wpa_printf(MSG_DEBUG, "nl80211: Probe Request reporting " "already on!"); return 0; } - if (nl_create_handles(&drv->nl_preq, drv->global->nl_cb, "preq")) + if (nl_create_handles(&bss->nl_preq, drv->global->nl_cb, "preq")) return -1; - if (nl80211_register_frame(drv, drv->nl_preq.handle, + if (nl80211_register_frame(drv, bss->nl_preq.handle, (WLAN_FC_TYPE_MGMT << 2) | (WLAN_FC_STYPE_PROBE_REQ << 4), NULL, 0) < 0) goto out_err; - eloop_register_read_sock(nl_socket_get_fd(drv->nl_preq.handle), + eloop_register_read_sock(nl_socket_get_fd(bss->nl_preq.handle), wpa_driver_nl80211_event_receive, drv, - drv->nl_preq.handle); + bss->nl_preq.handle); return 0; out_err: - nl_destroy_handles(&drv->nl_preq); + nl_destroy_handles(&bss->nl_preq); return -1; }