aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath6kl/cfg80211.c
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>2012-04-09 09:33:58 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2012-04-09 11:25:56 -0400
commitdf90b36940019a879d08bc5e8a20daa0c9fe0122 (patch)
tree0be946d8ad4042097b20295cfc806ae6d10a1c5d /drivers/net/wireless/ath/ath6kl/cfg80211.c
parentbed56e313ada1d25d16e4101677c8f75eda78c60 (diff)
ath6kl: Configure htcap in fw based on the channel type in AP mode
This patch disables HT in start_ap if the type of the channel on which the AP mode is going to be operating is non-HT. HT is enabled with default ht cap setting if the operating channel is going to be 11n. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl/cfg80211.c')
-rw-r--r--drivers/net/wireless/ath/ath6kl/cfg80211.c77
1 files changed, 56 insertions, 21 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 1229ce96ba90..900993017d09 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -2424,31 +2424,25 @@ void ath6kl_check_wow_status(struct ath6kl *ar)
2424} 2424}
2425#endif 2425#endif
2426 2426
2427static int ath6kl_set_channel(struct wiphy *wiphy, struct net_device *dev, 2427static int ath6kl_set_htcap(struct ath6kl_vif *vif, enum ieee80211_band band,
2428 struct ieee80211_channel *chan, 2428 bool ht_enable)
2429 enum nl80211_channel_type channel_type)
2430{ 2429{
2431 struct ath6kl_vif *vif; 2430 struct ath6kl_htcap *htcap = &vif->htcap;
2432
2433 /*
2434 * 'dev' could be NULL if a channel change is required for the hardware
2435 * device itself, instead of a particular VIF.
2436 *
2437 * FIXME: To be handled properly when monitor mode is supported.
2438 */
2439 if (!dev)
2440 return -EBUSY;
2441
2442 vif = netdev_priv(dev);
2443 2431
2444 if (!ath6kl_cfg80211_ready(vif)) 2432 if (htcap->ht_enable == ht_enable)
2445 return -EIO; 2433 return 0;
2446 2434
2447 ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: center_freq=%u hw_value=%u\n", 2435 if (ht_enable) {
2448 __func__, chan->center_freq, chan->hw_value); 2436 /* Set default ht capabilities */
2449 vif->next_chan = chan->center_freq; 2437 htcap->ht_enable = true;
2438 htcap->cap_info = (band == IEEE80211_BAND_2GHZ) ?
2439 ath6kl_g_htcap : ath6kl_a_htcap;
2440 htcap->ampdu_factor = IEEE80211_HT_MAX_AMPDU_16K;
2441 } else /* Disable ht */
2442 memset(htcap, 0, sizeof(*htcap));
2450 2443
2451 return 0; 2444 return ath6kl_wmi_set_htcap_cmd(vif->ar->wmi, vif->fw_vif_idx,
2445 band, htcap);
2452} 2446}
2453 2447
2454static bool ath6kl_is_p2p_ie(const u8 *pos) 2448static bool ath6kl_is_p2p_ie(const u8 *pos)
@@ -2525,6 +2519,35 @@ static int ath6kl_set_ies(struct ath6kl_vif *vif,
2525 return 0; 2519 return 0;
2526} 2520}
2527 2521
2522static int ath6kl_set_channel(struct wiphy *wiphy, struct net_device *dev,
2523 struct ieee80211_channel *chan,
2524 enum nl80211_channel_type channel_type)
2525{
2526 struct ath6kl_vif *vif;
2527
2528 /*
2529 * 'dev' could be NULL if a channel change is required for the hardware
2530 * device itself, instead of a particular VIF.
2531 *
2532 * FIXME: To be handled properly when monitor mode is supported.
2533 */
2534 if (!dev)
2535 return -EBUSY;
2536
2537 vif = netdev_priv(dev);
2538
2539 if (!ath6kl_cfg80211_ready(vif))
2540 return -EIO;
2541
2542 ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "%s: center_freq=%u hw_value=%u\n",
2543 __func__, chan->center_freq, chan->hw_value);
2544 vif->next_chan = chan->center_freq;
2545 vif->next_ch_type = channel_type;
2546 vif->next_ch_band = chan->band;
2547
2548 return 0;
2549}
2550
2528static int ath6kl_start_ap(struct wiphy *wiphy, struct net_device *dev, 2551static int ath6kl_start_ap(struct wiphy *wiphy, struct net_device *dev,
2529 struct cfg80211_ap_settings *info) 2552 struct cfg80211_ap_settings *info)
2530{ 2553{
@@ -2673,6 +2696,10 @@ static int ath6kl_start_ap(struct wiphy *wiphy, struct net_device *dev,
2673 return res; 2696 return res;
2674 } 2697 }
2675 2698
2699 if (ath6kl_set_htcap(vif, vif->next_ch_band,
2700 vif->next_ch_type != NL80211_CHAN_NO_HT))
2701 return -EIO;
2702
2676 res = ath6kl_wmi_ap_profile_commit(ar->wmi, vif->fw_vif_idx, &p); 2703 res = ath6kl_wmi_ap_profile_commit(ar->wmi, vif->fw_vif_idx, &p);
2677 if (res < 0) 2704 if (res < 0)
2678 return res; 2705 return res;
@@ -2707,6 +2734,13 @@ static int ath6kl_stop_ap(struct wiphy *wiphy, struct net_device *dev)
2707 ath6kl_wmi_disconnect_cmd(ar->wmi, vif->fw_vif_idx); 2734 ath6kl_wmi_disconnect_cmd(ar->wmi, vif->fw_vif_idx);
2708 clear_bit(CONNECTED, &vif->flags); 2735 clear_bit(CONNECTED, &vif->flags);
2709 2736
2737 /* Restore ht setting in firmware */
2738 if (ath6kl_set_htcap(vif, IEEE80211_BAND_2GHZ, true))
2739 return -EIO;
2740
2741 if (ath6kl_set_htcap(vif, IEEE80211_BAND_5GHZ, true))
2742 return -EIO;
2743
2710 return 0; 2744 return 0;
2711} 2745}
2712 2746
@@ -3252,6 +3286,7 @@ struct net_device *ath6kl_interface_add(struct ath6kl *ar, char *name,
3252 vif->next_mode = nw_type; 3286 vif->next_mode = nw_type;
3253 vif->listen_intvl_t = ATH6KL_DEFAULT_LISTEN_INTVAL; 3287 vif->listen_intvl_t = ATH6KL_DEFAULT_LISTEN_INTVAL;
3254 vif->bmiss_time_t = ATH6KL_DEFAULT_BMISS_TIME; 3288 vif->bmiss_time_t = ATH6KL_DEFAULT_BMISS_TIME;
3289 vif->htcap.ht_enable = true;
3255 3290
3256 memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN); 3291 memcpy(ndev->dev_addr, ar->mac_addr, ETH_ALEN);
3257 if (fw_vif_idx != 0) 3292 if (fw_vif_idx != 0)