Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linville' of git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx

+414 -144
+6 -6
drivers/net/wireless/wl12xx/acx.c
··· 90 90 struct acx_current_tx_power *acx; 91 91 int ret; 92 92 93 - wl1271_debug(DEBUG_ACX, "acx dot11_cur_tx_pwr"); 93 + wl1271_debug(DEBUG_ACX, "acx dot11_cur_tx_pwr %d", power); 94 94 95 95 if (power < 0 || power > 25) 96 96 return -EINVAL; ··· 1624 1624 return ret; 1625 1625 } 1626 1626 1627 - int wl1271_acx_max_tx_retry(struct wl1271 *wl) 1627 + int wl1271_acx_ap_max_tx_retry(struct wl1271 *wl) 1628 1628 { 1629 - struct wl1271_acx_max_tx_retry *acx = NULL; 1629 + struct wl1271_acx_ap_max_tx_retry *acx = NULL; 1630 1630 int ret; 1631 1631 1632 - wl1271_debug(DEBUG_ACX, "acx max tx retry"); 1632 + wl1271_debug(DEBUG_ACX, "acx ap max tx retry"); 1633 1633 1634 1634 acx = kzalloc(sizeof(*acx), GFP_KERNEL); 1635 1635 if (!acx) 1636 1636 return -ENOMEM; 1637 1637 1638 - acx->max_tx_retry = cpu_to_le16(wl->conf.tx.ap_max_tx_retries); 1638 + acx->max_tx_retry = cpu_to_le16(wl->conf.tx.max_tx_retries); 1639 1639 1640 1640 ret = wl1271_cmd_configure(wl, ACX_MAX_TX_FAILURE, acx, sizeof(*acx)); 1641 1641 if (ret < 0) { 1642 - wl1271_warning("acx max tx retry failed: %d", ret); 1642 + wl1271_warning("acx ap max tx retry failed: %d", ret); 1643 1643 goto out; 1644 1644 } 1645 1645
+2 -2
drivers/net/wireless/wl12xx/acx.h
··· 1168 1168 u8 timeout; 1169 1169 } __packed; 1170 1170 1171 - struct wl1271_acx_max_tx_retry { 1171 + struct wl1271_acx_ap_max_tx_retry { 1172 1172 struct acx_header header; 1173 1173 1174 1174 /* ··· 1400 1400 bool enable); 1401 1401 int wl1271_acx_tsf_info(struct wl1271 *wl, u64 *mactime); 1402 1402 int wl1271_acx_ps_rx_streaming(struct wl1271 *wl, bool enable); 1403 - int wl1271_acx_max_tx_retry(struct wl1271 *wl); 1403 + int wl1271_acx_ap_max_tx_retry(struct wl1271 *wl); 1404 1404 int wl1271_acx_config_ps(struct wl1271 *wl); 1405 1405 int wl1271_acx_set_inconnection_sta(struct wl1271 *wl, u8 *addr); 1406 1406 int wl1271_acx_set_ap_beacon_filter(struct wl1271 *wl, bool enable);
+3 -1
drivers/net/wireless/wl12xx/boot.c
··· 513 513 PERIODIC_SCAN_COMPLETE_EVENT_ID; 514 514 515 515 if (wl->bss_type == BSS_TYPE_AP_BSS) 516 - wl->event_mask |= STA_REMOVE_COMPLETE_EVENT_ID; 516 + wl->event_mask |= STA_REMOVE_COMPLETE_EVENT_ID | 517 + INACTIVE_STA_EVENT_ID | 518 + MAX_TX_RETRY_EVENT_ID; 517 519 else 518 520 wl->event_mask |= DUMMY_PACKET_EVENT_ID | 519 521 BA_SESSION_RX_CONSTRAINT_EVENT_ID;
+1 -5
drivers/net/wireless/wl12xx/cmd.c
··· 400 400 401 401 join->ctrl |= wl->session_counter << WL1271_JOIN_CMD_TX_SESSION_OFFSET; 402 402 403 - /* reset TX security counters */ 404 - wl->tx_security_last_seq = 0; 405 - wl->tx_security_seq = 0; 406 - 407 403 wl1271_debug(DEBUG_CMD, "cmd join: basic_rate_set=0x%x, rate_set=0x%x", 408 404 join->basic_rate_set, join->supported_rate_set); 409 405 ··· 1080 1084 1081 1085 memcpy(cmd->bssid, bss_conf->bssid, ETH_ALEN); 1082 1086 1083 - cmd->aging_period = cpu_to_le16(WL1271_AP_DEF_INACTIV_SEC); 1087 + cmd->aging_period = cpu_to_le16(wl->conf.tx.ap_aging_period); 1084 1088 cmd->bss_index = WL1271_AP_BSS_INDEX; 1085 1089 cmd->global_hlid = WL1271_AP_GLOBAL_HLID; 1086 1090 cmd->broadcast_hlid = WL1271_AP_BROADCAST_HLID;
+9 -1
drivers/net/wireless/wl12xx/conf.h
··· 713 713 /* 714 714 * AP-mode - allow this number of TX retries to a station before an 715 715 * event is triggered from FW. 716 + * In AP-mode the hlids of unreachable stations are given in the 717 + * "sta_tx_retry_exceeded" member in the event mailbox. 716 718 */ 717 - u16 ap_max_tx_retries; 719 + u8 max_tx_retries; 720 + 721 + /* 722 + * AP-mode - after this number of seconds a connected station is 723 + * considered inactive. 724 + */ 725 + u16 ap_aging_period; 718 726 719 727 /* 720 728 * Configuration for TID parameters.
+11 -4
drivers/net/wireless/wl12xx/debugfs.c
··· 30 30 #include "acx.h" 31 31 #include "ps.h" 32 32 #include "io.h" 33 + #include "tx.h" 33 34 34 35 /* ms */ 35 36 #define WL1271_DEBUGFS_STATS_LIFETIME 1000 ··· 234 233 char buf[20]; 235 234 int res; 236 235 237 - queue_len = wl->tx_queue_count; 236 + queue_len = wl1271_tx_total_queue_count(wl); 238 237 239 238 res = scnprintf(buf, sizeof(buf), "%u\n", queue_len); 240 239 return simple_read_from_buffer(userbuf, count, ppos, buf, res); ··· 339 338 #define DRIVER_STATE_PRINT_HEX(x) DRIVER_STATE_PRINT(x, "0x%x") 340 339 341 340 DRIVER_STATE_PRINT_INT(tx_blocks_available); 342 - DRIVER_STATE_PRINT_INT(tx_allocated_blocks); 341 + DRIVER_STATE_PRINT_INT(tx_allocated_blocks[0]); 342 + DRIVER_STATE_PRINT_INT(tx_allocated_blocks[1]); 343 + DRIVER_STATE_PRINT_INT(tx_allocated_blocks[2]); 344 + DRIVER_STATE_PRINT_INT(tx_allocated_blocks[3]); 343 345 DRIVER_STATE_PRINT_INT(tx_frames_cnt); 344 346 DRIVER_STATE_PRINT_LHEX(tx_frames_map[0]); 345 - DRIVER_STATE_PRINT_INT(tx_queue_count); 347 + DRIVER_STATE_PRINT_INT(tx_queue_count[0]); 348 + DRIVER_STATE_PRINT_INT(tx_queue_count[1]); 349 + DRIVER_STATE_PRINT_INT(tx_queue_count[2]); 350 + DRIVER_STATE_PRINT_INT(tx_queue_count[3]); 346 351 DRIVER_STATE_PRINT_INT(tx_packets_count); 347 352 DRIVER_STATE_PRINT_INT(tx_results_count); 348 353 DRIVER_STATE_PRINT_LHEX(flags); ··· 356 349 DRIVER_STATE_PRINT_INT(tx_blocks_freed[1]); 357 350 DRIVER_STATE_PRINT_INT(tx_blocks_freed[2]); 358 351 DRIVER_STATE_PRINT_INT(tx_blocks_freed[3]); 359 - DRIVER_STATE_PRINT_INT(tx_security_last_seq); 352 + DRIVER_STATE_PRINT_INT(tx_security_last_seq_lsb); 360 353 DRIVER_STATE_PRINT_INT(rx_counter); 361 354 DRIVER_STATE_PRINT_INT(session_counter); 362 355 DRIVER_STATE_PRINT_INT(state);
+42
drivers/net/wireless/wl12xx/event.c
··· 214 214 u32 vector; 215 215 bool beacon_loss = false; 216 216 bool is_ap = (wl->bss_type == BSS_TYPE_AP_BSS); 217 + bool disconnect_sta = false; 218 + unsigned long sta_bitmap = 0; 217 219 218 220 wl1271_event_mbox_dump(mbox); 219 221 ··· 295 293 wl1271_debug(DEBUG_EVENT, "DUMMY_PACKET_ID_EVENT_ID"); 296 294 if (wl->vif) 297 295 wl1271_tx_dummy_packet(wl); 296 + } 297 + 298 + /* 299 + * "TX retries exceeded" has a different meaning according to mode. 300 + * In AP mode the offending station is disconnected. 301 + */ 302 + if ((vector & MAX_TX_RETRY_EVENT_ID) && is_ap) { 303 + wl1271_debug(DEBUG_EVENT, "MAX_TX_RETRY_EVENT_ID"); 304 + sta_bitmap |= le16_to_cpu(mbox->sta_tx_retry_exceeded); 305 + disconnect_sta = true; 306 + } 307 + 308 + if ((vector & INACTIVE_STA_EVENT_ID) && is_ap) { 309 + wl1271_debug(DEBUG_EVENT, "INACTIVE_STA_EVENT_ID"); 310 + sta_bitmap |= le16_to_cpu(mbox->sta_aging_status); 311 + disconnect_sta = true; 312 + } 313 + 314 + if (is_ap && disconnect_sta) { 315 + u32 num_packets = wl->conf.tx.max_tx_retries; 316 + struct ieee80211_sta *sta; 317 + const u8 *addr; 318 + int h; 319 + 320 + for (h = find_first_bit(&sta_bitmap, AP_MAX_LINKS); 321 + h < AP_MAX_LINKS; 322 + h = find_next_bit(&sta_bitmap, AP_MAX_LINKS, h+1)) { 323 + if (!wl1271_is_active_sta(wl, h)) 324 + continue; 325 + 326 + addr = wl->links[h].addr; 327 + 328 + rcu_read_lock(); 329 + sta = ieee80211_find_sta(wl->vif, addr); 330 + if (sta) { 331 + wl1271_debug(DEBUG_EVENT, "remove sta %d", h); 332 + ieee80211_report_low_ack(sta, num_packets); 333 + } 334 + rcu_read_unlock(); 335 + } 298 336 } 299 337 300 338 if (wl->vif && beacon_loss)
+11 -1
drivers/net/wireless/wl12xx/event.h
··· 58 58 CHANNEL_SWITCH_COMPLETE_EVENT_ID = BIT(17), 59 59 BSS_LOSE_EVENT_ID = BIT(18), 60 60 REGAINED_BSS_EVENT_ID = BIT(19), 61 - ROAMING_TRIGGER_MAX_TX_RETRY_EVENT_ID = BIT(20), 61 + MAX_TX_RETRY_EVENT_ID = BIT(20), 62 62 /* STA: dummy paket for dynamic mem blocks */ 63 63 DUMMY_PACKET_EVENT_ID = BIT(21), 64 64 /* AP: STA remove complete */ 65 65 STA_REMOVE_COMPLETE_EVENT_ID = BIT(21), 66 66 SOFT_GEMINI_SENSE_EVENT_ID = BIT(22), 67 + /* STA: SG prediction */ 67 68 SOFT_GEMINI_PREDICTION_EVENT_ID = BIT(23), 69 + /* AP: Inactive STA */ 70 + INACTIVE_STA_EVENT_ID = BIT(23), 68 71 SOFT_GEMINI_AVALANCHE_EVENT_ID = BIT(24), 69 72 PLT_RX_CALIBRATION_COMPLETE_EVENT_ID = BIT(25), 70 73 DBG_EVENT_ID = BIT(26), ··· 122 119 123 120 /* AP FW only */ 124 121 u8 hlid_removed; 122 + 123 + /* a bitmap of hlids for stations that have been inactive too long */ 125 124 __le16 sta_aging_status; 125 + 126 + /* a bitmap of hlids for stations which didn't respond to TX */ 126 127 __le16 sta_tx_retry_exceeded; 127 128 128 129 /* ··· 149 142 void wl1271_event_mbox_config(struct wl1271 *wl); 150 143 int wl1271_event_handle(struct wl1271 *wl, u8 mbox); 151 144 void wl1271_pspoll_work(struct work_struct *work); 145 + 146 + /* Functions from main.c */ 147 + bool wl1271_is_active_sta(struct wl1271 *wl, u8 hlid); 152 148 153 149 #endif
+6 -1
drivers/net/wireless/wl12xx/init.c
··· 447 447 if (ret < 0) 448 448 return ret; 449 449 450 - ret = wl1271_acx_max_tx_retry(wl); 450 + ret = wl1271_acx_ap_max_tx_retry(wl); 451 451 if (ret < 0) 452 452 return ret; 453 453 454 454 ret = wl1271_acx_ap_mem_cfg(wl); 455 + if (ret < 0) 456 + return ret; 457 + 458 + /* initialize Tx power */ 459 + ret = wl1271_acx_tx_power(wl, wl->power_level); 455 460 if (ret < 0) 456 461 return ret; 457 462
+143 -59
drivers/net/wireless/wl12xx/main.c
··· 210 210 .tx_op_limit = 1504, 211 211 }, 212 212 }, 213 - .ap_max_tx_retries = 100, 213 + .max_tx_retries = 100, 214 + .ap_aging_period = 300, 214 215 .tid_conf_count = 4, 215 216 .tid_conf = { 216 217 [CONF_TX_AC_BE] = { ··· 824 823 } 825 824 } 826 825 826 + static u32 wl1271_tx_allocated_blocks(struct wl1271 *wl) 827 + { 828 + int i; 829 + u32 total_alloc_blocks = 0; 830 + 831 + for (i = 0; i < NUM_TX_QUEUES; i++) 832 + total_alloc_blocks += wl->tx_allocated_blocks[i]; 833 + 834 + return total_alloc_blocks; 835 + } 836 + 827 837 static void wl1271_fw_status(struct wl1271 *wl, 828 838 struct wl1271_fw_full_status *full_status) 829 839 { 830 840 struct wl1271_fw_common_status *status = &full_status->common; 831 841 struct timespec ts; 832 842 u32 old_tx_blk_count = wl->tx_blocks_available; 833 - u32 freed_blocks = 0; 843 + u32 freed_blocks = 0, ac_freed_blocks; 834 844 int i; 835 845 836 846 if (wl->bss_type == BSS_TYPE_AP_BSS) { ··· 861 849 862 850 /* update number of available TX blocks */ 863 851 for (i = 0; i < NUM_TX_QUEUES; i++) { 864 - freed_blocks += le32_to_cpu(status->tx_released_blks[i]) - 865 - wl->tx_blocks_freed[i]; 852 + ac_freed_blocks = le32_to_cpu(status->tx_released_blks[i]) - 853 + wl->tx_blocks_freed[i]; 854 + freed_blocks += ac_freed_blocks; 855 + 856 + wl->tx_allocated_blocks[i] -= ac_freed_blocks; 866 857 867 858 wl->tx_blocks_freed[i] = 868 859 le32_to_cpu(status->tx_released_blks[i]); 869 860 } 870 - 871 - wl->tx_allocated_blocks -= freed_blocks; 872 861 873 862 if (wl->bss_type == BSS_TYPE_AP_BSS) { 874 863 /* Update num of allocated TX blocks per link and ps status */ 875 864 wl1271_irq_update_links_status(wl, &full_status->ap); 876 865 wl->tx_blocks_available += freed_blocks; 877 866 } else { 878 - int avail = full_status->sta.tx_total - wl->tx_allocated_blocks; 867 + int avail = full_status->sta.tx_total - 868 + wl1271_tx_allocated_blocks(wl); 879 869 880 870 /* 881 871 * The FW might change the total number of TX memblocks before ··· 992 978 /* Check if any tx blocks were freed */ 993 979 spin_lock_irqsave(&wl->wl_lock, flags); 994 980 if (!test_bit(WL1271_FLAG_FW_TX_BUSY, &wl->flags) && 995 - wl->tx_queue_count) { 981 + wl1271_tx_total_queue_count(wl) > 0) { 996 982 spin_unlock_irqrestore(&wl->wl_lock, flags); 997 983 /* 998 984 * In order to avoid starvation of the TX path, ··· 1040 1026 /* In case TX was not handled here, queue TX work */ 1041 1027 clear_bit(WL1271_FLAG_TX_PENDING, &wl->flags); 1042 1028 if (!test_bit(WL1271_FLAG_FW_TX_BUSY, &wl->flags) && 1043 - wl->tx_queue_count) 1029 + wl1271_tx_total_queue_count(wl) > 0) 1044 1030 ieee80211_queue_work(wl->hw, &wl->tx_work); 1045 1031 spin_unlock_irqrestore(&wl->wl_lock, flags); 1046 1032 ··· 1240 1226 1241 1227 wl1271_info("Hardware recovery in progress. FW ver: %s pc: 0x%x", 1242 1228 wl->chip.fw_ver_str, wl1271_read32(wl, SCR_PAD4)); 1229 + 1230 + /* 1231 + * Advance security sequence number to overcome potential progress 1232 + * in the firmware during recovery. This doens't hurt if the network is 1233 + * not encrypted. 1234 + */ 1235 + if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags) || 1236 + test_bit(WL1271_FLAG_AP_STARTED, &wl->flags)) 1237 + wl->tx_security_seq += WL1271_TX_SQN_POST_RECOVERY_PADDING; 1243 1238 1244 1239 if (test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) 1245 1240 ieee80211_connection_loss(wl->vif); ··· 1497 1474 { 1498 1475 struct wl1271 *wl = hw->priv; 1499 1476 unsigned long flags; 1500 - int q; 1477 + int q, mapping; 1501 1478 u8 hlid = 0; 1502 1479 1503 - q = wl1271_tx_get_queue(skb_get_queue_mapping(skb)); 1480 + mapping = skb_get_queue_mapping(skb); 1481 + q = wl1271_tx_get_queue(mapping); 1504 1482 1505 1483 if (wl->bss_type == BSS_TYPE_AP_BSS) 1506 1484 hlid = wl1271_tx_get_hlid(skb); 1507 1485 1508 1486 spin_lock_irqsave(&wl->wl_lock, flags); 1509 1487 1510 - wl->tx_queue_count++; 1488 + wl->tx_queue_count[q]++; 1511 1489 1512 1490 /* 1513 1491 * The workqueue is slow to process the tx_queue and we need stop 1514 1492 * the queue here, otherwise the queue will get too long. 1515 1493 */ 1516 - if (wl->tx_queue_count >= WL1271_TX_QUEUE_HIGH_WATERMARK) { 1517 - wl1271_debug(DEBUG_TX, "op_tx: stopping queues"); 1518 - ieee80211_stop_queues(wl->hw); 1519 - set_bit(WL1271_FLAG_TX_QUEUE_STOPPED, &wl->flags); 1494 + if (wl->tx_queue_count[q] >= WL1271_TX_QUEUE_HIGH_WATERMARK) { 1495 + wl1271_debug(DEBUG_TX, "op_tx: stopping queues for q %d", q); 1496 + ieee80211_stop_queue(wl->hw, mapping); 1497 + set_bit(q, &wl->stopped_queues_map); 1520 1498 } 1521 1499 1522 1500 /* queue the packet */ ··· 1543 1519 int wl1271_tx_dummy_packet(struct wl1271 *wl) 1544 1520 { 1545 1521 unsigned long flags; 1522 + int q = wl1271_tx_get_queue(skb_get_queue_mapping(wl->dummy_packet)); 1546 1523 1547 1524 spin_lock_irqsave(&wl->wl_lock, flags); 1548 1525 set_bit(WL1271_FLAG_DUMMY_PACKET_PENDING, &wl->flags); 1549 - wl->tx_queue_count++; 1526 + wl->tx_queue_count[q]++; 1550 1527 spin_unlock_irqrestore(&wl->wl_lock, flags); 1551 1528 1552 1529 /* The FW is low on RX memory blocks, so send the dummy packet asap */ ··· 1611 1586 #ifdef CONFIG_PM 1612 1587 static int wl1271_configure_suspend_sta(struct wl1271 *wl) 1613 1588 { 1614 - int ret; 1589 + int ret = 0; 1615 1590 1616 1591 mutex_lock(&wl->mutex); 1592 + 1593 + if (!test_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags)) 1594 + goto out_unlock; 1617 1595 1618 1596 ret = wl1271_ps_elp_wakeup(wl); 1619 1597 if (ret < 0) ··· 1662 1634 1663 1635 static int wl1271_configure_suspend_ap(struct wl1271 *wl) 1664 1636 { 1665 - int ret; 1637 + int ret = 0; 1666 1638 1667 1639 mutex_lock(&wl->mutex); 1640 + 1641 + if (!test_bit(WL1271_FLAG_AP_STARTED, &wl->flags)) 1642 + goto out_unlock; 1668 1643 1669 1644 ret = wl1271_ps_elp_wakeup(wl); 1670 1645 if (ret < 0) ··· 1736 1705 } 1737 1706 /* flush any remaining work */ 1738 1707 wl1271_debug(DEBUG_MAC80211, "flushing remaining works"); 1739 - flush_delayed_work(&wl->scan_complete_work); 1740 1708 1741 1709 /* 1742 1710 * disable and re-enable interrupts in order to flush ··· 2007 1977 wl->psm_entry_retry = 0; 2008 1978 wl->power_level = WL1271_DEFAULT_POWER_LEVEL; 2009 1979 wl->tx_blocks_available = 0; 2010 - wl->tx_allocated_blocks = 0; 2011 1980 wl->tx_results_count = 0; 2012 1981 wl->tx_packets_count = 0; 2013 - wl->tx_security_last_seq = 0; 2014 - wl->tx_security_seq = 0; 2015 1982 wl->time_offset = 0; 2016 1983 wl->session_counter = 0; 2017 1984 wl->rate_set = CONF_TX_RATE_MASK_BASIC; ··· 2027 2000 */ 2028 2001 wl->flags = 0; 2029 2002 2030 - for (i = 0; i < NUM_TX_QUEUES; i++) 2003 + for (i = 0; i < NUM_TX_QUEUES; i++) { 2031 2004 wl->tx_blocks_freed[i] = 0; 2005 + wl->tx_allocated_blocks[i] = 0; 2006 + } 2032 2007 2033 2008 wl1271_debugfs_reset(wl); 2034 2009 ··· 2183 2154 clear_bit(WL1271_FLAG_JOINED, &wl->flags); 2184 2155 memset(wl->bssid, 0, ETH_ALEN); 2185 2156 2157 + /* reset TX security counters on a clean disconnect */ 2158 + wl->tx_security_last_seq_lsb = 0; 2159 + wl->tx_security_seq = 0; 2160 + 2186 2161 /* stop filtering packets based on bssid */ 2187 2162 wl1271_configure_filters(wl, FIF_OTHER_BSS); 2188 2163 ··· 2278 2245 wl->band = conf->channel->band; 2279 2246 wl->channel = channel; 2280 2247 } 2248 + 2249 + if ((changed & IEEE80211_CONF_CHANGE_POWER)) 2250 + wl->power_level = conf->power_level; 2281 2251 2282 2252 goto out; 2283 2253 } ··· 2787 2751 mutex_unlock(&wl->mutex); 2788 2752 2789 2753 return ret; 2754 + } 2755 + 2756 + static void wl1271_op_cancel_hw_scan(struct ieee80211_hw *hw, 2757 + struct ieee80211_vif *vif) 2758 + { 2759 + struct wl1271 *wl = hw->priv; 2760 + int ret; 2761 + 2762 + wl1271_debug(DEBUG_MAC80211, "mac80211 cancel hw scan"); 2763 + 2764 + mutex_lock(&wl->mutex); 2765 + 2766 + if (wl->state == WL1271_STATE_OFF) 2767 + goto out; 2768 + 2769 + if (wl->scan.state == WL1271_SCAN_STATE_IDLE) 2770 + goto out; 2771 + 2772 + ret = wl1271_ps_elp_wakeup(wl); 2773 + if (ret < 0) 2774 + goto out; 2775 + 2776 + if (wl->scan.state != WL1271_SCAN_STATE_DONE) { 2777 + ret = wl1271_scan_stop(wl); 2778 + if (ret < 0) 2779 + goto out_sleep; 2780 + } 2781 + wl->scan.state = WL1271_SCAN_STATE_IDLE; 2782 + memset(wl->scan.scanned_ch, 0, sizeof(wl->scan.scanned_ch)); 2783 + wl->scan.req = NULL; 2784 + ieee80211_scan_completed(wl->hw, true); 2785 + 2786 + out_sleep: 2787 + wl1271_ps_elp_sleep(wl); 2788 + out: 2789 + mutex_unlock(&wl->mutex); 2790 + 2791 + cancel_delayed_work_sync(&wl->scan_complete_work); 2790 2792 } 2791 2793 2792 2794 static int wl1271_op_sched_scan_start(struct ieee80211_hw *hw, ··· 3589 3515 __clear_bit(hlid, (unsigned long *)&wl->ap_fw_ps_map); 3590 3516 } 3591 3517 3518 + bool wl1271_is_active_sta(struct wl1271 *wl, u8 hlid) 3519 + { 3520 + int id = hlid - WL1271_AP_STA_HLID_START; 3521 + return test_bit(id, wl->ap_hlid_map); 3522 + } 3523 + 3592 3524 static int wl1271_op_sta_add(struct ieee80211_hw *hw, 3593 3525 struct ieee80211_vif *vif, 3594 3526 struct ieee80211_sta *sta) ··· 3753 3673 goto out; 3754 3674 3755 3675 /* packets are considered pending if in the TX queue or the FW */ 3756 - ret = (wl->tx_queue_count > 0) || (wl->tx_frames_cnt > 0); 3676 + ret = (wl1271_tx_total_queue_count(wl) > 0) || (wl->tx_frames_cnt > 0); 3757 3677 3758 3678 /* the above is appropriate for STA mode for PS purposes */ 3759 3679 WARN_ON(wl->bss_type != BSS_TYPE_STA_BSS); ··· 3916 3836 3917 3837 /* 5 GHz band channels for WL1273 */ 3918 3838 static struct ieee80211_channel wl1271_channels_5ghz[] = { 3919 - { .hw_value = 7, .center_freq = 5035}, 3920 - { .hw_value = 8, .center_freq = 5040}, 3921 - { .hw_value = 9, .center_freq = 5045}, 3922 - { .hw_value = 11, .center_freq = 5055}, 3923 - { .hw_value = 12, .center_freq = 5060}, 3924 - { .hw_value = 16, .center_freq = 5080}, 3925 - { .hw_value = 34, .center_freq = 5170}, 3926 - { .hw_value = 36, .center_freq = 5180}, 3927 - { .hw_value = 38, .center_freq = 5190}, 3928 - { .hw_value = 40, .center_freq = 5200}, 3929 - { .hw_value = 42, .center_freq = 5210}, 3930 - { .hw_value = 44, .center_freq = 5220}, 3931 - { .hw_value = 46, .center_freq = 5230}, 3932 - { .hw_value = 48, .center_freq = 5240}, 3933 - { .hw_value = 52, .center_freq = 5260}, 3934 - { .hw_value = 56, .center_freq = 5280}, 3935 - { .hw_value = 60, .center_freq = 5300}, 3936 - { .hw_value = 64, .center_freq = 5320}, 3937 - { .hw_value = 100, .center_freq = 5500}, 3938 - { .hw_value = 104, .center_freq = 5520}, 3939 - { .hw_value = 108, .center_freq = 5540}, 3940 - { .hw_value = 112, .center_freq = 5560}, 3941 - { .hw_value = 116, .center_freq = 5580}, 3942 - { .hw_value = 120, .center_freq = 5600}, 3943 - { .hw_value = 124, .center_freq = 5620}, 3944 - { .hw_value = 128, .center_freq = 5640}, 3945 - { .hw_value = 132, .center_freq = 5660}, 3946 - { .hw_value = 136, .center_freq = 5680}, 3947 - { .hw_value = 140, .center_freq = 5700}, 3948 - { .hw_value = 149, .center_freq = 5745}, 3949 - { .hw_value = 153, .center_freq = 5765}, 3950 - { .hw_value = 157, .center_freq = 5785}, 3951 - { .hw_value = 161, .center_freq = 5805}, 3952 - { .hw_value = 165, .center_freq = 5825}, 3839 + { .hw_value = 7, .center_freq = 5035, .max_power = 25 }, 3840 + { .hw_value = 8, .center_freq = 5040, .max_power = 25 }, 3841 + { .hw_value = 9, .center_freq = 5045, .max_power = 25 }, 3842 + { .hw_value = 11, .center_freq = 5055, .max_power = 25 }, 3843 + { .hw_value = 12, .center_freq = 5060, .max_power = 25 }, 3844 + { .hw_value = 16, .center_freq = 5080, .max_power = 25 }, 3845 + { .hw_value = 34, .center_freq = 5170, .max_power = 25 }, 3846 + { .hw_value = 36, .center_freq = 5180, .max_power = 25 }, 3847 + { .hw_value = 38, .center_freq = 5190, .max_power = 25 }, 3848 + { .hw_value = 40, .center_freq = 5200, .max_power = 25 }, 3849 + { .hw_value = 42, .center_freq = 5210, .max_power = 25 }, 3850 + { .hw_value = 44, .center_freq = 5220, .max_power = 25 }, 3851 + { .hw_value = 46, .center_freq = 5230, .max_power = 25 }, 3852 + { .hw_value = 48, .center_freq = 5240, .max_power = 25 }, 3853 + { .hw_value = 52, .center_freq = 5260, .max_power = 25 }, 3854 + { .hw_value = 56, .center_freq = 5280, .max_power = 25 }, 3855 + { .hw_value = 60, .center_freq = 5300, .max_power = 25 }, 3856 + { .hw_value = 64, .center_freq = 5320, .max_power = 25 }, 3857 + { .hw_value = 100, .center_freq = 5500, .max_power = 25 }, 3858 + { .hw_value = 104, .center_freq = 5520, .max_power = 25 }, 3859 + { .hw_value = 108, .center_freq = 5540, .max_power = 25 }, 3860 + { .hw_value = 112, .center_freq = 5560, .max_power = 25 }, 3861 + { .hw_value = 116, .center_freq = 5580, .max_power = 25 }, 3862 + { .hw_value = 120, .center_freq = 5600, .max_power = 25 }, 3863 + { .hw_value = 124, .center_freq = 5620, .max_power = 25 }, 3864 + { .hw_value = 128, .center_freq = 5640, .max_power = 25 }, 3865 + { .hw_value = 132, .center_freq = 5660, .max_power = 25 }, 3866 + { .hw_value = 136, .center_freq = 5680, .max_power = 25 }, 3867 + { .hw_value = 140, .center_freq = 5700, .max_power = 25 }, 3868 + { .hw_value = 149, .center_freq = 5745, .max_power = 25 }, 3869 + { .hw_value = 153, .center_freq = 5765, .max_power = 25 }, 3870 + { .hw_value = 157, .center_freq = 5785, .max_power = 25 }, 3871 + { .hw_value = 161, .center_freq = 5805, .max_power = 25 }, 3872 + { .hw_value = 165, .center_freq = 5825, .max_power = 25 }, 3953 3873 }; 3954 3874 3955 3875 /* mapping to indexes for wl1271_rates_5ghz */ ··· 4010 3930 .tx = wl1271_op_tx, 4011 3931 .set_key = wl1271_op_set_key, 4012 3932 .hw_scan = wl1271_op_hw_scan, 3933 + .cancel_hw_scan = wl1271_op_cancel_hw_scan, 4013 3934 .sched_scan_start = wl1271_op_sched_scan_start, 4014 3935 .sched_scan_stop = wl1271_op_sched_scan_stop, 4015 3936 .bss_info_changed = wl1271_op_bss_info_changed, ··· 4408 4327 wl->quirks = 0; 4409 4328 wl->platform_quirks = 0; 4410 4329 wl->sched_scanning = false; 4330 + wl->tx_security_seq = 0; 4331 + wl->tx_security_last_seq_lsb = 0; 4332 + 4411 4333 setup_timer(&wl->rx_streaming_timer, wl1271_rx_streaming_timer, 4412 4334 (unsigned long) wl); 4413 4335 wl->fwlog_size = 0;
+6 -3
drivers/net/wireless/wl12xx/ps.c
··· 193 193 194 194 static void wl1271_ps_filter_frames(struct wl1271 *wl, u8 hlid) 195 195 { 196 - int i, filtered = 0; 196 + int i; 197 197 struct sk_buff *skb; 198 198 struct ieee80211_tx_info *info; 199 199 unsigned long flags; 200 + int filtered[NUM_TX_QUEUES]; 200 201 201 202 /* filter all frames currently the low level queus for this hlid */ 202 203 for (i = 0; i < NUM_TX_QUEUES; i++) { 204 + filtered[i] = 0; 203 205 while ((skb = skb_dequeue(&wl->links[hlid].tx_queue[i]))) { 204 206 info = IEEE80211_SKB_CB(skb); 205 207 info->flags |= IEEE80211_TX_STAT_TX_FILTERED; 206 208 info->status.rates[0].idx = -1; 207 209 ieee80211_tx_status_ni(wl->hw, skb); 208 - filtered++; 210 + filtered[i]++; 209 211 } 210 212 } 211 213 212 214 spin_lock_irqsave(&wl->wl_lock, flags); 213 - wl->tx_queue_count -= filtered; 215 + for (i = 0; i < NUM_TX_QUEUES; i++) 216 + wl->tx_queue_count[i] -= filtered[i]; 214 217 spin_unlock_irqrestore(&wl->wl_lock, flags); 215 218 216 219 wl1271_handle_tx_low_watermark(wl);
+27
drivers/net/wireless/wl12xx/scan.c
··· 321 321 return 0; 322 322 } 323 323 324 + int wl1271_scan_stop(struct wl1271 *wl) 325 + { 326 + struct wl1271_cmd_header *cmd = NULL; 327 + int ret = 0; 328 + 329 + if (WARN_ON(wl->scan.state == WL1271_SCAN_STATE_IDLE)) 330 + return -EINVAL; 331 + 332 + wl1271_debug(DEBUG_CMD, "cmd scan stop"); 333 + 334 + cmd = kzalloc(sizeof(*cmd), GFP_KERNEL); 335 + if (!cmd) { 336 + ret = -ENOMEM; 337 + goto out; 338 + } 339 + 340 + ret = wl1271_cmd_send(wl, CMD_STOP_SCAN, cmd, 341 + sizeof(*cmd), 0); 342 + if (ret < 0) { 343 + wl1271_error("cmd stop_scan failed"); 344 + goto out; 345 + } 346 + out: 347 + kfree(cmd); 348 + return ret; 349 + } 350 + 324 351 static int 325 352 wl1271_scan_get_sched_scan_channels(struct wl1271 *wl, 326 353 struct cfg80211_sched_scan_request *req,
+1
drivers/net/wireless/wl12xx/scan.h
··· 28 28 29 29 int wl1271_scan(struct wl1271 *wl, const u8 *ssid, size_t ssid_len, 30 30 struct cfg80211_scan_request *req); 31 + int wl1271_scan_stop(struct wl1271 *wl); 31 32 int wl1271_scan_build_probe_req(struct wl1271 *wl, 32 33 const u8 *ssid, size_t ssid_len, 33 34 const u8 *ie, size_t ie_len, u8 band);
+6 -6
drivers/net/wireless/wl12xx/sdio.c
··· 166 166 ret = pm_runtime_get_sync(&func->dev); 167 167 if (ret) 168 168 goto out; 169 + } else { 170 + /* Runtime PM is disabled: power up the card manually */ 171 + ret = mmc_power_restore_host(func->card->host); 172 + if (ret < 0) 173 + goto out; 169 174 } 170 - 171 - /* Runtime PM might be disabled, so power up the card manually */ 172 - ret = mmc_power_restore_host(func->card->host); 173 - if (ret < 0) 174 - goto out; 175 175 176 176 sdio_claim_host(func); 177 177 sdio_enable_func(func); ··· 188 188 sdio_disable_func(func); 189 189 sdio_release_host(func); 190 190 191 - /* Runtime PM might be disabled, so power off the card manually */ 191 + /* Power off the card manually, even if runtime PM is enabled. */ 192 192 ret = mmc_power_save_host(func->card->host); 193 193 if (ret < 0) 194 194 return ret;
+97 -46
drivers/net/wireless/wl12xx/tx.c
··· 168 168 u32 total_len = skb->len + sizeof(struct wl1271_tx_hw_descr) + extra; 169 169 u32 len; 170 170 u32 total_blocks; 171 - int id, ret = -EBUSY; 171 + int id, ret = -EBUSY, ac; 172 172 u32 spare_blocks; 173 173 174 174 if (unlikely(wl->quirks & WL12XX_QUIRK_USE_2_SPARE_BLOCKS)) ··· 206 206 desc->id = id; 207 207 208 208 wl->tx_blocks_available -= total_blocks; 209 - wl->tx_allocated_blocks += total_blocks; 209 + 210 + ac = wl1271_tx_get_queue(skb_get_queue_mapping(skb)); 211 + wl->tx_allocated_blocks[ac] += total_blocks; 210 212 211 213 if (wl->bss_type == BSS_TYPE_AP_BSS) 212 214 wl->links[hlid].allocated_blks += total_blocks; ··· 385 383 if (ret < 0) 386 384 return ret; 387 385 386 + wl1271_tx_fill_hdr(wl, skb, extra, info, hlid); 387 + 388 388 if (wl->bss_type == BSS_TYPE_AP_BSS) { 389 389 wl1271_tx_ap_update_inconnection_sta(wl, skb); 390 390 wl1271_tx_regulate_link(wl, hlid); 391 391 } else { 392 392 wl1271_tx_update_filters(wl, skb); 393 393 } 394 - 395 - wl1271_tx_fill_hdr(wl, skb, extra, info, hlid); 396 394 397 395 /* 398 396 * The length of each packet is stored in terms of ··· 444 442 void wl1271_handle_tx_low_watermark(struct wl1271 *wl) 445 443 { 446 444 unsigned long flags; 445 + int i; 447 446 448 - if (test_bit(WL1271_FLAG_TX_QUEUE_STOPPED, &wl->flags) && 449 - wl->tx_queue_count <= WL1271_TX_QUEUE_LOW_WATERMARK) { 450 - /* firmware buffer has space, restart queues */ 451 - spin_lock_irqsave(&wl->wl_lock, flags); 452 - ieee80211_wake_queues(wl->hw); 453 - clear_bit(WL1271_FLAG_TX_QUEUE_STOPPED, &wl->flags); 454 - spin_unlock_irqrestore(&wl->wl_lock, flags); 447 + for (i = 0; i < NUM_TX_QUEUES; i++) { 448 + if (test_bit(i, &wl->stopped_queues_map) && 449 + wl->tx_queue_count[i] <= WL1271_TX_QUEUE_LOW_WATERMARK) { 450 + /* firmware buffer has space, restart queues */ 451 + spin_lock_irqsave(&wl->wl_lock, flags); 452 + ieee80211_wake_queue(wl->hw, 453 + wl1271_tx_get_mac80211_queue(i)); 454 + clear_bit(i, &wl->stopped_queues_map); 455 + spin_unlock_irqrestore(&wl->wl_lock, flags); 456 + } 455 457 } 458 + } 459 + 460 + static struct sk_buff_head *wl1271_select_queue(struct wl1271 *wl, 461 + struct sk_buff_head *queues) 462 + { 463 + int i, q = -1; 464 + u32 min_blks = 0xffffffff; 465 + 466 + /* 467 + * Find a non-empty ac where: 468 + * 1. There are packets to transmit 469 + * 2. The FW has the least allocated blocks 470 + */ 471 + for (i = 0; i < NUM_TX_QUEUES; i++) 472 + if (!skb_queue_empty(&queues[i]) && 473 + (wl->tx_allocated_blocks[i] < min_blks)) { 474 + q = i; 475 + min_blks = wl->tx_allocated_blocks[q]; 476 + } 477 + 478 + if (q == -1) 479 + return NULL; 480 + 481 + return &queues[q]; 456 482 } 457 483 458 484 static struct sk_buff *wl1271_sta_skb_dequeue(struct wl1271 *wl) 459 485 { 460 486 struct sk_buff *skb = NULL; 461 487 unsigned long flags; 488 + struct sk_buff_head *queue; 462 489 463 - skb = skb_dequeue(&wl->tx_queue[CONF_TX_AC_VO]); 464 - if (skb) 490 + queue = wl1271_select_queue(wl, wl->tx_queue); 491 + if (!queue) 465 492 goto out; 466 - skb = skb_dequeue(&wl->tx_queue[CONF_TX_AC_VI]); 467 - if (skb) 468 - goto out; 469 - skb = skb_dequeue(&wl->tx_queue[CONF_TX_AC_BE]); 470 - if (skb) 471 - goto out; 472 - skb = skb_dequeue(&wl->tx_queue[CONF_TX_AC_BK]); 493 + 494 + skb = skb_dequeue(queue); 473 495 474 496 out: 475 497 if (skb) { 498 + int q = wl1271_tx_get_queue(skb_get_queue_mapping(skb)); 476 499 spin_lock_irqsave(&wl->wl_lock, flags); 477 - wl->tx_queue_count--; 500 + wl->tx_queue_count[q]--; 478 501 spin_unlock_irqrestore(&wl->wl_lock, flags); 479 502 } 480 503 ··· 511 484 struct sk_buff *skb = NULL; 512 485 unsigned long flags; 513 486 int i, h, start_hlid; 487 + struct sk_buff_head *queue; 514 488 515 489 /* start from the link after the last one */ 516 490 start_hlid = (wl->last_tx_hlid + 1) % AP_MAX_LINKS; ··· 520 492 for (i = 0; i < AP_MAX_LINKS; i++) { 521 493 h = (start_hlid + i) % AP_MAX_LINKS; 522 494 523 - skb = skb_dequeue(&wl->links[h].tx_queue[CONF_TX_AC_VO]); 495 + /* only consider connected stations */ 496 + if (h >= WL1271_AP_STA_HLID_START && 497 + !test_bit(h - WL1271_AP_STA_HLID_START, wl->ap_hlid_map)) 498 + continue; 499 + 500 + queue = wl1271_select_queue(wl, wl->links[h].tx_queue); 501 + if (!queue) 502 + continue; 503 + 504 + skb = skb_dequeue(queue); 524 505 if (skb) 525 - goto out; 526 - skb = skb_dequeue(&wl->links[h].tx_queue[CONF_TX_AC_VI]); 527 - if (skb) 528 - goto out; 529 - skb = skb_dequeue(&wl->links[h].tx_queue[CONF_TX_AC_BE]); 530 - if (skb) 531 - goto out; 532 - skb = skb_dequeue(&wl->links[h].tx_queue[CONF_TX_AC_BK]); 533 - if (skb) 534 - goto out; 506 + break; 535 507 } 536 508 537 - out: 538 509 if (skb) { 510 + int q = wl1271_tx_get_queue(skb_get_queue_mapping(skb)); 539 511 wl->last_tx_hlid = h; 540 512 spin_lock_irqsave(&wl->wl_lock, flags); 541 - wl->tx_queue_count--; 513 + wl->tx_queue_count[q]--; 542 514 spin_unlock_irqrestore(&wl->wl_lock, flags); 543 515 } else { 544 516 wl->last_tx_hlid = 0; ··· 559 531 560 532 if (!skb && 561 533 test_and_clear_bit(WL1271_FLAG_DUMMY_PACKET_PENDING, &wl->flags)) { 534 + int q; 535 + 562 536 skb = wl->dummy_packet; 537 + q = wl1271_tx_get_queue(skb_get_queue_mapping(skb)); 563 538 spin_lock_irqsave(&wl->wl_lock, flags); 564 - wl->tx_queue_count--; 539 + wl->tx_queue_count[q]--; 565 540 spin_unlock_irqrestore(&wl->wl_lock, flags); 566 541 } 567 542 ··· 589 558 } 590 559 591 560 spin_lock_irqsave(&wl->wl_lock, flags); 592 - wl->tx_queue_count++; 561 + wl->tx_queue_count[q]++; 593 562 spin_unlock_irqrestore(&wl->wl_lock, flags); 594 563 } 595 564 ··· 735 704 736 705 wl->stats.retry_count += result->ack_failures; 737 706 738 - /* update security sequence number */ 739 - wl->tx_security_seq += (result->lsb_security_sequence_number - 740 - wl->tx_security_last_seq); 741 - wl->tx_security_last_seq = result->lsb_security_sequence_number; 707 + /* 708 + * update sequence number only when relevant, i.e. only in 709 + * sessions of TKIP, AES and GEM (not in open or WEP sessions) 710 + */ 711 + if (info->control.hw_key && 712 + (info->control.hw_key->cipher == WLAN_CIPHER_SUITE_TKIP || 713 + info->control.hw_key->cipher == WLAN_CIPHER_SUITE_CCMP || 714 + info->control.hw_key->cipher == WL1271_CIPHER_SUITE_GEM)) { 715 + u8 fw_lsb = result->tx_security_sequence_number_lsb; 716 + u8 cur_lsb = wl->tx_security_last_seq_lsb; 717 + 718 + /* 719 + * update security sequence number, taking care of potential 720 + * wrap-around 721 + */ 722 + wl->tx_security_seq += (fw_lsb - cur_lsb + 256) % 256; 723 + wl->tx_security_last_seq_lsb = fw_lsb; 724 + } 742 725 743 726 /* remove private header from packet */ 744 727 skb_pull(skb, sizeof(struct wl1271_tx_hw_descr)); ··· 817 772 void wl1271_tx_reset_link_queues(struct wl1271 *wl, u8 hlid) 818 773 { 819 774 struct sk_buff *skb; 820 - int i, total = 0; 775 + int i; 821 776 unsigned long flags; 822 777 struct ieee80211_tx_info *info; 778 + int total[NUM_TX_QUEUES]; 823 779 824 780 for (i = 0; i < NUM_TX_QUEUES; i++) { 781 + total[i] = 0; 825 782 while ((skb = skb_dequeue(&wl->links[hlid].tx_queue[i]))) { 826 783 wl1271_debug(DEBUG_TX, "link freeing skb 0x%p", skb); 827 784 info = IEEE80211_SKB_CB(skb); 828 785 info->status.rates[0].idx = -1; 829 786 info->status.rates[0].count = 0; 830 787 ieee80211_tx_status_ni(wl->hw, skb); 831 - total++; 788 + total[i]++; 832 789 } 833 790 } 834 791 835 792 spin_lock_irqsave(&wl->wl_lock, flags); 836 - wl->tx_queue_count -= total; 793 + for (i = 0; i < NUM_TX_QUEUES; i++) 794 + wl->tx_queue_count[i] -= total[i]; 837 795 spin_unlock_irqrestore(&wl->wl_lock, flags); 838 796 839 797 wl1271_handle_tx_low_watermark(wl); ··· 871 823 ieee80211_tx_status_ni(wl->hw, skb); 872 824 } 873 825 } 826 + wl->tx_queue_count[i] = 0; 874 827 } 875 828 } 876 829 877 - wl->tx_queue_count = 0; 830 + wl->stopped_queues_map = 0; 878 831 879 832 /* 880 833 * Make sure the driver is at a consistent state, in case this ··· 928 879 while (!time_after(jiffies, timeout)) { 929 880 mutex_lock(&wl->mutex); 930 881 wl1271_debug(DEBUG_TX, "flushing tx buffer: %d %d", 931 - wl->tx_frames_cnt, wl->tx_queue_count); 932 - if ((wl->tx_frames_cnt == 0) && (wl->tx_queue_count == 0)) { 882 + wl->tx_frames_cnt, 883 + wl1271_tx_total_queue_count(wl)); 884 + if ((wl->tx_frames_cnt == 0) && 885 + (wl1271_tx_total_queue_count(wl) == 0)) { 933 886 mutex_unlock(&wl->mutex); 934 887 return; 935 888 }
+27 -1
drivers/net/wireless/wl12xx/tx.h
··· 150 150 (from 1st EDCA AIFS counter until TX Complete). */ 151 151 __le32 medium_delay; 152 152 /* LS-byte of last TKIP seq-num (saved per AC for recovery). */ 153 - u8 lsb_security_sequence_number; 153 + u8 tx_security_sequence_number_lsb; 154 154 /* Retry count - number of transmissions without successful ACK.*/ 155 155 u8 ack_failures; 156 156 /* The rate that succeeded getting ACK ··· 180 180 default: 181 181 return CONF_TX_AC_BE; 182 182 } 183 + } 184 + 185 + static inline int wl1271_tx_get_mac80211_queue(int queue) 186 + { 187 + switch (queue) { 188 + case CONF_TX_AC_VO: 189 + return 0; 190 + case CONF_TX_AC_VI: 191 + return 1; 192 + case CONF_TX_AC_BE: 193 + return 2; 194 + case CONF_TX_AC_BK: 195 + return 3; 196 + default: 197 + return 2; 198 + } 199 + } 200 + 201 + static inline int wl1271_tx_total_queue_count(struct wl1271 *wl) 202 + { 203 + int i, count = 0; 204 + 205 + for (i = 0; i < NUM_TX_QUEUES; i++) 206 + count += wl->tx_queue_count[i]; 207 + 208 + return count; 183 209 } 184 210 185 211 void wl1271_tx_work(struct work_struct *work);
+16 -8
drivers/net/wireless/wl12xx/wl12xx.h
··· 144 144 145 145 #define WL1271_TX_SECURITY_LO16(s) ((u16)((s) & 0xffff)) 146 146 #define WL1271_TX_SECURITY_HI32(s) ((u32)(((s) >> 16) & 0xffffffff)) 147 + #define WL1271_TX_SQN_POST_RECOVERY_PADDING 0xff 147 148 148 149 #define WL1271_CIPHER_SUITE_GEM 0x00147201 149 150 ··· 173 172 #define WL1271_PS_STA_MAX_BLOCKS (2 * 9) 174 173 175 174 #define WL1271_AP_BSS_INDEX 0 176 - #define WL1271_AP_DEF_INACTIV_SEC 300 177 175 #define WL1271_AP_DEF_BEACON_EXP 20 178 176 179 177 #define ACX_TX_DESCRIPTORS 32 ··· 424 424 /* Accounting for allocated / available TX blocks on HW */ 425 425 u32 tx_blocks_freed[NUM_TX_QUEUES]; 426 426 u32 tx_blocks_available; 427 - u32 tx_allocated_blocks; 427 + u32 tx_allocated_blocks[NUM_TX_QUEUES]; 428 428 u32 tx_results_count; 429 429 430 430 /* Transmitted TX packets counter for chipset interface */ ··· 438 438 439 439 /* Frames scheduled for transmission, not handled yet */ 440 440 struct sk_buff_head tx_queue[NUM_TX_QUEUES]; 441 - int tx_queue_count; 441 + int tx_queue_count[NUM_TX_QUEUES]; 442 + long stopped_queues_map; 442 443 443 444 /* Frames received, not handled yet by mac80211 */ 444 445 struct sk_buff_head deferred_rx_queue; ··· 455 454 struct sk_buff *tx_frames[ACX_TX_DESCRIPTORS]; 456 455 int tx_frames_cnt; 457 456 458 - /* Security sequence number counters */ 459 - u8 tx_security_last_seq; 460 - s64 tx_security_seq; 457 + /* 458 + * Security sequence number 459 + * bits 0-15: lower 16 bits part of sequence number 460 + * bits 16-47: higher 32 bits part of sequence number 461 + * bits 48-63: not in use 462 + */ 463 + u64 tx_security_seq; 464 + 465 + /* 8 bits of the last sequence number in use */ 466 + u8 tx_security_last_seq_lsb; 461 467 462 468 /* FW Rx counter */ 463 469 u32 rx_counter; ··· 640 632 641 633 #define WL1271_DEFAULT_POWER_LEVEL 0 642 634 643 - #define WL1271_TX_QUEUE_LOW_WATERMARK 10 644 - #define WL1271_TX_QUEUE_HIGH_WATERMARK 25 635 + #define WL1271_TX_QUEUE_LOW_WATERMARK 32 636 + #define WL1271_TX_QUEUE_HIGH_WATERMARK 256 645 637 646 638 #define WL1271_DEFERRED_QUEUE_LIMIT 64 647 639