GitHub/LineageOS/android_kernel_motorola_exynos9610.git
12 years agoath6kl: add USB support
Kalle Valo [Fri, 11 Nov 2011 10:18:29 +0000 (12:18 +0200)]
ath6kl: add USB support

Add USB support for ar6004. Currently only firmware can be booted,
no commands can be sent to firmware yet as HTC layer doesn't work
with USB yet.

Based on patches by Kevin Fang.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: add hif_type
Kalle Valo [Fri, 11 Nov 2011 10:18:22 +0000 (12:18 +0200)]
ath6kl: add hif_type

In some rare cases core code needs to know what hif type is used. Add
a field to struct ath6kl to denote that. Hopefully this is just a
temporary solution.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: AR6004 SDIO support
Naveen Gangadharan [Fri, 11 Nov 2011 10:18:14 +0000 (12:18 +0200)]
ath6kl: AR6004 SDIO support

Add support for AR6004 SDIO. Tested scan, association (open mode) and
ping.

kvalo: change commit log a bit, drop board address changes

Signed-off-by: Naveen Gangadharan <ngangadh@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: firmware boot fixes for ar6004
Kalle Valo [Fri, 11 Nov 2011 10:18:06 +0000 (12:18 +0200)]
ath6kl: firmware boot fixes for ar6004

These have changed a bit since last time ar6004 code was commited.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: update ar6004 definitions
Kalle Valo [Fri, 11 Nov 2011 10:17:59 +0000 (12:17 +0200)]
ath6kl: update ar6004 definitions

Add also hw 1.1.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: move diag commands to hif driver
Kalle Valo [Fri, 11 Nov 2011 10:17:51 +0000 (12:17 +0200)]
ath6kl: move diag commands to hif driver

This is preparation for USB support which will have different diag
commands.

Based on code by Kevin Fang.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: change bmi sizes being configurable by HIF
Kalle Valo [Fri, 11 Nov 2011 10:17:42 +0000 (12:17 +0200)]
ath6kl: change bmi sizes being configurable by HIF

SDIO and USB have different maximum sizes for BMI commands so make that
configurable.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: move bmi calls to hif driver
Kalle Valo [Fri, 11 Nov 2011 10:17:33 +0000 (12:17 +0200)]
ath6kl: move bmi calls to hif driver

In preparation for USB support which has it's own method for bmi.

Based on code by Kevin Fang.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Fix target minimum length requirement for WMI_SEND_PROBE_RESPONSE_CMDID
Aarthi Thiruvengadam [Wed, 9 Nov 2011 18:05:56 +0000 (10:05 -0800)]
ath6kl: Fix target minimum length requirement for WMI_SEND_PROBE_RESPONSE_CMDID

The firmware expects the minimum length of
WMI_SEND_PROBE_RESPONSE_CMDID to be 13. However, when the device is a
P2P GO and it needs to send a probe response to a non-P2P client,
there are no P2P IEs to be added, and therefore the length of the WMI
command is 12. This command gets rejected by the firmware. To fix
this, add an extra byte to satisfy the minimum length requirement.

Signed-off-by: Aarthi Thiruvengadam <athiruve@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Fix cfg80211 warning while starting IBSS mode
Raja Mani [Wed, 9 Nov 2011 11:32:23 +0000 (17:02 +0530)]
ath6kl: Fix cfg80211 warning while starting IBSS mode

When the connect event is received from the target in IBSS mode,
cfg80211_ibss_joined() is called without informing BSS info to
cfg80211 layer which internally hits the below WARN_ON message.

WARNING: at net/wireless/ibss.c:33 __cfg80211_ibss_joined+0x153/0x180 [cfg80211]()
[..]
[ 4916.845878] Call Trace:
[ 4916.845889]  [<c10427d2>] warn_slowpath_common+0x72/0xa0
[ 4916.845905]  [<f8bccc63>] ? __cfg80211_ibss_joined+0x153/0x180 [cfg80211]
[ 4916.845918]  [<f8bccc63>] ? __cfg80211_ibss_joined+0x153/0x180 [cfg80211]
[ 4916.845923]  [<c1042822>] warn_slowpath_null+0x22/0x30
[ 4916.845934]  [<f8bccc63>] __cfg80211_ibss_joined+0x153/0x180 [cfg80211]
[ 4916.845941]  [<c1025108>] ? default_spin_lock_flags+0x8/0x10
[ 4916.845952]  [<f8bb7fcd>] cfg80211_process_rdev_events+0x19d/0x220 [cfg80211]
[ 4916.845962]  [<f8bb669b>] cfg80211_event_work+0x2b/0x50 [cfg80211]
[ 4916.845968]  [<c105aae6>] process_one_work+0x116/0x3c0
[ 4916.845977]  [<f8bb6670>] ? cfg80211_get_dev_from_info+0x40/0x40 [cfg80211]
[ 4916.845982]  [<c105cdf0>] worker_thread+0x140/0x3b0
[ 4916.845986]  [<c105ccb0>] ? manage_workers+0x1f0/0x1f0
[ 4916.845991]  [<c1060c64>] kthread+0x74/0x80
[ 4916.845995]  [<c1060bf0>] ? kthread_worker_fn+0x160/0x160
[ 4916.846001]  [<c14e7bbe>] kernel_thread_helper+0x6/0x10
[ 4916.846005] ---[ end trace 769254924e409367 ]---

This patch make sures that BSS info is delivered via cfg80211_inform_bss()
to cfg80211 in advance before intimating IBSS status to cfg80211.

In addition to this, one debug message is also added to know
ad-hoc mode status (creator/joiner).

kvalo: change subject

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Fix packet drop when ath6kl_cookie runs out
Vasanthakumar Thiagarajan [Tue, 8 Nov 2011 14:31:25 +0000 (20:01 +0530)]
ath6kl: Fix packet drop when ath6kl_cookie runs out

"ath6kl: Maintain virtual interface in a list" mistakenly stops the
netq only when the mode is ibss. This causes packet drops in sta mode
when the available cookies (buffer abstraction in ath6kl and also used
for tx throttling) runs out for the highest priority traffic. This patch
just fixes this regression though the original code may still need fixes
which can be addressed in separate patches.

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>
12 years agoath6kl: Fix accessing wrong skb->data in ath6kl_tx_complete()
Vasanthakumar Thiagarajan [Mon, 7 Nov 2011 07:20:17 +0000 (12:50 +0530)]
ath6kl: Fix accessing wrong skb->data in ath6kl_tx_complete()

When buffer alignmnet is applied, the data pointer of skb taken from
cookie will no longer point to the first byte of the actual data.
But the skb->data pointer is used in ath6kl_tx_complete() to get
the index of the virtual interface which will not give the correct
interface index and sometimes may give the following WARN_ON() message.
Use packet->buf instead of skb->data to fix this.

WARNING: at drivers/net/wireless/ath/ath6kl/wmi.c:88 ath6kl_get_vif_by_index+0x5b/0x60 [ath6kl]()
Hardware name: 2842K3U
Modules linked in: ath6kl mmc_block cfg80211 binfmt_misc ppdev nfs nfsd lockd nfs_acl auth_rpcgss sunrpc exportfs snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_intel
+snd_hda_codec snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_dummy thinkpad_acpi snd_seq_oss snd_seq_midi snd_rawmidi joydev fbcon tileblit font bitblit softcursor
+snd_seq_midi_event snd_seq snd_timer snd_seq_device i915 uvcvideo drm_kms_helper drm psmouse serio_raw snd i2c_algo_bit sdhci_pci videodev intel_agp soundcore intel_gtt jmb38x_ms
+memstick sdhci snd_page_alloc nvram lp parport agpgart video ahci r8169 mii libahci [last unloaded: ath6kl]
Pid: 15482, comm: kworker/u:1 Tainted: G        W   3.1.0-rc10-wl+ #2
Call Trace:
 [<c0144d72>] warn_slowpath_common+0x72/0xa0
 [<fb7c94fb>] ? ath6kl_get_vif_by_index+0x5b/0x60 [ath6kl]
 [<fb7c94fb>] ? ath6kl_get_vif_by_index+0x5b/0x60 [ath6kl]
 [<c0144dc2>] warn_slowpath_null+0x22/0x30
 [<fb7c94fb>] ath6kl_get_vif_by_index+0x5b/0x60 [ath6kl]
 [<fb7c7028>] ath6kl_tx_complete+0x128/0x4d0 [ath6kl]
 [<c04df920>] ? mmc_request_done+0x80/0x80
 [<fb7b9e2e>] htc_tx_complete+0x5e/0x70 [ath6kl]
 [<c05e4cf6>] ? _raw_spin_unlock_bh+0x16/0x20
 [<fb7ce588>] ? ath6kl_sdio_scatter_req_add+0x48/0x60 [ath6kl]
 [<fb7b9f42>] htc_async_tx_scat_complete+0xb2/0x120 [ath6kl]
 [<fb7ce9e7>] ath6kl_sdio_scat_rw+0x87/0x370 [ath6kl]
 [<c0101e12>] ? __switch_to+0xd2/0x190
 [<c01397b5>] ? finish_task_switch+0x45/0xd0
 [<c05e272e>] ? __schedule+0x3ae/0x8b0
 [<fb7cf00a>] ath6kl_sdio_write_async_work+0x4a/0xf0 [ath6kl]
 [<c015d266>] process_one_work+0x116/0x3c0
 [<fb7cefc0>] ? ath6kl_sdio_read_write_sync+0xb0/0xb0 [ath6kl]
 [<c015f5b0>] worker_thread+0x140/0x3b0
 [<c015f470>] ? manage_workers+0x1f0/0x1f0
 [<c0163424>] kthread+0x74/0x80
 [<c01633b0>] ? kthread_worker_fn+0x160/0x160
 [<c05ebdc6>] kernel_thread_helper+0x6/0x10

Reported-by: Aarthi Thiruvengadam <athiruve@qca.qualcomm.com>
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Indicate WAPI IE from (Re)Association Request frame
Dai Shuibing [Thu, 3 Nov 2011 09:39:39 +0000 (11:39 +0200)]
ath6kl: Indicate WAPI IE from (Re)Association Request frame

This is needed to know whether the STA requests WAPI to be used and if
so, with what AKM and cipher.

Signed-off-by: Dai Shuibing <shuibing@qca.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Allow SMS4 to be configured in AP mode
Dai Shuibing [Thu, 3 Nov 2011 09:39:38 +0000 (11:39 +0200)]
ath6kl: Allow SMS4 to be configured in AP mode

Signed-off-by: Dai Shuibing <shuibing@qca.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Add support for configuring SMS4 keys
Dai Shuibing [Thu, 3 Nov 2011 09:39:37 +0000 (11:39 +0200)]
ath6kl: Add support for configuring SMS4 keys

Indicate support for WPI-SMS4 cipher and allow SMS4 keys to be
configured.

Signed-off-by: Dai Shuibing <shuibing@qca.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
13 years agoath6kl: Fix error in writing create_qos debugfs
Vasanthakumar Thiagarajan [Fri, 4 Nov 2011 13:04:55 +0000 (18:34 +0530)]
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>
13 years agoath6kl: Fix tx packet drop in AP mode with bridge
Vasanthakumar Thiagarajan [Fri, 4 Nov 2011 10:18:51 +0000 (15:48 +0530)]
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>
13 years agoath6kl: Remove few unused WMI stuff
Raja Mani [Mon, 7 Nov 2011 20:52:47 +0000 (22:52 +0200)]
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>
13 years agoath6kl: Expose ath6kl's WOW capabilities to cfg80211
Raja Mani [Mon, 7 Nov 2011 20:52:46 +0000 (22:52 +0200)]
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>
13 years agoath6kl: Remove WARN_ON msg in Suspend path
Raja Mani [Mon, 7 Nov 2011 20:52:46 +0000 (22:52 +0200)]
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>
13 years agoath6kl: Perform WOW resume in RX path in case of SDIO IRQ wake up
Raja Mani [Mon, 7 Nov 2011 20:52:46 +0000 (22:52 +0200)]
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>
13 years agoath6kl: Invoke WOW suspend/resume calls during PM operation
Raja Mani [Mon, 7 Nov 2011 20:52:46 +0000 (22:52 +0200)]
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>
13 years agoath6kl: Move ath6kl_cfg80211_stop() call specific to deep sleep and cut pwr
Raja Mani [Mon, 7 Nov 2011 20:52:46 +0000 (22:52 +0200)]
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>
13 years agoath6kl: Add new state for WOW mode
Raja Mani [Mon, 7 Nov 2011 20:52:45 +0000 (22:52 +0200)]
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>
13 years agoath6kl: Include new parameter in suspend path for wowlan
Raja Mani [Mon, 7 Nov 2011 20:52:45 +0000 (22:52 +0200)]
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>
13 years agoath6kl: Add WOW suspend/resume implementation
Raja Mani [Mon, 7 Nov 2011 20:52:45 +0000 (22:52 +0200)]
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>
13 years agoath6kl: Add wmi functions to configure WOW mode and host sleep mode
Raja Mani [Mon, 7 Nov 2011 20:52:45 +0000 (22:52 +0200)]
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>
13 years agoath6kl: Add wmi functions to add/delete WOW patterns
Raja Mani [Mon, 7 Nov 2011 20:52:45 +0000 (22:52 +0200)]
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>
13 years agoath6kl: Do not hide ath6kl_wmi_addkey_cmd() error values
Jouni Malinen [Wed, 2 Nov 2011 21:46:47 +0000 (23:46 +0200)]
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>
13 years agoath6kl: Fix key configuration to copy at most seq_len from seq
Jouni Malinen [Wed, 2 Nov 2011 21:45:55 +0000 (23:45 +0200)]
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>
13 years agoath6kl: Remove unused WMI crypto defines
Jouni Malinen [Wed, 2 Nov 2011 21:44:14 +0000 (23:44 +0200)]
ath6kl: Remove unused WMI crypto defines

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
13 years agoath6kl: add suspend_cutpower module parameter
Kalle Valo [Thu, 3 Nov 2011 10:18:31 +0000 (12:18 +0200)]
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>
13 years agoath6kl: don't power down hardware when interface is down
Kalle Valo [Thu, 3 Nov 2011 09:53:57 +0000 (11:53 +0200)]
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>
13 years agoath6kl: Fix lockdep warning
Vasanthakumar Thiagarajan [Tue, 1 Nov 2011 11:08:50 +0000 (16:38 +0530)]
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>
13 years agoath6kl: cut power during suspend
Kalle Valo [Tue, 1 Nov 2011 06:44:44 +0000 (08:44 +0200)]
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>
13 years agoath6kl: refactor sdio configuration to a separate function
Kalle Valo [Tue, 1 Nov 2011 06:44:36 +0000 (08:44 +0200)]
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>
13 years agoath6kl: add state variable depicting hw/fw state
Kalle Valo [Tue, 1 Nov 2011 06:44:28 +0000 (08:44 +0200)]
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>
13 years agoath6kl: implement ath6kl_cfg80211_suspend()
Kalle Valo [Tue, 1 Nov 2011 06:44:21 +0000 (08:44 +0200)]
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>
13 years agoath6kl: reset CONNECT_PEND and CONNECTED flags in ath6kl_cfg80211_stop()
Kalle Valo [Tue, 1 Nov 2011 06:44:13 +0000 (08:44 +0200)]
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>
13 years agoath6kl: create ath6kl_cfg80211_stop()
Kalle Valo [Tue, 1 Nov 2011 06:44:04 +0000 (08:44 +0200)]
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>
13 years agoath6kl: add aborted parameter to ath6kl_cfg80211_scan_complete_event()
Kalle Valo [Tue, 1 Nov 2011 06:43:56 +0000 (08:43 +0200)]
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>
13 years agoath6kl: print seqno in htc debug logs
Kalle Valo [Sun, 30 Oct 2011 19:16:49 +0000 (21:16 +0200)]
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>
13 years agoath6kl: print firmware crashes always
Kalle Valo [Sun, 30 Oct 2011 19:16:41 +0000 (21:16 +0200)]
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>
13 years agoath6kl: fix WLAN_ENABLE usage in ath6kl_close()
Kalle Valo [Sun, 30 Oct 2011 19:16:33 +0000 (21:16 +0200)]
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>
13 years agoath6kl: power down hardware when interface is down
Kalle Valo [Sun, 30 Oct 2011 19:16:15 +0000 (21:16 +0200)]
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>
13 years agoath6kl: create ath6kl_hif_stop()
Kalle Valo [Sun, 30 Oct 2011 19:15:57 +0000 (21:15 +0200)]
ath6kl: create ath6kl_hif_stop()

This is to reset hif layer for powering down hw.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
13 years agoath6kl: change name of sdio driver to ath6kl
Kalle Valo [Fri, 28 Oct 2011 13:23:26 +0000 (16:23 +0300)]
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>
13 years agoath6kl: don't print an error for canceled packets
Kalle Valo [Thu, 27 Oct 2011 15:49:08 +0000 (18:49 +0300)]
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>
13 years agoath6kl: create ath6kl_htc_reset()
Kalle Valo [Thu, 27 Oct 2011 15:49:00 +0000 (18:49 +0300)]
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>
13 years agoath6kl: add a timeout to ath6kl_hif_intr_bh_handler()
Kalle Valo [Thu, 27 Oct 2011 15:48:52 +0000 (18:48 +0300)]
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>
13 years agoath6kl: remove useless cleanup call from ath6kl_bmi_done()
Kalle Valo [Thu, 27 Oct 2011 15:48:45 +0000 (18:48 +0300)]
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>
13 years agoath6kl: separate hardware boot code from module initialisation code
Kalle Valo [Thu, 27 Oct 2011 15:48:37 +0000 (18:48 +0300)]
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>
13 years agoath6kl: merge ath6kl_init() to ath6kl_core_init()
Kalle Valo [Thu, 27 Oct 2011 15:48:29 +0000 (18:48 +0300)]
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>
13 years agoath6kl: add a fixme to ath6kl_htc_wait_target()
Kalle Valo [Thu, 27 Oct 2011 15:48:22 +0000 (18:48 +0300)]
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>
13 years agoath6kl: move power control from sdio to core
Kalle Valo [Thu, 27 Oct 2011 15:48:14 +0000 (18:48 +0300)]
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>
13 years agoath6kl: rename ath6kl_wmi_qos_state_init() to _wmi_reset()
Kalle Valo [Thu, 27 Oct 2011 15:48:00 +0000 (18:48 +0300)]
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>
13 years agoath6kl: don't use cfg80211_scan_request after cfg80211_scan_done()
Kalle Valo [Thu, 27 Oct 2011 15:47:46 +0000 (18:47 +0300)]
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>
13 years agoath6kl: fix missing copy of action frame contents
Aarthi Thiruvengadam [Thu, 27 Oct 2011 16:35:56 +0000 (09:35 -0700)]
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>
13 years agoath6kl: Report unique remain-on-channel cookie values
Jouni Malinen [Thu, 27 Oct 2011 13:00:13 +0000 (16:00 +0300)]
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>
13 years agoath6kl: Fix compilation error from of.h
Sangwook Lee [Wed, 26 Oct 2011 15:28:38 +0000 (16:28 +0100)]
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>
13 years agoath6kl: Implement support for power parameter control from userspace
Rishi Panjwani [Wed, 26 Oct 2011 02:52:41 +0000 (19:52 -0700)]
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>
13 years agoath6kl: Implement support for listen interval from userspace
Rishi Panjwani [Wed, 26 Oct 2011 00:26:29 +0000 (17:26 -0700)]
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>
13 years agoath6kl: add support for WPS
Aarthi Thiruvengadam [Tue, 25 Oct 2011 18:25:52 +0000 (11:25 -0700)]
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>
13 years agoath6kl: add more boot debug messages
Kalle Valo [Mon, 24 Oct 2011 09:18:07 +0000 (12:18 +0300)]
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>
13 years agoath6kl: add debug messages for credit handling
Kalle Valo [Mon, 24 Oct 2011 09:17:59 +0000 (12:17 +0300)]
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>
13 years agoath6kl: remove unused debug levels
Kalle Valo [Mon, 24 Oct 2011 09:17:51 +0000 (12:17 +0300)]
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>
13 years agoath6kl: use ath6kl_credit prefix consistently
Kalle Valo [Mon, 24 Oct 2011 09:17:28 +0000 (12:17 +0300)]
ath6kl: use ath6kl_credit prefix consistently

Not all credit functions used that prefix, fix that.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
13 years agoath6kl: move all credit distribution code to htc.c
Kalle Valo [Mon, 24 Oct 2011 09:17:20 +0000 (12:17 +0300)]
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>
13 years agoath6kl: rename struct htc_credit_state_info to ath6kl_htc_credit_info
Kalle Valo [Mon, 24 Oct 2011 09:17:12 +0000 (12:17 +0300)]
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>
13 years agoath6kl: rename struct htc_endpoint_credit_dist.htc_rsvd to htc_ep
Kalle Valo [Mon, 24 Oct 2011 09:17:04 +0000 (12:17 +0300)]
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>
13 years agoath6kl: use ath6kl prefix in credit functions
Kalle Valo [Mon, 24 Oct 2011 09:16:55 +0000 (12:16 +0300)]
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>
13 years agoath6kl: remove unused A_CACHE_LINE_PAD
Kalle Valo [Mon, 24 Oct 2011 09:16:44 +0000 (12:16 +0300)]
ath6kl: remove unused A_CACHE_LINE_PAD

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
13 years agoath6kl: Use appropriate wdev from vif
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:26 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Initialize target wlan values for every vif
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:25 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Add a modparam to enable multi normal interface support
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:24 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Implement add_virtual_intf() and del_virtual_intf()
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:23 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Configure inteface information at init time
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:22 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Use the other variant of netdev (un)register APIs
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:21 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Maintain virtual interface in a list
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:20 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Introduce spinlock to protect vif specific information
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:19 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Store hw mac address in struct ath6kl
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:18 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Use interface index from wmi data headr
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:17 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Refactor ath6kl_destroy()
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:16 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Cleanup parameters in ath6kl_init_control_info() and ath6kl_init_profile_info()
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:15 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Remove net_device from ath6kl
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:14 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Take vif information from wmi event
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:13 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Maintain firmware interface index in struct ath6kl_vif
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:12 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Make net and target stats vif specific
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:11 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Move few more vif specific information to struct ath6kl_vif
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:10 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Move scan_req info and sme_state to vif
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:09 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Move disconnect timer to vif structure
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:08 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Move aggregation information to vif structure
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:07 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Move key information to vif structure
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:06 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Move channel information to vif structure
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:05 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Move bssid information to vif structure
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:04 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Move nw_type to vif structure
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:03 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Move ssid and crypto information to vif structure
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:02 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Define interface specific states
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:01 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Define an initial vif structure and use it
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:04:00 +0000 (19:34 +0530)]
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>
13 years agoath6kl: Cleanup fw interface type setting
Vasanthakumar Thiagarajan [Tue, 25 Oct 2011 14:03:59 +0000 (19:33 +0530)]
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>