Commit graph

12791 commits

Author SHA1 Message Date
Gertjan van Wingerde c18b7806e4 rt2x00: Add USB device ID of Buffalo WLI-UC-GNHP.
This is reported to be an RT3070 based device.

Reported-by: Teika Kazura <teika@lavabit.com>
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-15 10:02:56 -05:00
Stanislaw Gruszka c63b2d01b1 iwlegacy: remove unused IL_AC_UNSET define
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 15:20:03 +01:00
Greg Dietsche dd44eb9e13 iwlegacy: change IL_ERR to D_HT in iwl4965_rs_tl_turn_on_agg_for_tid
This message should be a debug message and not an error.

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:51:46 +01:00
Greg Dietsche 53611e0526 iwlegacy: change IL_WARN to D_HT in il4965_tx_agg_start
This message should be a debug message and not a warning.

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:51:44 +01:00
Stanislaw Gruszka 1722f8e12a iwlegacy: checkpatch.pl fixes
Fix most checkpatch.pl ERRORs and some WARNINGs.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:51:01 +01:00
Stanislaw Gruszka e7392364fc iwlegacy: indentions and whitespaces
Process iwlegacy source files using:

indent -npro -l500 -nhnl
indent -npro -kr -i8 -ts8 -sob -l80 -nbbo -ss -ncs -cp1 -il0 -psl

Plus manual compilation fixes.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:45:59 +01:00
Stanislaw Gruszka f02579e3a8 iwlegacy: merge iwl-debug.h into common.h
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:25:21 +01:00
Stanislaw Gruszka f19ab370a7 iwlegacy: rename iwl-debug.c to debug.c
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:24:36 +01:00
Stanislaw Gruszka eac3b21277 iwlegacy: merge iwl-fh.h into 4965.h
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:21:11 +01:00
Stanislaw Gruszka 9a95b37015 iwlegacy: use FH49_ prefix in 4965 code
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:20:39 +01:00
Stanislaw Gruszka 53143a1809 iwlegacy: use FH39_ prefix in 3945 code
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:20:33 +01:00
Stanislaw Gruszka e8c39d4e62 iwlegacy: rename iwl-prph.h to prph.h
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:20:27 +01:00
Stanislaw Gruszka 47ef694dd4 iwlegacy: merge iwl-{eeprom,led}.h into common.h
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:20:23 +01:00
Stanislaw Gruszka 99412002a0 iwlegacy: merge iwl-power.h into common.h
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:20:19 +01:00
Stanislaw Gruszka 3fbbf9a808 iwlegacy: merge iwl-legacy-rs.h into common.h
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:20:16 +01:00
Stanislaw Gruszka f44cfaf330 iwlegacy: remove iwl-helpers.h
This file was already merged into common.h

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:20:13 +01:00
Stanislaw Gruszka e94a4099ad iwlegacy: merge common header files
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:20:09 +01:00
Stanislaw Gruszka 98613be06e iwlegacy: rename iwl-core.h to common.h
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:19:34 +01:00
Stanislaw Gruszka 77375bb01c iwlegacy: rename iwl-csr.h to csr.h
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:12:12 +01:00
Stanislaw Gruszka e53aac4247 iwlegacy: move IL_MASK
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:12:06 +01:00
Stanislaw Gruszka 6278ddab9f iwlegacy: remove il_ieee80211_get_hw_conf
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 14:12:00 +01:00
Stanislaw Gruszka d4459a99c4 iwlegacy: rename iwl-commands.h to commands.h
On the way remove also not needed iwl-fh.h include.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 13:51:26 +01:00
Stanislaw Gruszka 7f8e122380 iwlegacy: rename module name
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 13:42:04 +01:00
Stanislaw Gruszka 0cdc21363c iwlegacy: merge common .c files
Merge iwl-{tx,rx,sta,scan,power,eeprom,led,hcmd}.c into common.c .

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 13:40:15 +01:00
Stanislaw Gruszka 4ed47911a2 iwlegacy: rename iwl-core.c to common.c
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 13:18:51 +01:00
Stanislaw Gruszka d2dfb33ec9 iwlegacy: rename other handlers
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 13:16:38 +01:00
Stanislaw Gruszka 6e9848b496 iwlegacy: s/rx_reply/hdl/
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 13:12:28 +01:00
Stanislaw Gruszka d0c72347be iwlegacy: s/rx_handler/handler/
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 13:12:24 +01:00
Stanislaw Gruszka 4d69c7521a iwlegacy: rename REPLY_ to N_ or C_
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 13:12:21 +01:00
Stanislaw Gruszka db7746f78c iwlegacy: s/STATISTICS/STATS/
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 13:11:50 +01:00
Stanislaw Gruszka a6766ccdaf iwlegacy: s/STATUS_/S_/
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 13:09:01 +01:00
Stanislaw Gruszka 6bbb1370c3 iwlegacy: move iwl-3945-{,hw,fh,debugfs}.h to 3945.h
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:59:59 +01:00
Stanislaw Gruszka af038f404f iwlegacy: move iwl-4965-{,hw,debugfs,calib}.h to 4965.h
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:59:02 +01:00
Stanislaw Gruszka 8f29b456f8 iwlegacy: add accidentally removed comments
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:57:25 +01:00
Stanislaw Gruszka ccf5533ec4 iwlegacy: rename iwl-3945-{rs,debugfs}.c to 3945-{rs,debug}.c
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:54:28 +01:00
Stanislaw Gruszka f3a1b49d66 iwlegacy: rename iwl-4965-{rs,calib,debugfs}.c to 4965-{rs,calib,debug}.c
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:54:25 +01:00
Stanislaw Gruszka fcb74588dc iwlegacy: merge iwl-4965-lib.c into 4965-mac.c
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:54:18 +01:00
Stanislaw Gruszka a1751b22a8 iwlegacy: merge iwl-4965-{tx,rx}.c into 4965-mac.c
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:50:37 +01:00
Stanislaw Gruszka eb3cdfb72d iwlegacy: merge iwl-4965-sta.c into 4965-mac.c
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:41:56 +01:00
Stanislaw Gruszka 862d32e6db iwlegacy: merge iwl-4965-ucode.c into 4965.c
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:41:53 +01:00
Stanislaw Gruszka 56e7a8cca0 iwlegacy: merge iwl-4965-eeprom.c into 4965.c
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:41:50 +01:00
Stanislaw Gruszka ecce1f09e8 iwlegacy: merge iwl-3945-led.c into 3945.c
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:41:31 +01:00
Stanislaw Gruszka fc19cbde0c iwlegacy: merge iwl-4965-led.c into 4965.c
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:41:01 +01:00
Stanislaw Gruszka 61fe55f61f iwlegacy: rename base 4965 and 3945 file names
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:40:26 +01:00
Stanislaw Gruszka 17d6e55735 iwlegacy: remove for_each_context
We do not support many contexts.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:31:35 +01:00
Stanislaw Gruszka 3b98c7f49b iwlegacy: s/TABLE/TBL/
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:31:32 +01:00
Stanislaw Gruszka 0c2c885200 iwlegacy: s/index/idx/
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:30:17 +01:00
Stanislaw Gruszka 2d09b0624a iwlegacy: s/INDEX/IDX/
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:26:43 +01:00
Stanislaw Gruszka 2eb058162e iwlegacy: s/IL_RATE/RATE/
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:26:39 +01:00
Stanislaw Gruszka 6ce1dc4530 iwlegacy: s/window/win/
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:26:33 +01:00
Stanislaw Gruszka ebf0d90d12 iwlegacy: s/statistics/stats/
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 12:26:28 +01:00
Stanislaw Gruszka b73bb5f13b iwlegacy: s/il_rx_mem_buffer/il_rx_buf/
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:29:24 +01:00
Stanislaw Gruszka 7c2cde2ef2 iwlegacy: partial rxon context cleanup
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:29:04 +01:00
Stanislaw Gruszka dcae1c641a iwlegacy: s/iwl_rx_packet/iwl_rx_pkt/
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:26:09 +01:00
Stanislaw Gruszka d317516798 iwlegacy: rename remaining IWLs to ILs
Also rename config names IWLWIFI_LEGACY to IWLEGACY

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:25:42 +01:00
Stanislaw Gruszka 232913b51e iwlegacy: remove not needed parentheses
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:23:08 +01:00
Stanislaw Gruszka db54eb57ce iwlegacy: rename il_{read,write}_prph
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:23:01 +01:00
Stanislaw Gruszka 0c1a94e299 iwlegacy: rename i/o direct methods
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:22:56 +01:00
Stanislaw Gruszka 1c8cae575b iwlegacy: remove _il_{read,write}_direct32
Use _il_{rd,wr} instead of another name of these operations.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:22:42 +01:00
Stanislaw Gruszka 138822698f iwlegacy: mark il_{grab,release}_nic_access as unlocked
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:22:36 +01:00
Stanislaw Gruszka 142b343f6e iwlegacy: mark poll bit as unlocked function
We do not take reg_lock during poll bit, so mark it such
using underscore.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:22:28 +01:00
Stanislaw Gruszka 841b2ccac3 iwlegacy: rename il_{read,write}32 to _il_{rd,wr}
Introduce rule that underscore at the beginning mean unlocked I/O method.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:22:15 +01:00
Stanislaw Gruszka b6297cd2aa iwlegacy: remove IL_CRIT
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:22:02 +01:00
Stanislaw Gruszka 9406f79775 iwlegacy: remove il argument from IWL_ERR/INFO/WARN/CRIT
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:21:47 +01:00
Stanislaw Gruszka 58de00a464 iwlegacy: rename IL_DEBUG_ to D_
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:21:01 +01:00
Stanislaw Gruszka 2d27c5dbd6 iwlegacy: remove DEBUG_LIMIT
Even if messages are generating fast we want to see all of them
when debugging.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:17:10 +01:00
Stanislaw Gruszka 46f16c492e iwlegacy: remove DEBUG_IO
Nothing useful at present.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:17:07 +01:00
Stanislaw Gruszka d2ddf621aa iwlegacy: rename iwlegacy to il
More renaming to make code shorter.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:17:04 +01:00
Stanislaw Gruszka 46bc8d4b0e iwlegacy: rename priv to il
Make code shorter.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:17:00 +01:00
Stanislaw Gruszka e2ebc8337d iwlegacy: rename iwl to il
iwl_legacy prefix result in long function names, what cause that we
have frequent line split and not readable code. Also iwl_foo symbols
are duplicated in iwlwifi driver, what is annoying when editing
kernel tree with cscope.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:16:58 +01:00
Stanislaw Gruszka fee005e5dd iwlegacy: remove tracing
This is not useful.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
2011-11-15 11:16:55 +01:00
John W. Linville 731f8e1c41 libertas: release bss references and avoid warning from cfg80211_inform_bss
CC [M]  drivers/net/wireless/libertas/cfg.o
drivers/net/wireless/libertas/cfg.c: In function ‘lbs_ret_scan’:
drivers/net/wireless/libertas/cfg.c:636:24: warning: ignoring return value of ‘cfg80211_inform_bss’, declared with attribute warn_unused_result
drivers/net/wireless/libertas/cfg.c: In function ‘lbs_join_post’:
drivers/net/wireless/libertas/cfg.c:1766:21: warning: ignoring return value of ‘cfg80211_inform_bss’, declared with attribute warn_unused_result

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:49 -05:00
John W. Linville 6d377cdbe3 brcmsmac: fix warning in _initvars_srom_pci
CC [M]  drivers/net/wireless/brcm80211/brcmsmac/srom.o
drivers/net/wireless/brcm80211/brcmsmac/srom.c: In function ‘_initvars_srom_pci’:
drivers/net/wireless/brcm80211/brcmsmac/srom.c:641:6: warning: ‘val’ may be used uninitialized in this function

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:48 -05:00
Franky Lin e78946e198 brcm80211: fmac: release bss struct returned from cfg80211_inform_bss
Referenced struct returned by cfg80211_inform_bss must be released with
cfg80211_put_bss to avoid memory leak.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:47 -05:00
Franky Lin 99b72cde63 brcm80211: fmac: remove PCMCIA core related code
all the devices supported or will be supported by brcmfmac
do not have a PCMCIA bus core. So remove the corresponding code.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:45 -05:00
Arend van Spriel 046808daf9 brcm80211: fmac: add function to free the glom skb queue
In several places in dhd_sdio.c a skb packet queue was being emptied
and the packets freed. This warrants to have a function in place to
do this.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:44 -05:00
Arend van Spriel 53ee4bc467 brcm80211: util: remove pointer traversal from brcmu_pkt_buf_free_skb
The function brcmu_pkt_buf_free_skb() was following the next pointer
to free all linked packets. However, it is only called with unlinked
packets so this can be removed.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:43 -05:00
Arend van Spriel 9a95e60e06 brcm80211: util: move brcmu_pkttotlen() function to brcmfmac
The functions brcmu_pkttotlen() is only used in brcmfmac driver
so it has been moved there. It also does not use the sk_buff
next pointer anymore but walks a skb queue to determine the total
length.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:42 -05:00
Alwin Beukers 02a588a2e3 brcm80211: smac: combine promiscuous mode functionality
Combined mac configuration for promiscious mode and monitor mode, and
removed unused monitor mode flag in pub structure.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:41 -05:00
Arend van Spriel ad3b8b3918 brcm80211: util: use sk_buff_head in precedence queue functions
Instead of dealing with sk_buff prev pointers the queue functions
now make use of the sk_buff_head functions provided by the kernel.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:40 -05:00
Arend van Spriel ad4d71f69e brcm80211: smac: remove usage of brcmu_pkttotlen
The function brcmu_pkttotlen calculates the total length of a sk_buff
chain following the next pointer. In brcmsmac this is not needed as
in each place where it was used the provided sk_buff had a NULL pointer
as next field value.

Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:39 -05:00
Franky Lin 122d36fd5a brcm80211: fmac: remove id retrieve code
sdio_chip.c is dedicated to sdio bus chip. No need to retrieve id
for bus core

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:38 -05:00
Franky Lin d77e70ff5a brcm80211: fmac: add resetcore function for bcm4330 chip
This patch is part of the series of adding new backplane support

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:37 -05:00
Franky Lin 086a2e0a63 brcm80211: fmac: add coredisable function for bcm4330 chip
This patch is part of the series of adding new backplane support

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:35 -05:00
Franky Lin 523894f267 brcm80211: fmac: add corerev function for bcm4330 chip
This patch is part of the series adding new backplane support

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:34 -05:00
Franky Lin 6ca687d946 brcm80211: fmac: add iscoreup function for bcm4330 chip
New type of backplane interconnect support is needed
for bcm4330

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:33 -05:00
Alwin Beukers e9ca530a7b brcm80211: smac: don't modify sta parameters when adding sta
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:32 -05:00
Arend van Spriel a0f24c8a93 brcm80211: smac: remove duplicate definition of D11_PHY_HDR_LEN
The macro definition D11_PHY_HDR_LEN was defined in d11.h and pub.h.
It has been removed from pub.h.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:31 -05:00
Arend van Spriel b7eec4233c brcm80211: smac: replace own access category definitions with mac80211 enum
The brcmsmac had own definitions for the access categories. The mac80211
header provides these as well as they are used in the conf_tx callback.
As the definitions did not match the driver configured the tx parameters
to the wrong queue.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:29 -05:00
Arend van Spriel bfd8284b65 brcm80211: smac: remove code under unused macro definitions
There were a couple of code segments left that were placed under
a macro definition that was not applicable or not used in the
brcmsmac driver. These pieces of code have been removed.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:28 -05:00
Arend van Spriel 9752915e3e brcm80211: smac: fix endianess issue for OTP memory access
This fixes issue when using OTP memory. It was introduced by
following commit:

commit 028f78d43d
Author: Arend van Spriel <arend@broadcom.com>
Date:   Fri Oct 21 16:16:35 2011 +0200

    brcm80211: smac: change buffer endianess convert function interface

Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 14:28:27 -05:00
Don Fry 97b52cfd1a iwlagn: move nvm_device_type from iwl_priv to iwl_trans
The nvm_device_type is eeprom related and does not need to be part
of the iwl_priv structure.  Move it and eliminate access to the iwl_priv
structure.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:56 -05:00
Don Fry 1431b2166a iwlagn: Remove dependence of iwl_priv from eeprom routines.
Make the eeprom routines less dependent on the iwl_priv structure.
Don't use the priv when bus structure is sufficient.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:56 -05:00
Venkataraman, Meenakshi 383b0874ab iwlwifi: fix rate-scaling algorithm for BT combo devices
iwlwifi tries to avoid using antenna B in BT combo devices when BT
is active. A bug in the rate-scaling algorithm was causing the combo
device to never attempt MIMO rates. Fix the algorithm to
opportunistically try MIMO rates when BT traffic is low.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:56 -05:00
Emmanuel Grumbach 81a3de1ce2 iwlwifi: add debug information on queue stop / wake
Users complain that the traffic gets stalled sometimes. This will
allow easier debugging.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:56 -05:00
Emmanuel Grumbach 0dcf50ca4e iwlwifi: remove the use of the QOS debug flag
This bit was used only once. Use IWL_DL_INFO instead.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:56 -05:00
Johannes Berg eb32043f43 iwlagn: don't always split remain-on-channel
Due to the P2P context always having the associated
bit set when we got to this code, we were splitting
up the remain-on-channel durations unconditionally.
This isn't needed -- if the P2P context is in P2P
device type mode it doesn't impose restrictions on
timing to skip it in that case.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:55 -05:00
Johannes Berg 3ddf6befb9 iwlagn: convert remain-on-channel duration to TU
The device expects TU but we get ms, so convert.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:55 -05:00
Emmanuel Grumbach 9cac4943aa iwlwifi: fix unused label in iwl_send_cmd_sync
Warning introduced by c847474b7dfdda304d0d8ffcc5a9db546b1cb3e9

iwlwifi: check status before send command

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:55 -05:00
Wey-Yi Guy 94b3c45c7b iwlwifi: check status before send command
Check the status before sending host command, if any of the condition
match, cancel the host command before queue

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:55 -05:00
Wey-Yi Guy 89db3b972c iwlwifi: set "echo" host command length
"echo" host command has no data, set the length to 0

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:55 -05:00
Wey-Yi Guy 023ca58f1d iwlwifi: Move the core suspend function to iwl-agn-lib
The core suspend function is part of agn, iwl_mac80211 should only
handle mac80211 I/F operations.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:54 -05:00
Wey-Yi Guy 76b2933111 iwlwifi: move station functions to mac80211
The station related mac80211 callback functions should belong to _mac80211

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:54 -05:00
Wey-Yi Guy ba4c531984 iwlwifi: move hw_scan into _mac80211 file
iwlagn_mac_hw_scan should belong to _mac80211 callback.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:54 -05:00
Wey-Yi Guy 0b7a4c788f iwlwifi: move more mac80211 callback function
Move more mac80211 related functions to _mac80211 file

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:54 -05:00
Johannes Berg a69cd040d0 iwlagn: explicitly program P2P QoS parameters
In P2P device mode, the device needs to have valid
QoS parameters. We currently have those because we
program parameters from any virtual interface into
all contexts, but not only do we want to get rid of
this -- it is also unpredictable since on the BSS
context we might have any parameters, and there it
might even be programmed for HT.

Explicitly program default QoS parameters into the
PAN context for P2P (the defaults are 11g but with
QoS disabled) to make device behaviour predictable.

This also helps when in a follow-up patch we will
use TX QoS parameters from mac80211 only for the
context they were meant for -- without this first
that would completely break P2P device discovery.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:54 -05:00
Johannes Berg df912e5119 iwlagn: use per-vif AC parameters
Eliad added the ability to configure AC parameters
per virtual interface; make use of this in iwlwifi
and set the parameters in the right context. Since
storage and uploading to the device is already per
context, this is sufficient.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:54 -05:00
Wey-Yi Guy 7335613ae2 iwlwifi: move all mac80211 related functions to one place
There are many mac80211 callback functions in the driver, as current
implementation, those functions are scatter everywhere which is very difficult
to find and maintain, move all the mac80211 callback functions into single
file. There should be no functional changes

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:53 -05:00
Don Fry de7f5f92db iwlagn: move ucode files out of the iwl_priv structure
Relocate the ucode files and update relevant code.
More code refactoring.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:53 -05:00
Don Fry baa0005663 iwlagn: push knowledge of ucode image lower down
Move the knowledge of the ucode image to lower level routines.  Also do
not pass the iwl_priv structure lower than it needs to be.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:53 -05:00
Don Fry 8929c24bf2 iwlagn: remove knowledge of ucode image location from upper layers
The upper layers of the driver do not need to know where the ucode is
stored.  It already passes in an enum of which ucode to load.  Let the
lower layer routines select the ucode to load.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:53 -05:00
Don Fry 5703ddb013 iwlagn: move ucode_write_complete from priv to trans structure
ucode_write_complete is used for ucode loading.  Move it as part of
restructuring work out of the priv structure.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:53 -05:00
Wey-Yi Guy b6cb406a02 iwlwifi: remove un-supported SKUs
BG only SKUs are no longer supported by 2000 and 1x5 series. Remove it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:53 -05:00
Johannes Berg aed0fd4acd iwlagn: fix NULL ptr deref when reprogramming sta w/o LQ
Reinette reports a crash in iwl_reprogram_ap_sta(). The
debugging shows:

  b1 16    mov    $0x16,%cl
 *f3 a5    rep movsl %ds     <-- trapping instruction:(%rsi),%es:(%rdi)

which is a memcpy of 22 (0x16) words (movsl). this points
to "priv->stations[sta_id].lq" being NULL since that is
the memcpy() of that size here.

The only way I see for this to happen is if we try to
do some RXON reprogramming while connecting to an AP,
after tx_sync() but before full setup, but that seems
like something that might very well happen.

Fix this by checking if the LQ is present and only then
reprogramming it.

Reported-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:52 -05:00
Wey-Yi Guy b2ccccdca4 iwlagn: check for SMPS mode
Check and report WARN only when its invalid

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:52 -05:00
Wey-Yi Guy 75a56eccb0 iwlwifi: two more SKUs for 6x05 series
Add two more SKUs for 6x05 series of device.
First SKU has low 5GHz channels actives, the other SKU has high 5GHz channels actives.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:52 -05:00
Todd Previte b36b110c57 iwlwifi: Suppress noisy syslog messages when RF_KILL switch engaged
When a station is associated with an AP and the RF_KILL switch is engaged,
numerous error messages were sent to the system log. The error messages
were the result of the failure(s) of the various submodules to perform
their tasks after the radios were disabled.

To resolve this situation, the messages were modified to use a new macro,
IWL_DEBUG_QUIET_RFKILL. This macro allows for the RF_KILL error messages
to be sent to the log provided that IWL_DEBUG is true and IWL_DL_RADIO
is '1'. For all other cases, the error messages resulting from an RFKILL
event will not be sent to the system log. Messages logged because of an
RFKILL will be tagged with the prefix '(RFKILL)' to clarify the cause of
the error.

Signed-off-by: Todd Previte <toddX.a.previte@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:52 -05:00
Johannes Berg 79d3eef891 iwlagn: add P2P NoA to probe responses
Whether to use NoA or not is entire controlled
by the uCode right now, and it also adds the
attribute to beacons. We do need to add it to
probe responses in the driver though.

Keep track of the NoA notification from the
uCode and add the data to probe responses when
such are transmitted. Use RCU to manage the
lifetime.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:52 -05:00
Rajkumar Manoharan 8915f980c1 ath9k_hw: Fix tx power settings for AR9003
Retriving tx power for 2x2 and 3x3 chainmask is not handled
properly. While calculating tx power for 2x2, 3 dBm was reduced
and for 3x3, 5 dBm was reduced which should be added back when
retriving.

Cc: Paul Stewart <pstew@google.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:52 -05:00
Daniel Kuehn fdacbcda7f ath9k: set ATH9K_PCI to y by default
Most ath9k devices are PCI/PCIe based, therefor making PCI/PCIe support
default y helps those porting a config from 2.6 kernel series
from getting "non-functional" wireless drivers with 3.x kernel series.

Signed-off-by: Daniel Kuehn <daniel@kuehn.se>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:51 -05:00
Johannes Berg 776d68f863 wireless: move ieee80211chan2mhz macro
The macro is only used in ipw2200 and we certainly
don't want to encourage its use, so move it out of
the radiotap header file and into the driver.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:50 -05:00
Rajkumar Manoharan 94e2ad9ee4 ath9k_hw: Fix channel list of CalFreqPeir for AR938x
This patch sync up CalFreqPeir channel list and paprd rate mask
of AR938x templates to the latest received from Systems team.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:49 -05:00
Rajkumar Manoharan 202bff08bf ath9k_hw: Read and configure xpa timing field
Configure xpa timing field while loading boad defaults to
fix 11b CCK spur issue that was observed in EMI testing.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:49 -05:00
Rajkumar Manoharan df222edc09 ath9k_hw: Read and configure quick drop for AR9003
Read and configure quick drop feild from AR9003 eeprom
inorder to help with strong signal. This patch also removes
obsolate parameters ob, db_stage2, db_stage_3, db_stage4
from the eeprom templates.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:48 -05:00
Amitkumar Karwar aa95a48d46 mwifiex: release bss structure returned by cfg80211_inform_bss()
Following compilation warning is fixed by releasing referenced BSS
structure returned by cfg80211_inform_bss().

"warning: ignoring return value of cfg80211_inform_bss,
declared with attribute warn_unused_result"

Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:48 -05:00
Amitkumar Karwar f72fa45f7d mwifiex: remove unnecessary free_priv handler
Cfg80211 stack allocates private area for driver use in
struct cfg80211_bss. It will be freed by stack in bss_release().
Driver don't need to worry about it.

In mwifiex driver, we use the private area just to store band
information(u8). We don't allocate memory explicitly and store
it's pointer in bss->priv. Hence we don't have any cleanup work
to do in free_priv handler. Currently we try to free the allocated
private area in free_priv handler which is not correct.

This patch removes unnecessary free_priv handler.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:48 -05:00
Yogesh Ashok Powar 8ed1303321 mwifiex: fix 'Smatch' warnings
Following three warnings are fixed:

>init.c +256 mwifiex_init_adapter(71)
>warn: variable dereferenced before check 'adapter->sleep_cfm'
>(see line 191)

>sta_rx.c +193 mwifiex_process_sta_rx_packet(75)
>warn: variable dereferenced before check 'priv' (see line 182)

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:48 -05:00
Yogesh Ashok Powar 63af63330f mwifiex: fix coding style
Rename DataRate to data_rate and arrange 'for' loop
for better readability.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:48 -05:00
Yogesh Ashok Powar ab581472c0 mwifiex: change return types to void
Functions mwifiex_11n_dispatch_pkt_until_start_win and
mwifiex_11n_scan_and_dispatch used to always return value
zero for all inputs. Changing these functions to void.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:47 -05:00
Yogesh Ashok Powar eedf15d34d mwifiex: use existing helper function mwifiex_fill_cap_info
Use existing helper function mwifiex_fill_cap_info to fill
the HT CAP info for ibss beacons.

Also removing extra parenthesis block for better readability.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:47 -05:00
Yogesh Ashok Powar 33f38d425f mwifiex: fix ht_cap_info in ibss beacons
A local variable is used to calculate ht_cap_info.
Erroneously ht_cap.cap_info isn't updated in the ibss beacons
after the calculation. This patch fixes it.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 12:32:47 -05:00
Amitkumar Karwar fada10584d mwifiex: fix association issue with AP configured in hidden SSID mode
Firmware expects 'max_ssid_length' field in
'struct mwifiex_ie_types_wildcard_ssid_params' to be '0' for
performing SSID specific scan. Currently driver updates it with
an actual SSID length. Hence UUT is not able to find the AP
configured in hidden SSID mode in scan results and association
fails.

max_ssid_length is filled with '0' to fix the issue.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 11:03:25 -05:00
Emmanuel Grumbach 43e5885658 iwlwifi: avoid a panic when unloading the module with RF Kill
When HW RF kill switch is set to kill the radio, our NIC issues an
interrupt after we stop the APM module. When we unload the module,
the driver disables and cleans the interrupts before stopping the
APM. So we have a real interrupt (inta not zero) pending.
When this interrupts pops up the tasklet has already been killed
and we crash.

Here is a logical description of the flow:

disable and clean interrupts
synchronize interrupts
kill the tasklet

stop the APM <<== creates an RF kill interrupt

free_irq <<== somehow our ISR is called here and we crash

Here is the panic message:

[  201.313636] BUG: unable to handle kernel paging request at ffff8800911b7150
[  201.314541] IP: [<ffffffff8106d652>] tasklet_action+0x62/0x130
[  201.315149] PGD 1c06063 PUD db37f067 PMD db408067 PTE 80000000911b7160
[  201.316456] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
[  201.317324] CPU 1
[  201.317495] Modules linked in: arc4 iwlwifi(-) mac80211 cfg80211 netconsole configfs binfmt_misc i915 drm_kms_helper drm uvcvideo i2c_algo_bit videodev dell_laptop dcdbas intel_agp dell_wmi intel_ips psmouse intel_gtt v4l2_compat_ioctl32 asix usbnet mii serio_raw video sparse_keymap firewire_ohci sdhci_pci sdhci firewire_core e1000e crc_itu_t [last unloaded: configfs]
[  201.323839]
[  201.324015] Pid: 2061, comm: modprobe Not tainted 3.1.0-rc9-wl #4 Dell Inc. Latitude E6410/0667CC
[  201.324736] RIP: 0010:[<ffffffff8106d652>]  [<ffffffff8106d652>] tasklet_action+0x62/0x130
[  201.325128] RSP: 0018:ffff88011bc43ea0  EFLAGS: 00010286
[  201.325338] RAX: ffff88008ae70000 RBX: ffff8800911b7150 RCX: ffff88008ae70028
[  201.325555] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff88008ae70000
[  201.325775] RBP: ffff88011bc43ec0 R08: 0000000000000000 R09: 0000000000000000
[  201.325994] R10: 0000000000000002 R11: 0000000000000001 R12: 0000000000000001
[  201.326212] R13: 0000000000000006 R14: 0000000000000100 R15: ffff88008e259fd8
[  201.326431] FS:  00007f4b90ea9700(0000) GS:ffff88011bc40000(0000) knlGS:0000000000000000
[  201.326657] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[  201.326864] CR2: ffff8800911b7150 CR3: 000000008fd6d000 CR4: 00000000000006e0
[  201.327083] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  201.327302] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[  201.327521] Process modprobe (pid: 2061, threadinfo ffff88008e258000, task ffff88008ae70000)
[  201.327747] Stack:
[  201.330494]  0000000000000046 0000000000000030 0000000000000001 0000000000000006
[  201.333870]  ffff88011bc43f30 ffffffff8106cd8a ffffffff811e1016 ffff88011bc43f08
[  201.337186]  0000000100000046 ffff88008e259fd8 0000000a10be2160 0000000000000006
[  201.340458] Call Trace:
[  201.342994]  <IRQ>
[  201.345656]  [<ffffffff8106cd8a>] __do_softirq+0xca/0x250
[  201.348185]  [<ffffffff811e1016>] ? pde_put+0x76/0x90
[  201.350730]  [<ffffffff8131aeae>] ? do_raw_spin_unlock+0x5e/0xb0
[  201.353261]  [<ffffffff811e1016>] ? pde_put+0x76/0x90
[  201.355776]  [<ffffffff8163ccfc>] call_softirq+0x1c/0x30
[  201.358287]  [<ffffffff8101531d>] do_softirq+0x9d/0xd0
[  201.360823]  [<ffffffff8106cb05>] irq_exit+0xd5/0xf0
[  201.363330]  [<ffffffff8163d5d6>] do_IRQ+0x66/0xe0
[  201.365819]  [<ffffffff81632673>] common_interrupt+0x73/0x73
[  201.368257]  <EOI>

Cc: <stable@kernel.org> 3.1+
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-11 11:03:24 -05:00
Vasanthakumar Thiagarajan 8cb6d9915f ath6kl: Fix error in writing create_qos debugfs
100 bytes are allocated to store the parameters which are needed
to create a priority stream. These 100 bytes are not sufficiant and
throws error when running the following command.

echo "6 2 3 1 1 9999999 9999999 9999999 7777777 0 6 45000 200 56789000
 56789000 5678900 0 0 9999999 20000 0" > create_qos

179 bytes are needed when the following vlaues are given so that
a maximum possible value in that data type can be given in decimal.

echo "255 255 255 255 255 4294967295 4294967295 4294967295 4294967295
 4294967295 255 65535 65535 4294967295 4294967295 4294967295 4294967295
 4294967295 4294967295 4294967295 4294967295" > create_qos

Following takes 187 bytes when given in hex

echo "0xff 0xff 0xff 0xff 0xff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
 0xff 0xffff 0xffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
 0xffffffff 0xffffffff" > create_qos

Increase the size to 200 bytes so that it can hold upto the maximum
value possible for that data type.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 13:00:01 +02:00
Vasanthakumar Thiagarajan a29517ce40 ath6kl: Fix tx packet drop in AP mode with bridge
skb is dropped in ath6kl_data_tx() when the headroom in skb
is insufficient. We hit this condition for every skb in AP mode
which is used with bridge, so all tx packets are getting dropped
when tried to send traffic to wireless client from bridge. Fix
this by reallocating the headroom instead of dropping the skb
when it has lesser headroom than needed.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 13:00:01 +02:00
Raja Mani 902b46293b ath6kl: Remove few unused WMI stuff
* Removed unused WOW_MAX_FILTER_LISTS macro.

* Removed empty ath6kl_wmi_get_wow_list_event_rx() function.
  List of configured WOW patterns are maintained in CFG layer
  itself. No need to have this function in ath6kl to get
  configured WOW pattern list. It can added later if we need
  it for debugging.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 13:00:00 +02:00
Raja Mani eae9e0661b ath6kl: Expose ath6kl's WOW capabilities to cfg80211
Set the list of ath6kl's WOW trigger options in wiphy->wowlan.flags
variable during wiphy registration. So that, those options can be
configured via iw.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 13:00:00 +02:00
Raja Mani 0737237411 ath6kl: Remove WARN_ON msg in Suspend path
In the current code, WOW resume is executed first from RX path
and ar->state is moved to ATH6KL_STATE_ON. When platform calls
ath6kl_sdio_resume() in CFG resume context, that time ar->state
could have moved to ON state. Printing WARN_ON(1) is void in
this context. Hence removing this.

Once WOW resume is removed from RX path, This WARN_ON msg can be
reverted.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 13:00:00 +02:00
Raja Mani a918fb3cc6 ath6kl: Perform WOW resume in RX path in case of SDIO IRQ wake up
The target triggers sdio data line to wake up the host when
WOW pattern matches. This causes sdio irq handler is being
executed in the host side which internally hits ath6kl's RX path.

WOW resume should happen before start processing any data from
the target. So it's required to perform WOW resume in RX path.

This area needs bit rework to avoid WOW resume in RX path,
As of now it's fine to have this model, rework will be done later.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 13:00:00 +02:00
Raja Mani d7c44e0ba5 ath6kl: Invoke WOW suspend/resume calls during PM operation
Link ath6kl's wow suspend/resume functions with the actual suspend/resume path.

WOW mode is selected when the host sdio controller supports both
MMC_PM_KEEP_POWER and MMC_PM_WAKE_SDIO_IRQ capabilities.

kvalo: also adds a missing break in ath6kl_cfg80211_resume(), luckily
it didn't have any effect on functionality.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 13:00:00 +02:00
Raja Mani 524441e3a7 ath6kl: Move ath6kl_cfg80211_stop() call specific to deep sleep and cut pwr
ath6kl_cfg80211_stop() call is not applicable for WOW mode. Hence moving
this call to deep sleep and cut pwr specific cases.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:59:59 +02:00
Raja Mani dd6c0c63b4 ath6kl: Add new state for WOW mode
In addition to existing deep sleep and cut pwr mode, new state
is added in ath6kl_cfg_suspend_mode as well as in ath6kl_state for WOW.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:59:59 +02:00
Raja Mani 0f60e9f4c2 ath6kl: Include new parameter in suspend path for wowlan
cfg80211 layer provides user defined wow parameters like Filter options, Patterns,
Pattern's mask, etc via "struct cfg80211_wowlan *wow" to suspend function.

Right now, this wowlan parameter is not handled in __ath6kl_cfg80211_suspend func.
This parameter has to be passed to HIF layer, So that it can be passed back to
ath6kl's cfg interface layer when WOW mode is selected.

In case of deep sleep and cut power mode, it's not handled.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:59:59 +02:00
Raja Mani 6cb3c714e7 ath6kl: Add WOW suspend/resume implementation
This is the core WOW suspend/resume functions will be called
in PM suspend/resume path.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:59:59 +02:00
Raja Mani 45cf110b2b ath6kl: Add wmi functions to configure WOW mode and host sleep mode
It will be used in WOW suspend/resume functions to
active/deactivate WOW suspend mode.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:59:59 +02:00
Raja Mani 5c9b4fa19a ath6kl: Add wmi functions to add/delete WOW patterns
These commands will be used in WOW suspend/resume functions
to configure WOW parameters like patterns to be matched
and it's mask value, etc.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:59:59 +02:00
Jouni Malinen f3e61eceb2 ath6kl: Do not hide ath6kl_wmi_addkey_cmd() error values
Instead of converting any error to EIO, just return the real error
value to upper layers.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:59:59 +02:00
Jouni Malinen f4bb9a6fbc ath6kl: Fix key configuration to copy at most seq_len from seq
There is no guarantee on the caller using 8-octet buffer for
key->seq, so better follow the key->seq_len parameter on figuring
out how many octets to copy.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:59:59 +02:00
Jouni Malinen 1ddc3377e1 ath6kl: Remove unused WMI crypto defines
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:59:58 +02:00
Kalle Valo 8277de15ef ath6kl: add suspend_cutpower module parameter
This is to force ath6kl to power off hardware during suspend even if
sdio support keep power. This is needed, for example, when sdio
controller is buggy or maximum powersaving is desired.

Usage:

insmod ath6kl.ko suspend_cutpower=1

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:59:58 +02:00
Kalle Valo cf97fa9fdf ath6kl: don't power down hardware when interface is down
Jouni reported that my patch "ath6kl: power down hardware when interface
is down" caused a regression on his x86 boxes and scan didn't work anymore.
I was able to reproduce the problem by disabling all debug messages.

So there has to be a race condition somewhere in the code and disable the
functionality until the race is fixed. Now hardware is powered from the
point where module is loaded until it's removed.

Reported-by: Jouni Malinen <jouni@qca.qualcomm.com>
Tested-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:59:00 +02:00
Vasanthakumar Thiagarajan 11f6e40d9f ath6kl: Fix lockdep warning
The following is the lockdep warning which detects possible
deadlock condition with the way ar->lock and ar->list_lock
are being used.

  (&(&ar->lock)->rlock){+.-...}, at: [<ffffffffa0492d13>] ath6kl_indicate_tx_activity+0x83/0x110 [ath6kl]
 but this lock took another, SOFTIRQ-unsafe lock in the past:
  (&(&ar->list_lock)->rlock){+.+...}

 and interrupts could create inverse lock ordering between them.

 other info that might help us debug this:
  Possible interrupt unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(&(&ar->list_lock)->rlock);
                                local_irq_disable();
                                lock(&(&ar->lock)->rlock);
                                lock(&(&ar->list_lock)->rlock);
   <Interrupt>
     lock(&(&ar->lock)->rlock);

  *** DEADLOCK ***

softirqs have to be disabled when acquiring ar->list_lock to avoid
the above deadlock condition. When the above warning printed the
interface is still up and running without issue.

Reported-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:59:00 +02:00
Kalle Valo b4b2a0b116 ath6kl: cut power during suspend
If sdio controller doesn't support keep power, cut power from hardware
during suspend and restart firmware during resume. If we are connected
during suspend, send a disconnected event to user space.

Earlier suspend failed with an error if sdio didn't support keep power.
Now suspend will happen succesfully even with that case.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:59:00 +02:00
Kalle Valo e28e810486 ath6kl: refactor sdio configuration to a separate function
These commands are also needed after cutpower suspend so create
a function for them. Also fix memory leaks in ath6kl_sdio_probe() error
path.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:59:00 +02:00
Kalle Valo 76a9fbe27e ath6kl: add state variable depicting hw/fw state
This way it's easier to track state changes and in the future add
more warnings about using hardware in wrong states. Currently there
are few random flags for trying to do the same, those will be cleaned
and removed in the future.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:59:00 +02:00
Kalle Valo 52d81a6883 ath6kl: implement ath6kl_cfg80211_suspend()
This is in preparation for cutpower suspend feature. HIF layer makes
the decision based on information provided by cfg80211 and what hardware
actually supports. Then it calls ath6kl_cfg80211_suspend() to enable
the chosen mode.

Functionality should be the same, this is just preparation for
more suspend modes (cutpower and wow).

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:59:00 +02:00
Kalle Valo 1f40525512 ath6kl: reset CONNECT_PEND and CONNECTED flags in ath6kl_cfg80211_stop()
Otherwise first connection establish after cutpower suspend will
fail.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:59:00 +02:00
Kalle Valo ec4b7f602d ath6kl: create ath6kl_cfg80211_stop()
Just take code from deep sleep for now, will be improved later. No
functional changes.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:59 +02:00
Kalle Valo 1c17d31389 ath6kl: add aborted parameter to ath6kl_cfg80211_scan_complete_event()
Currently it takes an error code as status, but what we really want to
tell is if the scan was aborted or not.

Also fix a bug where we were comparing firmware scan status values
with kernel error codes, which is obviously wrong. This meant
that ath6kl didn't detect when firmware informed about failed scans. I
doubt that this fix doesn't make any difference in practise but it
still needs to be fixed. This is fixed by adding an enum for the success
status code and checking for that.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:59 +02:00
Kalle Valo 2387f0dcd1 ath6kl: print seqno in htc debug logs
Makes it easier to debug where frames are going.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:59 +02:00
Kalle Valo 6250aac6df ath6kl: print firmware crashes always
Currently firmware crash dump is printed only if debug is enabled.
Change it so that the crash dump is always printed.

Also move the code from init.c to hif.c.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:59 +02:00
Kalle Valo 68469341f3 ath6kl: fix WLAN_ENABLE usage in ath6kl_close()
If ath6kl_init_hw_stop() failed with an error WLAN_ENABLED would not
be cleared. Found during code review and just a theoretical issue.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:59 +02:00
Kalle Valo 5fe4dffbc1 ath6kl: power down hardware when interface is down
The benefit from this is that user space can control hardware's power state
by putting interface up and down. This is handy if firmware gets to some
weird state.

The downside will be that putting interface up takes a bit longer,
I was measuring ~500 ms during interface up.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:59 +02:00
Kalle Valo 32a07e4448 ath6kl: create ath6kl_hif_stop()
This is to reset hif layer for powering down hw.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:58 +02:00
Kalle Valo cd4b8b8580 ath6kl: change name of sdio driver to ath6kl
Currently the name of the driver in struct sdio_driver is "ath6kl_sdio",
this is for example what uevent advertises. This is wrong as the module
is named as ath6kl.ko. Change it to "ath6kl" so that the names match.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:58 +02:00
Kalle Valo 778e650241 ath6kl: don't print an error for canceled packets
ath6kl_tx_complete() was printing an error when packet was canceled.
That causes unnecessary errors when hardware is powered off.

Also change the error to a warning and cleanup the message.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:58 +02:00
Kalle Valo 8a8109169b ath6kl: create ath6kl_htc_reset()
When rebooting hardware we need to reset the htc state in ath6kl_htc_stop().

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:58 +02:00
Kalle Valo d60e8ab6b9 ath6kl: add a timeout to ath6kl_hif_intr_bh_handler()
It's possible to busyloop forever in ath6kl_hif_intr_bh_handler(). Add
a check that it lasts only one second.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:57 +02:00
Kalle Valo 0c30295e4f ath6kl: remove useless cleanup call from ath6kl_bmi_done()
aht6kl core code will call the cleanup function when the device is removed.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:57 +02:00
Kalle Valo 20459ee274 ath6kl: separate hardware boot code from module initialisation code
Refactor the code needed to boot the hardware to a separate function so
that it will be easier boot and shutdown hardware.

No functional changes (hopefully).

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:57 +02:00
Kalle Valo 61448a93ef ath6kl: merge ath6kl_init() to ath6kl_core_init()
In preparation for splitting module initialisation and hardware boot
code from each other.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:56 +02:00
Kalle Valo 4e3d54c7ab ath6kl: add a fixme to ath6kl_htc_wait_target()
This doesn't look right, but investigate it later.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:56 +02:00
Kalle Valo b2e756989e ath6kl: move power control from sdio to core
In preparation for cutting down power from the chip on the fly.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:55 +02:00
Kalle Valo c89c591d19 ath6kl: rename ath6kl_wmi_qos_state_init() to _wmi_reset()
Just to make it more clear that this function is supposed to
reset wmi related variables.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:55 +02:00
Kalle Valo cb93821a9e ath6kl: don't use cfg80211_scan_request after cfg80211_scan_done()
Use of cfg80211_scan_request is not valid after calling cfg80211_scan_done()
but ath6kl_cfg80211_scan_complete_event() was doing exactly that. Change
the function to call cfg80211_scan_done() last.

This was found during code review, I didn't see any visible problems
due to this bug.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:55 +02:00
Aarthi Thiruvengadam 3101edef5c ath6kl: fix missing copy of action frame contents
The wpa_supplicant was receiving incorrect frame contents in the
callback function that indicates the status of the frame transmitted.
This patch fixes a missing copy of the frame contents to a local
buffer. The local buffer keeps track of the last sent management frame.

Signed-off-by: Aarthi Thiruvengadam <athiruve@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:55 +02:00
Jouni Malinen 1052261e4b ath6kl: Report unique remain-on-channel cookie values
Even though only a single concurrent remain-on-channel operation is
supported, there may be two pending remain-on-channel events (one to
indicate end of a canceled operation and another to indicate start of a
new operation). User space won't be able to distinguish these events
unless unique cookies are used.

The previous behavior resulted in wpa_supplicant getting quite
confused about the driver's offchannel state in various sequences
and this made the P2P state machine behave incorrectly. Use of
more than a single remain-on-channel cookie value fixes this.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:55 +02:00
Sangwook Lee f7830202c3 ath6kl: Fix compilation error from of.h
When compiling ath6kl for ARM with device tree tree compilation fails
with errors like:

include/linux/of.h: In function 'of_property_read_u32_array':
include/linux/of.h:249:10: error: 'ENOSYS' undeclared

Workaround this by including errno.h from init.c.

kvalo: improved commit log

Signed-off-by: Sangwook Lee <sangwook.lee@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:55 +02:00
Rishi Panjwani a24fc7c353 ath6kl: Implement support for power parameter control from userspace
In order to allow user space based control of power parameters, we use
available debugfs infrastructure. With these features user can control
power consumption by adjusting various sleep/wake up related parameters.
The feature has been added for testing purposes. All 5 parameters are
mandatory in correct order. They have to be written to the power_params
file. These are:

1) idle_period
2) no_of_pspoll
3) dtim_policy
4) tx_wakeup_policy
5) no_tx_to_wakeup

Example:

echo "200 1 0 1 1" > power_params

Signed-off-by: Rishi Panjwani <rpanjwan@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:55 +02:00
Rishi Panjwani ef8f0eba5a ath6kl: Implement support for listen interval from userspace
In order to allow user space based control of listen interval, we use
available debugfs infrastructure. Listen interval implies how frequently
we want the WLAN chip to wake up and synchronize the beacons in case it
is in sleep mode. The command requires two parameters in the following order:

1) listen_interval_time
2) listen_interval_beacons

The user has to write the listen interval_time (in msecs) and
listen_interval_beacons (in no. of beacons) to the listen_interval file in
ath6kl debug directory.

Example:

echo "30 1" > listen_interval

Signed-off-by: Rishi Panjwani <rpanjwan@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:55 +02:00
Aarthi Thiruvengadam 635412127e ath6kl: add support for WPS
Add control flag CONNECT_WPS_FLAG if a WPS IE is present in the
Association Request IEs. This flag is needed when the station must
connect to a WPS-enabled AP.

Signed-off-by: Aarthi Thiruvengadam <athiruve@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:54 +02:00
Kalle Valo 3ef987bee7 ath6kl: add more boot debug messages
Move some of the debug logs to boot level because they are more
interesting when debugging boot issues.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:54 +02:00
Kalle Valo 02f0d6fcab ath6kl: add debug messages for credit handling
Also take few from htc debug level which are more suitable for credit.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:54 +02:00
Kalle Valo d23ace77e2 ath6kl: remove unused debug levels
Few levels had only one user so I changed them to use WLAN_CFG.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:54 +02:00
Kalle Valo cb64a6105b ath6kl: use ath6kl_credit prefix consistently
Not all credit functions used that prefix, fix that.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:54 +02:00
Kalle Valo f2f921950d ath6kl: move all credit distribution code to htc.c
As htc is the only user there's no reason to keep it in main.c.

No functional changes.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:54 +02:00
Kalle Valo 3c3703987a ath6kl: rename struct htc_credit_state_info to ath6kl_htc_credit_info
Also rename cred_dist_cntxt to credit_info in struct htc_target.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:54 +02:00
Kalle Valo e8c39790d0 ath6kl: rename struct htc_endpoint_credit_dist.htc_rsvd to htc_ep
No need to use void pointer here.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:54 +02:00
Kalle Valo fa99e963b1 ath6kl: use ath6kl prefix in credit functions
This is to follow the common style in the driver. Also add braces to
fix a style issue.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:53 +02:00
Kalle Valo a9ab6ccf2d ath6kl: remove unused A_CACHE_LINE_PAD
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:53 +02:00
Vasanthakumar Thiagarajan 551959d84d ath6kl: Use appropriate wdev from vif
Remove the wdev reference in struct ath6kl.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:53 +02:00
Vasanthakumar Thiagarajan 0ce5944552 ath6kl: Initialize target wlan values for every vif
Wlan parameters need to be configured for every vif
in target.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:53 +02:00
Vasanthakumar Thiagarajan 3226f68af4 ath6kl: Add a modparam to enable multi normal interface support
This option lets operate more than one vif in normal mode (AP/STA/IBSS)
when support for multiple vif is enabled. This modparam needs to be used
as

modprobe ath6kl multi_norm_if_support=1

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:52 +02:00
Vasanthakumar Thiagarajan 55055976fe ath6kl: Implement add_virtual_intf() and del_virtual_intf()
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:52 +02:00
Vasanthakumar Thiagarajan 7b85832dfb ath6kl: Configure inteface information at init time
Virtual interface information need to be configured during
init time to the target. With MAX_NUM_VIF is restricted to
1, currently only a single vif is being configured.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:52 +02:00
Vasanthakumar Thiagarajan 2792972395 ath6kl: Use the other variant of netdev (un)register APIs
Use replace (un)register_netdev() with (un)register_netdevice()
so that the same ath6kl function can be used with
add_virtual_intf()/del_virtual_intf().

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:52 +02:00
Vasanthakumar Thiagarajan 990bd91519 ath6kl: Maintain virtual interface in a list
This patch removes all references to ar->vif and takes
vif from a list.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:52 +02:00
Vasanthakumar Thiagarajan 478ac02721 ath6kl: Introduce spinlock to protect vif specific information
Use this spinlock to protect the vif's data instead of
one from ath6kl.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:50 +02:00
Vasanthakumar Thiagarajan d66ea4f9d6 ath6kl: Store hw mac address in struct ath6kl
WMI ready event gives the mac address, cache this
mac address in struct ath6kl so that it can be used to
compute the mac address for other vif in case of multi vif.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:50 +02:00
Vasanthakumar Thiagarajan 6765d0aa5f ath6kl: Use interface index from wmi data headr
Interface index is passed in wmi data header as well, use it
to get the corresponding vif structure.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:49 +02:00
Vasanthakumar Thiagarajan 6db8fa53ad ath6kl: Refactor ath6kl_destroy()
So that the deinitialization of ath6kl and vif are separated.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:49 +02:00
Vasanthakumar Thiagarajan e29f25f5cd ath6kl: Cleanup parameters in ath6kl_init_control_info() and ath6kl_init_profile_info()
Pass vif structure to those functions instead of ath6kl because these
functions do vif specific information initialization.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:49 +02:00
Vasanthakumar Thiagarajan 28ae58dd1f ath6kl: Remove net_device from ath6kl
Use one which is available in vif structure instead.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:48 +02:00
Vasanthakumar Thiagarajan 240d279940 ath6kl: Take vif information from wmi event
Interface index is passed in wmi command header from target.
Use this index to get the appropriate vif.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:48 +02:00
Vasanthakumar Thiagarajan 334234b514 ath6kl: Maintain firmware interface index in struct ath6kl_vif
Pass this index to target in wmi commands to specify the interface
for which the command needs to be handled.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:48 +02:00
Vasanthakumar Thiagarajan b95907a744 ath6kl: Make net and target stats vif specific
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:48 +02:00
Vasanthakumar Thiagarajan cf5333d70f ath6kl: Move few more vif specific information to struct ath6kl_vif
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:48 +02:00
Vasanthakumar Thiagarajan 14ee6f6b7d ath6kl: Move scan_req info and sme_state to vif
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:48 +02:00
Vasanthakumar Thiagarajan de3ad7138c ath6kl: Move disconnect timer to vif structure
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:48 +02:00
Vasanthakumar Thiagarajan 2132c69cb9 ath6kl: Move aggregation information to vif structure
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:47 +02:00
Vasanthakumar Thiagarajan 6f2a73f9e5 ath6kl: Move key information to vif structure
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:47 +02:00
Vasanthakumar Thiagarajan f74bac54a5 ath6kl: Move channel information to vif structure
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:47 +02:00
Vasanthakumar Thiagarajan 8c8b65e3e3 ath6kl: Move bssid information to vif structure
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:47 +02:00
Vasanthakumar Thiagarajan f5938f249a ath6kl: Move nw_type to vif structure
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:47 +02:00
Vasanthakumar Thiagarajan 3450334f39 ath6kl: Move ssid and crypto information to vif structure
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:47 +02:00
Vasanthakumar Thiagarajan 59c98449b8 ath6kl: Define interface specific states
Currently ar->flag maintains interface stats. Move interface
specific states from ar->flag to vif->flags.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:47 +02:00
Vasanthakumar Thiagarajan 108438bc6a ath6kl: Define an initial vif structure and use it
vif specific information need to be moved from struct ath6kl.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:46 +02:00
Vasanthakumar Thiagarajan dd3751f7b1 ath6kl: Cleanup fw interface type setting
It is not necessary to use ath6kl_get_fw_iftype() to find out the
firmware interface type during initialization because the type
of the initial interface in INFRA_NETWORK. Hardcode the fw interface
type corresponding to INFRA_BSS instead of using ath6kl_get_fw_iftype().

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:46 +02:00
Vasanthakumar Thiagarajan 8dafb70edc ath6kl: Refactor wiphy dev and net dev init functions
This refactoring is done in a manner that it can be used
for multiple virtual interface.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:46 +02:00
Vasanthakumar Thiagarajan be98e3a48c ath6kl: Keep wiphy reference in ath6kl structure
This is to avoid using ar->wdev to get wiphy pointer, this
may need further cleanup for multi vif support.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:58:45 +02:00
Vasanthakumar Thiagarajan 521dffcc8a ath6kl: Pass ath6kl structure to ath6kl_init() instead of net_device
ar is again taken from private area of net_device in ath6kl_init(), pass
ar directly.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:58 +02:00
Rishi Panjwani 116b3a2e0f ath6kl: Implement support for background scan control from userspace
In order to allow user space based control of background scan interval,
we use available debugfs infrastructure. The feature has been added for
testing purposes. The user has to write the bgscan interval (in secs) to
the bgscan_interval file in ath6kl debug directory. To disable bgscan,
a '0' is to be written to the bgscan_interval file.

Example:

echo "2" > bgscan_interval

This will make the background scan interval as 2 seconds

kvalo: changed implementation so that there's only one call to
ath6kl_wmi_scanparams_cmd()

Signed-off-by: Rishi Panjwani <rpanjwan@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:57 +02:00
Kalle Valo 83973e0357 ath6kl: add debug level for hif
That way we htc level debug messages can be removed from hif files. Also
add few new messages and remove useless debug message about using
synchrous irq processing (we don't support anything else).

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:57 +02:00
Kalle Valo b1e03f8acf ath6kl: don't dump full htc packets
It's currently possible to dump full sdio packets, so dumping htc packets
is not strictly needed. So remove it, we can always add it back if
there ever comes a need for that.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:57 +02:00
Kalle Valo 471e92fdfb ath6kl: cleanup htc debug messages
Unify debug message format and other minor changes.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:57 +02:00
Kalle Valo ebf29c95cf ath6kl: merge htc debug levels
It's not really necessary to have separate debug levels for htc tx and rx
so combine them.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:57 +02:00
Rishi Panjwani 8fffd9e5ec ath6kl: Implement support for QOS-enable and QOS-disable from userspace
In order to allow user space based QOS control we use the available debugfs
infrastructure. With this feature, user can make changes to qos parameters,
thereby allowing creation and deletion of user defined priority streams and
features like uapsd. This feature has been added for testing purposes.

All 21 parameters for the create_qos command are mandatory in the correct
order. They have to be written to the create_qos file in
the ath6kl debug directory. These parameters(in order) are:

1)user priority
2)direction
3)traffic class
4)traffic type
5)voice PS capability
6)min service intvl
7)max service intvl
8)inactivity intvl
9)suspension intvl
10)serv start time
11)tsid
12)nominal msdu
13)max msdu
14)min data rate
15)mean data rate
16)peak data rate
17)max burst size
18)delay bound
19)min phy rate
20)surplus bw allowance
21)medium time

To create a qos stream:

echo "6 2 3 1 1 9999999 9999999 9999999 7777777 0 6 45000 200 56789000
56789000 5678900 0 0 9999999 20000 0" > create_qos

delete_qos requires 2 parameters:

1)traffic class
2)tsid

To delete a qos stream:

echo "3 1" > delete_qos

kvalo: minor commit log cleanup

Signed-off-by: Rishi Panjwani <rpanjwan@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:57 +02:00
Jouni Malinen 171693292e ath6kl: Fix endpoint_stats debugfs buffer length calculation
The previous version did not really make much sense and the theoretical
maximum length would be a bit longer. Calculate the length more
accurately. In addition, there is no need to clear the buffer, so use
kmalloc instead of kzalloc. For bonus points, add the forgotten
cred_rpt_from_other value to the file.

Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:57 +02:00
Sam Leffler 17380859a8 ath6kl: unbreak suspend
Add missing {}'s that caused ath6kl_sdio_suspend to always return -EINVAL
causing suspend to be aborted.

kvalo: I broke this in commit f7325b85e ("ath6kl: add sdio debug messages")

Signed-off-by: Sam Leffler <sleffler@chromium.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:57 +02:00
Kalle Valo bef26a7fca ath6kl: fix firmware start address for ar6003 hw2.0
Sangwook found out that commit 639d0b89 ("ath6kl: read firmware start
address from hardware") broke firmware boot on ar6003 hw2.0 as it seems
it's not posible to automatically query the address from hardware. So
we need to hardcode the address for hw2.0.

Reported-by: Sangwook Lee <sangwook.lee@linaro.org>
Tested-by: Sangwook Lee <sangwook.lee@linaro.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:56 +02:00
Jouni Malinen 837cb97e5b ath6kl: Allow CCKM AKM and KRK to be configured
Use vendor-specific suite selectors to allow CCKM to be configured.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:56 +02:00
Jouni Malinen ff0b007573 ath6kl: Add debugfs control for keepalive and disconnection timeout
The new debugfs files keepalive and disconnect_timeout can be used to
fetch the current values and to change the values for keepalive and
disconnect event timeout (both in seconds).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:56 +02:00
Jouni Malinen 1261875f7a ath6kl: Add debugfs files for roaming control
Roaming mode can be changed by writing roam mode (default, bssbias, or
lock) to roam_mode. Forced roam can be requested by writing the BSSID
into force_roam.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:56 +02:00
Jouni Malinen 4b28a80dd6 ath6kl: Add debugfs file for target roam table
The new roam_table debugfs file can be used to display the current
roam table from the target.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:56 +02:00
Jouni Malinen e8091281f5 ath6kl: Add endpoint_stats debugfs file
This file can be used to fetch endpoint statistics counters and
to clear them by writing 0 to it.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:56 +02:00
Kevin Fang 6981ffdc2f ath6kl: Add WSC IE on the associate message
For some WPS test items, such as item "5.1.14"
STAUT must include the WSC IE in the 802.11 Association Request frame.
Therefore, add the corresponding IE in association message.

Signed-off-by: Kevin Fang <kevin.fang@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:56 +02:00
Kalle Valo ad3f78b99e ath6kl: fix null skb dereference in ath6kl_rx()
smatch found that skb might be null in some cases in ath6kl_rx():

ath6kl/txrx.c +1252 ath6kl_rx(222) error: potential null derefence 'skb'.

This will happen when ath6kl is in AP mode and two clients send traffic
to each other.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:56 +02:00
Kalle Valo 2e1cb23c5e ath6kl: move remaining content from htc_hif.h to hif.h
Now htc_hif.h can be removed.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:55 +02:00
Kalle Valo 533cbbb686 ath6kl: remove unused values from htc_hif.h
Also remove some cache line optimisation. It was using hardcoded values
which is wrong.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:55 +02:00
Kalle Valo 8e8ddb2b8d ath6kl: move htc_hif to hif.c
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:55 +02:00
Kalle Valo b4be8959c2 ath6kl: return error block size is not power of 2
Currently only a warning is emitted but no error is returned.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:55 +02:00
Kalle Valo cbf49a6fff ath6kl: fix struct host_app_area endian handling
It was missing endian annotation.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:55 +02:00
Kalle Valo a7f0c58b89 ath6kl: remove unused parameters from struct wmi
There's no use for these, at least right now, so better to remove them.
If some of them are ever needed, we can always add them back.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:55 +02:00
Chilam Ng aa6cffc1a2 ath6kl: make sure WLAN power save is enabled during suspend
Power save is enabled during ath6kl init. But when user space disables power
save, the system will go into suspend with power save disabled. The ath6kl
driver will now explicitly enable power save prior to entering suspend and
restore its previous setting upon resume

Signed-off-by: Chilam Ng <chilamng@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:55 +02:00
Vasanthakumar Thiagarajan 4533d901a4 ath6kl: Minor cleanup in msg_look_ahead parameter in ath6kl_htc_rxmsg_pending_handler()
It is just a four byte information of the received message
from ath6kl_htc_rxmsg_pending_handler(). Remove unnecessary
array representaion.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:55 +02:00
Vasanthakumar Thiagarajan 99f54299b9 ath6kl: Avoid processing failed rx packets
It is not necessary to process an htc_packet which is allocated for rx
but failed in sdio rx. Though it does not fix any real issue, it does
not make much sense to process the failed frame.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:54 +02:00
Vasanthakumar Thiagarajan b8d5d5ff03 ath6kl: Fix htc_packet leak in ath6kl_htc_rx_fetch()
It is found during the code review. As the leak would happen only
in failure case, the imapct is not easily visible.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:54 +02:00
Vasanthakumar Thiagarajan 4159cc935a ath6kl: Fix htc_packet leak in ath6kl_htc_rx_process_packets()
Packet is not reclaimed when ath6kl_htc_rx_process_hdr() fails.
Fix this by deferring the packet deletion from comp_pktq till
ath6kl_htc_rx_process_hdr() returns success. This bug is found
in code review, impact is not easily visible as the leak happens
only in failure cases.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:54 +02:00
Vasanthakumar Thiagarajan 861dd058f4 ath6kl: Claim sdio function only at appropriate places
There are places where tx_complete callbacks are called with
claiming the sdio function. It is not necessary to hold the
sdio func for longer. This may even affect the host side power
save, if it is supported by the controller.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:54 +02:00
Vasanthakumar Thiagarajan 151bd30bdf ath6kl: Replace spin_lock_irqsave with spin_lock_bh
It is not necessary to use spinlock primitive to
protect data which is accessed in hard irq context as
nothing is running in hard irq with this driver. The
spinlock primitive meant to protect data in softirq
context is more appropriate.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-11-11 12:50:54 +02:00