aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-10-05 05:55:42 -0400
committerLuciano Coelho <coelho@ti.com>2011-10-07 01:32:34 -0400
commit30d0c8fd5b87d1c5486705d6420545a21533e115 (patch)
tree73e911f10dd19e16789b58ab8a496a9ec3fff6ad
parent87fbcb0f8c5c8fd57a4e3e7e638977c04ce1e0ca (diff)
wl12xx: move rate_set into wlvif
move rate_set 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/acx.c6
-rw-r--r--drivers/net/wireless/wl12xx/acx.h2
-rw-r--r--drivers/net/wireless/wl12xx/cmd.c12
-rw-r--r--drivers/net/wireless/wl12xx/debugfs.c1
-rw-r--r--drivers/net/wireless/wl12xx/init.c6
-rw-r--r--drivers/net/wireless/wl12xx/main.c24
-rw-r--r--drivers/net/wireless/wl12xx/wl12xx.h9
7 files changed, 33 insertions, 27 deletions
diff --git a/drivers/net/wireless/wl12xx/acx.c b/drivers/net/wireless/wl12xx/acx.c
index ca044a743191..1ef9b0b48635 100644
--- a/drivers/net/wireless/wl12xx/acx.c
+++ b/drivers/net/wireless/wl12xx/acx.c
@@ -739,7 +739,7 @@ int wl1271_acx_statistics(struct wl1271 *wl, struct acx_statistics *stats)
739 return 0; 739 return 0;
740} 740}
741 741
742int wl1271_acx_sta_rate_policies(struct wl1271 *wl) 742int wl1271_acx_sta_rate_policies(struct wl1271 *wl, struct wl12xx_vif *wlvif)
743{ 743{
744 struct acx_rate_policy *acx; 744 struct acx_rate_policy *acx;
745 struct conf_tx_rate_class *c = &wl->conf.tx.sta_rc_conf; 745 struct conf_tx_rate_class *c = &wl->conf.tx.sta_rc_conf;
@@ -755,7 +755,7 @@ int wl1271_acx_sta_rate_policies(struct wl1271 *wl)
755 } 755 }
756 756
757 wl1271_debug(DEBUG_ACX, "basic_rate: 0x%x, full_rate: 0x%x", 757 wl1271_debug(DEBUG_ACX, "basic_rate: 0x%x, full_rate: 0x%x",
758 wl->basic_rate, wl->rate_set); 758 wl->basic_rate, wlvif->rate_set);
759 759
760 /* configure one basic rate class */ 760 /* configure one basic rate class */
761 acx->rate_policy_idx = cpu_to_le32(ACX_TX_BASIC_RATE); 761 acx->rate_policy_idx = cpu_to_le32(ACX_TX_BASIC_RATE);
@@ -772,7 +772,7 @@ int wl1271_acx_sta_rate_policies(struct wl1271 *wl)
772 772
773 /* configure one AP supported rate class */ 773 /* configure one AP supported rate class */
774 acx->rate_policy_idx = cpu_to_le32(ACX_TX_AP_FULL_RATE); 774 acx->rate_policy_idx = cpu_to_le32(ACX_TX_AP_FULL_RATE);
775 acx->rate_policy.enabled_rates = cpu_to_le32(wl->rate_set); 775 acx->rate_policy.enabled_rates = cpu_to_le32(wlvif->rate_set);
776 acx->rate_policy.short_retry_limit = c->short_retry_limit; 776 acx->rate_policy.short_retry_limit = c->short_retry_limit;
777 acx->rate_policy.long_retry_limit = c->long_retry_limit; 777 acx->rate_policy.long_retry_limit = c->long_retry_limit;
778 acx->rate_policy.aflags = c->aflags; 778 acx->rate_policy.aflags = c->aflags;
diff --git a/drivers/net/wireless/wl12xx/acx.h b/drivers/net/wireless/wl12xx/acx.h
index e3f93b4b3429..81779f45ab41 100644
--- a/drivers/net/wireless/wl12xx/acx.h
+++ b/drivers/net/wireless/wl12xx/acx.h
@@ -1261,7 +1261,7 @@ int wl1271_acx_set_preamble(struct wl1271 *wl, enum acx_preamble_type preamble);
1261int wl1271_acx_cts_protect(struct wl1271 *wl, 1261int wl1271_acx_cts_protect(struct wl1271 *wl,
1262 enum acx_ctsprotect_type ctsprotect); 1262 enum acx_ctsprotect_type ctsprotect);
1263int wl1271_acx_statistics(struct wl1271 *wl, struct acx_statistics *stats); 1263int wl1271_acx_statistics(struct wl1271 *wl, struct acx_statistics *stats);
1264int wl1271_acx_sta_rate_policies(struct wl1271 *wl); 1264int wl1271_acx_sta_rate_policies(struct wl1271 *wl, struct wl12xx_vif *wlvif);
1265int wl1271_acx_ap_rate_policy(struct wl1271 *wl, struct conf_tx_rate_class *c, 1265int wl1271_acx_ap_rate_policy(struct wl1271 *wl, struct conf_tx_rate_class *c,
1266 u8 idx); 1266 u8 idx);
1267int wl1271_acx_ac_cfg(struct wl1271 *wl, u8 ac, u8 cw_min, u16 cw_max, 1267int wl1271_acx_ac_cfg(struct wl1271 *wl, u8 ac, u8 cw_min, u16 cw_max,
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
index c99fc61113d1..6a2f758eb1d3 100644
--- a/drivers/net/wireless/wl12xx/cmd.c
+++ b/drivers/net/wireless/wl12xx/cmd.c
@@ -578,7 +578,7 @@ int wl12xx_cmd_role_start_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif)
578 cmd->sta.ssid_len = wl->ssid_len; 578 cmd->sta.ssid_len = wl->ssid_len;
579 memcpy(cmd->sta.ssid, wl->ssid, wl->ssid_len); 579 memcpy(cmd->sta.ssid, wl->ssid, wl->ssid_len);
580 memcpy(cmd->sta.bssid, wl->bssid, ETH_ALEN); 580 memcpy(cmd->sta.bssid, wl->bssid, ETH_ALEN);
581 cmd->sta.local_rates = cpu_to_le32(wl->rate_set); 581 cmd->sta.local_rates = cpu_to_le32(wlvif->rate_set);
582 582
583 if (wl->sta_hlid == WL12XX_INVALID_LINK_ID) { 583 if (wl->sta_hlid == WL12XX_INVALID_LINK_ID) {
584 ret = wl12xx_allocate_link(wl, &wl->sta_hlid); 584 ret = wl12xx_allocate_link(wl, &wl->sta_hlid);
@@ -587,12 +587,12 @@ int wl12xx_cmd_role_start_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif)
587 } 587 }
588 cmd->sta.hlid = wl->sta_hlid; 588 cmd->sta.hlid = wl->sta_hlid;
589 cmd->sta.session = wl12xx_get_new_session_id(wl); 589 cmd->sta.session = wl12xx_get_new_session_id(wl);
590 cmd->sta.remote_rates = cpu_to_le32(wl->rate_set); 590 cmd->sta.remote_rates = cpu_to_le32(wlvif->rate_set);
591 591
592 wl1271_debug(DEBUG_CMD, "role start: roleid=%d, hlid=%d, session=%d " 592 wl1271_debug(DEBUG_CMD, "role start: roleid=%d, hlid=%d, session=%d "
593 "basic_rate_set: 0x%x, remote_rates: 0x%x", 593 "basic_rate_set: 0x%x, remote_rates: 0x%x",
594 wl->role_id, cmd->sta.hlid, cmd->sta.session, 594 wl->role_id, cmd->sta.hlid, cmd->sta.session,
595 wlvif->basic_rate_set, wl->rate_set); 595 wlvif->basic_rate_set, wlvif->rate_set);
596 596
597 ret = wl1271_cmd_send(wl, CMD_ROLE_START, cmd, sizeof(*cmd), 0); 597 ret = wl1271_cmd_send(wl, CMD_ROLE_START, cmd, sizeof(*cmd), 0);
598 if (ret < 0) { 598 if (ret < 0) {
@@ -792,7 +792,7 @@ int wl12xx_cmd_role_start_ibss(struct wl1271 *wl, struct wl12xx_vif *wlvif)
792 cmd->ibss.ssid_len = wl->ssid_len; 792 cmd->ibss.ssid_len = wl->ssid_len;
793 memcpy(cmd->ibss.ssid, wl->ssid, wl->ssid_len); 793 memcpy(cmd->ibss.ssid, wl->ssid, wl->ssid_len);
794 memcpy(cmd->ibss.bssid, wl->bssid, ETH_ALEN); 794 memcpy(cmd->ibss.bssid, wl->bssid, ETH_ALEN);
795 cmd->sta.local_rates = cpu_to_le32(wl->rate_set); 795 cmd->sta.local_rates = cpu_to_le32(wlvif->rate_set);
796 796
797 if (wl->sta_hlid == WL12XX_INVALID_LINK_ID) { 797 if (wl->sta_hlid == WL12XX_INVALID_LINK_ID) {
798 ret = wl12xx_allocate_link(wl, &wl->sta_hlid); 798 ret = wl12xx_allocate_link(wl, &wl->sta_hlid);
@@ -800,12 +800,12 @@ int wl12xx_cmd_role_start_ibss(struct wl1271 *wl, struct wl12xx_vif *wlvif)
800 goto out_free; 800 goto out_free;
801 } 801 }
802 cmd->ibss.hlid = wl->sta_hlid; 802 cmd->ibss.hlid = wl->sta_hlid;
803 cmd->ibss.remote_rates = cpu_to_le32(wl->rate_set); 803 cmd->ibss.remote_rates = cpu_to_le32(wlvif->rate_set);
804 804
805 wl1271_debug(DEBUG_CMD, "role start: roleid=%d, hlid=%d, session=%d " 805 wl1271_debug(DEBUG_CMD, "role start: roleid=%d, hlid=%d, session=%d "
806 "basic_rate_set: 0x%x, remote_rates: 0x%x", 806 "basic_rate_set: 0x%x, remote_rates: 0x%x",
807 wl->role_id, cmd->sta.hlid, cmd->sta.session, 807 wl->role_id, cmd->sta.hlid, cmd->sta.session,
808 wlvif->basic_rate_set, wl->rate_set); 808 wlvif->basic_rate_set, wlvif->rate_set);
809 809
810 wl1271_debug(DEBUG_CMD, "wl->bssid = %pM", wl->bssid); 810 wl1271_debug(DEBUG_CMD, "wl->bssid = %pM", wl->bssid);
811 811
diff --git a/drivers/net/wireless/wl12xx/debugfs.c b/drivers/net/wireless/wl12xx/debugfs.c
index 0419aafe5c57..e63fea4b120d 100644
--- a/drivers/net/wireless/wl12xx/debugfs.c
+++ b/drivers/net/wireless/wl12xx/debugfs.c
@@ -352,7 +352,6 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
352 DRIVER_STATE_PRINT_INT(state); 352 DRIVER_STATE_PRINT_INT(state);
353 DRIVER_STATE_PRINT_INT(bss_type); 353 DRIVER_STATE_PRINT_INT(bss_type);
354 DRIVER_STATE_PRINT_INT(channel); 354 DRIVER_STATE_PRINT_INT(channel);
355 DRIVER_STATE_PRINT_HEX(rate_set);
356 DRIVER_STATE_PRINT_HEX(basic_rate); 355 DRIVER_STATE_PRINT_HEX(basic_rate);
357 DRIVER_STATE_PRINT_INT(band); 356 DRIVER_STATE_PRINT_INT(band);
358 DRIVER_STATE_PRINT_INT(beacon_int); 357 DRIVER_STATE_PRINT_INT(beacon_int);
diff --git a/drivers/net/wireless/wl12xx/init.c b/drivers/net/wireless/wl12xx/init.c
index c00bdf8a3584..37955dad1f93 100644
--- a/drivers/net/wireless/wl12xx/init.c
+++ b/drivers/net/wireless/wl12xx/init.c
@@ -320,7 +320,7 @@ static int wl12xx_init_fwlog(struct wl1271 *wl)
320} 320}
321 321
322/* generic sta initialization (non vif-specific) */ 322/* generic sta initialization (non vif-specific) */
323static int wl1271_sta_hw_init(struct wl1271 *wl) 323static int wl1271_sta_hw_init(struct wl1271 *wl, struct wl12xx_vif *wlvif)
324{ 324{
325 int ret; 325 int ret;
326 326
@@ -345,7 +345,7 @@ static int wl1271_sta_hw_init(struct wl1271 *wl)
345 if (ret < 0) 345 if (ret < 0)
346 return ret; 346 return ret;
347 347
348 ret = wl1271_acx_sta_rate_policies(wl); 348 ret = wl1271_acx_sta_rate_policies(wl, wlvif);
349 if (ret < 0) 349 if (ret < 0)
350 return ret; 350 return ret;
351 351
@@ -586,7 +586,7 @@ int wl1271_init_vif_specific(struct wl1271 *wl, struct ieee80211_vif *vif)
586 if (ret < 0) 586 if (ret < 0)
587 return ret; 587 return ret;
588 } else { 588 } else {
589 ret = wl1271_sta_hw_init(wl); 589 ret = wl1271_sta_hw_init(wl, wlvif);
590 if (ret < 0) 590 if (ret < 0)
591 return ret; 591 return ret;
592 592
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 0c43cf55f9bf..195dcbdf1fc7 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1840,6 +1840,7 @@ static u8 wl12xx_get_role_type(struct wl1271 *wl)
1840static void wl12xx_init_vif_data(struct wl12xx_vif *wlvif) 1840static void wl12xx_init_vif_data(struct wl12xx_vif *wlvif)
1841{ 1841{
1842 wlvif->basic_rate_set = CONF_TX_RATE_MASK_BASIC; 1842 wlvif->basic_rate_set = CONF_TX_RATE_MASK_BASIC;
1843 wlvif->rate_set = CONF_TX_RATE_MASK_BASIC;
1843} 1844}
1844 1845
1845static int wl1271_op_add_interface(struct ieee80211_hw *hw, 1846static int wl1271_op_add_interface(struct ieee80211_hw *hw,
@@ -2106,7 +2107,6 @@ deinit:
2106 wl->tx_packets_count = 0; 2107 wl->tx_packets_count = 0;
2107 wl->time_offset = 0; 2108 wl->time_offset = 0;
2108 wl->session_counter = 0; 2109 wl->session_counter = 0;
2109 wl->rate_set = CONF_TX_RATE_MASK_BASIC;
2110 wl->bitrate_masks[IEEE80211_BAND_2GHZ] = wl->conf.tx.basic_rate; 2110 wl->bitrate_masks[IEEE80211_BAND_2GHZ] = wl->conf.tx.basic_rate;
2111 wl->bitrate_masks[IEEE80211_BAND_5GHZ] = wl->conf.tx.basic_rate_5; 2111 wl->bitrate_masks[IEEE80211_BAND_5GHZ] = wl->conf.tx.basic_rate_5;
2112 wl->vif = NULL; 2112 wl->vif = NULL;
@@ -2254,7 +2254,7 @@ out:
2254static void wl1271_set_band_rate(struct wl1271 *wl, struct wl12xx_vif *wlvif) 2254static void wl1271_set_band_rate(struct wl1271 *wl, struct wl12xx_vif *wlvif)
2255{ 2255{
2256 wlvif->basic_rate_set = wl->bitrate_masks[wl->band]; 2256 wlvif->basic_rate_set = wl->bitrate_masks[wl->band];
2257 wl->rate_set = wlvif->basic_rate_set; 2257 wlvif->rate_set = wlvif->basic_rate_set;
2258} 2258}
2259 2259
2260static bool wl12xx_is_roc(struct wl1271 *wl) 2260static bool wl12xx_is_roc(struct wl1271 *wl)
@@ -2284,9 +2284,9 @@ static int wl1271_sta_handle_idle(struct wl1271 *wl, struct wl12xx_vif *wlvif,
2284 if (ret < 0) 2284 if (ret < 0)
2285 goto out; 2285 goto out;
2286 } 2286 }
2287 wl->rate_set = wl1271_tx_min_rate_get(wl, 2287 wlvif->rate_set =
2288 wlvif->basic_rate_set); 2288 wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set);
2289 ret = wl1271_acx_sta_rate_policies(wl); 2289 ret = wl1271_acx_sta_rate_policies(wl, wlvif);
2290 if (ret < 0) 2290 if (ret < 0)
2291 goto out; 2291 goto out;
2292 ret = wl1271_acx_keep_alive_config( 2292 ret = wl1271_acx_keep_alive_config(
@@ -2387,7 +2387,7 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
2387 wl->basic_rate = 2387 wl->basic_rate =
2388 wl1271_tx_min_rate_get(wl, 2388 wl1271_tx_min_rate_get(wl,
2389 wlvif->basic_rate_set); 2389 wlvif->basic_rate_set);
2390 ret = wl1271_acx_sta_rate_policies(wl); 2390 ret = wl1271_acx_sta_rate_policies(wl, wlvif);
2391 if (ret < 0) 2391 if (ret < 0)
2392 wl1271_warning("rate policy for channel " 2392 wl1271_warning("rate policy for channel "
2393 "failed %d", ret); 2393 "failed %d", ret);
@@ -3502,10 +3502,11 @@ sta_not_found:
3502 wl1271_tx_min_rate_get(wl, 3502 wl1271_tx_min_rate_get(wl,
3503 wlvif->basic_rate_set); 3503 wlvif->basic_rate_set);
3504 if (sta_rate_set) 3504 if (sta_rate_set)
3505 wl->rate_set = wl1271_tx_enabled_rates_get(wl, 3505 wlvif->rate_set =
3506 wl1271_tx_enabled_rates_get(wl,
3506 sta_rate_set, 3507 sta_rate_set,
3507 wl->band); 3508 wl->band);
3508 ret = wl1271_acx_sta_rate_policies(wl); 3509 ret = wl1271_acx_sta_rate_policies(wl, wlvif);
3509 if (ret < 0) 3510 if (ret < 0)
3510 goto out; 3511 goto out;
3511 3512
@@ -3554,7 +3555,7 @@ sta_not_found:
3554 wl->basic_rate = 3555 wl->basic_rate =
3555 wl1271_tx_min_rate_get(wl, 3556 wl1271_tx_min_rate_get(wl,
3556 wlvif->basic_rate_set); 3557 wlvif->basic_rate_set);
3557 ret = wl1271_acx_sta_rate_policies(wl); 3558 ret = wl1271_acx_sta_rate_policies(wl, wlvif);
3558 if (ret < 0) 3559 if (ret < 0)
3559 goto out; 3560 goto out;
3560 3561
@@ -3612,8 +3613,8 @@ sta_not_found:
3612 wlvif->basic_rate_set); 3613 wlvif->basic_rate_set);
3613 3614
3614 /* by default, use 11b + OFDM rates */ 3615 /* by default, use 11b + OFDM rates */
3615 wl->rate_set = CONF_TX_IBSS_DEFAULT_RATES; 3616 wlvif->rate_set = CONF_TX_IBSS_DEFAULT_RATES;
3616 ret = wl1271_acx_sta_rate_policies(wl); 3617 ret = wl1271_acx_sta_rate_policies(wl, wlvif);
3617 if (ret < 0) 3618 if (ret < 0)
3618 goto out; 3619 goto out;
3619 } 3620 }
@@ -4844,7 +4845,6 @@ struct ieee80211_hw *wl1271_alloc_hw(void)
4844 wl->psm_entry_retry = 0; 4845 wl->psm_entry_retry = 0;
4845 wl->power_level = WL1271_DEFAULT_POWER_LEVEL; 4846 wl->power_level = WL1271_DEFAULT_POWER_LEVEL;
4846 wl->basic_rate = CONF_TX_RATE_MASK_BASIC; 4847 wl->basic_rate = CONF_TX_RATE_MASK_BASIC;
4847 wl->rate_set = CONF_TX_RATE_MASK_BASIC;
4848 wl->band = IEEE80211_BAND_2GHZ; 4848 wl->band = IEEE80211_BAND_2GHZ;
4849 wl->vif = NULL; 4849 wl->vif = NULL;
4850 wl->flags = 0; 4850 wl->flags = 0;
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index 7e30dd53cb88..6f3efbae740e 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -526,7 +526,6 @@ struct wl1271 {
526 * support only 1 stream, thus only 8 bits for the MCS rates (0-7). 526 * support only 1 stream, thus only 8 bits for the MCS rates (0-7).
527 */ 527 */
528 u32 basic_rate; 528 u32 basic_rate;
529 u32 rate_set;
530 u32 bitrate_masks[IEEE80211_NUM_BANDS]; 529 u32 bitrate_masks[IEEE80211_NUM_BANDS];
531 530
532 /* The current band */ 531 /* The current band */
@@ -640,6 +639,14 @@ struct wl1271_station {
640 639
641struct wl12xx_vif { 640struct wl12xx_vif {
642 u32 basic_rate_set; 641 u32 basic_rate_set;
642
643 /*
644 * currently configured rate set:
645 * bits 0-15 - 802.11abg rates
646 * bits 16-23 - 802.11n MCS index mask
647 * support only 1 stream, thus only 8 bits for the MCS rates (0-7).
648 */
649 u32 rate_set;
643}; 650};
644 651
645static inline struct wl12xx_vif *wl12xx_vif_to_data(struct ieee80211_vif *vif) 652static inline struct wl12xx_vif *wl12xx_vif_to_data(struct ieee80211_vif *vif)