dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

73 Commits

Author SHA1 Message Date
Rusty Russell 3db1cd5c05 net: fix assignment of 0/1 to bool variables.
DaveM said:
   Please, this kind of stuff rots forever and not using bool properly
   drives me crazy.

Joe Perches <joe@perches.com> gave me the spatch script:

	@@
	bool b;
	@@
	-b = 0
	+b = false
	@@
	bool b;
	@@
	-b = 1
	+b = true

I merely installed coccinelle, read the documentation and took credit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-19 22:27:29 -05:00
Johannes Berg 7c4ef7122c cfg80211: add flags for off-channel capabilities
Currently mac80211 implements these for all devices,
but given restrictions of some devices that isn't
really true, so prepare for being able to remove the
capability for some mac80211 devices.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-21 16:20:49 -05: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 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 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 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 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 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
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
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 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
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 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 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 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 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
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
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
Johannes Berg 562a74803f nl80211: advertise device AP SME
Add the ability to advertise that the device
contains the AP SME and what features it can
support. There are currently no features in
the bitmap -- probe response offload will be
advertised by a few patches Arik is working
on now (who took over from Guy Eilam) and a
device with AP SME will typically implement
and require response offload.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-09 16:12:38 -05:00
Kalle Valo ef54862642 ath6kl: fix size_t related warnings
My earlier debug log additions added these warnings when compiling 64 bit
kernels:

ath6kl/init.c:962: warning: format '%d' expects type 'int',
  but argument 3 has type 'size_t'
ath6kl/init.c:975: warning: format '%d' expects type 'int',
  but argument 3 has type 'size_t'
ath6kl/init.c:988: warning: format '%d' expects type 'int',
  but argument 3 has type 'size_t'
ath6kl/init.c:1009: warning: format '%d' expects type 'int',
  but argument 3 has type 'size_t'
ath6kl/init.c:1192: warning: format '%d' expects type 'int',
  but argument 4 has type 'size_t'
ath6kl/init.c:1236: warning: format '%d' expects type 'int',
  but argument 4 has type 'size_t'
ath6kl/init.c:1267: warning: format '%d' expects type 'int',
  but argument 4 has type 'size_t'

Reported-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-10-01 12:05:36 +03:00
Stephen Rothwell c6efe578fc wireless/ath6kl: use of module_param requires the inclusion of moduleparam.h
Otheriwse the module.h split up fails like this:

drivers/net/wireless/ath/ath6kl/init.c:27:26: error: expected ')' before 'uint'

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-09-28 19:32:59 +03:00
Kalle Valo 6bc364315a ath6kl: add debug logs for booting
Just to make it easier to find out why boot fails.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-09-28 19:27:31 +03:00
Kalle Valo 1b4304da0a ath6kl: allow firmware to override firmware patch address
In some firmware versions their patch address has changed. If the firmware
provides one, use it to override the default address.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-09-27 21:25:12 +03:00
Vivek Natarajan 011a36e119 ath6kl: Indicate the roaming capability of the firmware
When the rssi of the current AP drops, both wpa_supplicant and the
firmware may do a background scan to find a better AP and try to
associate. This might lead to a race condition where both may try
to connect to some AP based on their scan results.

Since the firmware is capable of handling roaming, let
wpa_supplicant know about this capability so that it will back off
from bgscan based roaming.

Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-09-22 10:36:53 +03:00
Jouni Malinen 457fb0415a ath6kl: Remove the unused node table implementation
Now that the scan results are reported directly to the cfg80211 BSS
table there is no need for maintaining this internal node table
implementation for scan results. Remove the definitions and node
table functions.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-09-22 10:07:59 +03:00
Vasanthakumar Thiagarajan ac59a2b285 ath6kl: Remove auth type fall back in auto authentication mode
Target already tries with different authentication mechanism
when authentication type is configured to NL80211_AUTHTYPE_AUTOMATIC.
Remove this piece of code from driver. Having this code in driver
even affects auto + WEP authentication in some cases.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-09-16 18:49:26 +03:00
Kalle Valo 97e0496d05 ath6kl: add firmware capabilities support
The new firmware format includes capability bits which make it
possible to check what features the firmware supports. Add infrastructure
to read the capabilities. For now it only provides
ATH6KL_FW_CAPABILITY_HOST_P2P which is not even used anywhere yet, but that
will be added later.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-09-16 18:48:34 +03:00
Kalle Valo 8a13748034 ath6kl: read reserved ram size from firmware file
A new version of firmware needs different reserved ram size so read that
from the firmware image.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-09-16 18:48:34 +03:00
Kalle Valo 639d0b8996 ath6kl: read firmware start address from hardware
It's actually possible to read the firmware start address from hardware,
that way there's no need to hardcode the address in hardware.

Thanks to Chilam Ng for the idea.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-09-16 18:48:34 +03:00
Kalle Valo 991b27eaf9 ath6kl: refactor firmware ext data addr and reserved ram handling size
Less if clauses this way and again easier to override the values.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2011-09-16 18:48:34 +03:00