diff options
author | Sujith Manoharan <Sujith.Manoharan@atheros.com> | 2011-04-27 07:43:40 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-28 14:53:20 -0400 |
commit | e2186b7c25ef9cdb6d631c8dd6a672f41abe22d5 (patch) | |
tree | 68bc5447c806d45a9cd1c26cdf2f83325b06d98c | |
parent | a55bb94aa37782fe9457751a3e508b1129fbbc7a (diff) |
ath9k_htc: Add set_bitrate_mask() callback
This callback is used to set the minimum rate for management
frames.
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_main.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index c8577d5cd0f7..e9746e8ff8dd 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c | |||
@@ -1659,6 +1659,55 @@ static void ath9k_htc_set_coverage_class(struct ieee80211_hw *hw, | |||
1659 | mutex_unlock(&priv->mutex); | 1659 | mutex_unlock(&priv->mutex); |
1660 | } | 1660 | } |
1661 | 1661 | ||
1662 | /* | ||
1663 | * Currently, this is used only for selecting the minimum rate | ||
1664 | * for management frames, rate selection for data frames remain | ||
1665 | * unaffected. | ||
1666 | */ | ||
1667 | static int ath9k_htc_set_bitrate_mask(struct ieee80211_hw *hw, | ||
1668 | struct ieee80211_vif *vif, | ||
1669 | const struct cfg80211_bitrate_mask *mask) | ||
1670 | { | ||
1671 | struct ath9k_htc_priv *priv = hw->priv; | ||
1672 | struct ath_common *common = ath9k_hw_common(priv->ah); | ||
1673 | struct ath9k_htc_target_rate_mask tmask; | ||
1674 | struct ath9k_htc_vif *avp = (void *)vif->drv_priv; | ||
1675 | int ret = 0; | ||
1676 | u8 cmd_rsp; | ||
1677 | |||
1678 | memset(&tmask, 0, sizeof(struct ath9k_htc_target_rate_mask)); | ||
1679 | |||
1680 | tmask.vif_index = avp->index; | ||
1681 | tmask.band = IEEE80211_BAND_2GHZ; | ||
1682 | tmask.mask = cpu_to_be32(mask->control[IEEE80211_BAND_2GHZ].legacy); | ||
1683 | |||
1684 | WMI_CMD_BUF(WMI_BITRATE_MASK_CMDID, &tmask); | ||
1685 | if (ret) { | ||
1686 | ath_err(common, | ||
1687 | "Unable to set 2G rate mask for " | ||
1688 | "interface at idx: %d\n", avp->index); | ||
1689 | goto out; | ||
1690 | } | ||
1691 | |||
1692 | tmask.band = IEEE80211_BAND_5GHZ; | ||
1693 | tmask.mask = cpu_to_be32(mask->control[IEEE80211_BAND_5GHZ].legacy); | ||
1694 | |||
1695 | WMI_CMD_BUF(WMI_BITRATE_MASK_CMDID, &tmask); | ||
1696 | if (ret) { | ||
1697 | ath_err(common, | ||
1698 | "Unable to set 5G rate mask for " | ||
1699 | "interface at idx: %d\n", avp->index); | ||
1700 | goto out; | ||
1701 | } | ||
1702 | |||
1703 | ath_dbg(common, ATH_DBG_CONFIG, | ||
1704 | "Set bitrate masks: 0x%x, 0x%x\n", | ||
1705 | mask->control[IEEE80211_BAND_2GHZ].legacy, | ||
1706 | mask->control[IEEE80211_BAND_5GHZ].legacy); | ||
1707 | out: | ||
1708 | return ret; | ||
1709 | } | ||
1710 | |||
1662 | struct ieee80211_ops ath9k_htc_ops = { | 1711 | struct ieee80211_ops ath9k_htc_ops = { |
1663 | .tx = ath9k_htc_tx, | 1712 | .tx = ath9k_htc_tx, |
1664 | .start = ath9k_htc_start, | 1713 | .start = ath9k_htc_start, |
@@ -1681,4 +1730,5 @@ struct ieee80211_ops ath9k_htc_ops = { | |||
1681 | .set_rts_threshold = ath9k_htc_set_rts_threshold, | 1730 | .set_rts_threshold = ath9k_htc_set_rts_threshold, |
1682 | .rfkill_poll = ath9k_htc_rfkill_poll_state, | 1731 | .rfkill_poll = ath9k_htc_rfkill_poll_state, |
1683 | .set_coverage_class = ath9k_htc_set_coverage_class, | 1732 | .set_coverage_class = ath9k_htc_set_coverage_class, |
1733 | .set_bitrate_mask = ath9k_htc_set_bitrate_mask, | ||
1684 | }; | 1734 | }; |