Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d56b4ae5 authored by Hamad Kadmany's avatar Hamad Kadmany Committed by Alexei Avshalom Lazar
Browse files

wil6210: add module parameter for alternate interface name



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.

Change-Id: Ie1cd3ccf777e84665075bc3b6d9fffa7d897de49
CRs-Fixed: 982931
Signed-off-by: default avatarHamad Kadmany <hkadmany@codeaurora.org>
[merez@codeaurora.org: fix checkpatch errors]
Signed-off-by: default avatarMaya Erez <merez@codeaurora.org>
Signed-off-by: default avatarAlexei Avshalom Lazar <ailizaro@codeaurora.org>
parent 658ae035
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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, 0444);
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);
@@ -114,6 +119,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)) {
@@ -138,7 +144,7 @@ void *wil_if_alloc(struct device *dev)
	ch = wdev->wiphy->bands[NL80211_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;