aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-10-05 05:56:02 -0400
committerLuciano Coelho <coelho@ti.com>2011-10-07 01:32:52 -0400
commit74ec839557878007c3f97d1bc89e09fde5d0f3fa (patch)
treed7bbb8c67cab1a6f69e8f87c97383d82b37c1983
parent6ec45dc282f6983d5685758c5e8993bc2c818d3c (diff)
wl12xx: move ps_poll_failures and psm_entry_retry into wlvif
move ps_poll_failures and psm_entry_retries into the per-interface data, rather than being global. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r--drivers/net/wireless/wl12xx/debugfs.c2
-rw-r--r--drivers/net/wireless/wl12xx/event.c14
-rw-r--r--drivers/net/wireless/wl12xx/main.c4
-rw-r--r--drivers/net/wireless/wl12xx/wl12xx.h12
4 files changed, 14 insertions, 18 deletions
diff --git a/drivers/net/wireless/wl12xx/debugfs.c b/drivers/net/wireless/wl12xx/debugfs.c
index 439db1f8d277..cd390e0da51d 100644
--- a/drivers/net/wireless/wl12xx/debugfs.c
+++ b/drivers/net/wireless/wl12xx/debugfs.c
@@ -351,8 +351,6 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
351 DRIVER_STATE_PRINT_INT(state); 351 DRIVER_STATE_PRINT_INT(state);
352 DRIVER_STATE_PRINT_INT(channel); 352 DRIVER_STATE_PRINT_INT(channel);
353 DRIVER_STATE_PRINT_INT(band); 353 DRIVER_STATE_PRINT_INT(band);
354 DRIVER_STATE_PRINT_INT(psm_entry_retry);
355 DRIVER_STATE_PRINT_INT(ps_poll_failures);
356 DRIVER_STATE_PRINT_INT(power_level); 354 DRIVER_STATE_PRINT_INT(power_level);
357 DRIVER_STATE_PRINT_INT(rssi_thold); 355 DRIVER_STATE_PRINT_INT(rssi_thold);
358 DRIVER_STATE_PRINT_INT(last_rssi_event); 356 DRIVER_STATE_PRINT_INT(last_rssi_event);
diff --git a/drivers/net/wireless/wl12xx/event.c b/drivers/net/wireless/wl12xx/event.c
index 7a9913a3f71c..6c48b8c3f5bb 100644
--- a/drivers/net/wireless/wl12xx/event.c
+++ b/drivers/net/wireless/wl12xx/event.c
@@ -78,8 +78,8 @@ static void wl1271_event_pspoll_delivery_fail(struct wl1271 *wl,
78 int delay = wl->conf.conn.ps_poll_recovery_period; 78 int delay = wl->conf.conn.ps_poll_recovery_period;
79 int ret; 79 int ret;
80 80
81 wl->ps_poll_failures++; 81 wlvif->ps_poll_failures++;
82 if (wl->ps_poll_failures == 1) 82 if (wlvif->ps_poll_failures == 1)
83 wl1271_info("AP with dysfunctional ps-poll, " 83 wl1271_info("AP with dysfunctional ps-poll, "
84 "trying to work around it."); 84 "trying to work around it.");
85 85
@@ -118,23 +118,23 @@ static int wl1271_event_ps_report(struct wl1271 *wl,
118 118
119 if (!test_bit(WL1271_FLAG_PSM, &wl->flags)) { 119 if (!test_bit(WL1271_FLAG_PSM, &wl->flags)) {
120 /* remain in active mode */ 120 /* remain in active mode */
121 wl->psm_entry_retry = 0; 121 wlvif->psm_entry_retry = 0;
122 break; 122 break;
123 } 123 }
124 124
125 if (wl->psm_entry_retry < total_retries) { 125 if (wlvif->psm_entry_retry < total_retries) {
126 wl->psm_entry_retry++; 126 wlvif->psm_entry_retry++;
127 ret = wl1271_ps_set_mode(wl, wlvif, 127 ret = wl1271_ps_set_mode(wl, wlvif,
128 STATION_POWER_SAVE_MODE, 128 STATION_POWER_SAVE_MODE,
129 wlvif->basic_rate, true); 129 wlvif->basic_rate, true);
130 } else { 130 } else {
131 wl1271_info("No ack to nullfunc from AP."); 131 wl1271_info("No ack to nullfunc from AP.");
132 wl->psm_entry_retry = 0; 132 wlvif->psm_entry_retry = 0;
133 *beacon_loss = true; 133 *beacon_loss = true;
134 } 134 }
135 break; 135 break;
136 case EVENT_ENTER_POWER_SAVE_SUCCESS: 136 case EVENT_ENTER_POWER_SAVE_SUCCESS:
137 wl->psm_entry_retry = 0; 137 wlvif->psm_entry_retry = 0;
138 138
139 /* enable beacon filtering */ 139 /* enable beacon filtering */
140 ret = wl1271_acx_beacon_filter_opt(wl, wlvif, true); 140 ret = wl1271_acx_beacon_filter_opt(wl, wlvif, true);
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index cb2355354bf0..fd2b9f21acff 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -2141,7 +2141,6 @@ deinit:
2141 wl->band = IEEE80211_BAND_2GHZ; 2141 wl->band = IEEE80211_BAND_2GHZ;
2142 2142
2143 wl->rx_counter = 0; 2143 wl->rx_counter = 0;
2144 wl->psm_entry_retry = 0;
2145 wl->power_level = WL1271_DEFAULT_POWER_LEVEL; 2144 wl->power_level = WL1271_DEFAULT_POWER_LEVEL;
2146 wl->tx_blocks_available = 0; 2145 wl->tx_blocks_available = 0;
2147 wl->tx_allocated_blocks = 0; 2146 wl->tx_allocated_blocks = 0;
@@ -3540,7 +3539,7 @@ sta_not_found:
3540 wlvif->aid = bss_conf->aid; 3539 wlvif->aid = bss_conf->aid;
3541 set_assoc = true; 3540 set_assoc = true;
3542 3541
3543 wl->ps_poll_failures = 0; 3542 wlvif->ps_poll_failures = 0;
3544 3543
3545 /* 3544 /*
3546 * use basic rates from AP, and determine lowest rate 3545 * use basic rates from AP, and determine lowest rate
@@ -4894,7 +4893,6 @@ struct ieee80211_hw *wl1271_alloc_hw(void)
4894 4893
4895 wl->channel = WL1271_DEFAULT_CHANNEL; 4894 wl->channel = WL1271_DEFAULT_CHANNEL;
4896 wl->rx_counter = 0; 4895 wl->rx_counter = 0;
4897 wl->psm_entry_retry = 0;
4898 wl->power_level = WL1271_DEFAULT_POWER_LEVEL; 4896 wl->power_level = WL1271_DEFAULT_POWER_LEVEL;
4899 wl->band = IEEE80211_BAND_2GHZ; 4897 wl->band = IEEE80211_BAND_2GHZ;
4900 wl->vif = NULL; 4898 wl->vif = NULL;
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index 7166a79e00e4..9d9d3fbd14e5 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -511,12 +511,6 @@ struct wl1271 {
511 struct completion *elp_compl; 511 struct completion *elp_compl;
512 struct delayed_work elp_work; 512 struct delayed_work elp_work;
513 513
514 /* counter for ps-poll delivery failures */
515 int ps_poll_failures;
516
517 /* retry counter for PSM entries */
518 u8 psm_entry_retry;
519
520 /* in dBm */ 514 /* in dBm */
521 int power_level; 515 int power_level;
522 516
@@ -652,6 +646,12 @@ struct wl12xx_vif {
652 646
653 struct completion *ps_compl; 647 struct completion *ps_compl;
654 struct delayed_work pspoll_work; 648 struct delayed_work pspoll_work;
649
650 /* counter for ps-poll delivery failures */
651 int ps_poll_failures;
652
653 /* retry counter for PSM entries */
654 u8 psm_entry_retry;
655}; 655};
656 656
657static inline struct wl12xx_vif *wl12xx_vif_to_data(struct ieee80211_vif *vif) 657static inline struct wl12xx_vif *wl12xx_vif_to_data(struct ieee80211_vif *vif)