aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Murphy2015-08-04 15:25:19 -0500
committerDan Murphy2015-08-04 15:25:19 -0500
commitfbecd6c3c88013374f3d39f4763a145f0bb2ffb3 (patch)
tree597bb6662e7510baa4c75925861349688bc4ba1c
parent5c13fd78e19fb9055c213cf00716642565f934e8 (diff)
parenta302ef8dbed4563adcaee9e110b68b343244a866 (diff)
downloadkernel-audio-ti-linux-4.1.y.tar.gz
kernel-audio-ti-linux-4.1.y.tar.xz
kernel-audio-ti-linux-4.1.y.zip
Merge branch 'wlcore-ti-linux-4.1.y' of git.ti.com:wilink8-wlan/wl18xx into ti-linux-4.1.yti-linux-4.1.y
TI-Feature: wlcore TI-Tree: git@git.ti.com:wilink8-wlan/wl18xx.git TI-Branch: wlcore-ti-linux-4.1.y * 'wlcore-ti-linux-4.1.y' of git.ti.com:wilink8-wlan/wl18xx: arm: dra72-evm: add wilink8 wlan and bt support ARM: dra7: add bluetooth device-tree support ARM: DRA7: Add wlan support for DRA7 ARM: dts: am437x-gp-evm: add wilink8 support arm: am57xx-evm: add wilink8 wlan and bt support ARM: dts: am335x-evm: add wilink8 bluetooth support ARM: dts: am335x-evm: add wilink8 wlan support wl18xx: add dynamic fw traces wl18xx: add diversity statistics wl18xx: update statistics acx and debugfs files wlcore: add antenna diversity reading wlcore: Add RX_BA_WIN_SIZE_CHANGE_EVENT event wlcore: ACX_BA_SESSION_RX_SETUP win_size taken from sta mac80211: RX BA support for sta max_rx_aggregation_subframes wlcore: add p2p device support mac80211: extract basic rates on start_ap wlcore/wl18xx : add time sync event handling wlcore: add generic_cfg_feature command definitions wlcore: always set MMC_PM_KEEP_POWER (workaround) wl18xx: use long intervals in sched scan Signed-off-by: Dan Murphy <DMurphy@ti.com> Conflicts: arch/arm/boot/dts/am335x-evm.dts arch/arm/boot/dts/am437x-gp-evm.dts
-rw-r--r--arch/arm/boot/dts/am335x-evm.dts81
-rw-r--r--arch/arm/boot/dts/am437x-gp-evm.dts103
-rw-r--r--arch/arm/boot/dts/am57xx-evm.dts50
-rw-r--r--arch/arm/boot/dts/dra7-evm.dts40
-rw-r--r--arch/arm/boot/dts/dra72-evm.dts64
-rw-r--r--drivers/net/wireless/ti/wl12xx/scan.c6
-rw-r--r--drivers/net/wireless/ti/wl18xx/acx.c27
-rw-r--r--drivers/net/wireless/ti/wl18xx/acx.h138
-rw-r--r--drivers/net/wireless/ti/wl18xx/debugfs.c231
-rw-r--r--drivers/net/wireless/ti/wl18xx/event.c74
-rw-r--r--drivers/net/wireless/ti/wl18xx/event.h13
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c60
-rw-r--r--drivers/net/wireless/ti/wl18xx/scan.c23
-rw-r--r--drivers/net/wireless/ti/wl18xx/scan.h4
-rw-r--r--drivers/net/wireless/ti/wlcore/acx.c5
-rw-r--r--drivers/net/wireless/ti/wlcore/acx.h3
-rw-r--r--drivers/net/wireless/ti/wlcore/cmd.c56
-rw-r--r--drivers/net/wireless/ti/wlcore/cmd.h15
-rw-r--r--drivers/net/wireless/ti/wlcore/conf.h11
-rw-r--r--drivers/net/wireless/ti/wlcore/init.c2
-rw-r--r--drivers/net/wireless/ti/wlcore/init.h1
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c123
-rw-r--r--drivers/net/wireless/ti/wlcore/rx.c3
-rw-r--r--drivers/net/wireless/ti/wlcore/rx.h3
-rw-r--r--drivers/net/wireless/ti/wlcore/scan.h6
-rw-r--r--drivers/net/wireless/ti/wlcore/sdio.c12
-rw-r--r--drivers/net/wireless/ti/wlcore/wlcore.h3
-rw-r--r--drivers/net/wireless/ti/wlcore/wlcore_i.h6
-rw-r--r--include/dt-bindings/pinctrl/am43xx.h1
-rw-r--r--include/net/mac80211.h21
-rw-r--r--net/mac80211/agg-rx.c32
-rw-r--r--net/mac80211/cfg.c52
-rw-r--r--net/mac80211/ht.c19
-rw-r--r--net/mac80211/sta_info.c3
34 files changed, 1103 insertions, 188 deletions
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index a22019da5e91..06a7e55f46ac 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -8,6 +8,7 @@
8/dts-v1/; 8/dts-v1/;
9 9
10#include "am33xx.dtsi" 10#include "am33xx.dtsi"
11#include <dt-bindings/interrupt-controller/irq.h>
11 12
12/ { 13/ {
13 model = "TI AM335x EVM"; 14 model = "TI AM335x EVM";
@@ -38,6 +39,20 @@
38 regulator-boot-on; 39 regulator-boot-on;
39 }; 40 };
40 41
42 wlan_en_reg: fixedregulator@2 {
43 compatible = "regulator-fixed";
44 regulator-name = "wlan-en-regulator";
45 regulator-min-microvolt = <1800000>;
46 regulator-max-microvolt = <1800000>;
47
48 /* WLAN_EN GPIO for this board - Bank1, pin16 */
49 gpio = <&gpio1 16 0>;
50
51 /* WLAN card specific delay */
52 startup-delay-us = <70000>;
53 enable-active-high;
54 };
55
41 matrix_keypad: matrix_keypad@0 { 56 matrix_keypad: matrix_keypad@0 {
42 compatible = "gpio-matrix-keypad"; 57 compatible = "gpio-matrix-keypad";
43 debounce-delay-ms = <5>; 58 debounce-delay-ms = <5>;
@@ -124,6 +139,18 @@
124 }; 139 };
125 }; 140 };
126 141
142 kim {
143 compatible = "kim";
144 nshutdown_gpio = <117>; /* Bank3, pin21 */
145 dev_name = "/dev/ttyS1";
146 flow_cntrl = <1>;
147 baud_rate = <3000000>;
148 };
149
150 btwilink {
151 compatible = "btwilink";
152 };
153
127 sound { 154 sound {
128 compatible = "ti,da830-evm-audio"; 155 compatible = "ti,da830-evm-audio";
129 ti,model = "AM335x-EVM"; 156 ti,model = "AM335x-EVM";
@@ -348,6 +375,27 @@
348 >; 375 >;
349 }; 376 };
350 377
378 /* wl12xx/wl18xx card on mmc3 */
379 mmc3_pins: pinmux_mmc3_pins {
380 pinctrl-single,pins = <
381 0x44 (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_a1.mmc2_dat0, INPUT_PULLUP | MODE3 */
382 0x48 (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_a2.mmc2_dat1, INPUT_PULLUP | MODE3 */
383 0x4C (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_a3.mmc2_dat2, INPUT_PULLUP | MODE3 */
384 0x78 (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_ben1.mmc2_dat3, INPUT_PULLUP | MODE3 */
385 0x88 (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_csn3.mmc2_cmd, INPUT_PULLUP | MODE3 */
386 0x8C (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_clk.mmc2_clk, INPUT_PULLUP | MODE3 */
387 >;
388 };
389
390 /* wl12xx/wl18xx card enable/irq GPIOs. */
391 wlan_pins: pinmux_wlan_pins {
392 pinctrl-single,pins = <
393 0x40 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a0.gpio1_16 */
394 0x19C (PIN_INPUT | MUX_MODE7) /* mcasp0_ahclkr.gpio3_17 */
395 0x1AC (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* mcasp0_ahclkx.gpio3_21 */
396 >;
397 };
398
351 lcd_pins_s0: lcd_pins_s0 { 399 lcd_pins_s0: lcd_pins_s0 {
352 pinctrl-single,pins = < 400 pinctrl-single,pins = <
353 0x20 (PIN_OUTPUT | MUX_MODE1) /* gpmc_ad8.lcd_data23 */ 401 0x20 (PIN_OUTPUT | MUX_MODE1) /* gpmc_ad8.lcd_data23 */
@@ -410,7 +458,6 @@
410 pinctrl-0 = <&uart1_pins_default>; 458 pinctrl-0 = <&uart1_pins_default>;
411 pinctrl-1 = <&uart1_pins_sleep>; 459 pinctrl-1 = <&uart1_pins_sleep>;
412 460
413
414 status = "okay"; 461 status = "okay";
415}; 462};
416 463
@@ -760,6 +807,38 @@
760 cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; 807 cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
761}; 808};
762 809
810&mmc3 {
811 /* these are on the crossbar and are outlined in the
812 xbar-event-map element */
813 dmas = <&edma 12
814 &edma 13>;
815 dma-names = "tx", "rx";
816 status = "okay";
817 vmmc-supply = <&wlan_en_reg>;
818 bus-width = <4>;
819 pinctrl-names = "default";
820 pinctrl-0 = <&mmc3_pins &wlan_pins>;
821 ti,non-removable;
822 ti,needs-special-hs-handling;
823 cap-power-off-card;
824 keep-power-in-suspend;
825
826 #address-cells = <1>;
827 #size-cells = <0>;
828 wlcore: wlcore@2 {
829 compatible = "ti,wl1835";
830 reg = <2>;
831 interrupt-parent = <&gpio3>;
832 interrupts = <17 IRQ_TYPE_LEVEL_HIGH>;
833 ref-clock-frequency = <38400000>;
834 };
835};
836
837&edma {
838 ti,edma-xbar-event-map = /bits/ 16 <1 12
839 2 13>;
840};
841
763&sham { 842&sham {
764 status = "okay"; 843 status = "okay";
765}; 844};
diff --git a/arch/arm/boot/dts/am437x-gp-evm.dts b/arch/arm/boot/dts/am437x-gp-evm.dts
index 26e96444d3a2..fff810005a98 100644
--- a/arch/arm/boot/dts/am437x-gp-evm.dts
+++ b/arch/arm/boot/dts/am437x-gp-evm.dts
@@ -21,6 +21,7 @@
21 21
22 aliases { 22 aliases {
23 display0 = &lcd0; 23 display0 = &lcd0;
24 serial3 = &uart3;
24 }; 25 };
25 26
26 evm_v3_3d: fixedregulator-v3_3d { 27 evm_v3_3d: fixedregulator-v3_3d {
@@ -42,6 +43,15 @@
42 gpio = <&gpio5 7 GPIO_ACTIVE_HIGH>; 43 gpio = <&gpio5 7 GPIO_ACTIVE_HIGH>;
43 }; 44 };
44 45
46 vmmcwl_fixed: fixedregulator-mmcwl {
47 compatible = "regulator-fixed";
48 regulator-name = "vmmcwl_fixed";
49 regulator-min-microvolt = <1800000>;
50 regulator-max-microvolt = <1800000>;
51 gpio = <&gpio1 20 GPIO_ACTIVE_HIGH>;
52 enable-active-high;
53 };
54
45 lcd_bl: backlight { 55 lcd_bl: backlight {
46 compatible = "pwm-backlight"; 56 compatible = "pwm-backlight";
47 pwms = <&ecap0 0 50000 PWM_POLARITY_INVERTED>; 57 pwms = <&ecap0 0 50000 PWM_POLARITY_INVERTED>;
@@ -138,8 +148,9 @@
138}; 148};
139 149
140&am43xx_pinmux { 150&am43xx_pinmux {
141 pinctrl-names = "default"; 151 pinctrl-names = "default", "sleep";
142 pinctrl-0 = <&ddr3_vtt_toggle_default>; 152 pinctrl-0 = <&ddr3_vtt_toggle_default &wlan_pins_default>;
153 pinctrl-1 = <&wlan_pins_sleep>;
143 154
144 ddr3_vtt_toggle_default: ddr_vtt_toggle_default { 155 ddr3_vtt_toggle_default: ddr_vtt_toggle_default {
145 pinctrl-single,pins = < 156 pinctrl-single,pins = <
@@ -490,6 +501,53 @@
490 0x174 (PIN_INPUT_PULLDOWN | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_EN | MUX_MODE0) /* uart0_txd.uart0_txd */ 501 0x174 (PIN_INPUT_PULLDOWN | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_EN | MUX_MODE0) /* uart0_txd.uart0_txd */
491 >; 502 >;
492 }; 503 };
504
505 mmc3_pins_default: pinmux_mmc3_pins_default {
506 pinctrl-single,pins = <
507 0x8c (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_clk.mmc2_clk */
508 0x88 (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_csn3.mmc2_cmd */
509 0x44 (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_a1.mmc2_dat0 */
510 0x48 (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_a2.mmc2_dat1 */
511 0x4c (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_a3.mmc2_dat2 */
512 0x78 (PIN_INPUT_PULLUP | MUX_MODE3) /* gpmc_be1n.mmc2_dat3 */
513 >;
514 };
515
516 mmc3_pins_sleep: pinmux_mmc3_pins_sleep {
517 pinctrl-single,pins = <
518 0x8c (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_clk.mmc2_clk */
519 0x88 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_csn3.mmc2_cmd */
520 0x44 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_a1.mmc2_dat0 */
521 0x48 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_a2.mmc2_dat1 */
522 0x4c (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_a3.mmc2_dat2 */
523 0x78 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* gpmc_be1n.mmc2_dat3 */
524 >;
525 };
526
527 wlan_pins_default: pinmux_wlan_pins_default {
528 pinctrl-single,pins = <
529 0x50 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a4.gpio1_20 WL_EN */
530 0x5c (PIN_INPUT | WAKEUP_ENABLE | MUX_MODE7) /* gpmc_a7.gpio1_23 WL_IRQ*/
531 0x40 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a0.gpio1_16 BT_EN*/
532 >;
533 };
534
535 wlan_pins_sleep: pinmux_wlan_pins_sleep {
536 pinctrl-single,pins = <
537 0x50 (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a4.gpio1_20 WL_EN */
538 0x5c (PIN_INPUT | WAKEUP_ENABLE | MUX_MODE7) /* gpmc_a7.gpio1_23 WL_IRQ*/
539 0x40 (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a0.gpio1_16 BT_EN*/
540 >;
541 };
542
543 uart3_pins: uart3_pins {
544 pinctrl-single,pins = <
545 0x228 (PIN_INPUT | MUX_MODE0) /* uart3_rxd.uart3_rxd */
546 0x22c (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart3_txd.uart3_txd */
547 0x230 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart3_ctsn.uart3_ctsn */
548 0x234 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* uart3_rtsn.uart3_rtsn */
549 >;
550 };
493}; 551};
494 552
495&i2c0 { 553&i2c0 {
@@ -649,6 +707,10 @@
649 status = "okay"; 707 status = "okay";
650}; 708};
651 709
710&gpio1 {
711 status = "okay";
712};
713
652&gpio3 { 714&gpio3 {
653 status = "okay"; 715 status = "okay";
654}; 716};
@@ -686,6 +748,43 @@
686 cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>; 748 cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
687}; 749};
688 750
751&mmc3 {
752 status = "okay";
753 /* these are on the crossbar and are outlined in the
754 xbar-event-map element */
755 dmas = <&edma 30
756 &edma 31>;
757 dma-names = "tx", "rx";
758 vmmc-supply = <&vmmcwl_fixed>;
759 bus-width = <4>;
760 pinctrl-names = "default", "sleep";
761 pinctrl-0 = <&mmc3_pins_default>;
762 pinctrl-1 = <&mmc3_pins_sleep>;
763 cap-power-off-card;
764 keep-power-in-suspend;
765 ti,non-removable;
766
767 #address-cells = <1>;
768 #size-cells = <0>;
769 wlcore: wlcore@0 {
770 compatible = "ti,wl1835";
771 reg = <2>;
772 interrupt-parent = <&gpio1>;
773 interrupts = <23 IRQ_TYPE_LEVEL_HIGH>;
774 };
775};
776
777&edma {
778 ti,edma-xbar-event-map = /bits/ 16 <1 30
779 2 31>;
780};
781
782&uart3 {
783 status = "okay";
784 pinctrl-names = "default";
785 pinctrl-0 = <&uart3_pins>;
786};
787
689&usb2_phy1 { 788&usb2_phy1 {
690 status = "okay"; 789 status = "okay";
691}; 790};
diff --git a/arch/arm/boot/dts/am57xx-evm.dts b/arch/arm/boot/dts/am57xx-evm.dts
index be109117c13d..c74605afb725 100644
--- a/arch/arm/boot/dts/am57xx-evm.dts
+++ b/arch/arm/boot/dts/am57xx-evm.dts
@@ -95,6 +95,33 @@
95 95
96 default-brightness-level = <8>; 96 default-brightness-level = <8>;
97 }; 97 };
98
99 vmmcwl_fixed: fixedregulator-mmcwl {
100 compatible = "regulator-fixed";
101 regulator-name = "vmmcwl_fixed";
102 /*
103 the gpio used for wlan_enable goes through a level shifter
104 on the platform. the settings for 1.8v below is needed by
105 the regulator driver, but is more of a comment since it
106 doesn't really control the voltage of the gpio
107 */
108 regulator-min-microvolt = <1800000>;
109 regulator-max-microvolt = <1800000>;
110 gpio = <&gpio5 8 GPIO_ACTIVE_HIGH>;
111 enable-active-high;
112 };
113
114 kim {
115 compatible = "kim";
116 nshutdown_gpio = <132>;
117 dev_name = "/dev/ttyS7";
118 flow_cntrl = <1>;
119 baud_rate = <3686400>;
120 };
121
122 btwilink {
123 compatible = "btwilink";
124 };
98}; 125};
99 126
100&i2c5 { 127&i2c5 {
@@ -177,3 +204,26 @@
177 touchscreen-size-y = <600>; 204 touchscreen-size-y = <600>;
178 }; 205 };
179}; 206};
207
208&uart8 {
209 status = "okay";
210};
211
212&mmc3 {
213 status = "okay";
214 vmmc-supply = <&vmmcwl_fixed>;
215 bus-width = <4>;
216 pinctrl-names = "default";
217 cap-power-off-card;
218 keep-power-in-suspend;
219 ti,non-removable;
220
221 #address-cells = <1>;
222 #size-cells = <0>;
223 wlcore: wlcore@0 {
224 compatible = "ti,wl1835";
225 reg = <2>;
226 interrupt-parent = <&gpio5>;
227 interrupts = <7 IRQ_TYPE_LEVEL_HIGH>;
228 };
229};
diff --git a/arch/arm/boot/dts/dra7-evm.dts b/arch/arm/boot/dts/dra7-evm.dts
index 10fa595ae8eb..76490bd77c0d 100644
--- a/arch/arm/boot/dts/dra7-evm.dts
+++ b/arch/arm/boot/dts/dra7-evm.dts
@@ -37,6 +37,28 @@
37 regulator-max-microvolt = <1800000>; 37 regulator-max-microvolt = <1800000>;
38 }; 38 };
39 39
40 vmmcwl_fixed: fixedregulator-mmcwl {
41 compatible = "regulator-fixed";
42 regulator-name = "vmmcwl_fixed";
43 regulator-min-microvolt = <1800000>;
44 regulator-max-microvolt = <1800000>;
45 gpio = <&gpio5 8 0>; /* gpio5_8 */
46 startup-delay-us = <70000>;
47 enable-active-high;
48 };
49
50 kim {
51 compatible = "kim";
52 nshutdown_gpio = <132>;
53 dev_name = "/dev/ttyS2";
54 flow_cntrl = <1>;
55 baud_rate = <3686400>;
56 };
57
58 btwilink {
59 compatible = "btwilink";
60 };
61
40 extcon_usb1: extcon_usb1 { 62 extcon_usb1: extcon_usb1 {
41 compatible = "linux,extcon-usb-gpio"; 63 compatible = "linux,extcon-usb-gpio";
42 id-gpio = <&pcf_gpio_21 1 GPIO_ACTIVE_HIGH>; 64 id-gpio = <&pcf_gpio_21 1 GPIO_ACTIVE_HIGH>;
@@ -457,6 +479,24 @@
457 bus-width = <8>; 479 bus-width = <8>;
458}; 480};
459 481
482&mmc4 {
483 status = "okay";
484 vmmc-supply = <&vmmcwl_fixed>;
485 bus-width = <4>;
486 cap-power-off-card;
487 keep-power-in-suspend;
488 ti,non-removable;
489
490 #address-cells = <1>;
491 #size-cells = <0>;
492 wlcore: wlcore@0 {
493 compatible = "ti,wl1835";
494 reg = <2>;
495 interrupt-parent = <&gpio5>;
496 interrupts = <7 IRQ_TYPE_LEVEL_HIGH>;
497 };
498};
499
460&cpu0 { 500&cpu0 {
461 cpu0-voltdm = <&voltdm_mpu>; 501 cpu0-voltdm = <&voltdm_mpu>;
462 voltage-tolerance = <1>; 502 voltage-tolerance = <1>;
diff --git a/arch/arm/boot/dts/dra72-evm.dts b/arch/arm/boot/dts/dra72-evm.dts
index 3158cac66747..b134e97e885f 100644
--- a/arch/arm/boot/dts/dra72-evm.dts
+++ b/arch/arm/boot/dts/dra72-evm.dts
@@ -132,6 +132,27 @@
132 clocks = <&atl_clkin2_ck>; 132 clocks = <&atl_clkin2_ck>;
133 }; 133 };
134 }; 134 };
135
136 vmmcwl_fixed: fixedregulator-mmcwl {
137 compatible = "regulator-fixed";
138 regulator-name = "vmmcwl_fixed";
139 regulator-min-microvolt = <1800000>;
140 regulator-max-microvolt = <1800000>;
141 gpio = <&gpio5 8 GPIO_ACTIVE_HIGH>; /* gpio5_8 */
142 enable-active-high;
143 };
144
145 kim {
146 compatible = "kim";
147 nshutdown_gpio = <132>;
148 dev_name = "/dev/ttyS2";
149 flow_cntrl = <1>;
150 baud_rate = <3686400>;
151 };
152
153 btwilink {
154 compatible = "btwilink";
155 };
135}; 156};
136 157
137&dra7_pmx_core { 158&dra7_pmx_core {
@@ -270,6 +291,24 @@
270 0x418 (MUX_MODE15 | PULL_UP) /* wakeup0.off */ 291 0x418 (MUX_MODE15 | PULL_UP) /* wakeup0.off */
271 >; 292 >;
272 }; 293 };
294
295 wlan_pins: pinmux_wlan_pins {
296 pinctrl-single,pins = <
297 0x3e8 (PIN_INPUT_PULLUP | MUX_MODE3) /* uart1_ctsn.mmc4_clk */
298 0x3ec (PIN_INPUT_PULLUP | MUX_MODE3) /* uart1_rtsn.mmc4_cmd */
299 0x3f0 (PIN_INPUT_PULLUP | MUX_MODE3) /* uart2_rxd.mmc4_dat0 */
300 0x3f4 (PIN_INPUT_PULLUP | MUX_MODE3) /* uart2_txd.mmc4_dat1 */
301 0x3f8 (PIN_INPUT_PULLUP | MUX_MODE3) /* uart2_ctsn.mmc4_dat2 */
302 0x3fc (PIN_INPUT_PULLUP | MUX_MODE3) /* uart2_rtsn.mmc4_dat3 */
303 0x2cc (PIN_OUTPUT | MUX_MODE14) /* mcasp1_axr6.gpio5_8 - WLAN_EN */
304 >;
305 };
306
307 wlirq_pins: pinmux_wlirq_pins {
308 pinctrl-single,pins = <
309 0x2c8 (PIN_INPUT_PULLUP | WAKEUP_EN | MUX_MODE14 ) /* mcasp1_axr5.gpio5_7 - WLAN_IRQ */
310 >;
311 };
273}; 312};
274 313
275&i2c1 { 314&i2c1 {
@@ -510,6 +549,11 @@
510 status = "okay"; 549 status = "okay";
511}; 550};
512 551
552&uart3 {
553 status = "okay";
554 gpios = <&pcf_gpio_21 14 GPIO_ACTIVE_LOW>;
555};
556
513&elm { 557&elm {
514 status = "okay"; 558 status = "okay";
515}; 559};
@@ -645,6 +689,26 @@
645 ti,non-removable; 689 ti,non-removable;
646}; 690};
647 691
692&mmc4 {
693 status = "okay";
694 vmmc-supply = <&vmmcwl_fixed>;
695 bus-width = <4>;
696 pinctrl-names = "default";
697 pinctrl-0 = <&wlan_pins &wlirq_pins>;
698 cap-power-off-card;
699 keep-power-in-suspend;
700 ti,non-removable;
701
702 #address-cells = <1>;
703 #size-cells = <0>;
704 wlcore: wlcore@0 {
705 compatible = "ti,wl1835";
706 reg = <2>;
707 interrupt-parent = <&gpio5>;
708 interrupts = <7 IRQ_TYPE_LEVEL_HIGH>;
709 };
710};
711
648&mac { 712&mac {
649 status = "okay"; 713 status = "okay";
650 slaves = <1>; 714 slaves = <1>;
diff --git a/drivers/net/wireless/ti/wl12xx/scan.c b/drivers/net/wireless/ti/wl12xx/scan.c
index 0c0d5cd98514..7c355fff2c5e 100644
--- a/drivers/net/wireless/ti/wl12xx/scan.c
+++ b/drivers/net/wireless/ti/wl12xx/scan.c
@@ -118,7 +118,11 @@ static int wl1271_scan_send(struct wl1271 *wl, struct wl12xx_vif *wlvif,
118 if (passive) 118 if (passive)
119 scan_options |= WL1271_SCAN_OPT_PASSIVE; 119 scan_options |= WL1271_SCAN_OPT_PASSIVE;
120 120
121 cmd->params.role_id = wlvif->role_id; 121 /* scan on the dev role if the regular one is not started */
122 if (wlcore_is_p2p_mgmt(wlvif))
123 cmd->params.role_id = wlvif->dev_role_id;
124 else
125 cmd->params.role_id = wlvif->role_id;
122 126
123 if (WARN_ON(cmd->params.role_id == WL12XX_INVALID_ROLE_ID)) { 127 if (WARN_ON(cmd->params.role_id == WL12XX_INVALID_ROLE_ID)) {
124 ret = -EINVAL; 128 ret = -EINVAL;
diff --git a/drivers/net/wireless/ti/wl18xx/acx.c b/drivers/net/wireless/ti/wl18xx/acx.c
index 67f2a0eec854..4be0409308cb 100644
--- a/drivers/net/wireless/ti/wl18xx/acx.c
+++ b/drivers/net/wireless/ti/wl18xx/acx.c
@@ -282,3 +282,30 @@ out:
282 kfree(acx); 282 kfree(acx);
283 return ret; 283 return ret;
284} 284}
285
286int wl18xx_acx_dynamic_fw_traces(struct wl1271 *wl)
287{
288 struct acx_dynamic_fw_traces_cfg *acx;
289 int ret;
290
291 wl1271_debug(DEBUG_ACX, "acx dynamic fw traces config %d",
292 wl->dynamic_fw_traces);
293
294 acx = kzalloc(sizeof(*acx), GFP_KERNEL);
295 if (!acx) {
296 ret = -ENOMEM;
297 goto out;
298 }
299
300 acx->dynamic_fw_traces = cpu_to_le32(wl->dynamic_fw_traces);
301
302 ret = wl1271_cmd_configure(wl, ACX_DYNAMIC_TRACES_CFG,
303 acx, sizeof(*acx));
304 if (ret < 0) {
305 wl1271_warning("acx config dynamic fw traces failed: %d", ret);
306 goto out;
307 }
308out:
309 kfree(acx);
310 return ret;
311}
diff --git a/drivers/net/wireless/ti/wl18xx/acx.h b/drivers/net/wireless/ti/wl18xx/acx.h
index 4afccd4b9467..342a2993ef98 100644
--- a/drivers/net/wireless/ti/wl18xx/acx.h
+++ b/drivers/net/wireless/ti/wl18xx/acx.h
@@ -35,7 +35,8 @@ enum {
35 ACX_PEER_CAP = 0x0056, 35 ACX_PEER_CAP = 0x0056,
36 ACX_INTERRUPT_NOTIFY = 0x0057, 36 ACX_INTERRUPT_NOTIFY = 0x0057,
37 ACX_RX_BA_FILTER = 0x0058, 37 ACX_RX_BA_FILTER = 0x0058,
38 ACX_AP_SLEEP_CFG = 0x0059 38 ACX_AP_SLEEP_CFG = 0x0059,
39 ACX_DYNAMIC_TRACES_CFG = 0x005A,
39}; 40};
40 41
41/* numbers of bits the length field takes (add 1 for the actual number) */ 42/* numbers of bits the length field takes (add 1 for the actual number) */
@@ -92,27 +93,26 @@ struct wl18xx_acx_checksum_state {
92 93
93 94
94struct wl18xx_acx_error_stats { 95struct wl18xx_acx_error_stats {
95 u32 error_frame; 96 u32 error_frame_non_ctrl;
96 u32 error_null_Frame_tx_start; 97 u32 error_frame_ctrl;
97 u32 error_numll_frame_cts_start; 98 u32 error_frame_during_protection;
98 u32 error_bar_retry; 99 u32 null_frame_tx_start;
99 u32 error_frame_cts_nul_flid; 100 u32 null_frame_cts_start;
100} __packed; 101 u32 bar_retry;
101 102 u32 num_frame_cts_nul_flid;
102struct wl18xx_acx_debug_stats { 103 u32 tx_abort_failure;
103 u32 debug1; 104 u32 tx_resume_failure;
104 u32 debug2; 105 u32 rx_cmplt_db_overflow_cnt;
105 u32 debug3; 106 u32 elp_while_rx_exch;
106 u32 debug4; 107 u32 elp_while_tx_exch;
107 u32 debug5; 108 u32 elp_while_tx;
108 u32 debug6; 109 u32 elp_while_nvic_pending;
109} __packed; 110 u32 rx_excessive_frame_len;
110 111 u32 burst_mismatch;
111struct wl18xx_acx_ring_stats { 112 u32 tbc_exch_mismatch;
112 u32 prepared_descs;
113 u32 tx_cmplt;
114} __packed; 113} __packed;
115 114
115#define NUM_OF_RATES_INDEXES 30
116struct wl18xx_acx_tx_stats { 116struct wl18xx_acx_tx_stats {
117 u32 tx_prepared_descs; 117 u32 tx_prepared_descs;
118 u32 tx_cmplt; 118 u32 tx_cmplt;
@@ -122,7 +122,7 @@ struct wl18xx_acx_tx_stats {
122 u32 tx_data_programmed; 122 u32 tx_data_programmed;
123 u32 tx_burst_programmed; 123 u32 tx_burst_programmed;
124 u32 tx_starts; 124 u32 tx_starts;
125 u32 tx_imm_resp; 125 u32 tx_stop;
126 u32 tx_start_templates; 126 u32 tx_start_templates;
127 u32 tx_start_int_templates; 127 u32 tx_start_int_templates;
128 u32 tx_start_fw_gen; 128 u32 tx_start_fw_gen;
@@ -131,13 +131,14 @@ struct wl18xx_acx_tx_stats {
131 u32 tx_exch; 131 u32 tx_exch;
132 u32 tx_retry_template; 132 u32 tx_retry_template;
133 u32 tx_retry_data; 133 u32 tx_retry_data;
134 u32 tx_retry_per_rate[NUM_OF_RATES_INDEXES];
134 u32 tx_exch_pending; 135 u32 tx_exch_pending;
135 u32 tx_exch_expiry; 136 u32 tx_exch_expiry;
136 u32 tx_done_template; 137 u32 tx_done_template;
137 u32 tx_done_data; 138 u32 tx_done_data;
138 u32 tx_done_int_template; 139 u32 tx_done_int_template;
139 u32 tx_frame_checksum; 140 u32 tx_cfe1;
140 u32 tx_checksum_result; 141 u32 tx_cfe2;
141 u32 frag_called; 142 u32 frag_called;
142 u32 frag_mpdu_alloc_failed; 143 u32 frag_mpdu_alloc_failed;
143 u32 frag_init_called; 144 u32 frag_init_called;
@@ -165,11 +166,8 @@ struct wl18xx_acx_rx_stats {
165 u32 rx_cmplt_task; 166 u32 rx_cmplt_task;
166 u32 rx_phy_hdr; 167 u32 rx_phy_hdr;
167 u32 rx_timeout; 168 u32 rx_timeout;
169 u32 rx_rts_timeout;
168 u32 rx_timeout_wa; 170 u32 rx_timeout_wa;
169 u32 rx_wa_density_dropped_frame;
170 u32 rx_wa_ba_not_expected;
171 u32 rx_frame_checksum;
172 u32 rx_checksum_result;
173 u32 defrag_called; 171 u32 defrag_called;
174 u32 defrag_init_called; 172 u32 defrag_init_called;
175 u32 defrag_in_process_called; 173 u32 defrag_in_process_called;
@@ -179,6 +177,7 @@ struct wl18xx_acx_rx_stats {
179 u32 decrypt_key_not_found; 177 u32 decrypt_key_not_found;
180 u32 defrag_need_decrypt; 178 u32 defrag_need_decrypt;
181 u32 rx_tkip_replays; 179 u32 rx_tkip_replays;
180 u32 rx_xfr;
182} __packed; 181} __packed;
183 182
184struct wl18xx_acx_isr_stats { 183struct wl18xx_acx_isr_stats {
@@ -193,21 +192,13 @@ struct wl18xx_acx_pwr_stats {
193 u32 connection_out_of_sync; 192 u32 connection_out_of_sync;
194 u32 cont_miss_bcns_spread[PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD]; 193 u32 cont_miss_bcns_spread[PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD];
195 u32 rcvd_awake_bcns_cnt; 194 u32 rcvd_awake_bcns_cnt;
196} __packed; 195 u32 sleep_time_count;
197 196 u32 sleep_time_avg;
198struct wl18xx_acx_event_stats { 197 u32 sleep_cycle_avg;
199 u32 calibration; 198 u32 sleep_percent;
200 u32 rx_mismatch; 199 u32 ap_sleep_active_conf;
201 u32 rx_mem_empty; 200 u32 ap_sleep_user_conf;
202} __packed; 201 u32 ap_sleep_counter;
203
204struct wl18xx_acx_ps_poll_stats {
205 u32 ps_poll_timeouts;
206 u32 upsd_timeouts;
207 u32 upsd_max_ap_turn;
208 u32 ps_poll_max_ap_turn;
209 u32 ps_poll_utilization;
210 u32 upsd_utilization;
211} __packed; 202} __packed;
212 203
213struct wl18xx_acx_rx_filter_stats { 204struct wl18xx_acx_rx_filter_stats {
@@ -227,11 +218,11 @@ struct wl18xx_acx_rx_rate_stats {
227} __packed; 218} __packed;
228 219
229#define AGGR_STATS_TX_AGG 16 220#define AGGR_STATS_TX_AGG 16
230#define AGGR_STATS_TX_RATE 16
231#define AGGR_STATS_RX_SIZE_LEN 16 221#define AGGR_STATS_RX_SIZE_LEN 16
232 222
233struct wl18xx_acx_aggr_stats { 223struct wl18xx_acx_aggr_stats {
234 u32 tx_agg_vs_rate[AGGR_STATS_TX_AGG * AGGR_STATS_TX_RATE]; 224 u32 tx_agg_rate[AGGR_STATS_TX_AGG];
225 u32 tx_agg_len[AGGR_STATS_TX_AGG];
235 u32 rx_size[AGGR_STATS_RX_SIZE_LEN]; 226 u32 rx_size[AGGR_STATS_RX_SIZE_LEN];
236} __packed; 227} __packed;
237 228
@@ -240,8 +231,6 @@ struct wl18xx_acx_aggr_stats {
240struct wl18xx_acx_pipeline_stats { 231struct wl18xx_acx_pipeline_stats {
241 u32 hs_tx_stat_fifo_int; 232 u32 hs_tx_stat_fifo_int;
242 u32 hs_rx_stat_fifo_int; 233 u32 hs_rx_stat_fifo_int;
243 u32 tcp_tx_stat_fifo_int;
244 u32 tcp_rx_stat_fifo_int;
245 u32 enc_tx_stat_fifo_int; 234 u32 enc_tx_stat_fifo_int;
246 u32 enc_rx_stat_fifo_int; 235 u32 enc_rx_stat_fifo_int;
247 u32 rx_complete_stat_fifo_int; 236 u32 rx_complete_stat_fifo_int;
@@ -249,38 +238,61 @@ struct wl18xx_acx_pipeline_stats {
249 u32 post_proc_swi; 238 u32 post_proc_swi;
250 u32 sec_frag_swi; 239 u32 sec_frag_swi;
251 u32 pre_to_defrag_swi; 240 u32 pre_to_defrag_swi;
252 u32 defrag_to_csum_swi; 241 u32 defrag_to_rx_xfer_swi;
253 u32 csum_to_rx_xfer_swi;
254 u32 dec_packet_in; 242 u32 dec_packet_in;
255 u32 dec_packet_in_fifo_full; 243 u32 dec_packet_in_fifo_full;
256 u32 dec_packet_out; 244 u32 dec_packet_out;
257 u32 cs_rx_packet_in;
258 u32 cs_rx_packet_out;
259 u16 pipeline_fifo_full[PIPE_STATS_HW_FIFO]; 245 u16 pipeline_fifo_full[PIPE_STATS_HW_FIFO];
246 u16 padding;
247} __packed;
248
249#define DIVERSITY_STATS_NUM_OF_ANT 2
250
251struct wl18xx_acx_diversity_stats {
252 u32 num_of_packets_per_ant[DIVERSITY_STATS_NUM_OF_ANT];
253 u32 total_num_of_toggles;
260} __packed; 254} __packed;
261 255
262struct wl18xx_acx_mem_stats { 256struct wl18xx_acx_thermal_stats {
263 u32 rx_free_mem_blks; 257 u16 irq_thr_low;
264 u32 tx_free_mem_blks; 258 u16 irq_thr_high;
265 u32 fwlog_free_mem_blks; 259 u16 tx_stop;
266 u32 fw_gen_free_mem_blks; 260 u16 tx_resume;
261 u16 false_irq;
262 u16 adc_source_unexpected;
263} __packed;
264
265#define WL18XX_NUM_OF_CALIBRATIONS_ERRORS 18
266struct wl18xx_acx_calib_failure_stats {
267 u16 fail_count[WL18XX_NUM_OF_CALIBRATIONS_ERRORS];
268 u32 calib_count;
269} __packed;
270
271struct wl18xx_roaming_stats {
272 s32 rssi_level;
273} __packed;
274
275struct wl18xx_dfs_stats {
276 u32 num_of_radar_detections;
267} __packed; 277} __packed;
268 278
269struct wl18xx_acx_statistics { 279struct wl18xx_acx_statistics {
270 struct acx_header header; 280 struct acx_header header;
271 281
272 struct wl18xx_acx_error_stats error; 282 struct wl18xx_acx_error_stats error;
273 struct wl18xx_acx_debug_stats debug;
274 struct wl18xx_acx_tx_stats tx; 283 struct wl18xx_acx_tx_stats tx;
275 struct wl18xx_acx_rx_stats rx; 284 struct wl18xx_acx_rx_stats rx;
276 struct wl18xx_acx_isr_stats isr; 285 struct wl18xx_acx_isr_stats isr;
277 struct wl18xx_acx_pwr_stats pwr; 286 struct wl18xx_acx_pwr_stats pwr;
278 struct wl18xx_acx_ps_poll_stats ps_poll;
279 struct wl18xx_acx_rx_filter_stats rx_filter; 287 struct wl18xx_acx_rx_filter_stats rx_filter;
280 struct wl18xx_acx_rx_rate_stats rx_rate; 288 struct wl18xx_acx_rx_rate_stats rx_rate;
281 struct wl18xx_acx_aggr_stats aggr_size; 289 struct wl18xx_acx_aggr_stats aggr_size;
282 struct wl18xx_acx_pipeline_stats pipeline; 290 struct wl18xx_acx_pipeline_stats pipeline;
283 struct wl18xx_acx_mem_stats mem; 291 struct wl18xx_acx_diversity_stats diversity;
292 struct wl18xx_acx_thermal_stats thermal;
293 struct wl18xx_acx_calib_failure_stats calib;
294 struct wl18xx_roaming_stats roaming;
295 struct wl18xx_dfs_stats dfs;
284} __packed; 296} __packed;
285 297
286struct wl18xx_acx_clear_statistics { 298struct wl18xx_acx_clear_statistics {
@@ -367,6 +379,15 @@ struct acx_ap_sleep_cfg {
367 u8 idle_conn_thresh; 379 u8 idle_conn_thresh;
368} __packed; 380} __packed;
369 381
382/*
383 * ACX_DYNAMIC_TRACES_CFG
384 * configure the FW dynamic traces
385 */
386struct acx_dynamic_fw_traces_cfg {
387 struct acx_header header;
388 __le32 dynamic_fw_traces;
389} __packed;
390
370int wl18xx_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap, 391int wl18xx_acx_host_if_cfg_bitmap(struct wl1271 *wl, u32 host_cfg_bitmap,
371 u32 sdio_blk_size, u32 extra_mem_blks, 392 u32 sdio_blk_size, u32 extra_mem_blks,
372 u32 len_field_size); 393 u32 len_field_size);
@@ -380,5 +401,6 @@ int wl18xx_acx_set_peer_cap(struct wl1271 *wl,
380int wl18xx_acx_interrupt_notify_config(struct wl1271 *wl, bool action); 401int wl18xx_acx_interrupt_notify_config(struct wl1271 *wl, bool action);
381int wl18xx_acx_rx_ba_filter(struct wl1271 *wl, bool action); 402int wl18xx_acx_rx_ba_filter(struct wl1271 *wl, bool action);
382int wl18xx_acx_ap_sleep(struct wl1271 *wl); 403int wl18xx_acx_ap_sleep(struct wl1271 *wl);
404int wl18xx_acx_dynamic_fw_traces(struct wl1271 *wl);
383 405
384#endif /* __WL18XX_ACX_H__ */ 406#endif /* __WL18XX_ACX_H__ */
diff --git a/drivers/net/wireless/ti/wl18xx/debugfs.c b/drivers/net/wireless/ti/wl18xx/debugfs.c
index 5fbd2230f372..911ae9a256aa 100644
--- a/drivers/net/wireless/ti/wl18xx/debugfs.c
+++ b/drivers/net/wireless/ti/wl18xx/debugfs.c
@@ -36,18 +36,23 @@
36 DEBUGFS_FWSTATS_FILE_ARRAY(a, b, c, wl18xx_acx_statistics) 36 DEBUGFS_FWSTATS_FILE_ARRAY(a, b, c, wl18xx_acx_statistics)
37 37
38 38
39WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug1, "%u"); 39WL18XX_DEBUGFS_FWSTATS_FILE(error, error_frame_non_ctrl, "%u");
40WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug2, "%u"); 40WL18XX_DEBUGFS_FWSTATS_FILE(error, error_frame_ctrl, "%u");
41WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug3, "%u"); 41WL18XX_DEBUGFS_FWSTATS_FILE(error, error_frame_during_protection, "%u");
42WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug4, "%u"); 42WL18XX_DEBUGFS_FWSTATS_FILE(error, null_frame_tx_start, "%u");
43WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug5, "%u"); 43WL18XX_DEBUGFS_FWSTATS_FILE(error, null_frame_cts_start, "%u");
44WL18XX_DEBUGFS_FWSTATS_FILE(debug, debug6, "%u"); 44WL18XX_DEBUGFS_FWSTATS_FILE(error, bar_retry, "%u");
45 45WL18XX_DEBUGFS_FWSTATS_FILE(error, num_frame_cts_nul_flid, "%u");
46WL18XX_DEBUGFS_FWSTATS_FILE(error, error_frame, "%u"); 46WL18XX_DEBUGFS_FWSTATS_FILE(error, tx_abort_failure, "%u");
47WL18XX_DEBUGFS_FWSTATS_FILE(error, error_null_Frame_tx_start, "%u"); 47WL18XX_DEBUGFS_FWSTATS_FILE(error, tx_resume_failure, "%u");
48WL18XX_DEBUGFS_FWSTATS_FILE(error, error_numll_frame_cts_start, "%u"); 48WL18XX_DEBUGFS_FWSTATS_FILE(error, rx_cmplt_db_overflow_cnt, "%u");
49WL18XX_DEBUGFS_FWSTATS_FILE(error, error_bar_retry, "%u"); 49WL18XX_DEBUGFS_FWSTATS_FILE(error, elp_while_rx_exch, "%u");
50WL18XX_DEBUGFS_FWSTATS_FILE(error, error_frame_cts_nul_flid, "%u"); 50WL18XX_DEBUGFS_FWSTATS_FILE(error, elp_while_tx_exch, "%u");
51WL18XX_DEBUGFS_FWSTATS_FILE(error, elp_while_tx, "%u");
52WL18XX_DEBUGFS_FWSTATS_FILE(error, elp_while_nvic_pending, "%u");
53WL18XX_DEBUGFS_FWSTATS_FILE(error, rx_excessive_frame_len, "%u");
54WL18XX_DEBUGFS_FWSTATS_FILE(error, burst_mismatch, "%u");
55WL18XX_DEBUGFS_FWSTATS_FILE(error, tbc_exch_mismatch, "%u");
51 56
52WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_prepared_descs, "%u"); 57WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_prepared_descs, "%u");
53WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_cmplt, "%u"); 58WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_cmplt, "%u");
@@ -57,7 +62,7 @@ WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_template_programmed, "%u");
57WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_data_programmed, "%u"); 62WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_data_programmed, "%u");
58WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_burst_programmed, "%u"); 63WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_burst_programmed, "%u");
59WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_starts, "%u"); 64WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_starts, "%u");
60WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_imm_resp, "%u"); 65WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_stop, "%u");
61WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_templates, "%u"); 66WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_templates, "%u");
62WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_int_templates, "%u"); 67WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_int_templates, "%u");
63WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_fw_gen, "%u"); 68WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_fw_gen, "%u");
@@ -66,13 +71,15 @@ WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_start_null_frame, "%u");
66WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_exch, "%u"); 71WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_exch, "%u");
67WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_retry_template, "%u"); 72WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_retry_template, "%u");
68WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_retry_data, "%u"); 73WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_retry_data, "%u");
74WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(tx, tx_retry_per_rate,
75 NUM_OF_RATES_INDEXES);
69WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_exch_pending, "%u"); 76WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_exch_pending, "%u");
70WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_exch_expiry, "%u"); 77WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_exch_expiry, "%u");
71WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_done_template, "%u"); 78WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_done_template, "%u");
72WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_done_data, "%u"); 79WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_done_data, "%u");
73WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_done_int_template, "%u"); 80WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_done_int_template, "%u");
74WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_frame_checksum, "%u"); 81WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_cfe1, "%u");
75WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_checksum_result, "%u"); 82WL18XX_DEBUGFS_FWSTATS_FILE(tx, tx_cfe2, "%u");
76WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_called, "%u"); 83WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_called, "%u");
77WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_mpdu_alloc_failed, "%u"); 84WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_mpdu_alloc_failed, "%u");
78WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_init_called, "%u"); 85WL18XX_DEBUGFS_FWSTATS_FILE(tx, frag_init_called, "%u");
@@ -97,11 +104,8 @@ WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_pre_complt, "%u");
97WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_cmplt_task, "%u"); 104WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_cmplt_task, "%u");
98WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_phy_hdr, "%u"); 105WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_phy_hdr, "%u");
99WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_timeout, "%u"); 106WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_timeout, "%u");
107WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_rts_timeout, "%u");
100WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_timeout_wa, "%u"); 108WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_timeout_wa, "%u");
101WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_wa_density_dropped_frame, "%u");
102WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_wa_ba_not_expected, "%u");
103WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_frame_checksum, "%u");
104WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_checksum_result, "%u");
105WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_called, "%u"); 109WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_called, "%u");
106WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_init_called, "%u"); 110WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_init_called, "%u");
107WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_in_process_called, "%u"); 111WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_in_process_called, "%u");
@@ -111,6 +115,7 @@ WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_decrypt_failed, "%u");
111WL18XX_DEBUGFS_FWSTATS_FILE(rx, decrypt_key_not_found, "%u"); 115WL18XX_DEBUGFS_FWSTATS_FILE(rx, decrypt_key_not_found, "%u");
112WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_need_decrypt, "%u"); 116WL18XX_DEBUGFS_FWSTATS_FILE(rx, defrag_need_decrypt, "%u");
113WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_tkip_replays, "%u"); 117WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_tkip_replays, "%u");
118WL18XX_DEBUGFS_FWSTATS_FILE(rx, rx_xfr, "%u");
114 119
115WL18XX_DEBUGFS_FWSTATS_FILE(isr, irqs, "%u"); 120WL18XX_DEBUGFS_FWSTATS_FILE(isr, irqs, "%u");
116 121
@@ -120,14 +125,13 @@ WL18XX_DEBUGFS_FWSTATS_FILE(pwr, connection_out_of_sync, "%u");
120WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(pwr, cont_miss_bcns_spread, 125WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(pwr, cont_miss_bcns_spread,
121 PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD); 126 PWR_STAT_MAX_CONT_MISSED_BCNS_SPREAD);
122WL18XX_DEBUGFS_FWSTATS_FILE(pwr, rcvd_awake_bcns_cnt, "%u"); 127WL18XX_DEBUGFS_FWSTATS_FILE(pwr, rcvd_awake_bcns_cnt, "%u");
123 128WL18XX_DEBUGFS_FWSTATS_FILE(pwr, sleep_time_count, "%u");
124 129WL18XX_DEBUGFS_FWSTATS_FILE(pwr, sleep_time_avg, "%u");
125WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, ps_poll_timeouts, "%u"); 130WL18XX_DEBUGFS_FWSTATS_FILE(pwr, sleep_cycle_avg, "%u");
126WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, upsd_timeouts, "%u"); 131WL18XX_DEBUGFS_FWSTATS_FILE(pwr, sleep_percent, "%u");
127WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, upsd_max_ap_turn, "%u"); 132WL18XX_DEBUGFS_FWSTATS_FILE(pwr, ap_sleep_active_conf, "%u");
128WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, ps_poll_max_ap_turn, "%u"); 133WL18XX_DEBUGFS_FWSTATS_FILE(pwr, ap_sleep_user_conf, "%u");
129WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, ps_poll_utilization, "%u"); 134WL18XX_DEBUGFS_FWSTATS_FILE(pwr, ap_sleep_counter, "%u");
130WL18XX_DEBUGFS_FWSTATS_FILE(ps_poll, upsd_utilization, "%u");
131 135
132WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, beacon_filter, "%u"); 136WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, beacon_filter, "%u");
133WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, arp_filter, "%u"); 137WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, arp_filter, "%u");
@@ -141,14 +145,14 @@ WL18XX_DEBUGFS_FWSTATS_FILE(rx_filter, max_arp_queue_dep, "%u");
141 145
142WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(rx_rate, rx_frames_per_rates, 50); 146WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(rx_rate, rx_frames_per_rates, 50);
143 147
144WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(aggr_size, tx_agg_vs_rate, 148WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(aggr_size, tx_agg_rate,
145 AGGR_STATS_TX_AGG*AGGR_STATS_TX_RATE); 149 AGGR_STATS_TX_AGG);
150WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(aggr_size, tx_agg_len,
151 AGGR_STATS_TX_AGG);
146WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(aggr_size, rx_size, 152WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(aggr_size, rx_size,
147 AGGR_STATS_RX_SIZE_LEN); 153 AGGR_STATS_RX_SIZE_LEN);
148 154
149WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, hs_tx_stat_fifo_int, "%u"); 155WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, hs_tx_stat_fifo_int, "%u");
150WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, tcp_tx_stat_fifo_int, "%u");
151WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, tcp_rx_stat_fifo_int, "%u");
152WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, enc_tx_stat_fifo_int, "%u"); 156WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, enc_tx_stat_fifo_int, "%u");
153WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, enc_rx_stat_fifo_int, "%u"); 157WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, enc_rx_stat_fifo_int, "%u");
154WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, rx_complete_stat_fifo_int, "%u"); 158WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, rx_complete_stat_fifo_int, "%u");
@@ -156,21 +160,32 @@ WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, pre_proc_swi, "%u");
156WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, post_proc_swi, "%u"); 160WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, post_proc_swi, "%u");
157WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, sec_frag_swi, "%u"); 161WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, sec_frag_swi, "%u");
158WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, pre_to_defrag_swi, "%u"); 162WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, pre_to_defrag_swi, "%u");
159WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, defrag_to_csum_swi, "%u"); 163WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, defrag_to_rx_xfer_swi, "%u");
160WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, csum_to_rx_xfer_swi, "%u");
161WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, dec_packet_in, "%u"); 164WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, dec_packet_in, "%u");
162WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, dec_packet_in_fifo_full, "%u"); 165WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, dec_packet_in_fifo_full, "%u");
163WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, dec_packet_out, "%u"); 166WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, dec_packet_out, "%u");
164WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, cs_rx_packet_in, "%u");
165WL18XX_DEBUGFS_FWSTATS_FILE(pipeline, cs_rx_packet_out, "%u");
166 167
167WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(pipeline, pipeline_fifo_full, 168WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(pipeline, pipeline_fifo_full,
168 PIPE_STATS_HW_FIFO); 169 PIPE_STATS_HW_FIFO);
169 170
170WL18XX_DEBUGFS_FWSTATS_FILE(mem, rx_free_mem_blks, "%u"); 171WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(diversity, num_of_packets_per_ant,
171WL18XX_DEBUGFS_FWSTATS_FILE(mem, tx_free_mem_blks, "%u"); 172 DIVERSITY_STATS_NUM_OF_ANT);
172WL18XX_DEBUGFS_FWSTATS_FILE(mem, fwlog_free_mem_blks, "%u"); 173WL18XX_DEBUGFS_FWSTATS_FILE(diversity, total_num_of_toggles, "%u");
173WL18XX_DEBUGFS_FWSTATS_FILE(mem, fw_gen_free_mem_blks, "%u"); 174
175WL18XX_DEBUGFS_FWSTATS_FILE(thermal, irq_thr_low, "%u");
176WL18XX_DEBUGFS_FWSTATS_FILE(thermal, irq_thr_high, "%u");
177WL18XX_DEBUGFS_FWSTATS_FILE(thermal, tx_stop, "%u");
178WL18XX_DEBUGFS_FWSTATS_FILE(thermal, tx_resume, "%u");
179WL18XX_DEBUGFS_FWSTATS_FILE(thermal, false_irq, "%u");
180WL18XX_DEBUGFS_FWSTATS_FILE(thermal, adc_source_unexpected, "%u");
181
182WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(calib, fail_count,
183 WL18XX_NUM_OF_CALIBRATIONS_ERRORS);
184WL18XX_DEBUGFS_FWSTATS_FILE(calib, calib_count, "%u");
185
186WL18XX_DEBUGFS_FWSTATS_FILE(roaming, rssi_level, "%d");
187
188WL18XX_DEBUGFS_FWSTATS_FILE(dfs, num_of_radar_detections, "%d");
174 189
175static ssize_t conf_read(struct file *file, char __user *user_buf, 190static ssize_t conf_read(struct file *file, char __user *user_buf,
176 size_t count, loff_t *ppos) 191 size_t count, loff_t *ppos)
@@ -281,6 +296,56 @@ static const struct file_operations radar_detection_ops = {
281 .llseek = default_llseek, 296 .llseek = default_llseek,
282}; 297};
283 298
299static ssize_t dynamic_fw_traces_write(struct file *file,
300 const char __user *user_buf,
301 size_t count, loff_t *ppos)
302{
303 struct wl1271 *wl = file->private_data;
304 unsigned long value;
305 int ret;
306
307 ret = kstrtoul_from_user(user_buf, count, 0, &value);
308 if (ret < 0)
309 return ret;
310
311 mutex_lock(&wl->mutex);
312
313 wl->dynamic_fw_traces = value;
314
315 if (unlikely(wl->state != WLCORE_STATE_ON))
316 goto out;
317
318 ret = wl1271_ps_elp_wakeup(wl);
319 if (ret < 0)
320 goto out;
321
322 ret = wl18xx_acx_dynamic_fw_traces(wl);
323 if (ret < 0)
324 count = ret;
325
326 wl1271_ps_elp_sleep(wl);
327out:
328 mutex_unlock(&wl->mutex);
329 return count;
330}
331
332static ssize_t dynamic_fw_traces_read(struct file *file,
333 char __user *userbuf,
334 size_t count, loff_t *ppos)
335{
336 struct wl1271 *wl = file->private_data;
337
338 return wl1271_format_buffer(userbuf, count, ppos,
339 "%d\n", wl->dynamic_fw_traces);
340}
341
342static const struct file_operations dynamic_fw_traces_ops = {
343 .read = dynamic_fw_traces_read,
344 .write = dynamic_fw_traces_write,
345 .open = simple_open,
346 .llseek = default_llseek,
347};
348
284int wl18xx_debugfs_add_files(struct wl1271 *wl, 349int wl18xx_debugfs_add_files(struct wl1271 *wl,
285 struct dentry *rootdir) 350 struct dentry *rootdir)
286{ 351{
@@ -301,18 +366,23 @@ int wl18xx_debugfs_add_files(struct wl1271 *wl,
301 366
302 DEBUGFS_ADD(clear_fw_stats, stats); 367 DEBUGFS_ADD(clear_fw_stats, stats);
303 368
304 DEBUGFS_FWSTATS_ADD(debug, debug1); 369 DEBUGFS_FWSTATS_ADD(error, error_frame_non_ctrl);
305 DEBUGFS_FWSTATS_ADD(debug, debug2); 370 DEBUGFS_FWSTATS_ADD(error, error_frame_ctrl);
306 DEBUGFS_FWSTATS_ADD(debug, debug3); 371 DEBUGFS_FWSTATS_ADD(error, error_frame_during_protection);
307 DEBUGFS_FWSTATS_ADD(debug, debug4); 372 DEBUGFS_FWSTATS_ADD(error, null_frame_tx_start);
308 DEBUGFS_FWSTATS_ADD(debug, debug5); 373 DEBUGFS_FWSTATS_ADD(error, null_frame_cts_start);
309 DEBUGFS_FWSTATS_ADD(debug, debug6); 374 DEBUGFS_FWSTATS_ADD(error, bar_retry);
310 375 DEBUGFS_FWSTATS_ADD(error, num_frame_cts_nul_flid);
311 DEBUGFS_FWSTATS_ADD(error, error_frame); 376 DEBUGFS_FWSTATS_ADD(error, tx_abort_failure);
312 DEBUGFS_FWSTATS_ADD(error, error_null_Frame_tx_start); 377 DEBUGFS_FWSTATS_ADD(error, tx_resume_failure);
313 DEBUGFS_FWSTATS_ADD(error, error_numll_frame_cts_start); 378 DEBUGFS_FWSTATS_ADD(error, rx_cmplt_db_overflow_cnt);
314 DEBUGFS_FWSTATS_ADD(error, error_bar_retry); 379 DEBUGFS_FWSTATS_ADD(error, elp_while_rx_exch);
315 DEBUGFS_FWSTATS_ADD(error, error_frame_cts_nul_flid); 380 DEBUGFS_FWSTATS_ADD(error, elp_while_tx_exch);
381 DEBUGFS_FWSTATS_ADD(error, elp_while_tx);
382 DEBUGFS_FWSTATS_ADD(error, elp_while_nvic_pending);
383 DEBUGFS_FWSTATS_ADD(error, rx_excessive_frame_len);
384 DEBUGFS_FWSTATS_ADD(error, burst_mismatch);
385 DEBUGFS_FWSTATS_ADD(error, tbc_exch_mismatch);
316 386
317 DEBUGFS_FWSTATS_ADD(tx, tx_prepared_descs); 387 DEBUGFS_FWSTATS_ADD(tx, tx_prepared_descs);
318 DEBUGFS_FWSTATS_ADD(tx, tx_cmplt); 388 DEBUGFS_FWSTATS_ADD(tx, tx_cmplt);
@@ -322,7 +392,7 @@ int wl18xx_debugfs_add_files(struct wl1271 *wl,
322 DEBUGFS_FWSTATS_ADD(tx, tx_data_programmed); 392 DEBUGFS_FWSTATS_ADD(tx, tx_data_programmed);
323 DEBUGFS_FWSTATS_ADD(tx, tx_burst_programmed); 393 DEBUGFS_FWSTATS_ADD(tx, tx_burst_programmed);
324 DEBUGFS_FWSTATS_ADD(tx, tx_starts); 394 DEBUGFS_FWSTATS_ADD(tx, tx_starts);
325 DEBUGFS_FWSTATS_ADD(tx, tx_imm_resp); 395 DEBUGFS_FWSTATS_ADD(tx, tx_stop);
326 DEBUGFS_FWSTATS_ADD(tx, tx_start_templates); 396 DEBUGFS_FWSTATS_ADD(tx, tx_start_templates);
327 DEBUGFS_FWSTATS_ADD(tx, tx_start_int_templates); 397 DEBUGFS_FWSTATS_ADD(tx, tx_start_int_templates);
328 DEBUGFS_FWSTATS_ADD(tx, tx_start_fw_gen); 398 DEBUGFS_FWSTATS_ADD(tx, tx_start_fw_gen);
@@ -331,13 +401,14 @@ int wl18xx_debugfs_add_files(struct wl1271 *wl,
331 DEBUGFS_FWSTATS_ADD(tx, tx_exch); 401 DEBUGFS_FWSTATS_ADD(tx, tx_exch);
332 DEBUGFS_FWSTATS_ADD(tx, tx_retry_template); 402 DEBUGFS_FWSTATS_ADD(tx, tx_retry_template);
333 DEBUGFS_FWSTATS_ADD(tx, tx_retry_data); 403 DEBUGFS_FWSTATS_ADD(tx, tx_retry_data);
404 DEBUGFS_FWSTATS_ADD(tx, tx_retry_per_rate);
334 DEBUGFS_FWSTATS_ADD(tx, tx_exch_pending); 405 DEBUGFS_FWSTATS_ADD(tx, tx_exch_pending);
335 DEBUGFS_FWSTATS_ADD(tx, tx_exch_expiry); 406 DEBUGFS_FWSTATS_ADD(tx, tx_exch_expiry);
336 DEBUGFS_FWSTATS_ADD(tx, tx_done_template); 407 DEBUGFS_FWSTATS_ADD(tx, tx_done_template);
337 DEBUGFS_FWSTATS_ADD(tx, tx_done_data); 408 DEBUGFS_FWSTATS_ADD(tx, tx_done_data);
338 DEBUGFS_FWSTATS_ADD(tx, tx_done_int_template); 409 DEBUGFS_FWSTATS_ADD(tx, tx_done_int_template);
339 DEBUGFS_FWSTATS_ADD(tx, tx_frame_checksum); 410 DEBUGFS_FWSTATS_ADD(tx, tx_cfe1);
340 DEBUGFS_FWSTATS_ADD(tx, tx_checksum_result); 411 DEBUGFS_FWSTATS_ADD(tx, tx_cfe2);
341 DEBUGFS_FWSTATS_ADD(tx, frag_called); 412 DEBUGFS_FWSTATS_ADD(tx, frag_called);
342 DEBUGFS_FWSTATS_ADD(tx, frag_mpdu_alloc_failed); 413 DEBUGFS_FWSTATS_ADD(tx, frag_mpdu_alloc_failed);
343 DEBUGFS_FWSTATS_ADD(tx, frag_init_called); 414 DEBUGFS_FWSTATS_ADD(tx, frag_init_called);
@@ -362,11 +433,8 @@ int wl18xx_debugfs_add_files(struct wl1271 *wl,
362 DEBUGFS_FWSTATS_ADD(rx, rx_cmplt_task); 433 DEBUGFS_FWSTATS_ADD(rx, rx_cmplt_task);
363 DEBUGFS_FWSTATS_ADD(rx, rx_phy_hdr); 434 DEBUGFS_FWSTATS_ADD(rx, rx_phy_hdr);
364 DEBUGFS_FWSTATS_ADD(rx, rx_timeout); 435 DEBUGFS_FWSTATS_ADD(rx, rx_timeout);
436 DEBUGFS_FWSTATS_ADD(rx, rx_rts_timeout);
365 DEBUGFS_FWSTATS_ADD(rx, rx_timeout_wa); 437 DEBUGFS_FWSTATS_ADD(rx, rx_timeout_wa);
366 DEBUGFS_FWSTATS_ADD(rx, rx_wa_density_dropped_frame);
367 DEBUGFS_FWSTATS_ADD(rx, rx_wa_ba_not_expected);
368 DEBUGFS_FWSTATS_ADD(rx, rx_frame_checksum);
369 DEBUGFS_FWSTATS_ADD(rx, rx_checksum_result);
370 DEBUGFS_FWSTATS_ADD(rx, defrag_called); 438 DEBUGFS_FWSTATS_ADD(rx, defrag_called);
371 DEBUGFS_FWSTATS_ADD(rx, defrag_init_called); 439 DEBUGFS_FWSTATS_ADD(rx, defrag_init_called);
372 DEBUGFS_FWSTATS_ADD(rx, defrag_in_process_called); 440 DEBUGFS_FWSTATS_ADD(rx, defrag_in_process_called);
@@ -376,6 +444,7 @@ int wl18xx_debugfs_add_files(struct wl1271 *wl,
376 DEBUGFS_FWSTATS_ADD(rx, decrypt_key_not_found); 444 DEBUGFS_FWSTATS_ADD(rx, decrypt_key_not_found);
377 DEBUGFS_FWSTATS_ADD(rx, defrag_need_decrypt); 445 DEBUGFS_FWSTATS_ADD(rx, defrag_need_decrypt);
378 DEBUGFS_FWSTATS_ADD(rx, rx_tkip_replays); 446 DEBUGFS_FWSTATS_ADD(rx, rx_tkip_replays);
447 DEBUGFS_FWSTATS_ADD(rx, rx_xfr);
379 448
380 DEBUGFS_FWSTATS_ADD(isr, irqs); 449 DEBUGFS_FWSTATS_ADD(isr, irqs);
381 450
@@ -384,13 +453,13 @@ int wl18xx_debugfs_add_files(struct wl1271 *wl,
384 DEBUGFS_FWSTATS_ADD(pwr, connection_out_of_sync); 453 DEBUGFS_FWSTATS_ADD(pwr, connection_out_of_sync);
385 DEBUGFS_FWSTATS_ADD(pwr, cont_miss_bcns_spread); 454 DEBUGFS_FWSTATS_ADD(pwr, cont_miss_bcns_spread);
386 DEBUGFS_FWSTATS_ADD(pwr, rcvd_awake_bcns_cnt); 455 DEBUGFS_FWSTATS_ADD(pwr, rcvd_awake_bcns_cnt);
387 456 DEBUGFS_FWSTATS_ADD(pwr, sleep_time_count);
388 DEBUGFS_FWSTATS_ADD(ps_poll, ps_poll_timeouts); 457 DEBUGFS_FWSTATS_ADD(pwr, sleep_time_avg);
389 DEBUGFS_FWSTATS_ADD(ps_poll, upsd_timeouts); 458 DEBUGFS_FWSTATS_ADD(pwr, sleep_cycle_avg);
390 DEBUGFS_FWSTATS_ADD(ps_poll, upsd_max_ap_turn); 459 DEBUGFS_FWSTATS_ADD(pwr, sleep_percent);
391 DEBUGFS_FWSTATS_ADD(ps_poll, ps_poll_max_ap_turn); 460 DEBUGFS_FWSTATS_ADD(pwr, ap_sleep_active_conf);
392 DEBUGFS_FWSTATS_ADD(ps_poll, ps_poll_utilization); 461 DEBUGFS_FWSTATS_ADD(pwr, ap_sleep_user_conf);
393 DEBUGFS_FWSTATS_ADD(ps_poll, upsd_utilization); 462 DEBUGFS_FWSTATS_ADD(pwr, ap_sleep_counter);
394 463
395 DEBUGFS_FWSTATS_ADD(rx_filter, beacon_filter); 464 DEBUGFS_FWSTATS_ADD(rx_filter, beacon_filter);
396 DEBUGFS_FWSTATS_ADD(rx_filter, arp_filter); 465 DEBUGFS_FWSTATS_ADD(rx_filter, arp_filter);
@@ -404,12 +473,11 @@ int wl18xx_debugfs_add_files(struct wl1271 *wl,
404 473
405 DEBUGFS_FWSTATS_ADD(rx_rate, rx_frames_per_rates); 474 DEBUGFS_FWSTATS_ADD(rx_rate, rx_frames_per_rates);
406 475
407 DEBUGFS_FWSTATS_ADD(aggr_size, tx_agg_vs_rate); 476 DEBUGFS_FWSTATS_ADD(aggr_size, tx_agg_rate);
477 DEBUGFS_FWSTATS_ADD(aggr_size, tx_agg_len);
408 DEBUGFS_FWSTATS_ADD(aggr_size, rx_size); 478 DEBUGFS_FWSTATS_ADD(aggr_size, rx_size);
409 479
410 DEBUGFS_FWSTATS_ADD(pipeline, hs_tx_stat_fifo_int); 480 DEBUGFS_FWSTATS_ADD(pipeline, hs_tx_stat_fifo_int);
411 DEBUGFS_FWSTATS_ADD(pipeline, tcp_tx_stat_fifo_int);
412 DEBUGFS_FWSTATS_ADD(pipeline, tcp_rx_stat_fifo_int);
413 DEBUGFS_FWSTATS_ADD(pipeline, enc_tx_stat_fifo_int); 481 DEBUGFS_FWSTATS_ADD(pipeline, enc_tx_stat_fifo_int);
414 DEBUGFS_FWSTATS_ADD(pipeline, enc_rx_stat_fifo_int); 482 DEBUGFS_FWSTATS_ADD(pipeline, enc_rx_stat_fifo_int);
415 DEBUGFS_FWSTATS_ADD(pipeline, rx_complete_stat_fifo_int); 483 DEBUGFS_FWSTATS_ADD(pipeline, rx_complete_stat_fifo_int);
@@ -417,22 +485,33 @@ int wl18xx_debugfs_add_files(struct wl1271 *wl,
417 DEBUGFS_FWSTATS_ADD(pipeline, post_proc_swi); 485 DEBUGFS_FWSTATS_ADD(pipeline, post_proc_swi);
418 DEBUGFS_FWSTATS_ADD(pipeline, sec_frag_swi); 486 DEBUGFS_FWSTATS_ADD(pipeline, sec_frag_swi);
419 DEBUGFS_FWSTATS_ADD(pipeline, pre_to_defrag_swi); 487 DEBUGFS_FWSTATS_ADD(pipeline, pre_to_defrag_swi);
420 DEBUGFS_FWSTATS_ADD(pipeline, defrag_to_csum_swi); 488 DEBUGFS_FWSTATS_ADD(pipeline, defrag_to_rx_xfer_swi);
421 DEBUGFS_FWSTATS_ADD(pipeline, csum_to_rx_xfer_swi);
422 DEBUGFS_FWSTATS_ADD(pipeline, dec_packet_in); 489 DEBUGFS_FWSTATS_ADD(pipeline, dec_packet_in);
423 DEBUGFS_FWSTATS_ADD(pipeline, dec_packet_in_fifo_full); 490 DEBUGFS_FWSTATS_ADD(pipeline, dec_packet_in_fifo_full);
424 DEBUGFS_FWSTATS_ADD(pipeline, dec_packet_out); 491 DEBUGFS_FWSTATS_ADD(pipeline, dec_packet_out);
425 DEBUGFS_FWSTATS_ADD(pipeline, cs_rx_packet_in);
426 DEBUGFS_FWSTATS_ADD(pipeline, cs_rx_packet_out);
427 DEBUGFS_FWSTATS_ADD(pipeline, pipeline_fifo_full); 492 DEBUGFS_FWSTATS_ADD(pipeline, pipeline_fifo_full);
428 493
429 DEBUGFS_FWSTATS_ADD(mem, rx_free_mem_blks); 494 DEBUGFS_FWSTATS_ADD(diversity, num_of_packets_per_ant);
430 DEBUGFS_FWSTATS_ADD(mem, tx_free_mem_blks); 495 DEBUGFS_FWSTATS_ADD(diversity, total_num_of_toggles);
431 DEBUGFS_FWSTATS_ADD(mem, fwlog_free_mem_blks); 496
432 DEBUGFS_FWSTATS_ADD(mem, fw_gen_free_mem_blks); 497 DEBUGFS_FWSTATS_ADD(thermal, irq_thr_low);
498 DEBUGFS_FWSTATS_ADD(thermal, irq_thr_high);
499 DEBUGFS_FWSTATS_ADD(thermal, tx_stop);
500 DEBUGFS_FWSTATS_ADD(thermal, tx_resume);
501 DEBUGFS_FWSTATS_ADD(thermal, false_irq);
502 DEBUGFS_FWSTATS_ADD(thermal, adc_source_unexpected);
503
504 DEBUGFS_FWSTATS_ADD(calib, fail_count);
505
506 DEBUGFS_FWSTATS_ADD(calib, calib_count);
507
508 DEBUGFS_FWSTATS_ADD(roaming, rssi_level);
509
510 DEBUGFS_FWSTATS_ADD(dfs, num_of_radar_detections);
433 511
434 DEBUGFS_ADD(conf, moddir); 512 DEBUGFS_ADD(conf, moddir);
435 DEBUGFS_ADD(radar_detection, moddir); 513 DEBUGFS_ADD(radar_detection, moddir);
514 DEBUGFS_ADD(dynamic_fw_traces, moddir);
436 515
437 return 0; 516 return 0;
438 517
diff --git a/drivers/net/wireless/ti/wl18xx/event.c b/drivers/net/wireless/ti/wl18xx/event.c
index 548bb9e7e91e..e0bc8a22f98e 100644
--- a/drivers/net/wireless/ti/wl18xx/event.c
+++ b/drivers/net/wireless/ti/wl18xx/event.c
@@ -112,6 +112,14 @@ static int wlcore_smart_config_decode_event(struct wl1271 *wl,
112 return 0; 112 return 0;
113} 113}
114 114
115static void wlcore_event_time_sync(struct wl1271 *wl, u16 tsf_msb, u16 tsf_lsb)
116{
117 u32 clock;
118 /* convert the MSB+LSB to a u32 TSF value */
119 clock = (tsf_msb << 16) | tsf_lsb;
120 wl1271_info("TIME_SYNC_EVENT_ID: clock %u", clock);
121}
122
115int wl18xx_process_mailbox_events(struct wl1271 *wl) 123int wl18xx_process_mailbox_events(struct wl1271 *wl)
116{ 124{
117 struct wl18xx_event_mailbox *mbox = wl->mbox; 125 struct wl18xx_event_mailbox *mbox = wl->mbox;
@@ -128,6 +136,11 @@ int wl18xx_process_mailbox_events(struct wl1271 *wl)
128 wl18xx_scan_completed(wl, wl->scan_wlvif); 136 wl18xx_scan_completed(wl, wl->scan_wlvif);
129 } 137 }
130 138
139 if (vector & TIME_SYNC_EVENT_ID)
140 wlcore_event_time_sync(wl,
141 mbox->time_sync_tsf_msb,
142 mbox->time_sync_tsf_lsb);
143
131 if (vector & RADAR_DETECTED_EVENT_ID) { 144 if (vector & RADAR_DETECTED_EVENT_ID) {
132 wl1271_info("radar event: channel %d type %s", 145 wl1271_info("radar event: channel %d type %s",
133 mbox->radar_channel, 146 mbox->radar_channel,
@@ -193,5 +206,66 @@ int wl18xx_process_mailbox_events(struct wl1271 *wl)
193 mbox->sc_pwd_len, 206 mbox->sc_pwd_len,
194 mbox->sc_pwd); 207 mbox->sc_pwd);
195 208
209 if (vector & RX_BA_WIN_SIZE_CHANGE_EVENT_ID) {
210 struct wl12xx_vif *wlvif;
211 struct ieee80211_vif *vif;
212 u8 role_id = mbox->rx_ba_role_id;
213 u8 link_id = mbox->rx_ba_link_id;
214 u8 win_size = mbox->rx_ba_win_size;
215 int prev_win_size;
216
217 wl1271_debug(DEBUG_EVENT,
218 "%s. role_id=%u link_id=%u win_size=%u",
219 "RX_BA_WIN_SIZE_CHANGE_EVENT_ID",
220 role_id, link_id, win_size);
221
222 wlvif = wl->links[link_id].wlvif;
223 if (unlikely(!wlvif)) {
224 wl1271_error("%s. link_id wlvif is null",
225 "RX_BA_WIN_SIZE_CHANGE_EVENT_ID");
226
227 goto out_event;
228 }
229
230 if (unlikely(wlvif->role_id != role_id)) {
231 wl1271_error("%s. wlvif has different role_id=%d",
232 "RX_BA_WIN_SIZE_CHANGE_EVENT_ID",
233 wlvif->role_id);
234
235 goto out_event;
236 }
237
238 prev_win_size = wlcore_rx_ba_max_subframes(wl, link_id);
239 if (unlikely(prev_win_size < 0)) {
240 wl1271_error("%s. cannot get link rx_ba_max_subframes",
241 "RX_BA_WIN_SIZE_CHANGE_EVENT_ID");
242
243 goto out_event;
244 }
245
246 if ((u8)prev_win_size <= win_size) {
247 /* This not supposed to happen unless a FW bug */
248 wl1271_error("%s. prev_win_size(%d) <= win_size(%d)",
249 "RX_BA_WIN_SIZE_CHANGE_EVENT_ID",
250 prev_win_size, win_size);
251
252 goto out_event;
253 }
254
255 /*
256 * Call MAC routine to update win_size and stop all link active
257 * BA sessions. This routine returns 0 on failure or previous
258 * win_size on success
259 */
260 vif = wl12xx_wlvif_to_vif(wlvif);
261 ieee80211_change_rx_ba_max_subframes(vif,
262 (wlvif->bss_type != BSS_TYPE_AP_BSS ?
263 vif->bss_conf.bssid :
264 wl->links[link_id].addr),
265 win_size);
266 }
267
268out_event:
269
196 return 0; 270 return 0;
197} 271}
diff --git a/drivers/net/wireless/ti/wl18xx/event.h b/drivers/net/wireless/ti/wl18xx/event.h
index 266ee87834e4..9495fadc8093 100644
--- a/drivers/net/wireless/ti/wl18xx/event.h
+++ b/drivers/net/wireless/ti/wl18xx/event.h
@@ -38,8 +38,10 @@ enum {
38 REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID = BIT(18), 38 REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID = BIT(18),
39 DFS_CHANNELS_CONFIG_COMPLETE_EVENT = BIT(19), 39 DFS_CHANNELS_CONFIG_COMPLETE_EVENT = BIT(19),
40 PERIODIC_SCAN_REPORT_EVENT_ID = BIT(20), 40 PERIODIC_SCAN_REPORT_EVENT_ID = BIT(20),
41 SMART_CONFIG_SYNC_EVENT_ID = BIT(22), 41 RX_BA_WIN_SIZE_CHANGE_EVENT_ID = BIT(21),
42 SMART_CONFIG_DECODE_EVENT_ID = BIT(23), 42 SMART_CONFIG_SYNC_EVENT_ID = BIT(22),
43 SMART_CONFIG_DECODE_EVENT_ID = BIT(23),
44 TIME_SYNC_EVENT_ID = BIT(24),
43}; 45};
44 46
45enum wl18xx_radar_types { 47enum wl18xx_radar_types {
@@ -95,13 +97,16 @@ struct wl18xx_event_mailbox {
95 /* smart config sync channel */ 97 /* smart config sync channel */
96 u8 sc_sync_channel; 98 u8 sc_sync_channel;
97 u8 sc_sync_band; 99 u8 sc_sync_band;
98 u8 padding2[2];
99 100
101 /* time sync msb*/
102 u16 time_sync_tsf_msb;
100 /* radar detect */ 103 /* radar detect */
101 u8 radar_channel; 104 u8 radar_channel;
102 u8 radar_type; 105 u8 radar_type;
103 106
104 u8 padding3[2]; 107 /* time sync lsb*/
108 u16 time_sync_tsf_lsb;
109
105} __packed; 110} __packed;
106 111
107int wl18xx_wait_for_event(struct wl1271 *wl, enum wlcore_wait_event event, 112int wl18xx_wait_for_event(struct wl1271 *wl, enum wlcore_wait_event event,
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index 717c4f5a02c2..555dd5548850 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -421,6 +421,8 @@ static struct wlcore_conf wl18xx_conf = {
421 .num_probe_reqs = 2, 421 .num_probe_reqs = 2,
422 .rssi_threshold = -90, 422 .rssi_threshold = -90,
423 .snr_threshold = 0, 423 .snr_threshold = 0,
424 .num_short_intervals = SCAN_MAX_SHORT_INTERVALS,
425 .long_interval = 30000,
424 }, 426 },
425 .ht = { 427 .ht = {
426 .rx_ba_win_size = 32, 428 .rx_ba_win_size = 32,
@@ -1002,8 +1004,9 @@ static int wl18xx_boot(struct wl1271 *wl)
1002 CHANNEL_SWITCH_COMPLETE_EVENT_ID | 1004 CHANNEL_SWITCH_COMPLETE_EVENT_ID |
1003 DFS_CHANNELS_CONFIG_COMPLETE_EVENT | 1005 DFS_CHANNELS_CONFIG_COMPLETE_EVENT |
1004 SMART_CONFIG_SYNC_EVENT_ID | 1006 SMART_CONFIG_SYNC_EVENT_ID |
1005 SMART_CONFIG_DECODE_EVENT_ID; 1007 SMART_CONFIG_DECODE_EVENT_ID |
1006; 1008 RX_BA_WIN_SIZE_CHANGE_EVENT_ID |
1009 TIME_SYNC_EVENT_ID;
1007 1010
1008 wl->ap_event_mask = MAX_TX_FAILURE_EVENT_ID; 1011 wl->ap_event_mask = MAX_TX_FAILURE_EVENT_ID;
1009 1012
@@ -1135,6 +1138,11 @@ static int wl18xx_hw_init(struct wl1271 *wl)
1135 if (ret < 0) 1138 if (ret < 0)
1136 return ret; 1139 return ret;
1137 1140
1141 /* set the dynamic fw traces bitmap */
1142 ret = wl18xx_acx_dynamic_fw_traces(wl);
1143 if (ret < 0)
1144 return ret;
1145
1138 if (checksum_param) { 1146 if (checksum_param) {
1139 ret = wl18xx_acx_set_checksum_state(wl); 1147 ret = wl18xx_acx_set_checksum_state(wl);
1140 if (ret != 0) 1148 if (ret != 0)
@@ -1768,7 +1776,7 @@ static struct ieee80211_sta_ht_cap wl18xx_mimo_ht_cap_2ghz = {
1768 1776
1769static const struct ieee80211_iface_limit wl18xx_iface_limits[] = { 1777static const struct ieee80211_iface_limit wl18xx_iface_limits[] = {
1770 { 1778 {
1771 .max = 3, 1779 .max = 2,
1772 .types = BIT(NL80211_IFTYPE_STATION), 1780 .types = BIT(NL80211_IFTYPE_STATION),
1773 }, 1781 },
1774 { 1782 {
@@ -1777,6 +1785,10 @@ static const struct ieee80211_iface_limit wl18xx_iface_limits[] = {
1777 BIT(NL80211_IFTYPE_P2P_GO) | 1785 BIT(NL80211_IFTYPE_P2P_GO) |
1778 BIT(NL80211_IFTYPE_P2P_CLIENT), 1786 BIT(NL80211_IFTYPE_P2P_CLIENT),
1779 }, 1787 },
1788 {
1789 .max = 1,
1790 .types = BIT(NL80211_IFTYPE_P2P_DEVICE),
1791 },
1780}; 1792};
1781 1793
1782static const struct ieee80211_iface_limit wl18xx_iface_ap_limits[] = { 1794static const struct ieee80211_iface_limit wl18xx_iface_ap_limits[] = {
@@ -1784,6 +1796,48 @@ static const struct ieee80211_iface_limit wl18xx_iface_ap_limits[] = {
1784 .max = 2, 1796 .max = 2,
1785 .types = BIT(NL80211_IFTYPE_AP), 1797 .types = BIT(NL80211_IFTYPE_AP),
1786 }, 1798 },
1799 {
1800 .max = 1,
1801 .types = BIT(NL80211_IFTYPE_P2P_DEVICE),
1802 },
1803};
1804
1805static const struct ieee80211_iface_limit wl18xx_iface_ap_cl_limits[] = {
1806 {
1807 .max = 1,
1808 .types = BIT(NL80211_IFTYPE_STATION),
1809 },
1810 {
1811 .max = 1,
1812 .types = BIT(NL80211_IFTYPE_AP),
1813 },
1814 {
1815 .max = 1,
1816 .types = BIT(NL80211_IFTYPE_P2P_CLIENT),
1817 },
1818 {
1819 .max = 1,
1820 .types = BIT(NL80211_IFTYPE_P2P_DEVICE),
1821 },
1822};
1823
1824static const struct ieee80211_iface_limit wl18xx_iface_ap_go_limits[] = {
1825 {
1826 .max = 1,
1827 .types = BIT(NL80211_IFTYPE_STATION),
1828 },
1829 {
1830 .max = 1,
1831 .types = BIT(NL80211_IFTYPE_AP),
1832 },
1833 {
1834 .max = 1,
1835 .types = BIT(NL80211_IFTYPE_P2P_GO),
1836 },
1837 {
1838 .max = 1,
1839 .types = BIT(NL80211_IFTYPE_P2P_DEVICE),
1840 },
1787}; 1841};
1788 1842
1789static const struct ieee80211_iface_combination 1843static const struct ieee80211_iface_combination
diff --git a/drivers/net/wireless/ti/wl18xx/scan.c b/drivers/net/wireless/ti/wl18xx/scan.c
index 98666f235a12..c938c494c785 100644
--- a/drivers/net/wireless/ti/wl18xx/scan.c
+++ b/drivers/net/wireless/ti/wl18xx/scan.c
@@ -51,7 +51,11 @@ static int wl18xx_scan_send(struct wl1271 *wl, struct wl12xx_vif *wlvif,
51 goto out; 51 goto out;
52 } 52 }
53 53
54 cmd->role_id = wlvif->role_id; 54 /* scan on the dev role if the regular one is not started */
55 if (wlcore_is_p2p_mgmt(wlvif))
56 cmd->role_id = wlvif->dev_role_id;
57 else
58 cmd->role_id = wlvif->role_id;
55 59
56 if (WARN_ON(cmd->role_id == WL12XX_INVALID_ROLE_ID)) { 60 if (WARN_ON(cmd->role_id == WL12XX_INVALID_ROLE_ID)) {
57 ret = -EINVAL; 61 ret = -EINVAL;
@@ -223,9 +227,20 @@ int wl18xx_scan_sched_scan_config(struct wl1271 *wl,
223 SCAN_TYPE_PERIODIC); 227 SCAN_TYPE_PERIODIC);
224 wl18xx_adjust_channels(cmd, cmd_channels); 228 wl18xx_adjust_channels(cmd, cmd_channels);
225 229
226 cmd->short_cycles_sec = 0; 230 if (c->num_short_intervals && c->long_interval &&
227 cmd->long_cycles_sec = cpu_to_le16(req->interval); 231 c->long_interval > req->interval) {
228 cmd->short_cycles_count = 0; 232 cmd->short_cycles_msec = cpu_to_le16(req->interval);
233 cmd->long_cycles_msec = cpu_to_le16(c->long_interval);
234 cmd->short_cycles_count = c->num_short_intervals;
235 } else {
236 cmd->short_cycles_msec = 0;
237 cmd->long_cycles_msec = cpu_to_le16(req->interval);
238 cmd->short_cycles_count = 0;
239 }
240 wl1271_debug(DEBUG_SCAN, "short_interval: %d, long_interval: %d, num_short: %d",
241 le16_to_cpu(cmd->short_cycles_msec),
242 le16_to_cpu(cmd->long_cycles_msec),
243 cmd->short_cycles_count);
229 244
230 cmd->total_cycles = 0; 245 cmd->total_cycles = 0;
231 246
diff --git a/drivers/net/wireless/ti/wl18xx/scan.h b/drivers/net/wireless/ti/wl18xx/scan.h
index 2e636aa5dba9..66a763f644d2 100644
--- a/drivers/net/wireless/ti/wl18xx/scan.h
+++ b/drivers/net/wireless/ti/wl18xx/scan.h
@@ -74,8 +74,8 @@ struct wl18xx_cmd_scan_params {
74 u8 dfs; /* number of dfs channels in 5ghz */ 74 u8 dfs; /* number of dfs channels in 5ghz */
75 u8 passive_active; /* number of passive before active channels 2.4ghz */ 75 u8 passive_active; /* number of passive before active channels 2.4ghz */
76 76
77 __le16 short_cycles_sec; 77 __le16 short_cycles_msec;
78 __le16 long_cycles_sec; 78 __le16 long_cycles_msec;
79 u8 short_cycles_count; 79 u8 short_cycles_count;
80 u8 total_cycles; /* 0 - infinite */ 80 u8 total_cycles; /* 0 - infinite */
81 u8 padding[2]; 81 u8 padding[2];
diff --git a/drivers/net/wireless/ti/wlcore/acx.c b/drivers/net/wireless/ti/wlcore/acx.c
index f28fa3b5029d..0646c9b6f8d7 100644
--- a/drivers/net/wireless/ti/wlcore/acx.c
+++ b/drivers/net/wireless/ti/wlcore/acx.c
@@ -1419,7 +1419,8 @@ out:
1419 1419
1420/* setup BA session receiver setting in the FW. */ 1420/* setup BA session receiver setting in the FW. */
1421int wl12xx_acx_set_ba_receiver_session(struct wl1271 *wl, u8 tid_index, 1421int wl12xx_acx_set_ba_receiver_session(struct wl1271 *wl, u8 tid_index,
1422 u16 ssn, bool enable, u8 peer_hlid) 1422 u16 ssn, bool enable, u8 peer_hlid,
1423 u8 win_size)
1423{ 1424{
1424 struct wl1271_acx_ba_receiver_setup *acx; 1425 struct wl1271_acx_ba_receiver_setup *acx;
1425 int ret; 1426 int ret;
@@ -1435,7 +1436,7 @@ int wl12xx_acx_set_ba_receiver_session(struct wl1271 *wl, u8 tid_index,
1435 acx->hlid = peer_hlid; 1436 acx->hlid = peer_hlid;
1436 acx->tid = tid_index; 1437 acx->tid = tid_index;
1437 acx->enable = enable; 1438 acx->enable = enable;
1438 acx->win_size = wl->conf.ht.rx_ba_win_size; 1439 acx->win_size = win_size;
1439 acx->ssn = ssn; 1440 acx->ssn = ssn;
1440 1441
1441 ret = wlcore_cmd_configure_failsafe(wl, ACX_BA_SESSION_RX_SETUP, acx, 1442 ret = wlcore_cmd_configure_failsafe(wl, ACX_BA_SESSION_RX_SETUP, acx,
diff --git a/drivers/net/wireless/ti/wlcore/acx.h b/drivers/net/wireless/ti/wlcore/acx.h
index 954d57ec98f4..524aea495dff 100644
--- a/drivers/net/wireless/ti/wlcore/acx.h
+++ b/drivers/net/wireless/ti/wlcore/acx.h
@@ -1112,7 +1112,8 @@ int wl1271_acx_set_ht_information(struct wl1271 *wl,
1112int wl12xx_acx_set_ba_initiator_policy(struct wl1271 *wl, 1112int wl12xx_acx_set_ba_initiator_policy(struct wl1271 *wl,
1113 struct wl12xx_vif *wlvif); 1113 struct wl12xx_vif *wlvif);
1114int wl12xx_acx_set_ba_receiver_session(struct wl1271 *wl, u8 tid_index, 1114int wl12xx_acx_set_ba_receiver_session(struct wl1271 *wl, u8 tid_index,
1115 u16 ssn, bool enable, u8 peer_hlid); 1115 u16 ssn, bool enable, u8 peer_hlid,
1116 u8 win_size);
1116int wl12xx_acx_tsf_info(struct wl1271 *wl, struct wl12xx_vif *wlvif, 1117int wl12xx_acx_tsf_info(struct wl1271 *wl, struct wl12xx_vif *wlvif,
1117 u64 *mactime); 1118 u64 *mactime);
1118int wl1271_acx_ps_rx_streaming(struct wl1271 *wl, struct wl12xx_vif *wlvif, 1119int wl1271_acx_ps_rx_streaming(struct wl1271 *wl, struct wl12xx_vif *wlvif,
diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c
index 68919f8d4310..f01d24baff7c 100644
--- a/drivers/net/wireless/ti/wlcore/cmd.c
+++ b/drivers/net/wireless/ti/wlcore/cmd.c
@@ -2003,12 +2003,15 @@ int wl12xx_start_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif,
2003 wlvif->bss_type == BSS_TYPE_IBSS))) 2003 wlvif->bss_type == BSS_TYPE_IBSS)))
2004 return -EINVAL; 2004 return -EINVAL;
2005 2005
2006 ret = wl12xx_cmd_role_enable(wl, 2006 /* the dev role is already started for p2p mgmt interfaces */
2007 wl12xx_wlvif_to_vif(wlvif)->addr, 2007 if (!wlcore_is_p2p_mgmt(wlvif)) {
2008 WL1271_ROLE_DEVICE, 2008 ret = wl12xx_cmd_role_enable(wl,
2009 &wlvif->dev_role_id); 2009 wl12xx_wlvif_to_vif(wlvif)->addr,
2010 if (ret < 0) 2010 WL1271_ROLE_DEVICE,
2011 goto out; 2011 &wlvif->dev_role_id);
2012 if (ret < 0)
2013 goto out;
2014 }
2012 2015
2013 ret = wl12xx_cmd_role_start_dev(wl, wlvif, band, channel); 2016 ret = wl12xx_cmd_role_start_dev(wl, wlvif, band, channel);
2014 if (ret < 0) 2017 if (ret < 0)
@@ -2023,7 +2026,8 @@ int wl12xx_start_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif,
2023out_stop: 2026out_stop:
2024 wl12xx_cmd_role_stop_dev(wl, wlvif); 2027 wl12xx_cmd_role_stop_dev(wl, wlvif);
2025out_disable: 2028out_disable:
2026 wl12xx_cmd_role_disable(wl, &wlvif->dev_role_id); 2029 if (!wlcore_is_p2p_mgmt(wlvif))
2030 wl12xx_cmd_role_disable(wl, &wlvif->dev_role_id);
2027out: 2031out:
2028 return ret; 2032 return ret;
2029} 2033}
@@ -2052,10 +2056,42 @@ int wl12xx_stop_dev(struct wl1271 *wl, struct wl12xx_vif *wlvif)
2052 if (ret < 0) 2056 if (ret < 0)
2053 goto out; 2057 goto out;
2054 2058
2055 ret = wl12xx_cmd_role_disable(wl, &wlvif->dev_role_id); 2059 if (!wlcore_is_p2p_mgmt(wlvif)) {
2056 if (ret < 0) 2060 ret = wl12xx_cmd_role_disable(wl, &wlvif->dev_role_id);
2057 goto out; 2061 if (ret < 0)
2062 goto out;
2063 }
2058 2064
2059out: 2065out:
2060 return ret; 2066 return ret;
2061} 2067}
2068
2069int wlcore_cmd_generic_cfg(struct wl1271 *wl, struct wl12xx_vif *wlvif,
2070 u8 feature, u8 enable, u8 value)
2071{
2072 struct wlcore_cmd_generic_cfg *cmd;
2073 int ret;
2074
2075 wl1271_debug(DEBUG_CMD,
2076 "cmd generic cfg (role %d feature %d enable %d value %d)",
2077 wlvif->role_id, feature, enable, value);
2078
2079 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
2080 if (!cmd)
2081 return -ENOMEM;
2082
2083 cmd->role_id = wlvif->role_id;
2084 cmd->feature = feature;
2085 cmd->enable = enable;
2086 cmd->value = value;
2087
2088 ret = wl1271_cmd_send(wl, CMD_GENERIC_CFG, cmd, sizeof(*cmd), 0);
2089 if (ret < 0) {
2090 wl1271_error("failed to send generic cfg command");
2091 goto out_free;
2092 }
2093out_free:
2094 kfree(cmd);
2095 return ret;
2096}
2097EXPORT_SYMBOL_GPL(wlcore_cmd_generic_cfg);
diff --git a/drivers/net/wireless/ti/wlcore/cmd.h b/drivers/net/wireless/ti/wlcore/cmd.h
index e14cd407a6ae..8dc46c0a489a 100644
--- a/drivers/net/wireless/ti/wlcore/cmd.h
+++ b/drivers/net/wireless/ti/wlcore/cmd.h
@@ -92,6 +92,8 @@ int wl12xx_cmd_remove_peer(struct wl1271 *wl, struct wl12xx_vif *wlvif,
92void wlcore_set_pending_regdomain_ch(struct wl1271 *wl, u16 channel, 92void wlcore_set_pending_regdomain_ch(struct wl1271 *wl, u16 channel,
93 enum ieee80211_band band); 93 enum ieee80211_band band);
94int wlcore_cmd_regdomain_config_locked(struct wl1271 *wl); 94int wlcore_cmd_regdomain_config_locked(struct wl1271 *wl);
95int wlcore_cmd_generic_cfg(struct wl1271 *wl, struct wl12xx_vif *wlvif,
96 u8 feature, u8 enable, u8 value);
95int wl12xx_cmd_config_fwlog(struct wl1271 *wl); 97int wl12xx_cmd_config_fwlog(struct wl1271 *wl);
96int wl12xx_cmd_start_fwlog(struct wl1271 *wl); 98int wl12xx_cmd_start_fwlog(struct wl1271 *wl);
97int wl12xx_cmd_stop_fwlog(struct wl1271 *wl); 99int wl12xx_cmd_stop_fwlog(struct wl1271 *wl);
@@ -652,6 +654,19 @@ struct wl12xx_cmd_regdomain_dfs_config {
652 u8 padding[3]; 654 u8 padding[3];
653} __packed; 655} __packed;
654 656
657enum wlcore_generic_cfg_feature {
658 WLCORE_CFG_FEATURE_RADAR_DEBUG = 2,
659};
660
661struct wlcore_cmd_generic_cfg {
662 struct wl1271_cmd_header header;
663
664 u8 role_id;
665 u8 feature;
666 u8 enable;
667 u8 value;
668} __packed;
669
655struct wl12xx_cmd_config_fwlog { 670struct wl12xx_cmd_config_fwlog {
656 struct wl1271_cmd_header header; 671 struct wl1271_cmd_header header;
657 672
diff --git a/drivers/net/wireless/ti/wlcore/conf.h b/drivers/net/wireless/ti/wlcore/conf.h
index 166add00b50f..52a9d1b14020 100644
--- a/drivers/net/wireless/ti/wlcore/conf.h
+++ b/drivers/net/wireless/ti/wlcore/conf.h
@@ -1186,6 +1186,15 @@ struct conf_sched_scan_settings {
1186 1186
1187 /* SNR threshold to be used for filtering */ 1187 /* SNR threshold to be used for filtering */
1188 s8 snr_threshold; 1188 s8 snr_threshold;
1189
1190 /*
1191 * number of short intervals scheduled scan cycles before
1192 * switching to long intervals
1193 */
1194 u8 num_short_intervals;
1195
1196 /* interval between each long scheduled scan cycle (in ms) */
1197 u16 long_interval;
1189} __packed; 1198} __packed;
1190 1199
1191struct conf_ht_setting { 1200struct conf_ht_setting {
@@ -1352,7 +1361,7 @@ struct conf_recovery_settings {
1352 * version, the two LSB are the lower driver's private conf 1361 * version, the two LSB are the lower driver's private conf
1353 * version. 1362 * version.
1354 */ 1363 */
1355#define WLCORE_CONF_VERSION (0x0006 << 16) 1364#define WLCORE_CONF_VERSION (0x0007 << 16)
1356#define WLCORE_CONF_MASK 0xffff0000 1365#define WLCORE_CONF_MASK 0xffff0000
1357#define WLCORE_CONF_SIZE (sizeof(struct wlcore_conf_header) + \ 1366#define WLCORE_CONF_SIZE (sizeof(struct wlcore_conf_header) + \
1358 sizeof(struct wlcore_conf)) 1367 sizeof(struct wlcore_conf))
diff --git a/drivers/net/wireless/ti/wlcore/init.c b/drivers/net/wireless/ti/wlcore/init.c
index 5ca1fb161a50..e92f2639af2c 100644
--- a/drivers/net/wireless/ti/wlcore/init.c
+++ b/drivers/net/wireless/ti/wlcore/init.c
@@ -348,7 +348,7 @@ static int wl12xx_init_fwlog(struct wl1271 *wl)
348} 348}
349 349
350/* generic sta initialization (non vif-specific) */ 350/* generic sta initialization (non vif-specific) */
351static int wl1271_sta_hw_init(struct wl1271 *wl, struct wl12xx_vif *wlvif) 351int wl1271_sta_hw_init(struct wl1271 *wl, struct wl12xx_vif *wlvif)
352{ 352{
353 int ret; 353 int ret;
354 354
diff --git a/drivers/net/wireless/ti/wlcore/init.h b/drivers/net/wireless/ti/wlcore/init.h
index a45fbfddec19..fd1cdb6bc3e4 100644
--- a/drivers/net/wireless/ti/wlcore/init.h
+++ b/drivers/net/wireless/ti/wlcore/init.h
@@ -35,5 +35,6 @@ int wl1271_hw_init(struct wl1271 *wl);
35int wl1271_init_vif_specific(struct wl1271 *wl, struct ieee80211_vif *vif); 35int wl1271_init_vif_specific(struct wl1271 *wl, struct ieee80211_vif *vif);
36int wl1271_init_ap_rates(struct wl1271 *wl, struct wl12xx_vif *wlvif); 36int wl1271_init_ap_rates(struct wl1271 *wl, struct wl12xx_vif *wlvif);
37int wl1271_ap_init_templates(struct wl1271 *wl, struct ieee80211_vif *vif); 37int wl1271_ap_init_templates(struct wl1271 *wl, struct ieee80211_vif *vif);
38int wl1271_sta_hw_init(struct wl1271 *wl, struct wl12xx_vif *wlvif);
38 39
39#endif 40#endif
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 0be807951afe..afba88beb7da 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -1792,6 +1792,9 @@ static int wl1271_op_suspend(struct ieee80211_hw *hw,
1792 1792
1793 wl->wow_enabled = true; 1793 wl->wow_enabled = true;
1794 wl12xx_for_each_wlvif(wl, wlvif) { 1794 wl12xx_for_each_wlvif(wl, wlvif) {
1795 if (wlcore_is_p2p_mgmt(wlvif))
1796 continue;
1797
1795 ret = wl1271_configure_suspend(wl, wlvif, wow); 1798 ret = wl1271_configure_suspend(wl, wlvif, wow);
1796 if (ret < 0) { 1799 if (ret < 0) {
1797 mutex_unlock(&wl->mutex); 1800 mutex_unlock(&wl->mutex);
@@ -1901,6 +1904,9 @@ static int wl1271_op_resume(struct ieee80211_hw *hw)
1901 goto out; 1904 goto out;
1902 1905
1903 wl12xx_for_each_wlvif(wl, wlvif) { 1906 wl12xx_for_each_wlvif(wl, wlvif) {
1907 if (wlcore_is_p2p_mgmt(wlvif))
1908 continue;
1909
1904 wl1271_configure_resume(wl, wlvif); 1910 wl1271_configure_resume(wl, wlvif);
1905 } 1911 }
1906 1912
@@ -2256,6 +2262,7 @@ static int wl12xx_init_vif_data(struct wl1271 *wl, struct ieee80211_vif *vif)
2256 wlvif->p2p = 1; 2262 wlvif->p2p = 1;
2257 /* fall-through */ 2263 /* fall-through */
2258 case NL80211_IFTYPE_STATION: 2264 case NL80211_IFTYPE_STATION:
2265 case NL80211_IFTYPE_P2P_DEVICE:
2259 wlvif->bss_type = BSS_TYPE_STA_BSS; 2266 wlvif->bss_type = BSS_TYPE_STA_BSS;
2260 break; 2267 break;
2261 case NL80211_IFTYPE_ADHOC: 2268 case NL80211_IFTYPE_ADHOC:
@@ -2477,7 +2484,8 @@ static void wlcore_hw_queue_iter(void *data, u8 *mac,
2477{ 2484{
2478 struct wlcore_hw_queue_iter_data *iter_data = data; 2485 struct wlcore_hw_queue_iter_data *iter_data = data;
2479 2486
2480 if (WARN_ON_ONCE(vif->hw_queue[0] == IEEE80211_INVAL_HW_QUEUE)) 2487 if (vif->type == NL80211_IFTYPE_P2P_DEVICE ||
2488 WARN_ON_ONCE(vif->hw_queue[0] == IEEE80211_INVAL_HW_QUEUE))
2481 return; 2489 return;
2482 2490
2483 if (iter_data->cur_running || vif == iter_data->vif) { 2491 if (iter_data->cur_running || vif == iter_data->vif) {
@@ -2495,6 +2503,11 @@ static int wlcore_allocate_hw_queue_base(struct wl1271 *wl,
2495 struct wlcore_hw_queue_iter_data iter_data = {}; 2503 struct wlcore_hw_queue_iter_data iter_data = {};
2496 int i, q_base; 2504 int i, q_base;
2497 2505
2506 if (vif->type == NL80211_IFTYPE_P2P_DEVICE) {
2507 vif->cab_queue = IEEE80211_INVAL_HW_QUEUE;
2508 return 0;
2509 }
2510
2498 iter_data.vif = vif; 2511 iter_data.vif = vif;
2499 2512
2500 /* mark all bits taken by active interfaces */ 2513 /* mark all bits taken by active interfaces */
@@ -2618,14 +2631,27 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
2618 goto out; 2631 goto out;
2619 } 2632 }
2620 2633
2621 ret = wl12xx_cmd_role_enable(wl, vif->addr, 2634 if (!wlcore_is_p2p_mgmt(wlvif)) {
2622 role_type, &wlvif->role_id); 2635 ret = wl12xx_cmd_role_enable(wl, vif->addr,
2623 if (ret < 0) 2636 role_type, &wlvif->role_id);
2624 goto out; 2637 if (ret < 0)
2638 goto out;
2625 2639
2626 ret = wl1271_init_vif_specific(wl, vif); 2640 ret = wl1271_init_vif_specific(wl, vif);
2627 if (ret < 0) 2641 if (ret < 0)
2628 goto out; 2642 goto out;
2643
2644 } else {
2645 ret = wl12xx_cmd_role_enable(wl, vif->addr, WL1271_ROLE_DEVICE,
2646 &wlvif->dev_role_id);
2647 if (ret < 0)
2648 goto out;
2649
2650 /* needed mainly for configuring rate policies */
2651 ret = wl1271_sta_hw_init(wl, wlvif);
2652 if (ret < 0)
2653 goto out;
2654 }
2629 2655
2630 list_add(&wlvif->list, &wl->wlvif_list); 2656 list_add(&wlvif->list, &wl->wlvif_list);
2631 set_bit(WLVIF_FLAG_INITIALIZED, &wlvif->flags); 2657 set_bit(WLVIF_FLAG_INITIALIZED, &wlvif->flags);
@@ -2696,9 +2722,15 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl,
2696 wl12xx_stop_dev(wl, wlvif); 2722 wl12xx_stop_dev(wl, wlvif);
2697 } 2723 }
2698 2724
2699 ret = wl12xx_cmd_role_disable(wl, &wlvif->role_id); 2725 if (!wlcore_is_p2p_mgmt(wlvif)) {
2700 if (ret < 0) 2726 ret = wl12xx_cmd_role_disable(wl, &wlvif->role_id);
2701 goto deinit; 2727 if (ret < 0)
2728 goto deinit;
2729 } else {
2730 ret = wl12xx_cmd_role_disable(wl, &wlvif->dev_role_id);
2731 if (ret < 0)
2732 goto deinit;
2733 }
2702 2734
2703 wl1271_ps_elp_sleep(wl); 2735 wl1271_ps_elp_sleep(wl);
2704 } 2736 }
@@ -3088,6 +3120,9 @@ static int wl12xx_config_vif(struct wl1271 *wl, struct wl12xx_vif *wlvif,
3088{ 3120{
3089 int ret; 3121 int ret;
3090 3122
3123 if (wlcore_is_p2p_mgmt(wlvif))
3124 return 0;
3125
3091 if (conf->power_level != wlvif->power_level) { 3126 if (conf->power_level != wlvif->power_level) {
3092 ret = wl1271_acx_tx_power(wl, wlvif, conf->power_level); 3127 ret = wl1271_acx_tx_power(wl, wlvif, conf->power_level);
3093 if (ret < 0) 3128 if (ret < 0)
@@ -3208,6 +3243,9 @@ static void wl1271_op_configure_filter(struct ieee80211_hw *hw,
3208 goto out; 3243 goto out;
3209 3244
3210 wl12xx_for_each_wlvif(wl, wlvif) { 3245 wl12xx_for_each_wlvif(wl, wlvif) {
3246 if (wlcore_is_p2p_mgmt(wlvif))
3247 continue;
3248
3211 if (wlvif->bss_type != BSS_TYPE_AP_BSS) { 3249 if (wlvif->bss_type != BSS_TYPE_AP_BSS) {
3212 if (*total & FIF_ALLMULTI) 3250 if (*total & FIF_ALLMULTI)
3213 ret = wl1271_acx_group_address_tbl(wl, wlvif, 3251 ret = wl1271_acx_group_address_tbl(wl, wlvif,
@@ -4838,6 +4876,9 @@ static int wl1271_op_conf_tx(struct ieee80211_hw *hw,
4838 u8 ps_scheme; 4876 u8 ps_scheme;
4839 int ret = 0; 4877 int ret = 0;
4840 4878
4879 if (wlcore_is_p2p_mgmt(wlvif))
4880 return 0;
4881
4841 mutex_lock(&wl->mutex); 4882 mutex_lock(&wl->mutex);
4842 4883
4843 wl1271_debug(DEBUG_MAC80211, "mac80211 conf tx %d", queue); 4884 wl1271_debug(DEBUG_MAC80211, "mac80211 conf tx %d", queue);
@@ -5219,6 +5260,48 @@ out:
5219 return ret; 5260 return ret;
5220} 5261}
5221 5262
5263int wlcore_rx_ba_max_subframes(struct wl1271 *wl, u8 hlid)
5264{
5265 struct wl12xx_vif *wlvif;
5266 struct ieee80211_vif *vif;
5267 struct ieee80211_sta *sta;
5268
5269 int win_size;
5270
5271 wlvif = wl->links[hlid].wlvif;
5272 if (unlikely(!wlvif)) {
5273 win_size = -EINVAL;
5274 wl1271_error("wlvif for hlid %d is null", hlid);
5275 goto out;
5276 }
5277
5278 vif = wl12xx_wlvif_to_vif(wlvif);
5279 if (unlikely(!vif)) {
5280 win_size = -EINVAL;
5281 wl1271_error("vif for hlid %d is null", hlid);
5282 goto out;
5283 }
5284
5285 rcu_read_lock();
5286 sta = ieee80211_find_sta(vif, wlvif->bss_type != BSS_TYPE_AP_BSS ?
5287 vif->bss_conf.bssid :
5288 wl->links[hlid].addr);
5289 if (unlikely(!sta)) {
5290 win_size = -EINVAL;
5291 wl1271_error("sta for hlid %d is null", hlid);
5292
5293 rcu_read_unlock();
5294 goto out;
5295 }
5296
5297 win_size = sta->max_rx_aggregation_subframes;
5298 rcu_read_unlock();
5299
5300out:
5301 return win_size;
5302}
5303EXPORT_SYMBOL_GPL(wlcore_rx_ba_max_subframes);
5304
5222static int wl1271_op_ampdu_action(struct ieee80211_hw *hw, 5305static int wl1271_op_ampdu_action(struct ieee80211_hw *hw,
5223 struct ieee80211_vif *vif, 5306 struct ieee80211_vif *vif,
5224 enum ieee80211_ampdu_mlme_action action, 5307 enum ieee80211_ampdu_mlme_action action,
@@ -5229,6 +5312,7 @@ static int wl1271_op_ampdu_action(struct ieee80211_hw *hw,
5229 struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif); 5312 struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
5230 int ret; 5313 int ret;
5231 u8 hlid, *ba_bitmap; 5314 u8 hlid, *ba_bitmap;
5315 int win_size;
5232 5316
5233 wl1271_debug(DEBUG_MAC80211, "mac80211 ampdu action %d tid %d", action, 5317 wl1271_debug(DEBUG_MAC80211, "mac80211 ampdu action %d tid %d", action,
5234 tid); 5318 tid);
@@ -5285,8 +5369,15 @@ static int wl1271_op_ampdu_action(struct ieee80211_hw *hw,
5285 break; 5369 break;
5286 } 5370 }
5287 5371
5372 win_size = wlcore_rx_ba_max_subframes(wl, hlid);
5373 if (win_size < 0) {
5374 ret = -EINVAL;
5375 wl1271_error("cannot get link rx_ba_max_subframes");
5376 break;
5377 }
5378
5288 ret = wl12xx_acx_set_ba_receiver_session(wl, tid, *ssn, true, 5379 ret = wl12xx_acx_set_ba_receiver_session(wl, tid, *ssn, true,
5289 hlid); 5380 hlid, win_size);
5290 if (!ret) { 5381 if (!ret) {
5291 *ba_bitmap |= BIT(tid); 5382 *ba_bitmap |= BIT(tid);
5292 wl->ba_rx_session_count++; 5383 wl->ba_rx_session_count++;
@@ -5307,7 +5398,7 @@ static int wl1271_op_ampdu_action(struct ieee80211_hw *hw,
5307 } 5398 }
5308 5399
5309 ret = wl12xx_acx_set_ba_receiver_session(wl, tid, 0, false, 5400 ret = wl12xx_acx_set_ba_receiver_session(wl, tid, 0, false,
5310 hlid); 5401 hlid, 0);
5311 if (!ret) { 5402 if (!ret) {
5312 *ba_bitmap &= ~BIT(tid); 5403 *ba_bitmap &= ~BIT(tid);
5313 wl->ba_rx_session_count--; 5404 wl->ba_rx_session_count--;
@@ -6083,8 +6174,10 @@ static int wl1271_init_ieee80211(struct wl1271 *wl)
6083 wl->hw->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); 6174 wl->hw->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
6084 6175
6085 wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | 6176 wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
6086 BIT(NL80211_IFTYPE_ADHOC) | BIT(NL80211_IFTYPE_AP) | 6177 BIT(NL80211_IFTYPE_AP) |
6087 BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO); 6178 BIT(NL80211_IFTYPE_P2P_DEVICE) |
6179 BIT(NL80211_IFTYPE_P2P_CLIENT) |
6180 BIT(NL80211_IFTYPE_P2P_GO);
6088 wl->hw->wiphy->max_scan_ssids = 1; 6181 wl->hw->wiphy->max_scan_ssids = 1;
6089 wl->hw->wiphy->max_sched_scan_ssids = 16; 6182 wl->hw->wiphy->max_sched_scan_ssids = 16;
6090 wl->hw->wiphy->max_match_sets = 16; 6183 wl->hw->wiphy->max_match_sets = 16;
diff --git a/drivers/net/wireless/ti/wlcore/rx.c b/drivers/net/wireless/ti/wlcore/rx.c
index e125974285cc..7df672a84530 100644
--- a/drivers/net/wireless/ti/wlcore/rx.c
+++ b/drivers/net/wireless/ti/wlcore/rx.c
@@ -74,7 +74,8 @@ static void wl1271_rx_status(struct wl1271 *wl,
74 if (desc->rate <= wl->hw_min_ht_rate) 74 if (desc->rate <= wl->hw_min_ht_rate)
75 status->flag |= RX_FLAG_HT; 75 status->flag |= RX_FLAG_HT;
76 76
77 status->signal = desc->rssi; 77 status->signal = ((desc->rssi & RSSI_LEVEL_BITMASK) | BIT(7));
78 status->antenna = ((desc->rssi & ANT_DIVERSITY_BITMASK) >> 7);
78 79
79 /* 80 /*
80 * FIXME: In wl1251, the SNR should be divided by two. In wl1271 we 81 * FIXME: In wl1251, the SNR should be divided by two. In wl1271 we
diff --git a/drivers/net/wireless/ti/wlcore/rx.h b/drivers/net/wireless/ti/wlcore/rx.h
index a3b1618db27c..f5a7087cfb97 100644
--- a/drivers/net/wireless/ti/wlcore/rx.h
+++ b/drivers/net/wireless/ti/wlcore/rx.h
@@ -30,6 +30,9 @@
30#define WL1271_RX_MAX_RSSI -30 30#define WL1271_RX_MAX_RSSI -30
31#define WL1271_RX_MIN_RSSI -95 31#define WL1271_RX_MIN_RSSI -95
32 32
33#define RSSI_LEVEL_BITMASK 0x7F
34#define ANT_DIVERSITY_BITMASK BIT(7)
35
33#define SHORT_PREAMBLE_BIT BIT(0) 36#define SHORT_PREAMBLE_BIT BIT(0)
34#define OFDM_RATE_BIT BIT(6) 37#define OFDM_RATE_BIT BIT(6)
35#define PBCC_RATE_BIT BIT(7) 38#define PBCC_RATE_BIT BIT(7)
diff --git a/drivers/net/wireless/ti/wlcore/scan.h b/drivers/net/wireless/ti/wlcore/scan.h
index 4dadd0c62cde..782eb297c196 100644
--- a/drivers/net/wireless/ti/wlcore/scan.h
+++ b/drivers/net/wireless/ti/wlcore/scan.h
@@ -83,6 +83,12 @@ struct wl1271_cmd_trigger_scan_to {
83#define MAX_CHANNELS_5GHZ 42 83#define MAX_CHANNELS_5GHZ 42
84 84
85#define SCAN_MAX_CYCLE_INTERVALS 16 85#define SCAN_MAX_CYCLE_INTERVALS 16
86
87/* The FW intervals can take up to 16 entries.
88 * The 1st entry isn't used (scan is immediate). The last
89 * entry should be used for the long_interval
90 */
91#define SCAN_MAX_SHORT_INTERVALS (SCAN_MAX_CYCLE_INTERVALS - 2)
86#define SCAN_MAX_BANDS 3 92#define SCAN_MAX_BANDS 3
87 93
88enum { 94enum {
diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index ea7e07abca4e..f50e466b5ce2 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -390,8 +390,16 @@ static int wl1271_suspend(struct device *dev)
390 dev_dbg(dev, "wl1271 suspend. wow_enabled: %d\n", 390 dev_dbg(dev, "wl1271 suspend. wow_enabled: %d\n",
391 wl->wow_enabled); 391 wl->wow_enabled);
392 392
393 /* check whether sdio should keep power */ 393 /*
394 if (wl->wow_enabled) { 394 * check whether sdio should keep power.
395 * due to some mmc layer issues, the system automatically
396 * powers us up on resume, which later cause issues when
397 * we try to restore_power again explicitly.
398 * workaround it by always asking to keep power. this is
399 * fine as the driver controls the chip power anyway.
400 * TODO: remove it when mmc issue is fixed.
401 */
402 if (true || wl->wow_enabled) {
395 sdio_flags = sdio_get_host_pm_caps(func); 403 sdio_flags = sdio_get_host_pm_caps(func);
396 404
397 if (!(sdio_flags & MMC_PM_KEEP_POWER)) { 405 if (!(sdio_flags & MMC_PM_KEEP_POWER)) {
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
index 7f363fa566a3..a1b6040e6491 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -500,6 +500,9 @@ struct wl1271 {
500 /* interface combinations supported by the hw */ 500 /* interface combinations supported by the hw */
501 const struct ieee80211_iface_combination *iface_combinations; 501 const struct ieee80211_iface_combination *iface_combinations;
502 u8 n_iface_combinations; 502 u8 n_iface_combinations;
503
504 /* dynamic fw traces */
505 u32 dynamic_fw_traces;
503}; 506};
504 507
505int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev); 508int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);
diff --git a/drivers/net/wireless/ti/wlcore/wlcore_i.h b/drivers/net/wireless/ti/wlcore/wlcore_i.h
index 39efc6d78b10..f5374ee82dbb 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore_i.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore_i.h
@@ -503,6 +503,11 @@ struct ieee80211_vif *wl12xx_wlvif_to_vif(struct wl12xx_vif *wlvif)
503 return container_of((void *)wlvif, struct ieee80211_vif, drv_priv); 503 return container_of((void *)wlvif, struct ieee80211_vif, drv_priv);
504} 504}
505 505
506static inline bool wlcore_is_p2p_mgmt(struct wl12xx_vif *wlvif)
507{
508 return wl12xx_wlvif_to_vif(wlvif)->type == NL80211_IFTYPE_P2P_DEVICE;
509}
510
506#define wl12xx_for_each_wlvif(wl, wlvif) \ 511#define wl12xx_for_each_wlvif(wl, wlvif) \
507 list_for_each_entry(wlvif, &wl->wlvif_list, list) 512 list_for_each_entry(wlvif, &wl->wlvif_list, list)
508 513
@@ -532,6 +537,7 @@ struct wl12xx_rx_filter *wl1271_rx_filter_alloc(void);
532int wl1271_rx_filter_get_fields_size(struct wl12xx_rx_filter *filter); 537int wl1271_rx_filter_get_fields_size(struct wl12xx_rx_filter *filter);
533void wl1271_rx_filter_flatten_fields(struct wl12xx_rx_filter *filter, 538void wl1271_rx_filter_flatten_fields(struct wl12xx_rx_filter *filter,
534 u8 *buf); 539 u8 *buf);
540int wlcore_rx_ba_max_subframes(struct wl1271 *wl, u8 hlid);
535 541
536#define JOIN_TIMEOUT 5000 /* 5000 milliseconds to join */ 542#define JOIN_TIMEOUT 5000 /* 5000 milliseconds to join */
537 543
diff --git a/include/dt-bindings/pinctrl/am43xx.h b/include/dt-bindings/pinctrl/am43xx.h
index c961b9032083..a8aac41d63a4 100644
--- a/include/dt-bindings/pinctrl/am43xx.h
+++ b/include/dt-bindings/pinctrl/am43xx.h
@@ -23,6 +23,7 @@
23#define SLEWCTRL_FAST 0 23#define SLEWCTRL_FAST 0
24#define DS0_FORCE_OFF_MODE (1 << 24) 24#define DS0_FORCE_OFF_MODE (1 << 24)
25#define DS0_PULL_UP_DOWN_EN (1 << 27) 25#define DS0_PULL_UP_DOWN_EN (1 << 27)
26#define WAKEUP_ENABLE (1 << 29)
26 27
27#define PIN_OUTPUT (PULL_DISABLE) 28#define PIN_OUTPUT (PULL_DISABLE)
28#define PIN_OUTPUT_PULLUP (PULL_UP) 29#define PIN_OUTPUT_PULLUP (PULL_UP)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index fc57f6b82fc5..3d4351039e2a 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1594,6 +1594,9 @@ struct ieee80211_sta_rates {
1594 * @supp_rates: Bitmap of supported rates (per band) 1594 * @supp_rates: Bitmap of supported rates (per band)
1595 * @ht_cap: HT capabilities of this STA; restricted to our own capabilities 1595 * @ht_cap: HT capabilities of this STA; restricted to our own capabilities
1596 * @vht_cap: VHT capabilities of this STA; restricted to our own capabilities 1596 * @vht_cap: VHT capabilities of this STA; restricted to our own capabilities
1597 * @max_rx_aggregation_subframes: restriction on rx buff size for this active
1598 * link. Initially set to local->hw.max_rx_aggregation_subframes but can
1599 * be modified by driver.
1597 * @wme: indicates whether the STA supports QoS/WME (if local devices does, 1600 * @wme: indicates whether the STA supports QoS/WME (if local devices does,
1598 * otherwise always false) 1601 * otherwise always false)
1599 * @drv_priv: data area for driver use, will always be aligned to 1602 * @drv_priv: data area for driver use, will always be aligned to
@@ -1620,6 +1623,7 @@ struct ieee80211_sta {
1620 u16 aid; 1623 u16 aid;
1621 struct ieee80211_sta_ht_cap ht_cap; 1624 struct ieee80211_sta_ht_cap ht_cap;
1622 struct ieee80211_sta_vht_cap vht_cap; 1625 struct ieee80211_sta_vht_cap vht_cap;
1626 u8 max_rx_aggregation_subframes;
1623 bool wme; 1627 bool wme;
1624 u8 uapsd_queues; 1628 u8 uapsd_queues;
1625 u8 max_sp; 1629 u8 max_sp;
@@ -4990,6 +4994,23 @@ void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap,
4990 const u8 *addr); 4994 const u8 *addr);
4991 4995
4992/** 4996/**
4997 * ieee80211_change_rx_ba_max_subframes - callback to change
4998 * sta.max_rx_aggregation_subframes and stop existing BA sessions
4999 *
5000 * This capability is useful in cases of IOP, i.e. cases where peer sta
5001 * or ap doesn't respect the max subframes in a single-frame and uses the
5002 * max window size instead. In these cases the driver/chip may recover by
5003 * decreasing the max_rx_aggregation_subframes to use the single frame
5004 * limitation.
5005 *
5006 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
5007 * @addr: & to bssid mac address
5008 * @max_subframes: new max_rx_aggregation_subframes for this sta
5009 */
5010void ieee80211_change_rx_ba_max_subframes(struct ieee80211_vif *vif,
5011 const u8 *addr,
5012 u8 max_subframes);
5013/**
4993 * ieee80211_send_bar - send a BlockAckReq frame 5014 * ieee80211_send_bar - send a BlockAckReq frame
4994 * 5015 *
4995 * can be used to flush pending frames from the peer's aggregation reorder 5016 * can be used to flush pending frames from the peer's aggregation reorder
diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
index 5c564a68fb50..fbf56af1bde9 100644
--- a/net/mac80211/agg-rx.c
+++ b/net/mac80211/agg-rx.c
@@ -131,6 +131,28 @@ void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap,
131} 131}
132EXPORT_SYMBOL(ieee80211_stop_rx_ba_session); 132EXPORT_SYMBOL(ieee80211_stop_rx_ba_session);
133 133
134void ieee80211_change_rx_ba_max_subframes(struct ieee80211_vif *vif,
135 const u8 *addr,
136 u8 max_subframes)
137{
138 struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
139 struct sta_info *sta;
140
141 if (max_subframes == 0)
142 return;
143
144 rcu_read_lock();
145 sta = sta_info_get_bss(sdata, addr);
146 if (!sta) {
147 rcu_read_unlock();
148 return;
149 }
150 sta->sta.max_rx_aggregation_subframes = max_subframes;
151 ieee80211_queue_work(&sta->local->hw, &sta->ampdu_mlme.work);
152 rcu_read_unlock();
153}
154EXPORT_SYMBOL(ieee80211_change_rx_ba_max_subframes);
155
134/* 156/*
135 * After accepting the AddBA Request we activated a timer, 157 * After accepting the AddBA Request we activated a timer,
136 * resetting it after each frame that arrives from the originator. 158 * resetting it after each frame that arrives from the originator.
@@ -270,13 +292,15 @@ void __ieee80211_start_rx_ba_session(struct sta_info *sta,
270 if (buf_size == 0) 292 if (buf_size == 0)
271 buf_size = IEEE80211_MAX_AMPDU_BUF; 293 buf_size = IEEE80211_MAX_AMPDU_BUF;
272 294
273 /* make sure the size doesn't exceed the maximum supported by the hw */
274 if (buf_size > local->hw.max_rx_aggregation_subframes)
275 buf_size = local->hw.max_rx_aggregation_subframes;
276
277 /* examine state machine */ 295 /* examine state machine */
278 mutex_lock(&sta->ampdu_mlme.mtx); 296 mutex_lock(&sta->ampdu_mlme.mtx);
279 297
298 /* make sure the size doesn't exceed the maximum supported by link */
299 if (buf_size > sta->sta.max_rx_aggregation_subframes)
300 buf_size = sta->sta.max_rx_aggregation_subframes;
301
302 ht_dbg(sta->sdata, "AddBA Req buf_size=%d\n", buf_size);
303
280 if (sta->ampdu_mlme.tid_rx[tid]) { 304 if (sta->ampdu_mlme.tid_rx[tid]) {
281 ht_dbg_ratelimited(sta->sdata, 305 ht_dbg_ratelimited(sta->sdata,
282 "unexpected AddBA Req from %pM on tid %u\n", 306 "unexpected AddBA Req from %pM on tid %u\n",
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index f06d42267306..5619e31958e7 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -706,6 +706,55 @@ static int ieee80211_assign_beacon(struct ieee80211_sub_if_data *sdata,
706 return changed; 706 return changed;
707} 707}
708 708
709static u32 get_rates_from_ie(struct ieee80211_sub_if_data *sdata,
710 const u8 *ies, u32 ies_len, u8 eid)
711{
712 struct ieee80211_supported_band *sband;
713 int i, j, rate;
714 u32 rates = 0;
715 const u8 *ie = cfg80211_find_ie(eid, ies, ies_len);
716
717 if (!ie)
718 return 0;
719
720 sband = sdata->local->hw.wiphy->bands[ieee80211_get_sdata_band(sdata)];
721 for (i = 0; i < ie[1]; i++) {
722 if (!(ie[2 + i] & 0x80))
723 continue;
724
725 rate = (ie[2 + i] & 0x7f) * 5;
726
727 for (j = 0; j < sband->n_bitrates; j++) {
728 if (sband->bitrates[j].bitrate == rate)
729 rates |= BIT(j);
730 }
731 }
732 return rates;
733}
734
735static u32 ieee80211_get_basic_rates(struct ieee80211_sub_if_data *sdata)
736{
737 struct sk_buff *skb;
738 struct ieee80211_mgmt *beacon;
739 const u8 *ies;
740 u32 rates = 0;
741
742 skb = ieee80211_beacon_get(&sdata->local->hw, &sdata->vif);
743 if (!skb)
744 return 0;
745
746 beacon = (struct ieee80211_mgmt *)skb->data;
747 ies = beacon->u.beacon.variable;
748
749 rates |= get_rates_from_ie(sdata, ies, skb_tail_pointer(skb) - ies,
750 WLAN_EID_SUPP_RATES);
751 rates |= get_rates_from_ie(sdata, ies, skb_tail_pointer(skb) - ies,
752 WLAN_EID_EXT_SUPP_RATES);
753
754 dev_kfree_skb(skb);
755 return rates;
756}
757
709static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, 758static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
710 struct cfg80211_ap_settings *params) 759 struct cfg80211_ap_settings *params)
711{ 760{
@@ -796,6 +845,9 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
796 } 845 }
797 changed |= err; 846 changed |= err;
798 847
848 sdata->vif.bss_conf.basic_rates = ieee80211_get_basic_rates(sdata);
849 changed |= BSS_CHANGED_BASIC_RATES;
850
799 err = drv_start_ap(sdata->local, sdata); 851 err = drv_start_ap(sdata->local, sdata);
800 if (err) { 852 if (err) {
801 old = sdata_dereference(sdata->u.ap.beacon, sdata); 853 old = sdata_dereference(sdata->u.ap.beacon, sdata);
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index 7a76ce639d58..aab3dc6dd5d1 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -300,6 +300,7 @@ void ieee80211_ba_session_work(struct work_struct *work)
300 struct sta_info *sta = 300 struct sta_info *sta =
301 container_of(work, struct sta_info, ampdu_mlme.work); 301 container_of(work, struct sta_info, ampdu_mlme.work);
302 struct tid_ampdu_tx *tid_tx; 302 struct tid_ampdu_tx *tid_tx;
303 struct tid_ampdu_rx *tid_rx;
303 int tid; 304 int tid;
304 305
305 /* 306 /*
@@ -324,6 +325,24 @@ void ieee80211_ba_session_work(struct work_struct *work)
324 sta, tid, WLAN_BACK_RECIPIENT, 325 sta, tid, WLAN_BACK_RECIPIENT,
325 WLAN_REASON_UNSPECIFIED, true); 326 WLAN_REASON_UNSPECIFIED, true);
326 327
328 /*
329 * Stop RX BA sessions affected by change of
330 * sta.max_rx_aggregation_subframe
331 */
332 tid_rx = sta->ampdu_mlme.tid_rx[tid];
333 if (tid_rx &&
334 tid_rx->buf_size > sta->sta.max_rx_aggregation_subframes) {
335 ht_dbg(sta->sdata,
336 "buf_size(%d) > max_subframes(%d) stopping tid %d\n",
337 tid_rx->buf_size,
338 sta->sta.max_rx_aggregation_subframes,
339 tid);
340
341 ___ieee80211_stop_rx_ba_session(
342 sta, tid, WLAN_BACK_RECIPIENT,
343 WLAN_REASON_UNSPECIFIED, true);
344 }
345
327 spin_lock_bh(&sta->lock); 346 spin_lock_bh(&sta->lock);
328 347
329 tid_tx = sta->ampdu_mlme.tid_start_tx[tid]; 348 tid_tx = sta->ampdu_mlme.tid_start_tx[tid];
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 2880f2ae99ab..4294a522f4c2 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -319,6 +319,9 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
319#endif 319#endif
320 320
321 memcpy(sta->sta.addr, addr, ETH_ALEN); 321 memcpy(sta->sta.addr, addr, ETH_ALEN);
322 sta->sta.max_rx_aggregation_subframes =
323 local->hw.max_rx_aggregation_subframes;
324
322 sta->local = local; 325 sta->local = local;
323 sta->sdata = sdata; 326 sta->sdata = sdata;
324 sta->last_rx = jiffies; 327 sta->last_rx = jiffies;