diff options
author | Avinash Patil <patila@marvell.com> | 2015-01-28 11:12:03 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-01-29 09:20:15 +0100 |
commit | cf0523350c6f12bdffb06c7000326edb296ec450 (patch) | |
tree | 49ca6819ec53fa2a68b3dc21faf4cb5e146c2dd7 /drivers/net/wireless/mwifiex/main.h | |
parent | mwifiex: add init parameter to init command routine (diff) | |
download | linux-cf0523350c6f12bdffb06c7000326edb296ec450.tar.xz linux-cf0523350c6f12bdffb06c7000326edb296ec450.zip |
mwifiex: manage virtual interface limits efficiently
Currently interface limits are checked by seeing if bss_mode for
particular priv is set. If bss_mode is not set, interface creation
is allowed. This patch adds framework to initializes maximum virtual
interfaces supported during load time and check current number of
interfaces created agains allowed interface limit during new virtual
interface creation.
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/mwifiex/main.h')
-rw-r--r-- | drivers/net/wireless/mwifiex/main.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index 9686bd8603c8..78304a714512 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h @@ -730,6 +730,8 @@ struct mwifiex_if_ops { struct mwifiex_adapter { u8 iface_type; + struct mwifiex_iface_comb iface_limit; + struct mwifiex_iface_comb curr_iface_comb; struct mwifiex_private *priv[MWIFIEX_MAX_BSS_NUM]; u8 priv_num; const struct firmware *firmware; @@ -1150,6 +1152,25 @@ mwifiex_get_priv(struct mwifiex_adapter *adapter, } /* + * This function returns the first available unused private structure pointer. + */ +static inline struct mwifiex_private * +mwifiex_get_unused_priv(struct mwifiex_adapter *adapter) +{ + int i; + + for (i = 0; i < adapter->priv_num; i++) { + if (adapter->priv[i]) { + if (adapter->priv[i]->bss_mode == + NL80211_IFTYPE_UNSPECIFIED) + break; + } + } + + return ((i < adapter->priv_num) ? adapter->priv[i] : NULL); +} + +/* * This function returns the driver private structure of a network device. */ static inline struct mwifiex_private * |