diff options
author | Avinash Patil <patila@marvell.com> | 2012-06-15 15:21:51 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-06-20 14:45:36 -0400 |
commit | 0abd79e5a87319f0710c8db2ef2a2c5c6479c32b (patch) | |
tree | d939ad031862cca6676b3f0423d543e0d5b8bbc4 /drivers/net/wireless/mwifiex | |
parent | 29a6b508569cc1d04884d3140ccb5973dd7d91fa (diff) |
mwifiex: set channel via start_ap handler for AP interface
This patch adds functionality to set channel info received from
cfg80211_ap_settings in start_ap handler.
Since set_channel cfg80211 handler has been removed and we need
not explicitely call mwifiex_uap_set_channel(); hence this
function definition is also removed.
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex')
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 23 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/main.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/uap_cmd.c | 30 |
3 files changed, 17 insertions, 37 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 015fec3371a0..7b4eaf41bfc0 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -384,13 +384,13 @@ mwifiex_set_rf_channel(struct mwifiex_private *priv, | |||
384 | cfp.freq = chan->center_freq; | 384 | cfp.freq = chan->center_freq; |
385 | cfp.channel = ieee80211_frequency_to_channel(chan->center_freq); | 385 | cfp.channel = ieee80211_frequency_to_channel(chan->center_freq); |
386 | 386 | ||
387 | if (mwifiex_bss_set_channel(priv, &cfp)) | 387 | if (priv->bss_type == MWIFIEX_BSS_TYPE_STA) { |
388 | return -EFAULT; | 388 | if (mwifiex_bss_set_channel(priv, &cfp)) |
389 | 389 | return -EFAULT; | |
390 | if (priv->bss_type == MWIFIEX_BSS_TYPE_STA) | ||
391 | return mwifiex_drv_change_adhoc_chan(priv, cfp.channel); | 390 | return mwifiex_drv_change_adhoc_chan(priv, cfp.channel); |
392 | else | 391 | } |
393 | return mwifiex_uap_set_channel(priv, cfp.channel); | 392 | |
393 | return 0; | ||
394 | } | 394 | } |
395 | 395 | ||
396 | /* | 396 | /* |
@@ -961,6 +961,17 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy, | |||
961 | return -EINVAL; | 961 | return -EINVAL; |
962 | } | 962 | } |
963 | 963 | ||
964 | bss_cfg->channel = | ||
965 | (u8)ieee80211_frequency_to_channel(params->channel->center_freq); | ||
966 | bss_cfg->band_cfg = BAND_CONFIG_MANUAL; | ||
967 | |||
968 | if (mwifiex_set_rf_channel(priv, params->channel, | ||
969 | params->channel_type)) { | ||
970 | kfree(bss_cfg); | ||
971 | wiphy_err(wiphy, "Failed to set band config information!\n"); | ||
972 | return -1; | ||
973 | } | ||
974 | |||
964 | if (mwifiex_set_secure_params(priv, bss_cfg, params)) { | 975 | if (mwifiex_set_secure_params(priv, bss_cfg, params)) { |
965 | kfree(bss_cfg); | 976 | kfree(bss_cfg); |
966 | wiphy_err(wiphy, "Failed to parse secuirty parameters!\n"); | 977 | wiphy_err(wiphy, "Failed to parse secuirty parameters!\n"); |
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index 5b32221077c4..512481ea664e 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h | |||
@@ -990,7 +990,6 @@ int mwifiex_set_tx_power(struct mwifiex_private *priv, | |||
990 | 990 | ||
991 | int mwifiex_main_process(struct mwifiex_adapter *); | 991 | int mwifiex_main_process(struct mwifiex_adapter *); |
992 | 992 | ||
993 | int mwifiex_uap_set_channel(struct mwifiex_private *priv, int channel); | ||
994 | int mwifiex_bss_set_channel(struct mwifiex_private *, | 993 | int mwifiex_bss_set_channel(struct mwifiex_private *, |
995 | struct mwifiex_chan_freq_power *cfp); | 994 | struct mwifiex_chan_freq_power *cfp); |
996 | int mwifiex_get_bss_info(struct mwifiex_private *, | 995 | int mwifiex_get_bss_info(struct mwifiex_private *, |
diff --git a/drivers/net/wireless/mwifiex/uap_cmd.c b/drivers/net/wireless/mwifiex/uap_cmd.c index 89f9a2a45de3..fb0c6cbfc277 100644 --- a/drivers/net/wireless/mwifiex/uap_cmd.c +++ b/drivers/net/wireless/mwifiex/uap_cmd.c | |||
@@ -421,33 +421,3 @@ int mwifiex_uap_prepare_cmd(struct mwifiex_private *priv, u16 cmd_no, | |||
421 | 421 | ||
422 | return 0; | 422 | return 0; |
423 | } | 423 | } |
424 | |||
425 | /* This function sets the RF channel for AP. | ||
426 | * | ||
427 | * This function populates channel information in AP config structure | ||
428 | * and sends command to configure channel information in AP. | ||
429 | */ | ||
430 | int mwifiex_uap_set_channel(struct mwifiex_private *priv, int channel) | ||
431 | { | ||
432 | struct mwifiex_uap_bss_param *bss_cfg; | ||
433 | struct wiphy *wiphy = priv->wdev->wiphy; | ||
434 | |||
435 | bss_cfg = kzalloc(sizeof(struct mwifiex_uap_bss_param), GFP_KERNEL); | ||
436 | if (!bss_cfg) | ||
437 | return -ENOMEM; | ||
438 | |||
439 | mwifiex_set_sys_config_invalid_data(bss_cfg); | ||
440 | bss_cfg->band_cfg = BAND_CONFIG_MANUAL; | ||
441 | bss_cfg->channel = channel; | ||
442 | |||
443 | if (mwifiex_send_cmd_async(priv, HostCmd_CMD_UAP_SYS_CONFIG, | ||
444 | HostCmd_ACT_GEN_SET, | ||
445 | UAP_BSS_PARAMS_I, bss_cfg)) { | ||
446 | wiphy_err(wiphy, "Failed to set the uAP channel\n"); | ||
447 | kfree(bss_cfg); | ||
448 | return -1; | ||
449 | } | ||
450 | |||
451 | kfree(bss_cfg); | ||
452 | return 0; | ||
453 | } | ||