linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Maya Erez <qca_merez@qca.qualcomm.com>
Cc: Lior David <qca_liord@qca.qualcomm.com>,
	linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com
Subject: Re: [PATCH 2/2] wil6210: add module parameter for alternate interface name
Date: Wed, 23 Mar 2016 17:27:48 +0200	[thread overview]
Message-ID: <87y499dxjf.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1458590472-677-3-git-send-email-qca_merez@qca.qualcomm.com> (Maya Erez's message of "Mon, 21 Mar 2016 22:01:12 +0200")

Maya Erez <qca_merez@qca.qualcomm.com> writes:

> From: Lior David <qca_liord@qca.qualcomm.com>
>
> Add a module parameter alt_ifname that when set, will name
> the primary network interface wigig<N> instead of the default
> wlan<N>. This helps platforms such as android where we need to
> clearly separate the WIGIG interface from the default wireless
> interface.
>
> Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
> Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
> ---
>  drivers/net/wireless/ath/wil6210/netdev.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/wil6210/netdev.c b/drivers/net/wireless/ath/wil6210/netdev.c
> index 3bc0e26..f78ea91 100644
> --- a/drivers/net/wireless/ath/wil6210/netdev.c
> +++ b/drivers/net/wireless/ath/wil6210/netdev.c
> @@ -14,10 +14,15 @@
>   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
>   */
>  
> +#include <linux/moduleparam.h>
>  #include <linux/etherdevice.h>
>  #include "wil6210.h"
>  #include "txrx.h"
>  
> +static bool alt_ifname; /* = false; */
> +module_param(alt_ifname, bool, S_IRUGO);
> +MODULE_PARM_DESC(alt_ifname, " use an alternate interface name wigigN instead of wlanN");
> +
>  static int wil_open(struct net_device *ndev)
>  {
>  	struct wil6210_priv *wil = ndev_to_wil(ndev);
> @@ -136,6 +141,7 @@ void *wil_if_alloc(struct device *dev)
>  	struct wil6210_priv *wil;
>  	struct ieee80211_channel *ch;
>  	int rc = 0;
> +	const char *ifname = alt_ifname ? "wigig%d" : "wlan%d";
>  
>  	wdev = wil_cfg80211_init(dev);
>  	if (IS_ERR(wdev)) {
> @@ -160,7 +166,7 @@ void *wil_if_alloc(struct device *dev)
>  	ch = wdev->wiphy->bands[IEEE80211_BAND_60GHZ]->channels;
>  	cfg80211_chandef_create(&wdev->preset_chandef, ch, NL80211_CHAN_NO_HT);
>  
> -	ndev = alloc_netdev(0, "wlan%d", NET_NAME_UNKNOWN, wil_dev_setup);
> +	ndev = alloc_netdev(0, ifname, NET_NAME_UNKNOWN, wil_dev_setup);
>  	if (!ndev) {
>  		dev_err(dev, "alloc_netdev_mqs failed\n");
>  		rc = -ENOMEM;

To me this looks like an ugly hack and I hope there is a better way to
handle the problem this patch is fixing. I think interface names
shouldn't matter from functionality point of view, anything requiring
certain naming is broken.

But if the interface name is so important why not use "wigig%d" always?
The user space can rename the interface name anyway.

-- 
Kalle Valo

  reply	other threads:[~2016-03-23 15:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-21 20:01 [PATCH 0/2] wil6210 changes Maya Erez
2016-03-21 20:01 ` [PATCH 1/2] wil6210: allow empty WMI commands in debugfs wmi_send Maya Erez
2016-04-04 15:04   ` Kalle Valo
2016-03-21 20:01 ` [PATCH 2/2] wil6210: add module parameter for alternate interface name Maya Erez
2016-03-23 15:27   ` Kalle Valo [this message]
2016-03-24 10:04     ` Lior David
2016-03-30 12:13       ` Kalle Valo
     [not found]         ` <56FFA3D0.7080603@codeaurora.org>
2016-04-02 14:54           ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y499dxjf.fsf@kamboji.qca.qualcomm.com \
    --to=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=qca_liord@qca.qualcomm.com \
    --cc=qca_merez@qca.qualcomm.com \
    --cc=wil6210@qca.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).