Commit 5e74b3aa authored by Eliad Peller's avatar Eliad Peller Committed by John W. Linville

wlcore/wl18xx/wl12xx: convert bitmaps to unsigned longs

The *_bit operations expect unsigned longs.
Instead of casting the pointers, simply define various
bitmaps as unsigned long (instead of u32).
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 9bccb8ae
...@@ -1668,7 +1668,7 @@ static bool wl12xx_lnk_high_prio(struct wl1271 *wl, u8 hlid, ...@@ -1668,7 +1668,7 @@ static bool wl12xx_lnk_high_prio(struct wl1271 *wl, u8 hlid,
{ {
u8 thold; u8 thold;
if (test_bit(hlid, (unsigned long *)&wl->fw_fast_lnk_map)) if (test_bit(hlid, &wl->fw_fast_lnk_map))
thold = wl->conf.tx.fast_link_thold; thold = wl->conf.tx.fast_link_thold;
else else
thold = wl->conf.tx.slow_link_thold; thold = wl->conf.tx.slow_link_thold;
......
...@@ -1609,7 +1609,7 @@ static bool wl18xx_lnk_high_prio(struct wl1271 *wl, u8 hlid, ...@@ -1609,7 +1609,7 @@ static bool wl18xx_lnk_high_prio(struct wl1271 *wl, u8 hlid,
u8 thold; u8 thold;
struct wl18xx_fw_status_priv *status_priv = struct wl18xx_fw_status_priv *status_priv =
(struct wl18xx_fw_status_priv *)wl->fw_status->priv; (struct wl18xx_fw_status_priv *)wl->fw_status->priv;
u32 suspend_bitmap; unsigned long suspend_bitmap;
/* if we don't have the link map yet, assume they all low prio */ /* if we don't have the link map yet, assume they all low prio */
if (!status_priv) if (!status_priv)
...@@ -1617,12 +1617,12 @@ static bool wl18xx_lnk_high_prio(struct wl1271 *wl, u8 hlid, ...@@ -1617,12 +1617,12 @@ static bool wl18xx_lnk_high_prio(struct wl1271 *wl, u8 hlid,
/* suspended links are never high priority */ /* suspended links are never high priority */
suspend_bitmap = le32_to_cpu(status_priv->link_suspend_bitmap); suspend_bitmap = le32_to_cpu(status_priv->link_suspend_bitmap);
if (test_bit(hlid, (unsigned long *)&suspend_bitmap)) if (test_bit(hlid, &suspend_bitmap))
return false; return false;
/* the priority thresholds are taken from FW */ /* the priority thresholds are taken from FW */
if (test_bit(hlid, (unsigned long *)&wl->fw_fast_lnk_map) && if (test_bit(hlid, &wl->fw_fast_lnk_map) &&
!test_bit(hlid, (unsigned long *)&wl->ap_fw_ps_map)) !test_bit(hlid, &wl->ap_fw_ps_map))
thold = status_priv->tx_fast_link_prio_threshold; thold = status_priv->tx_fast_link_prio_threshold;
else else
thold = status_priv->tx_slow_link_prio_threshold; thold = status_priv->tx_slow_link_prio_threshold;
...@@ -1636,17 +1636,17 @@ static bool wl18xx_lnk_low_prio(struct wl1271 *wl, u8 hlid, ...@@ -1636,17 +1636,17 @@ static bool wl18xx_lnk_low_prio(struct wl1271 *wl, u8 hlid,
u8 thold; u8 thold;
struct wl18xx_fw_status_priv *status_priv = struct wl18xx_fw_status_priv *status_priv =
(struct wl18xx_fw_status_priv *)wl->fw_status->priv; (struct wl18xx_fw_status_priv *)wl->fw_status->priv;
u32 suspend_bitmap; unsigned long suspend_bitmap;
/* if we don't have the link map yet, assume they all low prio */ /* if we don't have the link map yet, assume they all low prio */
if (!status_priv) if (!status_priv)
return true; return true;
suspend_bitmap = le32_to_cpu(status_priv->link_suspend_bitmap); suspend_bitmap = le32_to_cpu(status_priv->link_suspend_bitmap);
if (test_bit(hlid, (unsigned long *)&suspend_bitmap)) if (test_bit(hlid, &suspend_bitmap))
thold = status_priv->tx_suspend_threshold; thold = status_priv->tx_suspend_threshold;
else if (test_bit(hlid, (unsigned long *)&wl->fw_fast_lnk_map) && else if (test_bit(hlid, &wl->fw_fast_lnk_map) &&
!test_bit(hlid, (unsigned long *)&wl->ap_fw_ps_map)) !test_bit(hlid, &wl->ap_fw_ps_map))
thold = status_priv->tx_fast_stop_threshold; thold = status_priv->tx_fast_stop_threshold;
else else
thold = status_priv->tx_slow_stop_threshold; thold = status_priv->tx_slow_stop_threshold;
......
...@@ -496,7 +496,7 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf, ...@@ -496,7 +496,7 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
DRIVER_STATE_PRINT_INT(sg_enabled); DRIVER_STATE_PRINT_INT(sg_enabled);
DRIVER_STATE_PRINT_INT(enable_11a); DRIVER_STATE_PRINT_INT(enable_11a);
DRIVER_STATE_PRINT_INT(noise); DRIVER_STATE_PRINT_INT(noise);
DRIVER_STATE_PRINT_HEX(ap_fw_ps_map); DRIVER_STATE_PRINT_LHEX(ap_fw_ps_map);
DRIVER_STATE_PRINT_LHEX(ap_ps_map); DRIVER_STATE_PRINT_LHEX(ap_ps_map);
DRIVER_STATE_PRINT_HEX(quirks); DRIVER_STATE_PRINT_HEX(quirks);
DRIVER_STATE_PRINT_HEX(irq); DRIVER_STATE_PRINT_HEX(irq);
......
...@@ -333,7 +333,7 @@ static void wl12xx_irq_ps_regulate_link(struct wl1271 *wl, ...@@ -333,7 +333,7 @@ static void wl12xx_irq_ps_regulate_link(struct wl1271 *wl,
{ {
bool fw_ps; bool fw_ps;
fw_ps = test_bit(hlid, (unsigned long *)&wl->ap_fw_ps_map); fw_ps = test_bit(hlid, &wl->ap_fw_ps_map);
/* /*
* Wake up from high level PS if the STA is asleep with too little * Wake up from high level PS if the STA is asleep with too little
...@@ -360,13 +360,13 @@ static void wl12xx_irq_update_links_status(struct wl1271 *wl, ...@@ -360,13 +360,13 @@ static void wl12xx_irq_update_links_status(struct wl1271 *wl,
struct wl12xx_vif *wlvif, struct wl12xx_vif *wlvif,
struct wl_fw_status *status) struct wl_fw_status *status)
{ {
u32 cur_fw_ps_map; unsigned long cur_fw_ps_map;
u8 hlid; u8 hlid;
cur_fw_ps_map = status->link_ps_bitmap; cur_fw_ps_map = status->link_ps_bitmap;
if (wl->ap_fw_ps_map != cur_fw_ps_map) { if (wl->ap_fw_ps_map != cur_fw_ps_map) {
wl1271_debug(DEBUG_PSM, wl1271_debug(DEBUG_PSM,
"link ps prev 0x%x cur 0x%x changed 0x%x", "link ps prev 0x%lx cur 0x%lx changed 0x%lx",
wl->ap_fw_ps_map, cur_fw_ps_map, wl->ap_fw_ps_map, cur_fw_ps_map,
wl->ap_fw_ps_map ^ cur_fw_ps_map); wl->ap_fw_ps_map ^ cur_fw_ps_map);
...@@ -4754,7 +4754,7 @@ void wl1271_free_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 hlid) ...@@ -4754,7 +4754,7 @@ void wl1271_free_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 hlid)
clear_bit(hlid, wlvif->ap.sta_hlid_map); clear_bit(hlid, wlvif->ap.sta_hlid_map);
__clear_bit(hlid, &wl->ap_ps_map); __clear_bit(hlid, &wl->ap_ps_map);
__clear_bit(hlid, (unsigned long *)&wl->ap_fw_ps_map); __clear_bit(hlid, &wl->ap_fw_ps_map);
/* /*
* save the last used PN in the private part of iee80211_sta, * save the last used PN in the private part of iee80211_sta,
......
...@@ -126,7 +126,7 @@ static void wl1271_tx_regulate_link(struct wl1271 *wl, ...@@ -126,7 +126,7 @@ static void wl1271_tx_regulate_link(struct wl1271 *wl,
if (WARN_ON(!test_bit(hlid, wlvif->links_map))) if (WARN_ON(!test_bit(hlid, wlvif->links_map)))
return; return;
fw_ps = test_bit(hlid, (unsigned long *)&wl->ap_fw_ps_map); fw_ps = test_bit(hlid, &wl->ap_fw_ps_map);
tx_pkts = wl->links[hlid].allocated_pkts; tx_pkts = wl->links[hlid].allocated_pkts;
/* /*
......
...@@ -388,10 +388,10 @@ struct wl1271 { ...@@ -388,10 +388,10 @@ struct wl1271 {
int active_link_count; int active_link_count;
/* Fast/slow links bitmap according to FW */ /* Fast/slow links bitmap according to FW */
u32 fw_fast_lnk_map; unsigned long fw_fast_lnk_map;
/* AP-mode - a bitmap of links currently in PS mode according to FW */ /* AP-mode - a bitmap of links currently in PS mode according to FW */
u32 ap_fw_ps_map; unsigned long ap_fw_ps_map;
/* AP-mode - a bitmap of links currently in PS mode in mac80211 */ /* AP-mode - a bitmap of links currently in PS mode in mac80211 */
unsigned long ap_ps_map; unsigned long ap_ps_map;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment