From patchwork Thu Mar 31 18:53:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz.Dziedzic@tieto.com X-Patchwork-Id: 604252 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qbYZs2BYxz9sC3 for ; Fri, 1 Apr 2016 05:54:13 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=tieto.com header.i=@tieto.com header.b=po2QQARf; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1alhjF-0002g2-3W; Thu, 31 Mar 2016 18:54:01 +0000 Received: from mail-lf0-x22a.google.com ([2a00:1450:4010:c07::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1alhjA-0002dM-JD for hostap@lists.infradead.org; Thu, 31 Mar 2016 18:53:57 +0000 Received: by mail-lf0-x22a.google.com with SMTP id p188so38721810lfd.0 for ; Thu, 31 Mar 2016 11:53:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=+DZjGQk+AzEkcza15UEDqChOTzUIYcJNjDHENUcbs/I=; b=po2QQARfanvv5a71ko15Yn6uzCAI2mLrENpxD+4JXXUhhZEy3KTrRqW5SD0yDDHnaj uz9FY3rUF/CSSAs30DDeMLzFWbu9AsEVC/EicpeZnv8cHIpopOhCVGqSPj6rlNdNeiKx yVTDOF+Rje4hog38L7ja42qz9RLOpQXepMGSk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+DZjGQk+AzEkcza15UEDqChOTzUIYcJNjDHENUcbs/I=; b=W3P4U461jZ0VwQH3Q8y1xudU6Rw2HP8WW+sptmMIKvmeLJ+pRZolBCQfSbqU1ZzMUh mvJpoSiCcpXkYfT5GpCWMPQi/a8gjk0KGh34vtOcD2jp8tExli0uUkxqNtrjRjyjY4Tf 8vYH6iqZiaOh9TneDjy0kdKPrICdtT3D71P5WCZ/t+57MH5ipozkmPwA6CBFcuzjAfTs 5iJSVhgqwe5Re4rujrxUVPNqZvNr0iLU0pAaZBgziIuhJxf4Tdhv0agexjUL4Tx9XuNo s0SOoQVhPZsqVpPjpkloAzVgepPH/drGfmkK0C6yDrRDKHNeI2sv6GkmMeedTCliZ2tg i5cg== X-Gm-Message-State: AD7BkJKiN2AfTjBVqxD2y9szC8VGEf7rqJG2F4jAsm0o76R9w0bUQiCnei2J/p0xtq6T8y6rV4LuTCmV3vVZJk0ajtlWK018mMAquH67xCrhFQ/m/pKiU7XlBG2s/mmPhVxbAECkKO6U6O/FHkzazxZHlcwVPWGoRZFnpIUNjfCZvZMrP2Dj0/Ve0XC236CmB0RF X-Received: by 10.25.82.203 with SMTP id g194mr206098lfb.1.1459450412053; Thu, 31 Mar 2016 11:53:32 -0700 (PDT) Received: from dell6430.wifi.local (host-62-141-193-85.swidnica.mm.pl. [62.141.193.85]) by smtp.gmail.com with ESMTPSA id m187sm1588419lfg.3.2016.03.31.11.53.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 Mar 2016 11:53:31 -0700 (PDT) From: Janusz Dziedzic To: hostap@lists.infradead.org Subject: [PATCH] wpa_supplicant: send event to all interfaces Date: Thu, 31 Mar 2016 20:53:14 +0200 Message-Id: <1459450394-19120-1-git-send-email-janusz.dziedzic@tieto.com> X-Mailer: git-send-email 1.9.1 X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160331_115357_035249_6DCD30AC X-CRM114-Status: GOOD ( 10.50 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:4010:c07:0:0:0:22a listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: j@w1.fi, Janusz Dziedzic MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org In case we don't have ifidx and wdev_id pass such event to all interfaces and bss. Before we send event only to first interface and in case we are using p2p-dev we send event only to this one iface: p2p-dev-wlan0: CTRL-EVENT-REGDOM-CHANGE init=CORE type=WORLD Because of that we fail hwsim test cases eg. ibss_5ghz, while we never get CTRL-EVENT-REGDOM-CHANGE on wlan0. I also remove for_each() from wpa_supplicant_update_channel_list() while this function will be called now for each interface. So, seems this for_each() was a workaround for a real issue. Signed-off-by: Janusz Dziedzic --- Now, seems we pass test where we wait for REGDOM event janusz@dell6430:/home/work/hostap/tests/remote$ ./run-tests.py -r hwsim0 -r hwsim1 -r hwsim2 -d hwsim3 -d hwsim4 -h ibss_5ghz DUT: hwsim3 DUT: hwsim4 REF: hwsim0 REF: hwsim1 REF: hwsim2 RUN check_devices PASS START - ibss_5ghz (1/1) PASS () - 21.613292s src/drivers/driver_nl80211_event.c | 10 ++++++++-- wpa_supplicant/events.c | 15 +++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c index bd16edb..5220fc2 100644 --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c @@ -2240,9 +2240,15 @@ int process_global_event(struct nl_msg *msg, void *arg) dl_list_for_each_safe(drv, tmp, &global->interfaces, struct wpa_driver_nl80211_data, list) { + /* Send to all interfaces and bss */ + if ((ifidx == -1 && !wdev_id_set)) { + for (bss = drv->first_bss; bss; bss = bss->next) + do_process_drv_event(bss, gnlh->cmd, tb); + continue; + } + /* Send to one bss */ for (bss = drv->first_bss; bss; bss = bss->next) { - if ((ifidx == -1 && !wdev_id_set) || - ifidx == bss->ifindex || + if (ifidx == bss->ifindex || (wdev_id_set && bss->wdev_id_set && wdev_id == bss->wdev_id)) { do_process_drv_event(bss, gnlh->cmd, tb); diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 3c3f626..2399520 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -3159,8 +3159,6 @@ static const char * reg_type_str(enum reg_type type) static void wpa_supplicant_update_channel_list( struct wpa_supplicant *wpa_s, struct channel_list_changed *info) { - struct wpa_supplicant *ifs; - wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_REGDOM_CHANGE "init=%s type=%s%s%s", reg_init_str(info->initiator), reg_type_str(info->type), info->alpha2[0] ? " alpha2=" : "", @@ -3169,14 +3167,11 @@ static void wpa_supplicant_update_channel_list( if (wpa_s->drv_priv == NULL) return; /* Ignore event during drv initialization */ - dl_list_for_each(ifs, &wpa_s->radio->ifaces, struct wpa_supplicant, - radio_list) { - wpa_printf(MSG_DEBUG, "%s: Updating hw mode", - ifs->ifname); - free_hw_features(ifs); - ifs->hw.modes = wpa_drv_get_hw_feature_data( - ifs, &ifs->hw.num_modes, &ifs->hw.flags); - } + wpa_printf(MSG_DEBUG, "%s: Updating hw mode", + wpa_s->ifname); + free_hw_features(wpa_s); + wpa_s->hw.modes = wpa_drv_get_hw_feature_data( + wpa_s, &wpa_s->hw.num_modes, &wpa_s->hw.flags); /* Restart sched_scan with updated channel list */ if (wpa_s->sched_scanning) {