From patchwork Thu Jan 5 14:38:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 90025 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp8998276qgi; Thu, 5 Jan 2017 06:38:36 -0800 (PST) X-Received: by 10.84.234.1 with SMTP id m1mr127026475plk.155.1483627116437; Thu, 05 Jan 2017 06:38:36 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z21si76095081pgi.50.2017.01.05.06.38.36; Thu, 05 Jan 2017 06:38:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032545AbdAEOif (ORCPT + 1 other); Thu, 5 Jan 2017 09:38:35 -0500 Received: from mail-wj0-f181.google.com ([209.85.210.181]:35562 "EHLO mail-wj0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752524AbdAEOid (ORCPT ); Thu, 5 Jan 2017 09:38:33 -0500 Received: by mail-wj0-f181.google.com with SMTP id i20so36096384wjn.2 for ; Thu, 05 Jan 2017 06:38:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=Sgw0hB3MYg25YCMP0pAkj4bDvlbEo0+6UqHl5ntYsE0=; b=W57z47u9EiVqdVDjypd2X8OP0/tExlmMydhw5SSXopMCzjxWFoUNMMV7jArHdUcKW+ /Zw1y4yfk15oQW0Fl1SJ9/N4ZSCt0I/HJ3ZWM7MlWe+EvvP31nAFaRUVfE5FP4wZls5F /XPmfK1KK5qKiJkH/GSkPzWbyB8kYrjfFi6vs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=Sgw0hB3MYg25YCMP0pAkj4bDvlbEo0+6UqHl5ntYsE0=; b=oQGbTcFvwZ8xRaOIR2N/k6lmbQmNdxmX269yYgVj6CO7p0IeqDYQ1t2FJFFKKOHS32 Bh1H82xLYyI4E15JGBbhJ77kofII2MbwUKmVHhhsag9fYbr4cwqaaaFqY0oQ0WOQFdLu elDaxx5Zo5I0opZgg1LMdtFdgkpRlEYdOussMAEOpUfj3s5Ag3++BiEZBy6x666ZBGsy WmenkmWsoxRaGovIAUo7IrKEtKg6AAx0RmB7mL92C3sAdowmWwzeJBbmuagqvyO7r2sg rNXEmYFL7ghtEc2A06v3cxYbPWby37rwCmG9QOh33NMab6h+t4xgbTo7Ydj+b+IApZ4z Smlg== X-Gm-Message-State: AIkVDXJWryNXtv8H6/HqvZHoPXVq0Fud9j8YvaVotgms+Jf84VJYBO4ED06pDMzD/iuEVvCq X-Received: by 10.194.43.73 with SMTP id u9mr60801439wjl.109.1483627111621; Thu, 05 Jan 2017 06:38:31 -0800 (PST) Received: from [192.168.1.240] (178.red-79-157-58.dynamicip.rima-tde.net. [79.157.58.178]) by smtp.gmail.com with ESMTPSA id cl6sm104042313wjc.10.2017.01.05.06.38.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jan 2017 06:38:30 -0800 (PST) Subject: Re: SIOCSIWFREQ while in NL80211_IFTYPE_STATION To: Johannes Berg , netdev@vger.kernel.org, Daniel Lezcano References: <685811c3-6247-77fd-8c70-617951886451@linaro.org> <1483616301.4394.6.camel@sipsolutions.net> <92e60cb2-8bb4-df03-3434-4a055f575df0@linaro.org> <1483625204.4394.23.camel@sipsolutions.net> Cc: linux-wireless From: Jorge Ramirez Message-ID: Date: Thu, 5 Jan 2017 15:38:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1483625204.4394.23.camel@sipsolutions.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 01/05/2017 03:06 PM, Johannes Berg wrote: >> I am not sure it matters - if I understood your reply, there is no >> valid use case to change the frequency in that mode (and all that >> code should be removed); > All of wext *is* being removed - slowly :) > It's not longer default in the kernel configuration now. ah thanks for the info. I should have checked! > > IIRC, there actually was a valid use case here - to set the frequency > before you set the SSID - to be able to force a connection on that > channel with wext. ok, yes I thought this would make sense. > >> it seems to me that it is also your view that userspace (iwconfig) >> should be fixed accordingly to not call the extensions? > iwconfig should just be deleted and iw be used :-) understood. > >> I am just trying to understand how the current code is supposed to >> work by exercising widely available user-space tools while debugging >> the kernel. > Heh, ok. > >> Actually the frequency gets programmed without errors when reverting >> your commit http://tinyurl.com/ho4urp8 (which comes as a surprise as >> well). > Well, it's not my commit, but that makes sense. I suppose we should > treat this as a regression, but reverting that doesn't seem like the > right fix. Actually, I'm not convinced we should do monitor channel > change anyway when you set the frequency with wext, so we can probably > just remove that call there - want to send a patch to that effect? do you mean this? [jramirez@igloo ~ (debian-qcom-dragonboard410c-16.09-local $)]$ git diff I tested the change above: we can now modify the channel/frequency when the SSID is not set in managed mode. When the SSID is set however iwconfig does not report any error but channel/frequency doesn't change. if you think this is acceptable I can submit a patch > johannes diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c index a4e8af3..c56bac5 100644 --- a/net/wireless/wext-sme.c +++ b/net/wireless/wext-sme.c @@ -106,30 +106,7 @@ int cfg80211_mgd_wext_siwfreq(struct net_device *dev, goto out; } - wdev->wext.connect.channel = chan; - - /* - * SSID is not set, we just want to switch monitor channel, - * this is really just backward compatibility, if the SSID - * is set then we use the channel to select the BSS to use - * to connect to instead. If we were connected on another - * channel we disconnected above and reconnect below. - */ - if (chan && !wdev->wext.connect.ssid_len) { - struct cfg80211_chan_def chandef = { - .width = NL80211_CHAN_WIDTH_20_NOHT, - .center_freq1 = freq, - }; - - chandef.chan = ieee80211_get_channel(&rdev->wiphy, freq); - if (chandef.chan) - err = cfg80211_set_monitor_channel(rdev, &chandef); - else - err = -EINVAL; - goto out; - } - err = cfg80211_mgd_wext_connect(rdev, wdev); out: wdev_unlock(wdev);