* Re: [PATCH] mwifiex: module load parameter for interface creation
2014-11-05 14:08 [PATCH] mwifiex: module load parameter for interface creation Avinash Patil
@ 2014-11-05 13:45 ` Johannes Berg
2014-11-05 15:58 ` Avinash Patil
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2014-11-05 13:45 UTC (permalink / raw)
To: Avinash Patil; +Cc: linville, linux-wireless, cluo, yangyang, Amitkumar Karwar
On Wed, 2014-11-05 at 19:38 +0530, Avinash Patil wrote:
> This patch adds module load parameter driver_mode for mwifiex
> which would enable driver to create AP or P2P client interface while loading
> module. driver_mode is bitmap of interface modes for station, AP and
> P2P client.
>
> Station interface is created by default and is unaffected by driver_mode
> parameter.
Not really sure why this would make sense or be needed, you can always
create the interfaces from userspace?
johannes
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] mwifiex: module load parameter for interface creation
@ 2014-11-05 14:08 Avinash Patil
2014-11-05 13:45 ` Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: Avinash Patil @ 2014-11-05 14:08 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, cluo, yangyang, Avinash Patil, Amitkumar Karwar
This patch adds module load parameter driver_mode for mwifiex
which would enable driver to create AP or P2P client interface while loading
module. driver_mode is bitmap of interface modes for station, AP and
P2P client.
Station interface is created by default and is unaffected by driver_mode
parameter.
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
---
drivers/net/wireless/mwifiex/main.c | 32 ++++++++++++++++++++++++++++++++
drivers/net/wireless/mwifiex/main.h | 5 +++++
2 files changed, 37 insertions(+)
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 2a5a59b..2de8a6a 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -28,6 +28,11 @@ const char driver_version[] = "mwifiex " VERSION " (%s) ";
static char *cal_data_cfg;
module_param(cal_data_cfg, charp, 0);
+static unsigned short driver_mode;
+module_param(driver_mode, ushort, 0);
+MODULE_PARM_DESC(driver_mode,
+ "station=0x1(default), ap-sta=0x3, station-p2p=0x5, ap-sta-p2p=0x7");
+
/*
* This function registers the device and performs all the necessary
* initializations.
@@ -449,6 +454,11 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
goto err_init_fw;
}
+ if (driver_mode) {
+ driver_mode &= MWIFIEX_DRIVER_MODE_BITMASK;
+ driver_mode |= MWIFIEX_DRIVER_MODE_STA;
+ }
+
rtnl_lock();
/* Create station interface by default */
wdev = mwifiex_add_virtual_intf(adapter->wiphy, "mlan%d",
@@ -458,6 +468,28 @@ static void mwifiex_fw_dpc(const struct firmware *firmware, void *context)
rtnl_unlock();
goto err_add_intf;
}
+
+ if (driver_mode & MWIFIEX_DRIVER_MODE_UAP) {
+ wdev = mwifiex_add_virtual_intf(adapter->wiphy, "uap%d",
+ NL80211_IFTYPE_AP, NULL, NULL);
+ if (IS_ERR(wdev)) {
+ dev_err(adapter->dev, "cannot create AP interface\n");
+ rtnl_unlock();
+ goto err_add_intf;
+ }
+ }
+
+ if (driver_mode & MWIFIEX_DRIVER_MODE_P2P) {
+ wdev = mwifiex_add_virtual_intf(adapter->wiphy, "p2p%d",
+ NL80211_IFTYPE_P2P_CLIENT, NULL,
+ NULL);
+ if (IS_ERR(wdev)) {
+ dev_err(adapter->dev,
+ "cannot create p2p client interface\n");
+ rtnl_unlock();
+ goto err_add_intf;
+ }
+ }
rtnl_unlock();
mwifiex_drv_get_driver_version(adapter, fmt, sizeof(fmt) - 1);
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 5feaffb..1038cf8 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -48,6 +48,11 @@ enum {
MWIFIEX_SYNC_CMD
};
+#define MWIFIEX_DRIVER_MODE_STA BIT(0)
+#define MWIFIEX_DRIVER_MODE_UAP BIT(1)
+#define MWIFIEX_DRIVER_MODE_P2P BIT(2)
+#define MWIFIEX_DRIVER_MODE_BITMASK (BIT(0) | BIT(1) | BIT(2))
+
#define MWIFIEX_MAX_AP 64
#define MWIFIEX_DEFAULT_WATCHDOG_TIMEOUT (5 * HZ)
--
1.8.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH] mwifiex: module load parameter for interface creation
2014-11-05 13:45 ` Johannes Berg
@ 2014-11-05 15:58 ` Avinash Patil
0 siblings, 0 replies; 3+ messages in thread
From: Avinash Patil @ 2014-11-05 15:58 UTC (permalink / raw)
To: Johannes Berg
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org, Cathy Luo,
Marc Yang, Amitkumar Karwar
Hi Johannes,
Customer does not wish to add interface manually using iw or other tools. So we have provided option to load driver with module parameters to meet this requirement.
For all other cases, where default driver_mode is 0x1 behavior remains unchanged.
Thanks,
Avinash
________________________________________
From: Johannes Berg [johannes@sipsolutions.net]
Sent: Wednesday, November 05, 2014 7:15 PM
To: Avinash Patil
Cc: linville@tuxdriver.com; linux-wireless@vger.kernel.org; Cathy Luo; Marc Yang; Amitkumar Karwar
Subject: Re: [PATCH] mwifiex: module load parameter for interface creation
On Wed, 2014-11-05 at 19:38 +0530, Avinash Patil wrote:
> This patch adds module load parameter driver_mode for mwifiex
> which would enable driver to create AP or P2P client interface while loading
> module. driver_mode is bitmap of interface modes for station, AP and
> P2P client.
>
> Station interface is created by default and is unaffected by driver_mode
> parameter.
Not really sure why this would make sense or be needed, you can always
create the interfaces from userspace?
johannes
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-11-05 16:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-05 14:08 [PATCH] mwifiex: module load parameter for interface creation Avinash Patil
2014-11-05 13:45 ` Johannes Berg
2014-11-05 15:58 ` Avinash Patil
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.