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

Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem

+674 -489
+1 -2
drivers/net/wireless/Makefile
··· 50 50 obj-$(CONFIG_MAC80211_HWSIM) += mac80211_hwsim.o 51 51 52 52 obj-$(CONFIG_WL12XX) += wl12xx/ 53 - # small builtin driver bit 54 - obj-$(CONFIG_WL12XX_PLATFORM_DATA) += wl12xx/wl12xx_platform_data.o 53 + obj-$(CONFIG_WL12XX_PLATFORM_DATA) += wl12xx/ 55 54 56 55 obj-$(CONFIG_IWM) += iwmc3200wifi/
-11
drivers/net/wireless/airo.c
··· 217 217 (no spaces) list of rates (up to 8). */ 218 218 219 219 static int rates[8]; 220 - static int basic_rate; 221 220 static char *ssids[3]; 222 221 223 222 static int io[4]; ··· 249 250 MODULE_SUPPORTED_DEVICE("Aironet 4500, 4800 and Cisco 340/350"); 250 251 module_param_array(io, int, NULL, 0); 251 252 module_param_array(irq, int, NULL, 0); 252 - module_param(basic_rate, int, 0); 253 253 module_param_array(rates, int, NULL, 0); 254 254 module_param_array(ssids, charp, NULL, 0); 255 255 module_param(auto_wep, int, 0); ··· 3879 3881 memset(ai->config.rates,0,sizeof(ai->config.rates)); 3880 3882 for( i = 0; i < 8 && rates[i]; i++ ) { 3881 3883 ai->config.rates[i] = rates[i]; 3882 - } 3883 - } 3884 - if ( basic_rate > 0 ) { 3885 - for( i = 0; i < 8; i++ ) { 3886 - if ( ai->config.rates[i] == basic_rate || 3887 - !ai->config.rates ) { 3888 - ai->config.rates[i] = basic_rate | 0x80; 3889 - break; 3890 - } 3891 3884 } 3892 3885 } 3893 3886 set_bit (FLAG_COMMIT, &ai->flags);
+1 -1
drivers/net/wireless/ath/ath5k/ath5k.h
··· 1041 1041 #define ah_modes ah_capabilities.cap_mode 1042 1042 #define ah_ee_version ah_capabilities.cap_eeprom.ee_version 1043 1043 1044 - u32 ah_atim_window; 1045 1044 u32 ah_limit_tx_retries; 1046 1045 u8 ah_coverage_class; 1047 1046 ··· 1195 1196 void ath5k_hw_set_tsf64(struct ath5k_hw *ah, u64 tsf64); 1196 1197 void ath5k_hw_reset_tsf(struct ath5k_hw *ah); 1197 1198 void ath5k_hw_init_beacon(struct ath5k_hw *ah, u32 next_beacon, u32 interval); 1199 + bool ath5k_hw_check_beacon_timers(struct ath5k_hw *ah, int intval); 1198 1200 /* ACK bit rate */ 1199 1201 void ath5k_hw_set_ack_bitrate_high(struct ath5k_hw *ah, bool high); 1200 1202 /* Clock rate related functions */
-1
drivers/net/wireless/ath/ath5k/attach.c
··· 118 118 ah->ah_turbo = false; 119 119 ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER; 120 120 ah->ah_imr = 0; 121 - ah->ah_atim_window = 0; 122 121 ah->ah_limit_tx_retries = AR5K_INIT_TX_RETRY; 123 122 ah->ah_software_retry = false; 124 123 ah->ah_ant_mode = AR5K_ANTMODE_DEFAULT;
+14 -2
drivers/net/wireless/ath/ath5k/base.c
··· 1191 1191 */ 1192 1192 if (hw_tu >= sc->nexttbtt) 1193 1193 ath5k_beacon_update_timers(sc, bc_tstamp); 1194 + 1195 + /* Check if the beacon timers are still correct, because a TSF 1196 + * update might have created a window between them - for a 1197 + * longer description see the comment of this function: */ 1198 + if (!ath5k_hw_check_beacon_timers(sc->ah, sc->bintval)) { 1199 + ath5k_beacon_update_timers(sc, bc_tstamp); 1200 + ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON, 1201 + "fixed beacon timers after beacon receive\n"); 1202 + } 1194 1203 } 1195 1204 } 1196 1205 ··· 1886 1877 hw_tsf = ath5k_hw_get_tsf64(ah); 1887 1878 hw_tu = TSF_TO_TU(hw_tsf); 1888 1879 1889 - #define FUDGE 3 1890 - /* we use FUDGE to make sure the next TBTT is ahead of the current TU */ 1880 + #define FUDGE AR5K_TUNE_SW_BEACON_RESP + 3 1881 + /* We use FUDGE to make sure the next TBTT is ahead of the current TU. 1882 + * Since we later substract AR5K_TUNE_SW_BEACON_RESP (10) in the timer 1883 + * configuration we need to make sure it is bigger than that. */ 1884 + 1891 1885 if (bc_tsf == -1) { 1892 1886 /* 1893 1887 * no beacons received, called internally.
+58
drivers/net/wireless/ath/ath5k/debug.c
··· 483 483 .owner = THIS_MODULE, 484 484 }; 485 485 486 + /* debugfs: misc */ 487 + 488 + static ssize_t read_file_misc(struct file *file, char __user *user_buf, 489 + size_t count, loff_t *ppos) 490 + { 491 + struct ath5k_softc *sc = file->private_data; 492 + char buf[700]; 493 + unsigned int len = 0; 494 + u32 filt = ath5k_hw_get_rx_filter(sc->ah); 495 + 496 + len += snprintf(buf+len, sizeof(buf)-len, "bssid-mask: %pM\n", 497 + sc->bssidmask); 498 + len += snprintf(buf+len, sizeof(buf)-len, "filter-flags: 0x%x ", 499 + filt); 500 + if (filt & AR5K_RX_FILTER_UCAST) 501 + len += snprintf(buf+len, sizeof(buf)-len, " UCAST"); 502 + if (filt & AR5K_RX_FILTER_MCAST) 503 + len += snprintf(buf+len, sizeof(buf)-len, " MCAST"); 504 + if (filt & AR5K_RX_FILTER_BCAST) 505 + len += snprintf(buf+len, sizeof(buf)-len, " BCAST"); 506 + if (filt & AR5K_RX_FILTER_CONTROL) 507 + len += snprintf(buf+len, sizeof(buf)-len, " CONTROL"); 508 + if (filt & AR5K_RX_FILTER_BEACON) 509 + len += snprintf(buf+len, sizeof(buf)-len, " BEACON"); 510 + if (filt & AR5K_RX_FILTER_PROM) 511 + len += snprintf(buf+len, sizeof(buf)-len, " PROM"); 512 + if (filt & AR5K_RX_FILTER_XRPOLL) 513 + len += snprintf(buf+len, sizeof(buf)-len, " XRPOLL"); 514 + if (filt & AR5K_RX_FILTER_PROBEREQ) 515 + len += snprintf(buf+len, sizeof(buf)-len, " PROBEREQ"); 516 + if (filt & AR5K_RX_FILTER_PHYERR_5212) 517 + len += snprintf(buf+len, sizeof(buf)-len, " PHYERR-5212"); 518 + if (filt & AR5K_RX_FILTER_RADARERR_5212) 519 + len += snprintf(buf+len, sizeof(buf)-len, " RADARERR-5212"); 520 + if (filt & AR5K_RX_FILTER_PHYERR_5211) 521 + snprintf(buf+len, sizeof(buf)-len, " PHYERR-5211"); 522 + if (filt & AR5K_RX_FILTER_RADARERR_5211) 523 + len += snprintf(buf+len, sizeof(buf)-len, " RADARERR-5211\n"); 524 + else 525 + len += snprintf(buf+len, sizeof(buf)-len, "\n"); 526 + 527 + if (len > sizeof(buf)) 528 + len = sizeof(buf); 529 + 530 + return simple_read_from_buffer(user_buf, count, ppos, buf, len); 531 + } 532 + 533 + static const struct file_operations fops_misc = { 534 + .read = read_file_misc, 535 + .open = ath5k_debugfs_open, 536 + .owner = THIS_MODULE, 537 + }; 538 + 486 539 487 540 /* debugfs: frameerrors */ 488 541 ··· 909 856 S_IWUSR | S_IRUSR, 910 857 sc->debug.debugfs_phydir, sc, &fops_antenna); 911 858 859 + sc->debug.debugfs_misc = debugfs_create_file("misc", 860 + S_IRUSR, 861 + sc->debug.debugfs_phydir, sc, &fops_misc); 862 + 912 863 sc->debug.debugfs_frameerrors = debugfs_create_file("frameerrors", 913 864 S_IWUSR | S_IRUSR, 914 865 sc->debug.debugfs_phydir, sc, ··· 943 886 debugfs_remove(sc->debug.debugfs_beacon); 944 887 debugfs_remove(sc->debug.debugfs_reset); 945 888 debugfs_remove(sc->debug.debugfs_antenna); 889 + debugfs_remove(sc->debug.debugfs_misc); 946 890 debugfs_remove(sc->debug.debugfs_frameerrors); 947 891 debugfs_remove(sc->debug.debugfs_ani); 948 892 debugfs_remove(sc->debug.debugfs_queue);
+1
drivers/net/wireless/ath/ath5k/debug.h
··· 75 75 struct dentry *debugfs_beacon; 76 76 struct dentry *debugfs_reset; 77 77 struct dentry *debugfs_antenna; 78 + struct dentry *debugfs_misc; 78 79 struct dentry *debugfs_frameerrors; 79 80 struct dentry *debugfs_ani; 80 81 struct dentry *debugfs_queue;
+2 -2
drivers/net/wireless/ath/ath5k/dma.c
··· 244 244 245 245 /* Force channel idle high */ 246 246 AR5K_REG_ENABLE_BITS(ah, AR5K_DIAG_SW_5211, 247 - AR5K_DIAG_SW_CHANEL_IDLE_HIGH); 247 + AR5K_DIAG_SW_CHANNEL_IDLE_HIGH); 248 248 249 249 /* Wait a while and disable mechanism */ 250 250 udelay(200); ··· 261 261 } while (--i && pending); 262 262 263 263 AR5K_REG_DISABLE_BITS(ah, AR5K_DIAG_SW_5211, 264 - AR5K_DIAG_SW_CHANEL_IDLE_HIGH); 264 + AR5K_DIAG_SW_CHANNEL_IDLE_HIGH); 265 265 } 266 266 267 267 /* Clear register */
+98 -1
drivers/net/wireless/ath/ath5k/pcu.c
··· 495 495 { 496 496 u32 tsf_lower, tsf_upper1, tsf_upper2; 497 497 int i; 498 + unsigned long flags; 499 + 500 + /* This code is time critical - we don't want to be interrupted here */ 501 + local_irq_save(flags); 498 502 499 503 /* 500 504 * While reading TSF upper and then lower part, the clock is still ··· 520 516 break; 521 517 tsf_upper1 = tsf_upper2; 522 518 } 519 + 520 + local_irq_restore(flags); 523 521 524 522 WARN_ON( i == ATH5K_MAX_TSF_READ ); 525 523 ··· 606 600 /* Timer3 marks the end of our ATIM window 607 601 * a zero length window is not allowed because 608 602 * we 'll get no beacons */ 609 - timer3 = next_beacon + (ah->ah_atim_window ? ah->ah_atim_window : 1); 603 + timer3 = next_beacon + 1; 610 604 611 605 /* 612 606 * Set the beacon register and enable all timers. ··· 644 638 * disable power save reporting.*/ 645 639 AR5K_REG_DISABLE_BITS(ah, AR5K_STA_ID1, AR5K_STA_ID1_PWR_SV); 646 640 641 + } 642 + 643 + /** 644 + * ath5k_check_timer_win - Check if timer B is timer A + window 645 + * 646 + * @a: timer a (before b) 647 + * @b: timer b (after a) 648 + * @window: difference between a and b 649 + * @intval: timers are increased by this interval 650 + * 651 + * This helper function checks if timer B is timer A + window and covers 652 + * cases where timer A or B might have already been updated or wrapped 653 + * around (Timers are 16 bit). 654 + * 655 + * Returns true if O.K. 656 + */ 657 + static inline bool 658 + ath5k_check_timer_win(int a, int b, int window, int intval) 659 + { 660 + /* 661 + * 1.) usually B should be A + window 662 + * 2.) A already updated, B not updated yet 663 + * 3.) A already updated and has wrapped around 664 + * 4.) B has wrapped around 665 + */ 666 + if ((b - a == window) || /* 1.) */ 667 + (a - b == intval - window) || /* 2.) */ 668 + ((a | 0x10000) - b == intval - window) || /* 3.) */ 669 + ((b | 0x10000) - a == window)) /* 4.) */ 670 + return true; /* O.K. */ 671 + return false; 672 + } 673 + 674 + /** 675 + * ath5k_hw_check_beacon_timers - Check if the beacon timers are correct 676 + * 677 + * @ah: The &struct ath5k_hw 678 + * @intval: beacon interval 679 + * 680 + * This is a workaround for IBSS mode: 681 + * 682 + * The need for this function arises from the fact that we have 4 separate 683 + * HW timer registers (TIMER0 - TIMER3), which are closely related to the 684 + * next beacon target time (NBTT), and that the HW updates these timers 685 + * seperately based on the current TSF value. The hardware increments each 686 + * timer by the beacon interval, when the local TSF coverted to TU is equal 687 + * to the value stored in the timer. 688 + * 689 + * The reception of a beacon with the same BSSID can update the local HW TSF 690 + * at any time - this is something we can't avoid. If the TSF jumps to a 691 + * time which is later than the time stored in a timer, this timer will not 692 + * be updated until the TSF in TU wraps around at 16 bit (the size of the 693 + * timers) and reaches the time which is stored in the timer. 694 + * 695 + * The problem is that these timers are closely related to TIMER0 (NBTT) and 696 + * that they define a time "window". When the TSF jumps between two timers 697 + * (e.g. ATIM and NBTT), the one in the past will be left behind (not 698 + * updated), while the one in the future will be updated every beacon 699 + * interval. This causes the window to get larger, until the TSF wraps 700 + * around as described above and the timer which was left behind gets 701 + * updated again. But - because the beacon interval is usually not an exact 702 + * divisor of the size of the timers (16 bit), an unwanted "window" between 703 + * these timers has developed! 704 + * 705 + * This is especially important with the ATIM window, because during 706 + * the ATIM window only ATIM frames and no data frames are allowed to be 707 + * sent, which creates transmission pauses after each beacon. This symptom 708 + * has been described as "ramping ping" because ping times increase linearly 709 + * for some time and then drop down again. A wrong window on the DMA beacon 710 + * timer has the same effect, so we check for these two conditions. 711 + * 712 + * Returns true if O.K. 713 + */ 714 + bool 715 + ath5k_hw_check_beacon_timers(struct ath5k_hw *ah, int intval) 716 + { 717 + unsigned int nbtt, atim, dma; 718 + 719 + nbtt = ath5k_hw_reg_read(ah, AR5K_TIMER0); 720 + atim = ath5k_hw_reg_read(ah, AR5K_TIMER3); 721 + dma = ath5k_hw_reg_read(ah, AR5K_TIMER1) >> 3; 722 + 723 + /* NOTE: SWBA is different. Having a wrong window there does not 724 + * stop us from sending data and this condition is catched thru 725 + * other means (SWBA interrupt) */ 726 + 727 + if (ath5k_check_timer_win(nbtt, atim, 1, intval) && 728 + ath5k_check_timer_win(dma, nbtt, AR5K_TUNE_DMA_BEACON_RESP, 729 + intval)) 730 + return true; /* O.K. */ 731 + return false; 647 732 } 648 733 649 734 /**
+2 -2
drivers/net/wireless/ath/ath5k/phy.c
··· 1257 1257 * Disable beacons and RX/TX queues, wait 1258 1258 */ 1259 1259 AR5K_REG_ENABLE_BITS(ah, AR5K_DIAG_SW_5210, 1260 - AR5K_DIAG_SW_DIS_TX | AR5K_DIAG_SW_DIS_RX_5210); 1260 + AR5K_DIAG_SW_DIS_TX_5210 | AR5K_DIAG_SW_DIS_RX_5210); 1261 1261 beacon = ath5k_hw_reg_read(ah, AR5K_BEACON_5210); 1262 1262 ath5k_hw_reg_write(ah, beacon & ~AR5K_BEACON_ENABLE, AR5K_BEACON_5210); 1263 1263 ··· 1336 1336 * Re-enable RX/TX and beacons 1337 1337 */ 1338 1338 AR5K_REG_DISABLE_BITS(ah, AR5K_DIAG_SW_5210, 1339 - AR5K_DIAG_SW_DIS_TX | AR5K_DIAG_SW_DIS_RX_5210); 1339 + AR5K_DIAG_SW_DIS_TX_5210 | AR5K_DIAG_SW_DIS_RX_5210); 1340 1340 ath5k_hw_reg_write(ah, beacon, AR5K_BEACON_5210); 1341 1341 1342 1342 return 0;
+14 -15
drivers/net/wireless/ath/ath5k/reg.h
··· 1387 1387 1388 1388 1389 1389 /* 1390 - * PCU control register 1390 + * PCU Diagnostic register 1391 1391 * 1392 - * Only DIS_RX is used in the code, the rest i guess are 1393 - * for tweaking/diagnostics. 1392 + * Used for tweaking/diagnostics. 1394 1393 */ 1395 1394 #define AR5K_DIAG_SW_5210 0x8068 /* Register Address [5210] */ 1396 1395 #define AR5K_DIAG_SW_5211 0x8048 /* Register Address [5211+] */ ··· 1398 1399 #define AR5K_DIAG_SW_DIS_WEP_ACK 0x00000001 /* Disable ACKs if WEP key is invalid */ 1399 1400 #define AR5K_DIAG_SW_DIS_ACK 0x00000002 /* Disable ACKs */ 1400 1401 #define AR5K_DIAG_SW_DIS_CTS 0x00000004 /* Disable CTSs */ 1401 - #define AR5K_DIAG_SW_DIS_ENC 0x00000008 /* Disable encryption */ 1402 - #define AR5K_DIAG_SW_DIS_DEC 0x00000010 /* Disable decryption */ 1403 - #define AR5K_DIAG_SW_DIS_TX 0x00000020 /* Disable transmit [5210] */ 1404 - #define AR5K_DIAG_SW_DIS_RX_5210 0x00000040 /* Disable recieve */ 1402 + #define AR5K_DIAG_SW_DIS_ENC 0x00000008 /* Disable HW encryption */ 1403 + #define AR5K_DIAG_SW_DIS_DEC 0x00000010 /* Disable HW decryption */ 1404 + #define AR5K_DIAG_SW_DIS_TX_5210 0x00000020 /* Disable transmit [5210] */ 1405 + #define AR5K_DIAG_SW_DIS_RX_5210 0x00000040 /* Disable receive */ 1405 1406 #define AR5K_DIAG_SW_DIS_RX_5211 0x00000020 1406 1407 #define AR5K_DIAG_SW_DIS_RX (ah->ah_version == AR5K_AR5210 ? \ 1407 1408 AR5K_DIAG_SW_DIS_RX_5210 : AR5K_DIAG_SW_DIS_RX_5211) 1408 - #define AR5K_DIAG_SW_LOOP_BACK_5210 0x00000080 /* Loopback (i guess it goes with DIS_TX) [5210] */ 1409 + #define AR5K_DIAG_SW_LOOP_BACK_5210 0x00000080 /* TX Data Loopback (i guess it goes with DIS_TX) [5210] */ 1409 1410 #define AR5K_DIAG_SW_LOOP_BACK_5211 0x00000040 1410 1411 #define AR5K_DIAG_SW_LOOP_BACK (ah->ah_version == AR5K_AR5210 ? \ 1411 1412 AR5K_DIAG_SW_LOOP_BACK_5210 : AR5K_DIAG_SW_LOOP_BACK_5211) 1412 - #define AR5K_DIAG_SW_CORR_FCS_5210 0x00000100 /* Corrupted FCS */ 1413 + #define AR5K_DIAG_SW_CORR_FCS_5210 0x00000100 /* Generate invalid TX FCS */ 1413 1414 #define AR5K_DIAG_SW_CORR_FCS_5211 0x00000080 1414 1415 #define AR5K_DIAG_SW_CORR_FCS (ah->ah_version == AR5K_AR5210 ? \ 1415 1416 AR5K_DIAG_SW_CORR_FCS_5210 : AR5K_DIAG_SW_CORR_FCS_5211) 1416 - #define AR5K_DIAG_SW_CHAN_INFO_5210 0x00000200 /* Dump channel info */ 1417 + #define AR5K_DIAG_SW_CHAN_INFO_5210 0x00000200 /* Add 56 bytes of channel info before the frame data in the RX buffer */ 1417 1418 #define AR5K_DIAG_SW_CHAN_INFO_5211 0x00000100 1418 1419 #define AR5K_DIAG_SW_CHAN_INFO (ah->ah_version == AR5K_AR5210 ? \ 1419 1420 AR5K_DIAG_SW_CHAN_INFO_5210 : AR5K_DIAG_SW_CHAN_INFO_5211) ··· 1425 1426 #define AR5K_DIAG_SW_SCVRAM_SEED 0x0003f800 /* [5210] */ 1426 1427 #define AR5K_DIAG_SW_SCRAM_SEED_M 0x0001fc00 /* Scrambler seed mask */ 1427 1428 #define AR5K_DIAG_SW_SCRAM_SEED_S 10 1428 - #define AR5K_DIAG_SW_DIS_SEQ_INC 0x00040000 /* Disable seqnum increment (?)[5210] */ 1429 + #define AR5K_DIAG_SW_DIS_SEQ_INC_5210 0x00040000 /* Disable seqnum increment (?)[5210] */ 1429 1430 #define AR5K_DIAG_SW_FRAME_NV0_5210 0x00080000 1430 1431 #define AR5K_DIAG_SW_FRAME_NV0_5211 0x00020000 /* Accept frames of non-zero protocol number */ 1431 1432 #define AR5K_DIAG_SW_FRAME_NV0 (ah->ah_version == AR5K_AR5210 ? \ 1432 1433 AR5K_DIAG_SW_FRAME_NV0_5210 : AR5K_DIAG_SW_FRAME_NV0_5211) 1433 1434 #define AR5K_DIAG_SW_OBSPT_M 0x000c0000 /* Observation point select (?) */ 1434 1435 #define AR5K_DIAG_SW_OBSPT_S 18 1435 - #define AR5K_DIAG_SW_RX_CLEAR_HIGH 0x0010000 /* Force RX Clear high */ 1436 - #define AR5K_DIAG_SW_IGNORE_CARR_SENSE 0x0020000 /* Ignore virtual carrier sense */ 1437 - #define AR5K_DIAG_SW_CHANEL_IDLE_HIGH 0x0040000 /* Force channel idle high */ 1438 - #define AR5K_DIAG_SW_PHEAR_ME 0x0080000 /* ??? */ 1436 + #define AR5K_DIAG_SW_RX_CLEAR_HIGH 0x00100000 /* Ignore carrier sense */ 1437 + #define AR5K_DIAG_SW_IGNORE_CARR_SENSE 0x00200000 /* Ignore virtual carrier sense */ 1438 + #define AR5K_DIAG_SW_CHANNEL_IDLE_HIGH 0x00400000 /* Force channel idle high */ 1439 + #define AR5K_DIAG_SW_PHEAR_ME 0x00800000 /* ??? */ 1439 1440 1440 1441 /* 1441 1442 * TSF (clock) register (lower 32 bits)
+11 -11
drivers/net/wireless/ath/ath9k/ar5008_phy.c
··· 118 118 if (!AR_SREV_5416(ah) || synth_freq >= 3000) 119 119 return; 120 120 121 - BUG_ON(AR_SREV_9280_10_OR_LATER(ah)); 121 + BUG_ON(AR_SREV_9280_20_OR_LATER(ah)); 122 122 123 123 if (synth_freq < 2412) 124 124 new_bias = 0; ··· 454 454 455 455 struct ath_common *common = ath9k_hw_common(ah); 456 456 457 - BUG_ON(AR_SREV_9280_10_OR_LATER(ah)); 457 + BUG_ON(AR_SREV_9280_20_OR_LATER(ah)); 458 458 459 459 ATH_ALLOC_BANK(ah->analogBank0Data, ah->iniBank0.ia_rows); 460 460 ATH_ALLOC_BANK(ah->analogBank1Data, ah->iniBank1.ia_rows); ··· 484 484 bank = NULL; \ 485 485 } while (0); 486 486 487 - BUG_ON(AR_SREV_9280_10_OR_LATER(ah)); 487 + BUG_ON(AR_SREV_9280_20_OR_LATER(ah)); 488 488 489 489 ATH_FREE_BANK(ah->analogBank0Data); 490 490 ATH_FREE_BANK(ah->analogBank1Data); ··· 525 525 * for single chip devices, that is AR9280 or anything 526 526 * after that. 527 527 */ 528 - if (AR_SREV_9280_10_OR_LATER(ah)) 528 + if (AR_SREV_9280_20_OR_LATER(ah)) 529 529 return true; 530 530 531 531 /* Setup rf parameters */ ··· 663 663 */ 664 664 REG_SET_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); 665 665 666 - if (AR_SREV_9280_10_OR_LATER(ah)) { 666 + if (AR_SREV_9280_20_OR_LATER(ah)) { 667 667 val = REG_READ(ah, AR_PCU_MISC_MODE2); 668 668 669 669 if (!AR_SREV_9271(ah)) 670 670 val &= ~AR_PCU_MISC_MODE2_HWWAR1; 671 671 672 - if (AR_SREV_9287_10_OR_LATER(ah)) 672 + if (AR_SREV_9287_11_OR_LATER(ah)) 673 673 val = val & (~AR_PCU_MISC_MODE2_HWWAR2); 674 674 675 675 REG_WRITE(ah, AR_PCU_MISC_MODE2, val); 676 676 } 677 677 678 678 if (!AR_SREV_5416_20_OR_LATER(ah) || 679 - AR_SREV_9280_10_OR_LATER(ah)) 679 + AR_SREV_9280_20_OR_LATER(ah)) 680 680 return; 681 681 /* 682 682 * Disable BB clock gating ··· 701 701 u32 phymode; 702 702 u32 enableDacFifo = 0; 703 703 704 - if (AR_SREV_9285_10_OR_LATER(ah)) 704 + if (AR_SREV_9285_12_OR_LATER(ah)) 705 705 enableDacFifo = (REG_READ(ah, AR_PHY_TURBO) & 706 706 AR_PHY_FC_ENABLE_DAC_FIFO); 707 707 ··· 820 820 REGWRITE_BUFFER_FLUSH(ah); 821 821 DISABLE_REGWRITE_BUFFER(ah); 822 822 823 - if (AR_SREV_9280(ah) || AR_SREV_9287_10_OR_LATER(ah)) 823 + if (AR_SREV_9280(ah) || AR_SREV_9287_11_OR_LATER(ah)) 824 824 REG_WRITE_ARRAY(&ah->iniModesRxGain, modesIndex, regWrites); 825 825 826 826 if (AR_SREV_9280(ah) || AR_SREV_9285_12_OR_LATER(ah) || 827 - AR_SREV_9287_10_OR_LATER(ah)) 827 + AR_SREV_9287_11_OR_LATER(ah)) 828 828 REG_WRITE_ARRAY(&ah->iniModesTxGain, modesIndex, regWrites); 829 829 830 830 if (AR_SREV_9271_10(ah)) ··· 900 900 rfMode |= (IS_CHAN_B(chan) || IS_CHAN_G(chan)) 901 901 ? AR_PHY_MODE_DYNAMIC : AR_PHY_MODE_OFDM; 902 902 903 - if (!AR_SREV_9280_10_OR_LATER(ah)) 903 + if (!AR_SREV_9280_20_OR_LATER(ah)) 904 904 rfMode |= (IS_CHAN_5GHZ(chan)) ? 905 905 AR_PHY_MODE_RF5GHZ : AR_PHY_MODE_RF2GHZ; 906 906
+6 -15
drivers/net/wireless/ath/ath9k/ar9002_calib.c
··· 567 567 AR5416_EEP_TXGAIN_HIGH_POWER) 568 568 return; 569 569 570 - if (AR_SREV_9285_11(ah)) { 571 - REG_WRITE(ah, AR9285_AN_TOP4, (AR9285_AN_TOP4_DEFAULT | 0x14)); 572 - udelay(10); 573 - } 574 - 575 570 for (i = 0; i < ARRAY_SIZE(regList); i++) 576 571 regList[i][1] = REG_READ(ah, regList[i][0]); 577 572 ··· 646 651 REG_WRITE(ah, regList[i][0], regList[i][1]); 647 652 648 653 REG_RMW_FIELD(ah, AR9285_AN_RF2G6, AR9285_AN_RF2G6_CCOMP, ccomp_org); 649 - 650 - if (AR_SREV_9285_11(ah)) 651 - REG_WRITE(ah, AR9285_AN_TOP4, AR9285_AN_TOP4_DEFAULT); 652 - 653 654 } 654 655 655 656 static void ar9002_hw_pa_cal(struct ath_hw *ah, bool is_reset) ··· 655 664 ar9271_hw_pa_cal(ah, is_reset); 656 665 else 657 666 ah->pacal_info.skipcount--; 658 - } else if (AR_SREV_9285_11_OR_LATER(ah)) { 667 + } else if (AR_SREV_9285_12_OR_LATER(ah)) { 659 668 if (is_reset || !ah->pacal_info.skipcount) 660 669 ar9285_hw_pa_cal(ah, is_reset); 661 670 else ··· 832 841 if (!ar9285_hw_clc(ah, chan)) 833 842 return false; 834 843 } else { 835 - if (AR_SREV_9280_10_OR_LATER(ah)) { 836 - if (!AR_SREV_9287_10_OR_LATER(ah)) 844 + if (AR_SREV_9280_20_OR_LATER(ah)) { 845 + if (!AR_SREV_9287_11_OR_LATER(ah)) 837 846 REG_CLR_BIT(ah, AR_PHY_ADC_CTL, 838 847 AR_PHY_ADC_CTL_OFF_PWDADC); 839 848 REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, ··· 855 864 return false; 856 865 } 857 866 858 - if (AR_SREV_9280_10_OR_LATER(ah)) { 859 - if (!AR_SREV_9287_10_OR_LATER(ah)) 867 + if (AR_SREV_9280_20_OR_LATER(ah)) { 868 + if (!AR_SREV_9287_11_OR_LATER(ah)) 860 869 REG_SET_BIT(ah, AR_PHY_ADC_CTL, 861 870 AR_PHY_ADC_CTL_OFF_PWDADC); 862 871 REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, ··· 967 976 } 968 977 969 978 if (AR_SREV_9160_10_OR_LATER(ah)) { 970 - if (AR_SREV_9280_10_OR_LATER(ah)) { 979 + if (AR_SREV_9280_20_OR_LATER(ah)) { 971 980 ah->iq_caldata.calData = &iq_cal_single_sample; 972 981 ah->adcgain_caldata.calData = 973 982 &adc_gain_cal_single_sample;
+1 -1
drivers/net/wireless/ath/ath9k/ar9002_hw.c
··· 569 569 ops->config_pci_powersave = ar9002_hw_configpcipowersave; 570 570 571 571 ar5008_hw_attach_phy_ops(ah); 572 - if (AR_SREV_9280_10_OR_LATER(ah)) 572 + if (AR_SREV_9280_20_OR_LATER(ah)) 573 573 ar9002_hw_attach_phy_ops(ah); 574 574 575 575 ar9002_hw_attach_calib_ops(ah);
+1 -1
drivers/net/wireless/ath/ath9k/eeprom.h
··· 101 101 #define AR5416_VER_MASK (eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) 102 102 #define OLC_FOR_AR9280_20_LATER (AR_SREV_9280_20_OR_LATER(ah) && \ 103 103 ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL)) 104 - #define OLC_FOR_AR9287_10_LATER (AR_SREV_9287_10_OR_LATER(ah) && \ 104 + #define OLC_FOR_AR9287_10_LATER (AR_SREV_9287_11_OR_LATER(ah) && \ 105 105 ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL)) 106 106 107 107 #define AR_EEPROM_RFSILENT_GPIO_SEL 0x001c
+2 -8
drivers/net/wireless/ath/ath9k/eeprom_4k.c
··· 333 333 } 334 334 335 335 if (i == 0) { 336 - if (AR_SREV_9280_10_OR_LATER(ah)) 336 + if (AR_SREV_9280_20_OR_LATER(ah)) 337 337 ss = (int16_t)(0 - (minPwrT4[i] / 2)); 338 338 else 339 339 ss = 0; ··· 761 761 762 762 regulatory->max_power_level = ratesArray[i]; 763 763 764 - if (AR_SREV_9280_10_OR_LATER(ah)) { 764 + if (AR_SREV_9280_20_OR_LATER(ah)) { 765 765 for (i = 0; i < Ar5416RateSize; i++) 766 766 ratesArray[i] -= AR5416_PWR_TABLE_OFFSET_DB * 2; 767 767 } ··· 909 909 AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); 910 910 REG_RMW_FIELD(ah, AR_PHY_RXGAIN + 0x1000, 911 911 AR9280_PHY_RXGAIN_TXRX_MARGIN, pModal->rxTxMarginCh[0]); 912 - 913 - if (AR_SREV_9285_11(ah)) 914 - REG_WRITE(ah, AR9285_AN_TOP4, (AR9285_AN_TOP4_DEFAULT | 0x14)); 915 912 } 916 913 917 914 /* ··· 1105 1108 db2[4]); 1106 1109 } 1107 1110 1108 - 1109 - if (AR_SREV_9285_11(ah)) 1110 - REG_WRITE(ah, AR9285_AN_TOP4, AR9285_AN_TOP4_DEFAULT); 1111 1111 1112 1112 REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, 1113 1113 pModal->switchSettling);
+3 -3
drivers/net/wireless/ath/ath9k/eeprom_9287.c
··· 324 324 minDelta = 0; 325 325 326 326 if (i == 0) { 327 - if (AR_SREV_9280_10_OR_LATER(ah)) 327 + if (AR_SREV_9280_20_OR_LATER(ah)) 328 328 ss = (int16_t)(0 - (minPwrT4[i] / 2)); 329 329 else 330 330 ss = 0; ··· 883 883 ratesArray[i] = AR9287_MAX_RATE_POWER; 884 884 } 885 885 886 - if (AR_SREV_9280_10_OR_LATER(ah)) { 886 + if (AR_SREV_9280_20_OR_LATER(ah)) { 887 887 for (i = 0; i < Ar5416RateSize; i++) 888 888 ratesArray[i] -= AR9287_PWR_TABLE_OFFSET_DB * 2; 889 889 } ··· 977 977 else 978 978 i = rate6mb; 979 979 980 - if (AR_SREV_9280_10_OR_LATER(ah)) 980 + if (AR_SREV_9280_20_OR_LATER(ah)) 981 981 regulatory->max_power_level = 982 982 ratesArray[i] + AR9287_PWR_TABLE_OFFSET_DB * 2; 983 983 else
+9 -9
drivers/net/wireless/ath/ath9k/eeprom_def.c
··· 223 223 } 224 224 225 225 /* Enable fixup for AR_AN_TOP2 if necessary */ 226 - if (AR_SREV_9280_10_OR_LATER(ah) && 226 + if (AR_SREV_9280_20_OR_LATER(ah) && 227 227 (eep->baseEepHeader.version & 0xff) > 0x0a && 228 228 eep->baseEepHeader.pwdclkind == 0) 229 229 ah->need_an_top2_fixup = 1; ··· 317 317 if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) { 318 318 txRxAttenLocal = pModal->txRxAttenCh[i]; 319 319 320 - if (AR_SREV_9280_10_OR_LATER(ah)) { 320 + if (AR_SREV_9280_20_OR_LATER(ah)) { 321 321 REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, 322 322 AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN, 323 323 pModal->bswMargin[i]); ··· 344 344 } 345 345 } 346 346 347 - if (AR_SREV_9280_10_OR_LATER(ah)) { 347 + if (AR_SREV_9280_20_OR_LATER(ah)) { 348 348 REG_RMW_FIELD(ah, 349 349 AR_PHY_RXGAIN + regChainOffset, 350 350 AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); ··· 408 408 regChainOffset, i); 409 409 } 410 410 411 - if (AR_SREV_9280_10_OR_LATER(ah)) { 411 + if (AR_SREV_9280_20_OR_LATER(ah)) { 412 412 if (IS_CHAN_2GHZ(chan)) { 413 413 ath9k_hw_analog_shift_rmw(ah, AR_AN_RF2G1_CH0, 414 414 AR_AN_RF2G1_CH0_OB, ··· 461 461 REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_ADC, 462 462 pModal->adcDesiredSize); 463 463 464 - if (!AR_SREV_9280_10_OR_LATER(ah)) 464 + if (!AR_SREV_9280_20_OR_LATER(ah)) 465 465 REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, 466 466 AR_PHY_DESIRED_SZ_PGA, 467 467 pModal->pgaDesiredSize); ··· 478 478 REG_RMW_FIELD(ah, AR_PHY_RF_CTL3, AR_PHY_TX_END_TO_A2_RX_ON, 479 479 pModal->txEndToRxOn); 480 480 481 - if (AR_SREV_9280_10_OR_LATER(ah)) { 481 + if (AR_SREV_9280_20_OR_LATER(ah)) { 482 482 REG_RMW_FIELD(ah, AR_PHY_CCA, AR9280_PHY_CCA_THRESH62, 483 483 pModal->thresh62); 484 484 REG_RMW_FIELD(ah, AR_PHY_EXT_CCA0, ··· 696 696 } 697 697 698 698 if (i == 0) { 699 - if (AR_SREV_9280_10_OR_LATER(ah)) 699 + if (AR_SREV_9280_20_OR_LATER(ah)) 700 700 ss = (int16_t)(0 - (minPwrT4[i] / 2)); 701 701 else 702 702 ss = 0; ··· 1291 1291 ratesArray[i] = AR5416_MAX_RATE_POWER; 1292 1292 } 1293 1293 1294 - if (AR_SREV_9280_10_OR_LATER(ah)) { 1294 + if (AR_SREV_9280_20_OR_LATER(ah)) { 1295 1295 for (i = 0; i < Ar5416RateSize; i++) { 1296 1296 int8_t pwr_table_offset; 1297 1297 ··· 1395 1395 else if (IS_CHAN_HT20(chan)) 1396 1396 i = rateHt20_0; 1397 1397 1398 - if (AR_SREV_9280_10_OR_LATER(ah)) 1398 + if (AR_SREV_9280_20_OR_LATER(ah)) 1399 1399 regulatory->max_power_level = 1400 1400 ratesArray[i] + AR5416_PWR_TABLE_OFFSET_DB * 2; 1401 1401 else
+8 -1
drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
··· 235 235 ath9k_hw_get_txq_props(ah, qnum, &qi_be); 236 236 237 237 qi.tqi_aifs = qi_be.tqi_aifs; 238 - qi.tqi_cwmin = 4*qi_be.tqi_cwmin; 238 + /* For WIFI Beacon Distribution 239 + * Long slot time : 2x cwmin 240 + * Short slot time : 4x cwmin 241 + */ 242 + if (ah->slottime == ATH9K_SLOT_TIME_20) 243 + qi.tqi_cwmin = 2*qi_be.tqi_cwmin; 244 + else 245 + qi.tqi_cwmin = 4*qi_be.tqi_cwmin; 239 246 qi.tqi_cwmax = qi_be.tqi_cwmax; 240 247 241 248 if (!ath9k_hw_set_txq_props(ah, priv->beaconq, &qi)) {
+3
drivers/net/wireless/ath/ath9k/htc_drv_init.c
··· 561 561 common->keymax = ATH_KEYMAX; 562 562 } 563 563 564 + if (priv->ah->misc_mode & AR_PCU_MIC_NEW_LOC_ENA) 565 + common->crypt_caps |= ATH_CRYPT_CAP_MIC_COMBINED; 566 + 564 567 /* 565 568 * Reset the key cache since some parts do not 566 569 * reset the contents on initial power up.
+13 -14
drivers/net/wireless/ath/ath9k/hw.c
··· 565 565 ath9k_hw_init_cal_settings(ah); 566 566 567 567 ah->ani_function = ATH9K_ANI_ALL; 568 - if (AR_SREV_9280_10_OR_LATER(ah) && !AR_SREV_9300_20_OR_LATER(ah)) 568 + if (AR_SREV_9280_20_OR_LATER(ah) && !AR_SREV_9300_20_OR_LATER(ah)) 569 569 ah->ani_function &= ~ATH9K_ANI_NOISE_IMMUNITY_LEVEL; 570 570 if (!AR_SREV_9300_20_OR_LATER(ah)) 571 571 ah->ani_function &= ~ATH9K_ANI_MRC_CCK; ··· 1190 1190 int count = 50; 1191 1191 u32 reg; 1192 1192 1193 - if (AR_SREV_9285_10_OR_LATER(ah)) 1193 + if (AR_SREV_9285_12_OR_LATER(ah)) 1194 1194 return true; 1195 1195 1196 1196 do { ··· 1312 1312 if (tsf) 1313 1313 ath9k_hw_settsf64(ah, tsf); 1314 1314 1315 - if (AR_SREV_9280_10_OR_LATER(ah)) 1315 + if (AR_SREV_9280_20_OR_LATER(ah)) 1316 1316 REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, AR_GPIO_JTAG_DISABLE); 1317 1317 1318 1318 if (!AR_SREV_9300_20_OR_LATER(ah)) ··· 1787 1787 regulatory->current_rd = eeval; 1788 1788 1789 1789 eeval = ah->eep_ops->get_eeprom(ah, EEP_REG_1); 1790 - if (AR_SREV_9285_10_OR_LATER(ah)) 1790 + if (AR_SREV_9285_12_OR_LATER(ah)) 1791 1791 eeval |= AR9285_RDEXT_DEFAULT; 1792 1792 regulatory->current_rd_ext = eeval; 1793 1793 ··· 1857 1857 /* Use rx_chainmask from EEPROM. */ 1858 1858 pCap->rx_chainmask = ah->eep_ops->get_eeprom(ah, EEP_RX_MASK); 1859 1859 1860 - if (!(AR_SREV_9280(ah) && (ah->hw_version.macRev == 0))) 1861 - ah->misc_mode |= AR_PCU_MIC_NEW_LOC_ENA; 1860 + ah->misc_mode |= AR_PCU_MIC_NEW_LOC_ENA; 1862 1861 1863 1862 pCap->low_2ghz_chan = 2312; 1864 1863 pCap->high_2ghz_chan = 2732; ··· 1893 1894 pCap->num_gpio_pins = AR9271_NUM_GPIO; 1894 1895 else if (AR_DEVID_7010(ah)) 1895 1896 pCap->num_gpio_pins = AR7010_NUM_GPIO; 1896 - else if (AR_SREV_9285_10_OR_LATER(ah)) 1897 + else if (AR_SREV_9285_12_OR_LATER(ah)) 1897 1898 pCap->num_gpio_pins = AR9285_NUM_GPIO; 1898 - else if (AR_SREV_9280_10_OR_LATER(ah)) 1899 + else if (AR_SREV_9280_20_OR_LATER(ah)) 1899 1900 pCap->num_gpio_pins = AR928X_NUM_GPIO; 1900 1901 else 1901 1902 pCap->num_gpio_pins = AR_NUM_GPIO; ··· 1952 1953 pCap->num_antcfg_2ghz = 1953 1954 ah->eep_ops->get_num_ant_config(ah, ATH9K_HAL_FREQ_BAND_2GHZ); 1954 1955 1955 - if (AR_SREV_9280_10_OR_LATER(ah) && 1956 + if (AR_SREV_9280_20_OR_LATER(ah) && 1956 1957 ath9k_hw_btcoex_supported(ah)) { 1957 1958 btcoex_hw->btactive_gpio = ATH_BTACTIVE_GPIO; 1958 1959 btcoex_hw->wlanactive_gpio = ATH_WLANACTIVE_GPIO; ··· 1989 1990 if (AR_SREV_9300_20_OR_LATER(ah)) 1990 1991 pCap->hw_caps |= ATH9K_HW_CAP_RAC_SUPPORTED; 1991 1992 1992 - if (AR_SREV_9287_10_OR_LATER(ah) || AR_SREV_9271(ah)) 1993 + if (AR_SREV_9287_11_OR_LATER(ah) || AR_SREV_9271(ah)) 1993 1994 pCap->hw_caps |= ATH9K_HW_CAP_SGI_20; 1994 1995 1995 1996 if (AR_SREV_9285(ah)) ··· 2073 2074 return MS_REG_READ(AR9300, gpio) != 0; 2074 2075 else if (AR_SREV_9271(ah)) 2075 2076 return MS_REG_READ(AR9271, gpio) != 0; 2076 - else if (AR_SREV_9287_10_OR_LATER(ah)) 2077 + else if (AR_SREV_9287_11_OR_LATER(ah)) 2077 2078 return MS_REG_READ(AR9287, gpio) != 0; 2078 - else if (AR_SREV_9285_10_OR_LATER(ah)) 2079 + else if (AR_SREV_9285_12_OR_LATER(ah)) 2079 2080 return MS_REG_READ(AR9285, gpio) != 0; 2080 - else if (AR_SREV_9280_10_OR_LATER(ah)) 2081 + else if (AR_SREV_9280_20_OR_LATER(ah)) 2081 2082 return MS_REG_READ(AR928X, gpio) != 0; 2082 2083 else 2083 2084 return MS_REG_READ(AR, gpio) != 0; ··· 2574 2575 int used; 2575 2576 2576 2577 /* chipsets >= AR9280 are single-chip */ 2577 - if (AR_SREV_9280_10_OR_LATER(ah)) { 2578 + if (AR_SREV_9280_20_OR_LATER(ah)) { 2578 2579 used = snprintf(hw_name, len, 2579 2580 "Atheros AR%s Rev:%x", 2580 2581 ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
+1 -1
drivers/net/wireless/ath/ath9k/init.c
··· 211 211 else 212 212 max_streams = 2; 213 213 214 - if (AR_SREV_9280_10_OR_LATER(ah)) { 214 + if (AR_SREV_9280_20_OR_LATER(ah)) { 215 215 if (max_streams >= 2) 216 216 ht_info->cap |= IEEE80211_HT_CAP_TX_STBC; 217 217 ht_info->cap |= (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT);
+4 -2
drivers/net/wireless/ath/ath9k/main.c
··· 270 270 { 271 271 struct ath_hw *ah = sc->sc_ah; 272 272 struct ath9k_hw_cal_data *caldata = ah->caldata; 273 + struct ath_common *common = ath9k_hw_common(ah); 273 274 int chain; 274 275 275 276 if (!caldata || !caldata->paprd_done) ··· 279 278 ath9k_ps_wakeup(sc); 280 279 ar9003_paprd_enable(ah, false); 281 280 for (chain = 0; chain < AR9300_MAX_CHAINS; chain++) { 282 - if (!(ah->caps.tx_chainmask & BIT(chain))) 281 + if (!(common->tx_chainmask & BIT(chain))) 283 282 continue; 284 283 285 284 ar9003_paprd_populate_single_table(ah, caldata, chain); ··· 301 300 struct ieee80211_supported_band *sband = &sc->sbands[band]; 302 301 struct ath_tx_control txctl; 303 302 struct ath9k_hw_cal_data *caldata = ah->caldata; 303 + struct ath_common *common = ath9k_hw_common(ah); 304 304 int qnum, ftype; 305 305 int chain_ok = 0; 306 306 int chain; ··· 335 333 ath9k_ps_wakeup(sc); 336 334 ar9003_paprd_init_table(ah); 337 335 for (chain = 0; chain < AR9300_MAX_CHAINS; chain++) { 338 - if (!(ah->caps.tx_chainmask & BIT(chain))) 336 + if (!(common->tx_chainmask & BIT(chain))) 339 337 continue; 340 338 341 339 chain_ok = 0;
+7 -3
drivers/net/wireless/ath/ath9k/recv.c
··· 454 454 else 455 455 rfilt |= ATH9K_RX_FILTER_BEACON; 456 456 457 - if ((AR_SREV_9280_10_OR_LATER(sc->sc_ah) || 458 - AR_SREV_9285_10_OR_LATER(sc->sc_ah)) && 457 + if ((AR_SREV_9280_20_OR_LATER(sc->sc_ah) || 458 + AR_SREV_9285_12_OR_LATER(sc->sc_ah)) && 459 459 (sc->sc_ah->opmode == NL80211_IFTYPE_AP) && 460 460 (sc->rx.rxfilter & FIF_PSPOLL)) 461 461 rfilt |= ATH9K_RX_FILTER_PSPOLL; ··· 977 977 * at least one sdata of a wiphy on mac80211 but with ath9k virtual 978 978 * wiphy you'd have to iterate over every wiphy and each sdata. 979 979 */ 980 - sta = ieee80211_find_sta_by_hw(hw, hdr->addr2); 980 + if (is_multicast_ether_addr(hdr->addr1)) 981 + sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr2, NULL); 982 + else 983 + sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr2, hdr->addr1); 984 + 981 985 if (sta) { 982 986 an = (struct ath_node *) sta->drv_priv; 983 987 if (rx_stats->rs_rssi != ATH9K_RSSI_BAD &&
+4 -30
drivers/net/wireless/ath/ath9k/reg.h
··· 819 819 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9160_11)) 820 820 #define AR_SREV_9280(_ah) \ 821 821 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9280)) 822 - #define AR_SREV_9280_10_OR_LATER(_ah) \ 822 + #define AR_SREV_9280_20_OR_LATER(_ah) \ 823 823 (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9280)) 824 824 #define AR_SREV_9280_20(_ah) \ 825 - (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9280) && \ 826 - ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9280_20)) 827 - #define AR_SREV_9280_20_OR_LATER(_ah) \ 828 - (((_ah)->hw_version.macVersion > AR_SREV_VERSION_9280) || \ 829 - (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9280) && \ 830 - ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9280_20))) 825 + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9280)) 831 826 832 827 #define AR_SREV_9285(_ah) \ 833 828 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9285)) 834 - #define AR_SREV_9285_10_OR_LATER(_ah) \ 835 - (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9285)) 836 - #define AR_SREV_9285_11(_ah) \ 837 - (AR_SREV_9285(ah) && \ 838 - ((_ah)->hw_version.macRev == AR_SREV_REVISION_9285_11)) 839 - #define AR_SREV_9285_11_OR_LATER(_ah) \ 840 - (((_ah)->hw_version.macVersion > AR_SREV_VERSION_9285) || \ 841 - (AR_SREV_9285(ah) && ((_ah)->hw_version.macRev >= \ 842 - AR_SREV_REVISION_9285_11))) 843 - #define AR_SREV_9285_12(_ah) \ 844 - (AR_SREV_9285(ah) && \ 845 - ((_ah)->hw_version.macRev == AR_SREV_REVISION_9285_12)) 846 829 #define AR_SREV_9285_12_OR_LATER(_ah) \ 847 - (((_ah)->hw_version.macVersion > AR_SREV_VERSION_9285) || \ 848 - (AR_SREV_9285(ah) && ((_ah)->hw_version.macRev >= \ 849 - AR_SREV_REVISION_9285_12))) 830 + (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9285)) 850 831 851 832 #define AR_SREV_9287(_ah) \ 852 833 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287)) 853 - #define AR_SREV_9287_10_OR_LATER(_ah) \ 834 + #define AR_SREV_9287_11_OR_LATER(_ah) \ 854 835 (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9287)) 855 - #define AR_SREV_9287_10(_ah) \ 856 - (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ 857 - ((_ah)->hw_version.macRev == AR_SREV_REVISION_9287_10)) 858 836 #define AR_SREV_9287_11(_ah) \ 859 837 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ 860 838 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9287_11)) 861 - #define AR_SREV_9287_11_OR_LATER(_ah) \ 862 - (((_ah)->hw_version.macVersion > AR_SREV_VERSION_9287) || \ 863 - (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ 864 - ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9287_11))) 865 839 #define AR_SREV_9287_12(_ah) \ 866 840 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ 867 841 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9287_12))
+1 -2
drivers/net/wireless/ath/ath9k/xmit.c
··· 328 328 329 329 rcu_read_lock(); 330 330 331 - /* XXX: use ieee80211_find_sta! */ 332 - sta = ieee80211_find_sta_by_hw(hw, hdr->addr1); 331 + sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr1, hdr->addr2); 333 332 if (!sta) { 334 333 rcu_read_unlock(); 335 334
+1 -1
drivers/net/wireless/ath/carl9170/Kconfig
··· 10 10 but it needs a special firmware (carl9170-1.fw) to do that. 11 11 12 12 The firmware can be downloaded from our wiki here: 13 - http://wireless.kernel.org/en/users/Drivers/carl9170 13 + <http://wireless.kernel.org/en/users/Drivers/carl9170> 14 14 15 15 If you choose to build a module, it'll be called carl9170. 16 16
-1
drivers/net/wireless/ath/carl9170/carl9170.h
··· 364 364 unsigned int tx_dropped; 365 365 unsigned int tx_ack_failures; 366 366 unsigned int tx_fcs_errors; 367 - unsigned int tx_ampdu_timeout; 368 367 unsigned int rx_dropped; 369 368 370 369 /* EEPROM */
-4
drivers/net/wireless/ath/carl9170/debug.c
··· 798 798 atomic_read(&ar->tx_total_queued)); 799 799 DEBUGFS_READONLY_FILE(tx_ampdu_scheduler, 20, "%d", 800 800 atomic_read(&ar->tx_ampdu_scheduler)); 801 - DEBUGFS_READONLY_FILE(tx_ampdu_timeout, 20, "%d", 802 - ar->tx_ampdu_timeout); 803 801 804 802 DEBUGFS_READONLY_FILE(tx_total_pending, 20, "%d", 805 803 atomic_read(&ar->tx_total_pending)); ··· 869 871 870 872 DEBUGFS_ADD(ampdu_density); 871 873 DEBUGFS_ADD(ampdu_factor); 872 - 873 - DEBUGFS_ADD(tx_ampdu_timeout); 874 874 875 875 DEBUGFS_ADD(tx_janitor_last_run); 876 876
+15 -5
drivers/net/wireless/ath/carl9170/main.c
··· 230 230 for (i = 0; i < ar->hw->queues; i++) { 231 231 struct sk_buff *skb; 232 232 233 - while ((skb = skb_dequeue(&ar->tx_pending[i]))) 233 + while ((skb = skb_dequeue(&ar->tx_pending[i]))) { 234 + struct ieee80211_tx_info *info; 235 + 236 + info = IEEE80211_SKB_CB(skb); 237 + if (info->flags & IEEE80211_TX_CTL_AMPDU) 238 + atomic_dec(&ar->tx_ampdu_upload); 239 + 234 240 carl9170_tx_status(ar, skb, false); 241 + } 235 242 } 236 243 } 237 244 ··· 1248 1241 1249 1242 switch (action) { 1250 1243 case IEEE80211_AMPDU_TX_START: 1251 - if (WARN_ON_ONCE(!sta_info->ht_sta)) 1244 + if (!sta_info->ht_sta) 1252 1245 return -EOPNOTSUPP; 1253 1246 1254 1247 rcu_read_lock(); ··· 1460 1453 while ((skb = __skb_dequeue(&tid_info->queue))) 1461 1454 __skb_queue_tail(&free, skb); 1462 1455 spin_unlock_bh(&tid_info->lock); 1463 - 1464 - ieee80211_stop_tx_ba_session(sta, 1465 - tid_info->tid); 1466 1456 } 1467 1457 rcu_read_unlock(); 1468 1458 } ··· 1469 1465 skb_queue_walk_safe(&ar->tx_pending[i], skb, tmp) { 1470 1466 struct _carl9170_tx_superframe *super; 1471 1467 struct ieee80211_hdr *hdr; 1468 + struct ieee80211_tx_info *info; 1472 1469 1473 1470 super = (void *) skb->data; 1474 1471 hdr = (void *) super->frame_data; ··· 1478 1473 continue; 1479 1474 1480 1475 __skb_unlink(skb, &ar->tx_pending[i]); 1476 + 1477 + info = IEEE80211_SKB_CB(skb); 1478 + if (info->flags & IEEE80211_TX_CTL_AMPDU) 1479 + atomic_dec(&ar->tx_ampdu_upload); 1480 + 1481 1481 carl9170_tx_status(ar, skb, false); 1482 1482 } 1483 1483 spin_unlock_bh(&ar->tx_pending[i].lock);
+77 -115
drivers/net/wireless/ath/carl9170/tx.c
··· 760 760 struct carl9170_tx_info *arinfo; 761 761 unsigned int hw_queue; 762 762 int i; 763 - u16 keytype = 0; 764 - u16 len, icv = 0; 763 + __le16 mac_tmp; 764 + u16 len; 765 765 bool ampdu, no_ack; 766 766 767 767 BUILD_BUG_ON(sizeof(*arinfo) > sizeof(info->rate_driver_data)); ··· 772 772 AR9170_TX_HWDESC_LEN); 773 773 774 774 BUILD_BUG_ON(IEEE80211_TX_MAX_RATES < CARL9170_TX_MAX_RATES); 775 + 776 + BUILD_BUG_ON(AR9170_MAX_VIRTUAL_MAC > 777 + ((CARL9170_TX_SUPER_MISC_VIF_ID >> 778 + CARL9170_TX_SUPER_MISC_VIF_ID_S) + 1)); 775 779 776 780 hw_queue = ar9170_qmap[carl9170_get_queue(ar, skb)]; 777 781 ··· 797 793 txc = (void *)skb_push(skb, sizeof(*txc)); 798 794 memset(txc, 0, sizeof(*txc)); 799 795 800 - ampdu = !!(info->flags & IEEE80211_TX_CTL_AMPDU); 796 + SET_VAL(CARL9170_TX_SUPER_MISC_QUEUE, txc->s.misc, hw_queue); 797 + 798 + if (likely(cvif)) 799 + SET_VAL(CARL9170_TX_SUPER_MISC_VIF_ID, txc->s.misc, cvif->id); 800 + 801 + if (unlikely(info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM)) 802 + txc->s.misc |= CARL9170_TX_SUPER_MISC_CAB; 803 + 804 + if (unlikely(ieee80211_is_probe_resp(hdr->frame_control))) 805 + txc->s.misc |= CARL9170_TX_SUPER_MISC_FILL_IN_TSF; 806 + 807 + mac_tmp = cpu_to_le16(AR9170_TX_MAC_HW_DURATION | 808 + AR9170_TX_MAC_BACKOFF); 809 + mac_tmp |= cpu_to_le16((hw_queue << AR9170_TX_MAC_QOS_S) && 810 + AR9170_TX_MAC_QOS); 811 + 801 812 no_ack = !!(info->flags & IEEE80211_TX_CTL_NO_ACK); 813 + if (unlikely(no_ack)) 814 + mac_tmp |= cpu_to_le16(AR9170_TX_MAC_NO_ACK); 802 815 803 816 if (info->control.hw_key) { 804 - icv = info->control.hw_key->icv_len; 817 + len += info->control.hw_key->icv_len; 805 818 806 819 switch (info->control.hw_key->cipher) { 807 820 case WLAN_CIPHER_SUITE_WEP40: 808 821 case WLAN_CIPHER_SUITE_WEP104: 809 822 case WLAN_CIPHER_SUITE_TKIP: 810 - keytype = AR9170_TX_MAC_ENCR_RC4; 823 + mac_tmp |= cpu_to_le16(AR9170_TX_MAC_ENCR_RC4); 811 824 break; 812 825 case WLAN_CIPHER_SUITE_CCMP: 813 - keytype = AR9170_TX_MAC_ENCR_AES; 826 + mac_tmp |= cpu_to_le16(AR9170_TX_MAC_ENCR_AES); 814 827 break; 815 828 default: 816 829 WARN_ON(1); ··· 835 814 } 836 815 } 837 816 838 - BUILD_BUG_ON(AR9170_MAX_VIRTUAL_MAC > 839 - ((CARL9170_TX_SUPER_MISC_VIF_ID >> 840 - CARL9170_TX_SUPER_MISC_VIF_ID_S) + 1)); 817 + ampdu = !!(info->flags & IEEE80211_TX_CTL_AMPDU); 818 + if (ampdu) { 819 + unsigned int density, factor; 841 820 842 - txc->s.len = cpu_to_le16(len + sizeof(*txc)); 843 - txc->f.length = cpu_to_le16(len + icv + 4); 844 - SET_VAL(CARL9170_TX_SUPER_MISC_VIF_ID, txc->s.misc, 845 - cvif ? cvif->id : 0); 821 + if (unlikely(!sta || !cvif)) 822 + goto err_out; 846 823 847 - txc->f.mac_control = cpu_to_le16(AR9170_TX_MAC_HW_DURATION | 848 - AR9170_TX_MAC_BACKOFF); 824 + factor = min_t(unsigned int, 1u, 825 + info->control.sta->ht_cap.ampdu_factor); 849 826 850 - SET_VAL(CARL9170_TX_SUPER_MISC_QUEUE, txc->s.misc, hw_queue); 827 + density = info->control.sta->ht_cap.ampdu_density; 851 828 852 - txc->f.mac_control |= cpu_to_le16(hw_queue << AR9170_TX_MAC_QOS_S); 853 - txc->f.mac_control |= cpu_to_le16(keytype); 854 - txc->f.phy_control = cpu_to_le32(0); 829 + if (density) { 830 + /* 831 + * Watch out! 832 + * 833 + * Otus uses slightly different density values than 834 + * those from the 802.11n spec. 835 + */ 855 836 856 - if (no_ack) 857 - txc->f.mac_control |= cpu_to_le16(AR9170_TX_MAC_NO_ACK); 837 + density = max_t(unsigned int, density + 1, 7u); 838 + } 858 839 859 - if (info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) 860 - txc->s.misc |= CARL9170_TX_SUPER_MISC_CAB; 840 + SET_VAL(CARL9170_TX_SUPER_AMPDU_DENSITY, 841 + txc->s.ampdu_settings, density); 861 842 862 - txrate = &info->control.rates[0]; 863 - if (carl9170_tx_rts_check(ar, txrate, ampdu, no_ack)) 864 - txc->f.mac_control |= cpu_to_le16(AR9170_TX_MAC_PROT_RTS); 865 - else if (carl9170_tx_cts_check(ar, txrate)) 866 - txc->f.mac_control |= cpu_to_le16(AR9170_TX_MAC_PROT_CTS); 843 + SET_VAL(CARL9170_TX_SUPER_AMPDU_FACTOR, 844 + txc->s.ampdu_settings, factor); 867 845 868 - SET_VAL(CARL9170_TX_SUPER_RI_TRIES, txc->s.ri[0], txrate->count); 869 - txc->f.phy_control |= carl9170_tx_physet(ar, info, txrate); 870 - 871 - if (info->flags & IEEE80211_TX_CTL_AMPDU) { 872 - for (i = 1; i < CARL9170_TX_MAX_RATES; i++) { 846 + for (i = 0; i < CARL9170_TX_MAX_RATES; i++) { 873 847 txrate = &info->control.rates[i]; 874 - if (txrate->idx >= 0) 848 + if (txrate->idx >= 0) { 849 + txc->s.ri[i] = 850 + CARL9170_TX_SUPER_RI_AMPDU; 851 + 852 + if (WARN_ON(!(txrate->flags & 853 + IEEE80211_TX_RC_MCS))) { 854 + /* 855 + * Not sure if it's even possible 856 + * to aggregate non-ht rates with 857 + * this HW. 858 + */ 859 + goto err_out; 860 + } 875 861 continue; 862 + } 876 863 877 864 txrate->idx = 0; 878 865 txrate->count = ar->hw->max_rate_tries; 879 866 } 867 + 868 + mac_tmp |= cpu_to_le16(AR9170_TX_MAC_AGGR); 880 869 } 881 870 882 871 /* ··· 909 878 txc->s.ri[i] |= (AR9170_TX_MAC_PROT_CTS << 910 879 CARL9170_TX_SUPER_RI_ERP_PROT_S); 911 880 912 - /* 913 - * unaggregated fallback, in case aggregation 914 - * proves to be unsuccessful and unreliable. 915 - */ 916 - if (ampdu && i < 3) 917 - txc->s.ri[i] |= CARL9170_TX_SUPER_RI_AMPDU; 918 - 919 881 txc->s.rr[i - 1] = carl9170_tx_physet(ar, info, txrate); 920 882 } 921 883 922 - if (ieee80211_is_probe_resp(hdr->frame_control)) 923 - txc->s.misc |= CARL9170_TX_SUPER_MISC_FILL_IN_TSF; 884 + txrate = &info->control.rates[0]; 885 + SET_VAL(CARL9170_TX_SUPER_RI_TRIES, txc->s.ri[0], txrate->count); 924 886 925 - if (ampdu) { 926 - unsigned int density, factor; 887 + if (carl9170_tx_rts_check(ar, txrate, ampdu, no_ack)) 888 + mac_tmp |= cpu_to_le16(AR9170_TX_MAC_PROT_RTS); 889 + else if (carl9170_tx_cts_check(ar, txrate)) 890 + mac_tmp |= cpu_to_le16(AR9170_TX_MAC_PROT_CTS); 927 891 928 - if (unlikely(!sta || !cvif)) 929 - goto err_out; 930 - 931 - density = info->control.sta->ht_cap.ampdu_density; 932 - factor = info->control.sta->ht_cap.ampdu_factor; 933 - 934 - if (density) { 935 - /* 936 - * Watch out! 937 - * 938 - * Otus uses slightly different density values than 939 - * those from the 802.11n spec. 940 - */ 941 - 942 - density = max_t(unsigned int, density + 1, 7u); 943 - } 944 - 945 - factor = min_t(unsigned int, 1u, factor); 946 - 947 - SET_VAL(CARL9170_TX_SUPER_AMPDU_DENSITY, 948 - txc->s.ampdu_settings, density); 949 - 950 - SET_VAL(CARL9170_TX_SUPER_AMPDU_FACTOR, 951 - txc->s.ampdu_settings, factor); 952 - 953 - if (info->control.rates[0].flags & IEEE80211_TX_RC_MCS) { 954 - txc->f.mac_control |= cpu_to_le16(AR9170_TX_MAC_AGGR); 955 - } else { 956 - /* 957 - * Not sure if it's even possible to aggregate 958 - * non-ht rates with this HW. 959 - */ 960 - WARN_ON_ONCE(1); 961 - } 962 - } 892 + txc->s.len = cpu_to_le16(skb->len); 893 + txc->f.length = cpu_to_le16(len + FCS_LEN); 894 + txc->f.mac_control = mac_tmp; 895 + txc->f.phy_control = carl9170_tx_physet(ar, info, txrate); 963 896 964 897 arinfo = (void *)info->rate_driver_data; 965 898 arinfo->timeout = jiffies; ··· 1037 1042 queue = TID_TO_WME_AC(tid_info->tid); 1038 1043 1039 1044 spin_lock_bh(&tid_info->lock); 1040 - if (tid_info->state != CARL9170_TID_STATE_XMIT) { 1041 - first = skb_peek(&tid_info->queue); 1042 - if (first) { 1043 - struct ieee80211_tx_info *txinfo; 1044 - struct carl9170_tx_info *arinfo; 1045 - 1046 - txinfo = IEEE80211_SKB_CB(first); 1047 - arinfo = (void *) txinfo->rate_driver_data; 1048 - 1049 - if (time_is_after_jiffies(arinfo->timeout + 1050 - msecs_to_jiffies(CARL9170_QUEUE_TIMEOUT)) 1051 - == true) 1052 - goto processed; 1053 - 1054 - /* 1055 - * We've been waiting for the frame which 1056 - * matches "snx" (start sequence of the 1057 - * next aggregate) for some time now. 1058 - * 1059 - * But it never arrived. Therefore 1060 - * jump to the next available frame 1061 - * and kick-start the transmission. 1062 - * 1063 - * Note: This might induce odd latency 1064 - * spikes because the receiver will be 1065 - * waiting for the lost frame too. 1066 - */ 1067 - ar->tx_ampdu_timeout++; 1068 - 1069 - tid_info->snx = carl9170_get_seq(first); 1070 - tid_info->state = CARL9170_TID_STATE_XMIT; 1071 - } else { 1072 - goto processed; 1073 - } 1074 - } 1045 + if (tid_info->state != CARL9170_TID_STATE_XMIT) 1046 + goto processed; 1075 1047 1076 1048 tid_info->counter++; 1077 1049 first = skb_peek(&tid_info->queue);
-2
drivers/net/wireless/ath/carl9170/usb.c
··· 606 606 AR9170_USB_EP_CMD), cmd, cmd->hdr.len + 4, 607 607 carl9170_usb_cmd_complete, ar, 1); 608 608 609 - urb->transfer_flags |= URB_ZERO_PACKET; 610 - 611 609 if (free_buf) 612 610 urb->transfer_flags |= URB_FREE_BUFFER; 613 611
+3
drivers/net/wireless/wl12xx/Makefile
··· 16 16 obj-$(CONFIG_WL1271) += wl1271.o 17 17 obj-$(CONFIG_WL1271_SPI) += wl1271_spi.o 18 18 obj-$(CONFIG_WL1271_SDIO) += wl1271_sdio.o 19 + 20 + # small builtin driver bit 21 + obj-$(CONFIG_WL12XX_PLATFORM_DATA) += wl12xx_platform_data.o
+6 -11
drivers/net/wireless/wl12xx/wl1271_boot.c
··· 274 274 275 275 /* 276 276 * We've reached the first zero length, the first NVS table 277 - * is 7 bytes further. 277 + * is located at an aligned offset which is at least 7 bytes further. 278 278 */ 279 - nvs_ptr += 7; 279 + nvs_ptr = (u8 *)wl->nvs->nvs + 280 + ALIGN(nvs_ptr - (u8 *)wl->nvs->nvs + 7, 4); 280 281 nvs_len -= nvs_ptr - (u8 *)wl->nvs->nvs; 281 - nvs_len = ALIGN(nvs_len, 4); 282 282 283 283 /* FIXME: The driver sets the partition here, but this is not needed, 284 284 since it sets to the same one as currently in use */ ··· 286 286 wl1271_set_partition(wl, &part_table[PART_WORK]); 287 287 288 288 /* Copy the NVS tables to a new block to ensure alignment */ 289 - /* FIXME: We jump 3 more bytes before uploading the NVS. It seems 290 - that our NVS files have three extra zeros here. I'm not sure whether 291 - the problem is in our NVS generation or we should really jumpt these 292 - 3 bytes here */ 293 - nvs_ptr += 3; 294 - 295 - nvs_aligned = kmemdup(nvs_ptr, nvs_len, GFP_KERNEL); if 296 - (!nvs_aligned) return -ENOMEM; 289 + nvs_aligned = kmemdup(nvs_ptr, nvs_len, GFP_KERNEL); 290 + if (!nvs_aligned) 291 + return -ENOMEM; 297 292 298 293 /* And finally we upload the NVS tables */ 299 294 /* FIXME: In wl1271, we upload everything at once.
+32 -15
include/net/mac80211.h
··· 321 321 * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame 322 322 * @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this 323 323 * frame and selects the maximum number of streams that it can use. 324 + * 325 + * Note: If you have to add new flags to the enumeration, then don't 326 + * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. 324 327 */ 325 328 enum mac80211_tx_control_flags { 326 329 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), ··· 352 349 }; 353 350 354 351 #define IEEE80211_TX_CTL_STBC_SHIFT 23 352 + 353 + /* 354 + * This definition is used as a mask to clear all temporary flags, which are 355 + * set by the tx handlers for each transmission attempt by the mac80211 stack. 356 + */ 357 + #define IEEE80211_TX_TEMPORARY_FLAGS (IEEE80211_TX_CTL_NO_ACK | \ 358 + IEEE80211_TX_CTL_CLEAR_PS_FILT | IEEE80211_TX_CTL_FIRST_FRAGMENT | \ 359 + IEEE80211_TX_CTL_SEND_AFTER_DTIM | IEEE80211_TX_CTL_AMPDU | \ 360 + IEEE80211_TX_STAT_TX_FILTERED | IEEE80211_TX_STAT_ACK | \ 361 + IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK | \ 362 + IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_PSPOLL_RESPONSE | \ 363 + IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC | \ 364 + IEEE80211_TX_CTL_STBC) 355 365 356 366 /** 357 367 * enum mac80211_rate_control_flags - per-rate flags set by the ··· 581 565 * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index 582 566 * @RX_FLAG_40MHZ: HT40 (40 MHz) was used 583 567 * @RX_FLAG_SHORT_GI: Short guard interval was used 584 - * @RX_FLAG_INTERNAL_CMTR: set internally after frame was reported 585 - * on cooked monitor to avoid double-reporting it for multiple 586 - * virtual interfaces 587 568 */ 588 569 enum mac80211_rx_flags { 589 570 RX_FLAG_MMIC_ERROR = 1<<0, ··· 594 581 RX_FLAG_HT = 1<<9, 595 582 RX_FLAG_40MHZ = 1<<10, 596 583 RX_FLAG_SHORT_GI = 1<<11, 597 - RX_FLAG_INTERNAL_CMTR = 1<<12, 598 584 }; 599 585 600 586 /** ··· 614 602 * @rate_idx: index of data rate into band's supported rates or MCS index if 615 603 * HT rates are use (RX_FLAG_HT) 616 604 * @flag: %RX_FLAG_* 605 + * @rx_flags: internal RX flags for mac80211 617 606 */ 618 607 struct ieee80211_rx_status { 619 608 u64 mactime; ··· 624 611 int antenna; 625 612 int rate_idx; 626 613 int flag; 614 + unsigned int rx_flags; 627 615 }; 628 616 629 617 /** ··· 2430 2416 const u8 *addr); 2431 2417 2432 2418 /** 2433 - * ieee80211_find_sta_by_hw - find a station on hardware 2419 + * ieee80211_find_sta_by_ifaddr - find a station on hardware 2434 2420 * 2435 2421 * @hw: pointer as obtained from ieee80211_alloc_hw() 2436 - * @addr: station's address 2422 + * @addr: remote station's address 2423 + * @localaddr: local address (vif->sdata->vif.addr). Use NULL for 'any'. 2437 2424 * 2438 2425 * This function must be called under RCU lock and the 2439 2426 * resulting pointer is only valid under RCU lock as well. 2440 2427 * 2441 - * NOTE: This function should not be used! When mac80211 is converted 2442 - * internally to properly keep track of stations on multiple 2443 - * virtual interfaces, it will not always know which station to 2444 - * return here since a single address might be used by multiple 2445 - * logical stations (e.g. consider a station connecting to another 2446 - * BSSID on the same AP hardware without disconnecting first). 2428 + * NOTE: You may pass NULL for localaddr, but then you will just get 2429 + * the first STA that matches the remote address 'addr'. 2430 + * We can have multiple STA associated with multiple 2431 + * logical stations (e.g. consider a station connecting to another 2432 + * BSSID on the same AP hardware without disconnecting first). 2433 + * In this case, the result of this method with localaddr NULL 2434 + * is not reliable. 2447 2435 * 2448 - * DO NOT USE THIS FUNCTION. 2436 + * DO NOT USE THIS FUNCTION with localaddr NULL if at all possible. 2449 2437 */ 2450 - struct ieee80211_sta *ieee80211_find_sta_by_hw(struct ieee80211_hw *hw, 2451 - const u8 *addr); 2438 + struct ieee80211_sta *ieee80211_find_sta_by_ifaddr(struct ieee80211_hw *hw, 2439 + const u8 *addr, 2440 + const u8 *localaddr); 2452 2441 2453 2442 /** 2454 2443 * ieee80211_sta_block_awake - block station from waking up
-1
net/mac80211/debugfs.c
··· 368 368 if (!phyd) 369 369 return; 370 370 371 - local->debugfs.stations = debugfs_create_dir("stations", phyd); 372 371 local->debugfs.keys = debugfs_create_dir("keys", phyd); 373 372 374 373 DEBUGFS_ADD(frequency);
+3
net/mac80211/debugfs_netdev.c
··· 409 409 sprintf(buf, "netdev:%s", sdata->name); 410 410 sdata->debugfs.dir = debugfs_create_dir(buf, 411 411 sdata->local->hw.wiphy->debugfsdir); 412 + if (sdata->debugfs.dir) 413 + sdata->debugfs.subdir_stations = debugfs_create_dir("stations", 414 + sdata->debugfs.dir); 412 415 add_files(sdata); 413 416 } 414 417
+1 -1
net/mac80211/debugfs_sta.c
··· 300 300 301 301 void ieee80211_sta_debugfs_add(struct sta_info *sta) 302 302 { 303 - struct dentry *stations_dir = sta->local->debugfs.stations; 303 + struct dentry *stations_dir = sta->sdata->debugfs.subdir_stations; 304 304 u8 mac[3*ETH_ALEN]; 305 305 306 306 sta->debugfs.add_has_run = true;
+34 -9
net/mac80211/ieee80211_i.h
··· 159 159 #define RX_DROP_MONITOR ((__force ieee80211_rx_result) 2u) 160 160 #define RX_QUEUED ((__force ieee80211_rx_result) 3u) 161 161 162 - #define IEEE80211_RX_IN_SCAN BIT(0) 163 - /* frame is destined to interface currently processed (incl. multicast frames) */ 164 - #define IEEE80211_RX_RA_MATCH BIT(1) 165 - #define IEEE80211_RX_AMSDU BIT(2) 166 - #define IEEE80211_RX_FRAGMENTED BIT(3) 167 - #define IEEE80211_MALFORMED_ACTION_FRM BIT(4) 168 - /* only add flags here that do not change with subframes of an aMPDU */ 162 + /** 163 + * enum ieee80211_packet_rx_flags - packet RX flags 164 + * @IEEE80211_RX_RA_MATCH: frame is destined to interface currently processed 165 + * (incl. multicast frames) 166 + * @IEEE80211_RX_IN_SCAN: received while scanning 167 + * @IEEE80211_RX_FRAGMENTED: fragmented frame 168 + * @IEEE80211_RX_AMSDU: a-MSDU packet 169 + * @IEEE80211_RX_MALFORMED_ACTION_FRM: action frame is malformed 170 + * 171 + * These are per-frame flags that are attached to a frame in the 172 + * @rx_flags field of &struct ieee80211_rx_status. 173 + */ 174 + enum ieee80211_packet_rx_flags { 175 + IEEE80211_RX_IN_SCAN = BIT(0), 176 + IEEE80211_RX_RA_MATCH = BIT(1), 177 + IEEE80211_RX_FRAGMENTED = BIT(2), 178 + IEEE80211_RX_AMSDU = BIT(3), 179 + IEEE80211_RX_MALFORMED_ACTION_FRM = BIT(4), 180 + }; 181 + 182 + /** 183 + * enum ieee80211_rx_flags - RX data flags 184 + * 185 + * @IEEE80211_RX_CMNTR: received on cooked monitor already 186 + * 187 + * These flags are used across handling multiple interfaces 188 + * for a single frame. 189 + */ 190 + enum ieee80211_rx_flags { 191 + IEEE80211_RX_CMNTR = BIT(0), 192 + }; 169 193 170 194 struct ieee80211_rx_data { 171 195 struct sk_buff *skb; ··· 588 564 #ifdef CONFIG_MAC80211_DEBUGFS 589 565 struct { 590 566 struct dentry *dir; 567 + struct dentry *subdir_stations; 591 568 struct dentry *default_key; 592 569 struct dentry *default_mgmt_key; 593 570 } debugfs; ··· 924 899 #ifdef CONFIG_MAC80211_DEBUGFS 925 900 struct local_debugfsdentries { 926 901 struct dentry *rcdir; 927 - struct dentry *stations; 928 902 struct dentry *keys; 929 903 } debugfs; 930 904 #endif ··· 1280 1256 const u8 *key, u8 key_len, u8 key_idx); 1281 1257 int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer, 1282 1258 const u8 *ie, size_t ie_len, 1283 - enum ieee80211_band band); 1259 + enum ieee80211_band band, u32 rate_mask, 1260 + u8 channel); 1284 1261 void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst, 1285 1262 const u8 *ssid, size_t ssid_len, 1286 1263 const u8 *ie, size_t ie_len);
+2 -1
net/mac80211/main.c
··· 110 110 chan = scan_chan; 111 111 channel_type = NL80211_CHAN_NO_HT; 112 112 local->hw.conf.flags |= IEEE80211_CONF_OFFCHANNEL; 113 - } else if (local->tmp_channel) { 113 + } else if (local->tmp_channel && 114 + local->oper_channel != local->tmp_channel) { 114 115 chan = scan_chan = local->tmp_channel; 115 116 channel_type = local->tmp_channel_type; 116 117 local->hw.conf.flags |= IEEE80211_CONF_OFFCHANNEL;
+8 -8
net/mac80211/mlme.c
··· 880 880 sdata->u.mgd.flags &= ~(IEEE80211_STA_CONNECTION_POLL | 881 881 IEEE80211_STA_BEACON_POLL); 882 882 883 - /* 884 - * Always handle WMM once after association regardless 885 - * of the first value the AP uses. Setting -1 here has 886 - * that effect because the AP values is an unsigned 887 - * 4-bit value. 888 - */ 889 - sdata->u.mgd.wmm_last_param_set = -1; 890 - 891 883 ieee80211_led_assoc(local, 1); 892 884 893 885 if (local->hw.flags & IEEE80211_HW_NEED_DTIM_PERIOD) ··· 1358 1366 " the AP (error %d)\n", sdata->name, err); 1359 1367 return false; 1360 1368 } 1369 + 1370 + /* 1371 + * Always handle WMM once after association regardless 1372 + * of the first value the AP uses. Setting -1 here has 1373 + * that effect because the AP values is an unsigned 1374 + * 4-bit value. 1375 + */ 1376 + ifmgd->wmm_last_param_set = -1; 1361 1377 1362 1378 if (elems.wmm_param) 1363 1379 ieee80211_sta_wmm_params(local, sdata, elems.wmm_param,
+158 -139
net/mac80211/rx.c
··· 315 315 static void ieee80211_parse_qos(struct ieee80211_rx_data *rx) 316 316 { 317 317 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; 318 + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); 318 319 int tid; 319 320 320 321 /* does the frame have a qos control field? */ ··· 324 323 /* frame has qos control */ 325 324 tid = *qc & IEEE80211_QOS_CTL_TID_MASK; 326 325 if (*qc & IEEE80211_QOS_CONTROL_A_MSDU_PRESENT) 327 - rx->flags |= IEEE80211_RX_AMSDU; 328 - else 329 - rx->flags &= ~IEEE80211_RX_AMSDU; 326 + status->rx_flags |= IEEE80211_RX_AMSDU; 330 327 } else { 331 328 /* 332 329 * IEEE 802.11-2007, 7.1.3.4.1 ("Sequence Number field"): ··· 386 387 ieee80211_rx_h_passive_scan(struct ieee80211_rx_data *rx) 387 388 { 388 389 struct ieee80211_local *local = rx->local; 390 + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); 389 391 struct sk_buff *skb = rx->skb; 390 392 391 - if (unlikely(test_bit(SCAN_HW_SCANNING, &local->scanning))) 393 + if (likely(!(status->rx_flags & IEEE80211_RX_IN_SCAN))) 394 + return RX_CONTINUE; 395 + 396 + if (test_bit(SCAN_HW_SCANNING, &local->scanning)) 392 397 return ieee80211_scan_rx(rx->sdata, skb); 393 398 394 - if (unlikely(test_bit(SCAN_SW_SCANNING, &local->scanning) && 395 - (rx->flags & IEEE80211_RX_IN_SCAN))) { 399 + if (test_bit(SCAN_SW_SCANNING, &local->scanning)) { 396 400 /* drop all the other packets during a software scan anyway */ 397 401 if (ieee80211_scan_rx(rx->sdata, skb) != RX_QUEUED) 398 402 dev_kfree_skb(skb); 399 403 return RX_QUEUED; 400 404 } 401 405 402 - if (unlikely(rx->flags & IEEE80211_RX_IN_SCAN)) { 403 - /* scanning finished during invoking of handlers */ 404 - I802_DEBUG_INC(local->rx_handlers_drop_passive_scan); 405 - return RX_DROP_UNUSABLE; 406 - } 407 - 408 - return RX_CONTINUE; 406 + /* scanning finished during invoking of handlers */ 407 + I802_DEBUG_INC(local->rx_handlers_drop_passive_scan); 408 + return RX_DROP_UNUSABLE; 409 409 } 410 410 411 411 ··· 783 785 ieee80211_rx_h_check(struct ieee80211_rx_data *rx) 784 786 { 785 787 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; 788 + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); 786 789 787 790 /* Drop duplicate 802.11 retransmissions (IEEE 802.11 Chap. 9.2.9) */ 788 791 if (rx->sta && !is_multicast_ether_addr(hdr->addr1)) { 789 792 if (unlikely(ieee80211_has_retry(hdr->frame_control) && 790 793 rx->sta->last_seq_ctrl[rx->queue] == 791 794 hdr->seq_ctrl)) { 792 - if (rx->flags & IEEE80211_RX_RA_MATCH) { 795 + if (status->rx_flags & IEEE80211_RX_RA_MATCH) { 793 796 rx->local->dot11FrameDuplicateCount++; 794 797 rx->sta->num_duplicates++; 795 798 } ··· 823 824 if ((!ieee80211_has_fromds(hdr->frame_control) && 824 825 !ieee80211_has_tods(hdr->frame_control) && 825 826 ieee80211_is_data(hdr->frame_control)) || 826 - !(rx->flags & IEEE80211_RX_RA_MATCH)) { 827 + !(status->rx_flags & IEEE80211_RX_RA_MATCH)) { 827 828 /* Drop IBSS frames and frames for other hosts 828 829 * silently. */ 829 830 return RX_DROP_MONITOR; ··· 880 881 * No point in finding a key and decrypting if the frame is neither 881 882 * addressed to us nor a multicast frame. 882 883 */ 883 - if (!(rx->flags & IEEE80211_RX_RA_MATCH)) 884 + if (!(status->rx_flags & IEEE80211_RX_RA_MATCH)) 884 885 return RX_CONTINUE; 885 886 886 887 /* start without a key */ ··· 1113 1114 sta->last_rx = jiffies; 1114 1115 } 1115 1116 1116 - if (!(rx->flags & IEEE80211_RX_RA_MATCH)) 1117 + if (!(status->rx_flags & IEEE80211_RX_RA_MATCH)) 1117 1118 return RX_CONTINUE; 1118 1119 1119 1120 if (rx->sdata->vif.type == NL80211_IFTYPE_STATION) ··· 1270 1271 unsigned int frag, seq; 1271 1272 struct ieee80211_fragment_entry *entry; 1272 1273 struct sk_buff *skb; 1274 + struct ieee80211_rx_status *status; 1273 1275 1274 1276 hdr = (struct ieee80211_hdr *)rx->skb->data; 1275 1277 fc = hdr->frame_control; ··· 1370 1370 } 1371 1371 1372 1372 /* Complete frame has been reassembled - process it now */ 1373 - rx->flags |= IEEE80211_RX_FRAGMENTED; 1373 + status = IEEE80211_SKB_RXCB(rx->skb); 1374 + status->rx_flags |= IEEE80211_RX_FRAGMENTED; 1374 1375 1375 1376 out: 1376 1377 if (rx->sta) ··· 1388 1387 { 1389 1388 struct ieee80211_sub_if_data *sdata = rx->sdata; 1390 1389 __le16 fc = ((struct ieee80211_hdr *)rx->skb->data)->frame_control; 1390 + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); 1391 1391 1392 1392 if (likely(!rx->sta || !ieee80211_is_pspoll(fc) || 1393 - !(rx->flags & IEEE80211_RX_RA_MATCH))) 1393 + !(status->rx_flags & IEEE80211_RX_RA_MATCH))) 1394 1394 return RX_CONTINUE; 1395 1395 1396 1396 if ((sdata->vif.type != NL80211_IFTYPE_AP) && ··· 1552 1550 struct sk_buff *skb, *xmit_skb; 1553 1551 struct ethhdr *ehdr = (struct ethhdr *) rx->skb->data; 1554 1552 struct sta_info *dsta; 1553 + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); 1555 1554 1556 1555 skb = rx->skb; 1557 1556 xmit_skb = NULL; ··· 1560 1557 if ((sdata->vif.type == NL80211_IFTYPE_AP || 1561 1558 sdata->vif.type == NL80211_IFTYPE_AP_VLAN) && 1562 1559 !(sdata->flags & IEEE80211_SDATA_DONT_BRIDGE_PACKETS) && 1563 - (rx->flags & IEEE80211_RX_RA_MATCH) && 1560 + (status->rx_flags & IEEE80211_RX_RA_MATCH) && 1564 1561 (sdata->vif.type != NL80211_IFTYPE_AP_VLAN || !sdata->u.vlan.sta)) { 1565 1562 if (is_multicast_ether_addr(ehdr->h_dest)) { 1566 1563 /* ··· 1637 1634 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 1638 1635 __le16 fc = hdr->frame_control; 1639 1636 struct sk_buff_head frame_list; 1637 + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); 1640 1638 1641 1639 if (unlikely(!ieee80211_is_data(fc))) 1642 1640 return RX_CONTINUE; ··· 1645 1641 if (unlikely(!ieee80211_is_data_present(fc))) 1646 1642 return RX_DROP_MONITOR; 1647 1643 1648 - if (!(rx->flags & IEEE80211_RX_AMSDU)) 1644 + if (!(status->rx_flags & IEEE80211_RX_AMSDU)) 1649 1645 return RX_CONTINUE; 1650 1646 1651 1647 if (ieee80211_has_a4(hdr->frame_control) && ··· 1696 1692 struct sk_buff *skb = rx->skb, *fwd_skb; 1697 1693 struct ieee80211_local *local = rx->local; 1698 1694 struct ieee80211_sub_if_data *sdata = rx->sdata; 1695 + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); 1699 1696 1700 1697 hdr = (struct ieee80211_hdr *) skb->data; 1701 1698 hdrlen = ieee80211_hdrlen(hdr->frame_control); ··· 1742 1737 1743 1738 mesh_hdr->ttl--; 1744 1739 1745 - if (rx->flags & IEEE80211_RX_RA_MATCH) { 1740 + if (status->rx_flags & IEEE80211_RX_RA_MATCH) { 1746 1741 if (!mesh_hdr->ttl) 1747 1742 IEEE80211_IFSTA_MESH_CTR_INC(&rx->sdata->u.mesh, 1748 1743 dropped_frames_ttl); ··· 1952 1947 ieee80211_rx_h_mgmt_check(struct ieee80211_rx_data *rx) 1953 1948 { 1954 1949 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; 1950 + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); 1955 1951 1956 1952 /* 1957 1953 * From here on, look only at management frames. ··· 1965 1959 if (!ieee80211_is_mgmt(mgmt->frame_control)) 1966 1960 return RX_DROP_MONITOR; 1967 1961 1968 - if (!(rx->flags & IEEE80211_RX_RA_MATCH)) 1962 + if (!(status->rx_flags & IEEE80211_RX_RA_MATCH)) 1969 1963 return RX_DROP_MONITOR; 1970 1964 1971 1965 if (ieee80211_drop_unencrypted_mgmt(rx)) ··· 1980 1974 struct ieee80211_local *local = rx->local; 1981 1975 struct ieee80211_sub_if_data *sdata = rx->sdata; 1982 1976 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; 1977 + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); 1983 1978 int len = rx->skb->len; 1984 1979 1985 1980 if (!ieee80211_is_action(mgmt->frame_control)) ··· 1993 1986 if (!rx->sta && mgmt->u.action.category != WLAN_CATEGORY_PUBLIC) 1994 1987 return RX_DROP_UNUSABLE; 1995 1988 1996 - if (!(rx->flags & IEEE80211_RX_RA_MATCH)) 1989 + if (!(status->rx_flags & IEEE80211_RX_RA_MATCH)) 1997 1990 return RX_DROP_UNUSABLE; 1998 1991 1999 1992 switch (mgmt->u.action.category) { ··· 2089 2082 return RX_CONTINUE; 2090 2083 2091 2084 invalid: 2092 - rx->flags |= IEEE80211_MALFORMED_ACTION_FRM; 2085 + status->rx_flags |= IEEE80211_RX_MALFORMED_ACTION_FRM; 2093 2086 /* will return in the next handlers */ 2094 2087 return RX_CONTINUE; 2095 2088 ··· 2111 2104 static ieee80211_rx_result debug_noinline 2112 2105 ieee80211_rx_h_userspace_mgmt(struct ieee80211_rx_data *rx) 2113 2106 { 2114 - struct ieee80211_rx_status *status; 2107 + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); 2115 2108 2116 2109 /* skip known-bad action frames and return them in the next handler */ 2117 - if (rx->flags & IEEE80211_MALFORMED_ACTION_FRM) 2110 + if (status->rx_flags & IEEE80211_RX_MALFORMED_ACTION_FRM) 2118 2111 return RX_CONTINUE; 2119 2112 2120 2113 /* ··· 2123 2116 * so userspace can register for those to know whether ones 2124 2117 * it transmitted were processed or returned. 2125 2118 */ 2126 - status = IEEE80211_SKB_RXCB(rx->skb); 2127 2119 2128 2120 if (cfg80211_rx_mgmt(rx->sdata->dev, status->freq, 2129 2121 rx->skb->data, rx->skb->len, ··· 2144 2138 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; 2145 2139 struct sk_buff *nskb; 2146 2140 struct ieee80211_sub_if_data *sdata = rx->sdata; 2141 + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); 2147 2142 2148 2143 if (!ieee80211_is_action(mgmt->frame_control)) 2149 2144 return RX_CONTINUE; ··· 2159 2152 * registration mechanisms, but older ones still use cooked 2160 2153 * monitor interfaces so push all frames there. 2161 2154 */ 2162 - if (!(rx->flags & IEEE80211_MALFORMED_ACTION_FRM) && 2155 + if (!(status->rx_flags & IEEE80211_RX_MALFORMED_ACTION_FRM) && 2163 2156 (sdata->vif.type == NL80211_IFTYPE_AP || 2164 2157 sdata->vif.type == NL80211_IFTYPE_AP_VLAN)) 2165 2158 return RX_DROP_MONITOR; ··· 2293 2286 struct net_device *prev_dev = NULL; 2294 2287 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); 2295 2288 2296 - if (status->flag & RX_FLAG_INTERNAL_CMTR) 2289 + /* 2290 + * If cooked monitor has been processed already, then 2291 + * don't do it again. If not, set the flag. 2292 + */ 2293 + if (rx->flags & IEEE80211_RX_CMNTR) 2297 2294 goto out_free_skb; 2295 + rx->flags |= IEEE80211_RX_CMNTR; 2298 2296 2299 2297 if (skb_headroom(skb) < sizeof(*rthdr) && 2300 2298 pskb_expand_head(skb, sizeof(*rthdr), 0, GFP_ATOMIC)) ··· 2355 2343 if (prev_dev) { 2356 2344 skb->dev = prev_dev; 2357 2345 netif_receive_skb(skb); 2358 - skb = NULL; 2359 - } else 2360 - goto out_free_skb; 2361 - 2362 - status->flag |= RX_FLAG_INTERNAL_CMTR; 2363 - return; 2346 + return; 2347 + } 2364 2348 2365 2349 out_free_skb: 2366 2350 dev_kfree_skb(skb); ··· 2417 2409 * same TID from the same station 2418 2410 */ 2419 2411 rx->skb = skb; 2412 + rx->flags = 0; 2420 2413 2421 2414 CALL_RXH(ieee80211_rx_h_decrypt) 2422 2415 CALL_RXH(ieee80211_rx_h_check_more_data) ··· 2452 2443 } 2453 2444 } 2454 2445 2455 - static void ieee80211_invoke_rx_handlers(struct ieee80211_sub_if_data *sdata, 2456 - struct ieee80211_rx_data *rx, 2457 - struct sk_buff *skb) 2446 + static void ieee80211_invoke_rx_handlers(struct ieee80211_rx_data *rx) 2458 2447 { 2459 2448 struct sk_buff_head reorder_release; 2460 2449 ieee80211_rx_result res = RX_DROP_MONITOR; 2461 2450 2462 2451 __skb_queue_head_init(&reorder_release); 2463 - 2464 - rx->skb = skb; 2465 - rx->sdata = sdata; 2466 2452 2467 2453 #define CALL_RXH(rxh) \ 2468 2454 do { \ ··· 2488 2484 void ieee80211_release_reorder_timeout(struct sta_info *sta, int tid) 2489 2485 { 2490 2486 struct sk_buff_head frames; 2491 - struct ieee80211_rx_data rx = { }; 2487 + struct ieee80211_rx_data rx = { 2488 + .sta = sta, 2489 + .sdata = sta->sdata, 2490 + .local = sta->local, 2491 + .queue = tid, 2492 + }; 2492 2493 struct tid_ampdu_rx *tid_agg_rx; 2493 2494 2494 2495 tid_agg_rx = rcu_dereference(sta->ampdu_mlme.tid_rx[tid]); ··· 2501 2492 return; 2502 2493 2503 2494 __skb_queue_head_init(&frames); 2504 - 2505 - /* construct rx struct */ 2506 - rx.sta = sta; 2507 - rx.sdata = sta->sdata; 2508 - rx.local = sta->local; 2509 - rx.queue = tid; 2510 - rx.flags |= IEEE80211_RX_RA_MATCH; 2511 - 2512 - if (unlikely(test_bit(SCAN_HW_SCANNING, &sta->local->scanning) || 2513 - test_bit(SCAN_OFF_CHANNEL, &sta->local->scanning))) 2514 - rx.flags |= IEEE80211_RX_IN_SCAN; 2515 2495 2516 2496 spin_lock(&tid_agg_rx->reorder_lock); 2517 2497 ieee80211_sta_reorder_release(&sta->local->hw, tid_agg_rx, &frames); ··· 2511 2513 2512 2514 /* main receive path */ 2513 2515 2514 - static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata, 2515 - struct ieee80211_rx_data *rx, 2516 + static int prepare_for_handlers(struct ieee80211_rx_data *rx, 2516 2517 struct ieee80211_hdr *hdr) 2517 2518 { 2519 + struct ieee80211_sub_if_data *sdata = rx->sdata; 2518 2520 struct sk_buff *skb = rx->skb; 2519 2521 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); 2520 2522 u8 *bssid = ieee80211_get_bssid(hdr, skb->len, sdata->vif.type); ··· 2528 2530 compare_ether_addr(sdata->vif.addr, hdr->addr1) != 0) { 2529 2531 if (!(sdata->dev->flags & IFF_PROMISC)) 2530 2532 return 0; 2531 - rx->flags &= ~IEEE80211_RX_RA_MATCH; 2533 + status->rx_flags &= ~IEEE80211_RX_RA_MATCH; 2532 2534 } 2533 2535 break; 2534 2536 case NL80211_IFTYPE_ADHOC: ··· 2538 2540 return 1; 2539 2541 } 2540 2542 else if (!ieee80211_bssid_match(bssid, sdata->u.ibss.bssid)) { 2541 - if (!(rx->flags & IEEE80211_RX_IN_SCAN)) 2543 + if (!(status->rx_flags & IEEE80211_RX_IN_SCAN)) 2542 2544 return 0; 2543 - rx->flags &= ~IEEE80211_RX_RA_MATCH; 2545 + status->rx_flags &= ~IEEE80211_RX_RA_MATCH; 2544 2546 } else if (!multicast && 2545 2547 compare_ether_addr(sdata->vif.addr, 2546 2548 hdr->addr1) != 0) { 2547 2549 if (!(sdata->dev->flags & IFF_PROMISC)) 2548 2550 return 0; 2549 - rx->flags &= ~IEEE80211_RX_RA_MATCH; 2551 + status->rx_flags &= ~IEEE80211_RX_RA_MATCH; 2550 2552 } else if (!rx->sta) { 2551 2553 int rate_idx; 2552 2554 if (status->flag & RX_FLAG_HT) ··· 2564 2566 if (!(sdata->dev->flags & IFF_PROMISC)) 2565 2567 return 0; 2566 2568 2567 - rx->flags &= ~IEEE80211_RX_RA_MATCH; 2569 + status->rx_flags &= ~IEEE80211_RX_RA_MATCH; 2568 2570 } 2569 2571 break; 2570 2572 case NL80211_IFTYPE_AP_VLAN: ··· 2575 2577 return 0; 2576 2578 } else if (!ieee80211_bssid_match(bssid, 2577 2579 sdata->vif.addr)) { 2578 - if (!(rx->flags & IEEE80211_RX_IN_SCAN)) 2580 + if (!(status->rx_flags & IEEE80211_RX_IN_SCAN)) 2579 2581 return 0; 2580 - rx->flags &= ~IEEE80211_RX_RA_MATCH; 2582 + status->rx_flags &= ~IEEE80211_RX_RA_MATCH; 2581 2583 } 2582 2584 break; 2583 2585 case NL80211_IFTYPE_WDS: ··· 2596 2598 } 2597 2599 2598 2600 /* 2601 + * This function returns whether or not the SKB 2602 + * was destined for RX processing or not, which, 2603 + * if consume is true, is equivalent to whether 2604 + * or not the skb was consumed. 2605 + */ 2606 + static bool ieee80211_prepare_and_rx_handle(struct ieee80211_rx_data *rx, 2607 + struct sk_buff *skb, bool consume) 2608 + { 2609 + struct ieee80211_local *local = rx->local; 2610 + struct ieee80211_sub_if_data *sdata = rx->sdata; 2611 + struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); 2612 + struct ieee80211_hdr *hdr = (void *)skb->data; 2613 + int prepares; 2614 + 2615 + rx->skb = skb; 2616 + status->rx_flags |= IEEE80211_RX_RA_MATCH; 2617 + prepares = prepare_for_handlers(rx, hdr); 2618 + 2619 + if (!prepares) 2620 + return false; 2621 + 2622 + if (status->flag & RX_FLAG_MMIC_ERROR) { 2623 + if (status->rx_flags & IEEE80211_RX_RA_MATCH) 2624 + ieee80211_rx_michael_mic_report(hdr, rx); 2625 + return false; 2626 + } 2627 + 2628 + if (!consume) { 2629 + skb = skb_copy(skb, GFP_ATOMIC); 2630 + if (!skb) { 2631 + if (net_ratelimit()) 2632 + wiphy_debug(local->hw.wiphy, 2633 + "failed to copy multicast frame for %s\n", 2634 + sdata->name); 2635 + return true; 2636 + } 2637 + 2638 + rx->skb = skb; 2639 + } 2640 + 2641 + ieee80211_invoke_rx_handlers(rx); 2642 + return true; 2643 + } 2644 + 2645 + /* 2599 2646 * This is the actual Rx frames handler. as it blongs to Rx path it must 2600 2647 * be called with rcu_read_lock protection. 2601 2648 */ ··· 2653 2610 struct ieee80211_hdr *hdr; 2654 2611 __le16 fc; 2655 2612 struct ieee80211_rx_data rx; 2656 - int prepares; 2657 - struct ieee80211_sub_if_data *prev = NULL; 2658 - struct sk_buff *skb_new; 2659 - struct sta_info *sta, *tmp; 2660 - bool found_sta = false; 2613 + struct ieee80211_sub_if_data *prev; 2614 + struct sta_info *sta, *tmp, *prev_sta; 2661 2615 int err = 0; 2662 2616 2663 2617 fc = ((struct ieee80211_hdr *)skb->data)->frame_control; ··· 2667 2627 2668 2628 if (unlikely(test_bit(SCAN_HW_SCANNING, &local->scanning) || 2669 2629 test_bit(SCAN_OFF_CHANNEL, &local->scanning))) 2670 - rx.flags |= IEEE80211_RX_IN_SCAN; 2630 + status->rx_flags |= IEEE80211_RX_IN_SCAN; 2671 2631 2672 2632 if (ieee80211_is_mgmt(fc)) 2673 2633 err = skb_linearize(skb); ··· 2684 2644 ieee80211_verify_alignment(&rx); 2685 2645 2686 2646 if (ieee80211_is_data(fc)) { 2647 + prev_sta = NULL; 2648 + 2687 2649 for_each_sta_info(local, hdr->addr2, sta, tmp) { 2688 - rx.sta = sta; 2689 - found_sta = true; 2690 - rx.sdata = sta->sdata; 2691 - 2692 - rx.flags |= IEEE80211_RX_RA_MATCH; 2693 - prepares = prepare_for_handlers(rx.sdata, &rx, hdr); 2694 - if (prepares) { 2695 - if (status->flag & RX_FLAG_MMIC_ERROR) { 2696 - if (rx.flags & IEEE80211_RX_RA_MATCH) 2697 - ieee80211_rx_michael_mic_report(hdr, &rx); 2698 - } else 2699 - prev = rx.sdata; 2650 + if (!prev_sta) { 2651 + prev_sta = sta; 2652 + continue; 2700 2653 } 2654 + 2655 + rx.sta = prev_sta; 2656 + rx.sdata = prev_sta->sdata; 2657 + ieee80211_prepare_and_rx_handle(&rx, skb, false); 2658 + 2659 + prev_sta = sta; 2660 + } 2661 + 2662 + if (prev_sta) { 2663 + rx.sta = prev_sta; 2664 + rx.sdata = prev_sta->sdata; 2665 + 2666 + if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) 2667 + return; 2701 2668 } 2702 2669 } 2703 - if (!found_sta) { 2704 - list_for_each_entry_rcu(sdata, &local->interfaces, list) { 2705 - if (!ieee80211_sdata_running(sdata)) 2706 - continue; 2707 2670 2708 - if (sdata->vif.type == NL80211_IFTYPE_MONITOR || 2709 - sdata->vif.type == NL80211_IFTYPE_AP_VLAN) 2710 - continue; 2671 + prev = NULL; 2711 2672 2712 - /* 2713 - * frame is destined for this interface, but if it's 2714 - * not also for the previous one we handle that after 2715 - * the loop to avoid copying the SKB once too much 2716 - */ 2673 + list_for_each_entry_rcu(sdata, &local->interfaces, list) { 2674 + if (!ieee80211_sdata_running(sdata)) 2675 + continue; 2717 2676 2718 - if (!prev) { 2719 - prev = sdata; 2720 - continue; 2721 - } 2677 + if (sdata->vif.type == NL80211_IFTYPE_MONITOR || 2678 + sdata->vif.type == NL80211_IFTYPE_AP_VLAN) 2679 + continue; 2722 2680 2723 - rx.sta = sta_info_get_bss(prev, hdr->addr2); 2681 + /* 2682 + * frame is destined for this interface, but if it's 2683 + * not also for the previous one we handle that after 2684 + * the loop to avoid copying the SKB once too much 2685 + */ 2724 2686 2725 - rx.flags |= IEEE80211_RX_RA_MATCH; 2726 - prepares = prepare_for_handlers(prev, &rx, hdr); 2727 - 2728 - if (!prepares) 2729 - goto next; 2730 - 2731 - if (status->flag & RX_FLAG_MMIC_ERROR) { 2732 - rx.sdata = prev; 2733 - if (rx.flags & IEEE80211_RX_RA_MATCH) 2734 - ieee80211_rx_michael_mic_report(hdr, 2735 - &rx); 2736 - goto next; 2737 - } 2738 - 2739 - /* 2740 - * frame was destined for the previous interface 2741 - * so invoke RX handlers for it 2742 - */ 2743 - 2744 - skb_new = skb_copy(skb, GFP_ATOMIC); 2745 - if (!skb_new) { 2746 - if (net_ratelimit()) 2747 - wiphy_debug(local->hw.wiphy, 2748 - "failed to copy multicast frame for %s\n", 2749 - prev->name); 2750 - goto next; 2751 - } 2752 - ieee80211_invoke_rx_handlers(prev, &rx, skb_new); 2753 - next: 2687 + if (!prev) { 2754 2688 prev = sdata; 2689 + continue; 2755 2690 } 2756 2691 2757 - if (prev) { 2758 - rx.sta = sta_info_get_bss(prev, hdr->addr2); 2692 + rx.sta = sta_info_get_bss(prev, hdr->addr2); 2693 + rx.sdata = prev; 2694 + ieee80211_prepare_and_rx_handle(&rx, skb, false); 2759 2695 2760 - rx.flags |= IEEE80211_RX_RA_MATCH; 2761 - prepares = prepare_for_handlers(prev, &rx, hdr); 2762 - 2763 - if (!prepares) 2764 - prev = NULL; 2765 - } 2696 + prev = sdata; 2766 2697 } 2767 - if (prev) 2768 - ieee80211_invoke_rx_handlers(prev, &rx, skb); 2769 - else 2770 - dev_kfree_skb(skb); 2698 + 2699 + if (prev) { 2700 + rx.sta = sta_info_get_bss(prev, hdr->addr2); 2701 + rx.sdata = prev; 2702 + 2703 + if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) 2704 + return; 2705 + } 2706 + 2707 + dev_kfree_skb(skb); 2771 2708 } 2772 2709 2773 2710 /* ··· 2817 2800 rate = &sband->bitrates[status->rate_idx]; 2818 2801 } 2819 2802 } 2803 + 2804 + status->rx_flags = 0; 2820 2805 2821 2806 /* 2822 2807 * key references and virtual interfaces are protected using RCU
+2 -1
net/mac80211/scan.c
··· 242 242 local->hw_scan_req->n_channels = n_chans; 243 243 244 244 ielen = ieee80211_build_preq_ies(local, (u8 *)local->hw_scan_req->ie, 245 - req->ie, req->ie_len, band); 245 + req->ie, req->ie_len, band, (u32) -1, 246 + 0); 246 247 local->hw_scan_req->ie_len = ielen; 247 248 248 249 return true;
+11 -4
net/mac80211/sta_info.c
··· 838 838 mutex_unlock(&local->sta_mtx); 839 839 } 840 840 841 - struct ieee80211_sta *ieee80211_find_sta_by_hw(struct ieee80211_hw *hw, 842 - const u8 *addr) 841 + struct ieee80211_sta *ieee80211_find_sta_by_ifaddr(struct ieee80211_hw *hw, 842 + const u8 *addr, 843 + const u8 *localaddr) 843 844 { 844 845 struct sta_info *sta, *nxt; 845 846 846 - /* Just return a random station ... first in list ... */ 847 + /* 848 + * Just return a random station if localaddr is NULL 849 + * ... first in list. 850 + */ 847 851 for_each_sta_info(hw_to_local(hw), addr, sta, nxt) { 852 + if (localaddr && 853 + compare_ether_addr(sta->sdata->vif.addr, localaddr) != 0) 854 + continue; 848 855 if (!sta->uploaded) 849 856 return NULL; 850 857 return &sta->sta; ··· 859 852 860 853 return NULL; 861 854 } 862 - EXPORT_SYMBOL_GPL(ieee80211_find_sta_by_hw); 855 + EXPORT_SYMBOL_GPL(ieee80211_find_sta_by_ifaddr); 863 856 864 857 struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif, 865 858 const u8 *addr)
+1
net/mac80211/status.c
··· 58 58 info->control.vif = &sta->sdata->vif; 59 59 info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING | 60 60 IEEE80211_TX_INTFL_RETRANSMISSION; 61 + info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS; 61 62 62 63 sta->tx_filtered_count++; 63 64
+33 -14
net/mac80211/util.c
··· 895 895 896 896 int ieee80211_build_preq_ies(struct ieee80211_local *local, u8 *buffer, 897 897 const u8 *ie, size_t ie_len, 898 - enum ieee80211_band band) 898 + enum ieee80211_band band, u32 rate_mask, 899 + u8 channel) 899 900 { 900 901 struct ieee80211_supported_band *sband; 901 902 u8 *pos; 902 903 size_t offset = 0, noffset; 903 904 int supp_rates_len, i; 905 + u8 rates[32]; 906 + int num_rates; 907 + int ext_rates_len; 904 908 905 909 sband = local->hw.wiphy->bands[band]; 906 910 907 911 pos = buffer; 908 912 909 - supp_rates_len = min_t(int, sband->n_bitrates, 8); 913 + num_rates = 0; 914 + for (i = 0; i < sband->n_bitrates; i++) { 915 + if ((BIT(i) & rate_mask) == 0) 916 + continue; /* skip rate */ 917 + rates[num_rates++] = (u8) (sband->bitrates[i].bitrate / 5); 918 + } 919 + 920 + supp_rates_len = min_t(int, num_rates, 8); 910 921 911 922 *pos++ = WLAN_EID_SUPP_RATES; 912 923 *pos++ = supp_rates_len; 913 - 914 - for (i = 0; i < supp_rates_len; i++) { 915 - int rate = sband->bitrates[i].bitrate; 916 - *pos++ = (u8) (rate / 5); 917 - } 924 + memcpy(pos, rates, supp_rates_len); 925 + pos += supp_rates_len; 918 926 919 927 /* insert "request information" if in custom IEs */ 920 928 if (ie && ie_len) { ··· 940 932 offset = noffset; 941 933 } 942 934 943 - if (sband->n_bitrates > i) { 935 + ext_rates_len = num_rates - supp_rates_len; 936 + if (ext_rates_len > 0) { 944 937 *pos++ = WLAN_EID_EXT_SUPP_RATES; 945 - *pos++ = sband->n_bitrates - i; 938 + *pos++ = ext_rates_len; 939 + memcpy(pos, rates + supp_rates_len, ext_rates_len); 940 + pos += ext_rates_len; 941 + } 946 942 947 - for (; i < sband->n_bitrates; i++) { 948 - int rate = sband->bitrates[i].bitrate; 949 - *pos++ = (u8) (rate / 5); 950 - } 943 + if (channel && sband->band == IEEE80211_BAND_2GHZ) { 944 + *pos++ = WLAN_EID_DS_PARAMS; 945 + *pos++ = 1; 946 + *pos++ = channel; 951 947 } 952 948 953 949 /* insert custom IEs that go before HT */ ··· 1020 1008 struct ieee80211_mgmt *mgmt; 1021 1009 size_t buf_len; 1022 1010 u8 *buf; 1011 + u8 chan; 1023 1012 1024 1013 /* FIXME: come up with a proper value */ 1025 1014 buf = kmalloc(200 + ie_len, GFP_KERNEL); ··· 1030 1017 return; 1031 1018 } 1032 1019 1020 + chan = ieee80211_frequency_to_channel( 1021 + local->hw.conf.channel->center_freq); 1022 + 1033 1023 buf_len = ieee80211_build_preq_ies(local, buf, ie, ie_len, 1034 - local->hw.conf.channel->band); 1024 + local->hw.conf.channel->band, 1025 + sdata->rc_rateidx_mask 1026 + [local->hw.conf.channel->band], 1027 + chan); 1035 1028 1036 1029 skb = ieee80211_probereq_get(&local->hw, &sdata->vif, 1037 1030 ssid, ssid_len,
+1 -1
net/mac80211/wpa.c
··· 117 117 key = &rx->key->conf.key[key_offset]; 118 118 michael_mic(key, hdr, data, data_len, mic); 119 119 if (memcmp(mic, data + data_len, MICHAEL_MIC_LEN) != 0 || wpa_test) { 120 - if (!(rx->flags & IEEE80211_RX_RA_MATCH)) 120 + if (!(status->rx_flags & IEEE80211_RX_RA_MATCH)) 121 121 return RX_DROP_UNUSABLE; 122 122 123 123 mac80211_ev_michael_mic_failure(rx->sdata, rx->key->conf.keyidx,
+19
net/wireless/ibss.c
··· 88 88 if (wdev->ssid_len) 89 89 return -EALREADY; 90 90 91 + if (!params->basic_rates) { 92 + /* 93 + * If no rates were explicitly configured, 94 + * use the mandatory rate set for 11b or 95 + * 11a for maximum compatibility. 96 + */ 97 + struct ieee80211_supported_band *sband = 98 + rdev->wiphy.bands[params->channel->band]; 99 + int j; 100 + u32 flag = params->channel->band == IEEE80211_BAND_5GHZ ? 101 + IEEE80211_RATE_MANDATORY_A : 102 + IEEE80211_RATE_MANDATORY_B; 103 + 104 + for (j = 0; j < sband->n_bitrates; j++) { 105 + if (sband->bitrates[j].flags & flag) 106 + params->basic_rates |= BIT(j); 107 + } 108 + } 109 + 91 110 if (WARN_ON(wdev->connect_keys)) 92 111 kfree(wdev->connect_keys); 93 112 wdev->connect_keys = connkeys;
+2 -18
net/wireless/nl80211.c
··· 4119 4119 goto out; 4120 4120 } 4121 4121 } 4122 - } else { 4123 - /* 4124 - * If no rates were explicitly configured, 4125 - * use the mandatory rate set for 11b or 4126 - * 11a for maximum compatibility. 4127 - */ 4128 - struct ieee80211_supported_band *sband = 4129 - wiphy->bands[ibss.channel->band]; 4130 - int j; 4131 - u32 flag = ibss.channel->band == IEEE80211_BAND_5GHZ ? 4132 - IEEE80211_RATE_MANDATORY_A : 4133 - IEEE80211_RATE_MANDATORY_B; 4134 - 4135 - for (j = 0; j < sband->n_bitrates; j++) { 4136 - if (sband->bitrates[j].flags & flag) 4137 - ibss.basic_rates |= BIT(j); 4138 - } 4139 4122 } 4140 4123 4141 4124 err = cfg80211_join_ibss(rdev, dev, &ibss, connkeys); ··· 4973 4990 4974 4991 err = get_rdev_dev_by_info_ifindex(info, &rdev, &dev); 4975 4992 if (err) 4976 - goto unlock_rdev; 4993 + goto unlock_rtnl; 4977 4994 4978 4995 wdev = dev->ieee80211_ptr; 4979 4996 ··· 4997 5014 unlock_rdev: 4998 5015 cfg80211_unlock_rdev(rdev); 4999 5016 dev_put(dev); 5017 + unlock_rtnl: 5000 5018 rtnl_unlock(); 5001 5019 5002 5020 out: