Commit graph

269672 commits

Author SHA1 Message Date
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