aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/cw1200/sta.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/cw1200/sta.c')
-rw-r--r--drivers/net/wireless/cw1200/sta.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/drivers/net/wireless/cw1200/sta.c b/drivers/net/wireless/cw1200/sta.c
index 4cd0352b508..cd0cad7f775 100644
--- a/drivers/net/wireless/cw1200/sta.c
+++ b/drivers/net/wireless/cw1200/sta.c
@@ -13,6 +13,7 @@
#include <linux/sched.h>
#include <linux/firmware.h>
#include <linux/module.h>
+#include <linux/etherdevice.h>
#include "cw1200.h"
#include "sta.h"
@@ -555,8 +556,8 @@ u64 cw1200_prepare_multicast(struct ieee80211_hw *hw,
pr_debug("[STA] multicast: %pM\n", ha->addr);
memcpy(&priv->multicast_filter.macaddrs[count],
ha->addr, ETH_ALEN);
- if (memcmp(ha->addr, broadcast_ipv4, ETH_ALEN) &&
- memcmp(ha->addr, broadcast_ipv6, ETH_ALEN))
+ if (!ether_addr_equal(ha->addr, broadcast_ipv4) &&
+ !ether_addr_equal(ha->addr, broadcast_ipv6))
priv->has_multicast_subscription = true;
count++;
}
@@ -621,7 +622,7 @@ int cw1200_conf_tx(struct ieee80211_hw *dev, struct ieee80211_vif *vif,
mutex_lock(&priv->conf_mutex);
if (queue < dev->queues) {
- old_uapsd_flags = priv->uapsd_info.uapsd_flags;
+ old_uapsd_flags = le16_to_cpu(priv->uapsd_info.uapsd_flags);
WSM_TX_QUEUE_SET(&priv->tx_queue_params, queue, 0, 0, 0);
ret = wsm_set_tx_queue_params(priv,
@@ -645,7 +646,7 @@ int cw1200_conf_tx(struct ieee80211_hw *dev, struct ieee80211_vif *vif,
ret = cw1200_set_uapsd_param(priv, &priv->edca);
if (!ret && priv->setbssparams_done &&
(priv->join_status == CW1200_JOIN_STATUS_STA) &&
- (old_uapsd_flags != priv->uapsd_info.uapsd_flags))
+ (old_uapsd_flags != le16_to_cpu(priv->uapsd_info.uapsd_flags)))
ret = cw1200_set_pm(priv, &priv->powersave_mode);
}
} else {
@@ -935,7 +936,8 @@ static int __cw1200_flush(struct cw1200_common *priv, bool drop)
return ret;
}
-void cw1200_flush(struct ieee80211_hw *hw, u32 queues, bool drop)
+void cw1200_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+ u32 queues, bool drop)
{
struct cw1200_common *priv = hw->priv;
@@ -1089,18 +1091,18 @@ static int cw1200_parse_sdd_file(struct cw1200_common *priv)
ret = -1;
break;
}
- v = le16_to_cpu(*((u16 *)(p + 2)));
+ v = le16_to_cpu(*((__le16 *)(p + 2)));
if (!v) /* non-zero means this is enabled */
break;
- v = le16_to_cpu(*((u16 *)(p + 4)));
+ v = le16_to_cpu(*((__le16 *)(p + 4)));
priv->conf_listen_interval = (v >> 7) & 0x1F;
pr_debug("PTA found; Listen Interval %d\n",
priv->conf_listen_interval);
break;
}
case SDD_REFERENCE_FREQUENCY_ELT_ID: {
- u16 clk = le16_to_cpu(*((u16 *)(p + 2)));
+ u16 clk = le16_to_cpu(*((__le16 *)(p + 2)));
if (clk != priv->hw_refclk)
pr_warn("SDD file doesn't match configured refclk (%d vs %d)\n",
clk, priv->hw_refclk);
@@ -1406,11 +1408,8 @@ static void cw1200_do_unjoin(struct cw1200_common *priv)
if (!priv->join_status)
goto done;
- if (priv->join_status > CW1200_JOIN_STATUS_IBSS) {
- wiphy_err(priv->hw->wiphy, "Unexpected: join status: %d\n",
- priv->join_status);
- BUG_ON(1);
- }
+ if (priv->join_status == CW1200_JOIN_STATUS_AP)
+ goto done;
cancel_work_sync(&priv->update_filtering_work);
cancel_work_sync(&priv->set_beacon_wakeup_period_work);
@@ -1785,9 +1784,9 @@ static int cw1200_set_btcoexinfo(struct cw1200_common *priv)
} else {
pr_debug("[STA] STA has non ERP rates\n");
/* B only mode */
- arg.internalTxRate = (__ffs(priv->association_mode.basic_rate_set));
+ arg.internalTxRate = (__ffs(le32_to_cpu(priv->association_mode.basic_rate_set)));
}
- arg.nonErpInternalTxRate = (__ffs(priv->association_mode.basic_rate_set));
+ arg.nonErpInternalTxRate = (__ffs(le32_to_cpu(priv->association_mode.basic_rate_set)));
} else {
/* P2P mode */
arg.internalTxRate = (__ffs(priv->bss_params.operational_rate_set & ~0xF));
@@ -1908,7 +1907,7 @@ void cw1200_bss_info_changed(struct ieee80211_hw *dev,
if (info->assoc || info->ibss_joined) {
struct ieee80211_sta *sta = NULL;
- u32 val = 0;
+ __le32 htprot = 0;
if (info->dtim_period)
priv->join_dtim_period = info->dtim_period;
@@ -1935,19 +1934,18 @@ void cw1200_bss_info_changed(struct ieee80211_hw *dev,
/* Non Greenfield stations present */
if (priv->ht_info.operation_mode &
IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT)
- val |= WSM_NON_GREENFIELD_STA_PRESENT;
+ htprot |= cpu_to_le32(WSM_NON_GREENFIELD_STA_PRESENT);
/* Set HT protection method */
- val |= (priv->ht_info.operation_mode & IEEE80211_HT_OP_MODE_PROTECTION) << 2;
+ htprot |= cpu_to_le32((priv->ht_info.operation_mode & IEEE80211_HT_OP_MODE_PROTECTION) << 2);
/* TODO:
* STBC_param.dual_cts
* STBC_param.LSIG_TXOP_FILL
*/
- val = cpu_to_le32(val);
wsm_write_mib(priv, WSM_MIB_ID_SET_HT_PROTECTION,
- &val, sizeof(val));
+ &htprot, sizeof(htprot));
priv->association_mode.greenfield =
cw1200_ht_greenfield(&priv->ht_info);