diff options
author | Eliad Peller <eliad@wizery.com> | 2011-10-05 05:55:55 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-10-07 01:32:46 -0400 |
commit | 98b8625301e55bd3e4340f704edc378e4707e577 (patch) | |
tree | 7ef1d23425d0db9e92106acb69035ca0b19bba5f | |
parent | a8ab39a4b588e8523be2fa75671bdc9612d3467a (diff) |
wl12xx: move session_counter into wlvif
move session_counter 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/cmd.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/debugfs.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/tx.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/wl12xx.h | 9 |
5 files changed, 16 insertions, 17 deletions
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c index d0124e63dad1..89d263e7b569 100644 --- a/drivers/net/wireless/wl12xx/cmd.c +++ b/drivers/net/wireless/wl12xx/cmd.c | |||
@@ -454,14 +454,15 @@ static void wl12xx_free_link(struct wl1271 *wl, u8 *hlid) | |||
454 | *hlid = WL12XX_INVALID_LINK_ID; | 454 | *hlid = WL12XX_INVALID_LINK_ID; |
455 | } | 455 | } |
456 | 456 | ||
457 | static int wl12xx_get_new_session_id(struct wl1271 *wl) | 457 | static int wl12xx_get_new_session_id(struct wl1271 *wl, |
458 | struct wl12xx_vif *wlvif) | ||
458 | { | 459 | { |
459 | if (wl->session_counter >= SESSION_COUNTER_MAX) | 460 | if (wlvif->session_counter >= SESSION_COUNTER_MAX) |
460 | wl->session_counter = 0; | 461 | wlvif->session_counter = 0; |
461 | 462 | ||
462 | wl->session_counter++; | 463 | wlvif->session_counter++; |
463 | 464 | ||
464 | return wl->session_counter; | 465 | return wlvif->session_counter; |
465 | } | 466 | } |
466 | 467 | ||
467 | int wl12xx_cmd_role_start_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif) | 468 | int wl12xx_cmd_role_start_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif) |
@@ -488,7 +489,7 @@ int wl12xx_cmd_role_start_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif) | |||
488 | goto out_free; | 489 | goto out_free; |
489 | } | 490 | } |
490 | cmd->device.hlid = wl->dev_hlid; | 491 | cmd->device.hlid = wl->dev_hlid; |
491 | cmd->device.session = wl->session_counter; | 492 | cmd->device.session = wlvif->session_counter; |
492 | 493 | ||
493 | wl1271_debug(DEBUG_CMD, "role start: roleid=%d, hlid=%d, session=%d", | 494 | wl1271_debug(DEBUG_CMD, "role start: roleid=%d, hlid=%d, session=%d", |
494 | cmd->role_id, cmd->device.hlid, cmd->device.session); | 495 | cmd->role_id, cmd->device.hlid, cmd->device.session); |
@@ -587,7 +588,7 @@ int wl12xx_cmd_role_start_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif) | |||
587 | goto out_free; | 588 | goto out_free; |
588 | } | 589 | } |
589 | cmd->sta.hlid = wlvif->sta.hlid; | 590 | cmd->sta.hlid = wlvif->sta.hlid; |
590 | cmd->sta.session = wl12xx_get_new_session_id(wl); | 591 | cmd->sta.session = wl12xx_get_new_session_id(wl, wlvif); |
591 | cmd->sta.remote_rates = cpu_to_le32(wlvif->rate_set); | 592 | cmd->sta.remote_rates = cpu_to_le32(wlvif->rate_set); |
592 | 593 | ||
593 | wl1271_debug(DEBUG_CMD, "role start: roleid=%d, hlid=%d, session=%d " | 594 | wl1271_debug(DEBUG_CMD, "role start: roleid=%d, hlid=%d, session=%d " |
diff --git a/drivers/net/wireless/wl12xx/debugfs.c b/drivers/net/wireless/wl12xx/debugfs.c index 3309fea2e90e..d8d856823651 100644 --- a/drivers/net/wireless/wl12xx/debugfs.c +++ b/drivers/net/wireless/wl12xx/debugfs.c | |||
@@ -348,7 +348,6 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf, | |||
348 | DRIVER_STATE_PRINT_INT(tx_blocks_freed); | 348 | DRIVER_STATE_PRINT_INT(tx_blocks_freed); |
349 | DRIVER_STATE_PRINT_INT(tx_security_last_seq_lsb); | 349 | DRIVER_STATE_PRINT_INT(tx_security_last_seq_lsb); |
350 | DRIVER_STATE_PRINT_INT(rx_counter); | 350 | DRIVER_STATE_PRINT_INT(rx_counter); |
351 | DRIVER_STATE_PRINT_INT(session_counter); | ||
352 | DRIVER_STATE_PRINT_INT(state); | 351 | DRIVER_STATE_PRINT_INT(state); |
353 | DRIVER_STATE_PRINT_INT(channel); | 352 | DRIVER_STATE_PRINT_INT(channel); |
354 | DRIVER_STATE_PRINT_INT(band); | 353 | DRIVER_STATE_PRINT_INT(band); |
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index 731e34bc275a..63871b46c0c1 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -2128,7 +2128,6 @@ deinit: | |||
2128 | wl->tx_results_count = 0; | 2128 | wl->tx_results_count = 0; |
2129 | wl->tx_packets_count = 0; | 2129 | wl->tx_packets_count = 0; |
2130 | wl->time_offset = 0; | 2130 | wl->time_offset = 0; |
2131 | wl->session_counter = 0; | ||
2132 | wl->bitrate_masks[IEEE80211_BAND_2GHZ] = wl->conf.tx.basic_rate; | 2131 | wl->bitrate_masks[IEEE80211_BAND_2GHZ] = wl->conf.tx.basic_rate; |
2133 | wl->bitrate_masks[IEEE80211_BAND_5GHZ] = wl->conf.tx.basic_rate_5; | 2132 | wl->bitrate_masks[IEEE80211_BAND_5GHZ] = wl->conf.tx.basic_rate_5; |
2134 | wl->vif = NULL; | 2133 | wl->vif = NULL; |
@@ -4896,7 +4895,6 @@ struct ieee80211_hw *wl1271_alloc_hw(void) | |||
4896 | wl->tx_spare_blocks = TX_HW_BLOCK_SPARE_DEFAULT; | 4895 | wl->tx_spare_blocks = TX_HW_BLOCK_SPARE_DEFAULT; |
4897 | wl->system_hlid = WL12XX_SYSTEM_HLID; | 4896 | wl->system_hlid = WL12XX_SYSTEM_HLID; |
4898 | wl->dev_hlid = WL12XX_INVALID_LINK_ID; | 4897 | wl->dev_hlid = WL12XX_INVALID_LINK_ID; |
4899 | wl->session_counter = 0; | ||
4900 | wl->active_sta_count = 0; | 4898 | wl->active_sta_count = 0; |
4901 | setup_timer(&wl->rx_streaming_timer, wl1271_rx_streaming_timer, | 4899 | setup_timer(&wl->rx_streaming_timer, wl1271_rx_streaming_timer, |
4902 | (unsigned long) wl); | 4900 | (unsigned long) wl); |
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c index 53c6451a8fde..da8427f5d7a8 100644 --- a/drivers/net/wireless/wl12xx/tx.c +++ b/drivers/net/wireless/wl12xx/tx.c | |||
@@ -321,15 +321,15 @@ static void wl1271_tx_fill_hdr(struct wl1271 *wl, struct ieee80211_vif *vif, | |||
321 | * FW expects the dummy packet to have an invalid session id - | 321 | * FW expects the dummy packet to have an invalid session id - |
322 | * any session id that is different than the one set in the join | 322 | * any session id that is different than the one set in the join |
323 | */ | 323 | */ |
324 | tx_attr = ((~wl->session_counter) << | 324 | tx_attr = (SESSION_COUNTER_INVALID << |
325 | TX_HW_ATTR_OFST_SESSION_COUNTER) & | 325 | TX_HW_ATTR_OFST_SESSION_COUNTER) & |
326 | TX_HW_ATTR_SESSION_COUNTER; | 326 | TX_HW_ATTR_SESSION_COUNTER; |
327 | 327 | ||
328 | tx_attr |= TX_HW_ATTR_TX_DUMMY_REQ; | 328 | tx_attr |= TX_HW_ATTR_TX_DUMMY_REQ; |
329 | } else { | 329 | } else { |
330 | /* configure the tx attributes */ | 330 | /* configure the tx attributes */ |
331 | tx_attr = | 331 | tx_attr = wlvif->session_counter << |
332 | wl->session_counter << TX_HW_ATTR_OFST_SESSION_COUNTER; | 332 | TX_HW_ATTR_OFST_SESSION_COUNTER; |
333 | } | 333 | } |
334 | 334 | ||
335 | desc->hlid = hlid; | 335 | desc->hlid = hlid; |
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h index aa84899466a8..9fcaa03cd737 100644 --- a/drivers/net/wireless/wl12xx/wl12xx.h +++ b/drivers/net/wireless/wl12xx/wl12xx.h | |||
@@ -429,9 +429,6 @@ struct wl1271 { | |||
429 | /* Time-offset between host and chipset clocks */ | 429 | /* Time-offset between host and chipset clocks */ |
430 | s64 time_offset; | 430 | s64 time_offset; |
431 | 431 | ||
432 | /* Session counter for the chipset */ | ||
433 | int session_counter; | ||
434 | |||
435 | /* Frames scheduled for transmission, not handled yet */ | 432 | /* Frames scheduled for transmission, not handled yet */ |
436 | struct sk_buff_head tx_queue[NUM_TX_QUEUES]; | 433 | struct sk_buff_head tx_queue[NUM_TX_QUEUES]; |
437 | int tx_queue_count[NUM_TX_QUEUES]; | 434 | int tx_queue_count[NUM_TX_QUEUES]; |
@@ -650,6 +647,9 @@ struct wl12xx_vif { | |||
650 | 647 | ||
651 | /* Our association ID */ | 648 | /* Our association ID */ |
652 | u16 aid; | 649 | u16 aid; |
650 | |||
651 | /* Session counter for the chipset */ | ||
652 | int session_counter; | ||
653 | }; | 653 | }; |
654 | 654 | ||
655 | static inline struct wl12xx_vif *wl12xx_vif_to_data(struct ieee80211_vif *vif) | 655 | static inline struct wl12xx_vif *wl12xx_vif_to_data(struct ieee80211_vif *vif) |
@@ -671,7 +671,8 @@ size_t wl12xx_copy_fwlog(struct wl1271 *wl, u8 *memblock, size_t maxlen); | |||
671 | 671 | ||
672 | #define JOIN_TIMEOUT 5000 /* 5000 milliseconds to join */ | 672 | #define JOIN_TIMEOUT 5000 /* 5000 milliseconds to join */ |
673 | 673 | ||
674 | #define SESSION_COUNTER_MAX 7 /* maximum value for the session counter */ | 674 | #define SESSION_COUNTER_MAX 6 /* maximum value for the session counter */ |
675 | #define SESSION_COUNTER_INVALID 7 /* used with dummy_packet */ | ||
675 | 676 | ||
676 | #define WL1271_DEFAULT_POWER_LEVEL 0 | 677 | #define WL1271_DEFAULT_POWER_LEVEL 0 |
677 | 678 | ||