]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - wl12xx/wl12xx.git/log
wl12xx/wl12xx.git
11 years agomac80211: reject BA action frames if sent fron non HT STA R5.xx_Build-131 R5.xx_Build-132 R5.xx_Build-133 R5.xx_Build-134 R5.xx_Build-135 R5.xx_Build-136 R5.xx_Build-137 R5.xx_Build-138 R5.xx_Build-139 R5.xx_Build-141 R5.xx_Build-142 R5.xx_Build-143 R5.xx_Build-144 R5.xx_Build-145 R5.xx_Build-146 R5.xx_Build-147 R5.xx_Build-148 R5.xx_Build-149 R5.xx_Build-150 R5.xx_Build-151 R5.xx_Build-152 R5.xx_Build-153 R5.xx_Build-154 R5.xx_Build-155 R5.xx_Build-156 R5.xx_Build-157 R5.xx_Build-158 R5.xx_Build-159 R5.xx_Build-160 R5.xx_Build-161 R5.xx_Build-162 R5.xx_Build-163 R5.xx_Build-164 R5.xx_Build-165 R5.xx_Build-166 R5.xx_Build-167 R5.xx_Build-168 R5.xx_Build-169 R5.xx_Build-170 R5.xx_Build-171 R5.xx_Build-172 R5.xx_Build-173 R5.xx_Build-174 R5.xx_Build-175 R5.xx_Build-182 R5.xx_Build-187 R5.xx_Build-188 R5.xx_Build-189 R5.xx_Build-190 R5.xx_Build-191 R5.xx_Build-192 R5.xx_Build-193 R5.xx_Build-194 R5.xx_Build-195 R5.xx_Build-196 R5.xx_Build-197 R5.xx_Build-198 R5.xx_Build-199 R5.xx_Build-200 R5.xx_Build-201 R5.xx_Build-202 R5.xx_Build-203 R5.xx_Build-204 R5.xx_Build-205 ol_R5.SP3.04 ol_R5.SP3.05 ol_R5.SP3.06
Eyal Shapira [Sat, 3 Nov 2012 14:35:35 +0000 (16:35 +0200)]
mac80211: reject BA action frames if sent fron non HT STA

The FW doesn't work well with BA sessions started from non 802.11n
STAs. Reject these as a work around until the FW issue is fixed.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agomac80211: warn on enabling beacon while off channel R5.xx_Build-129 R5.xx_Build-130
Eyal Shapira [Fri, 2 Nov 2012 10:14:44 +0000 (12:14 +0200)]
mac80211: warn on enabling beacon while off channel

This can cause the beaconing to start on the wrong channel.
Several such races were fixed but still add a WARN_ON as
we'd like to know if something like that still happens.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: improve some debug logs
Eyal Shapira [Fri, 2 Nov 2012 10:19:21 +0000 (12:19 +0200)]
wl12xx: improve some debug logs

These turned out to be useful so add them.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: fix list_add/list_del R5.xx_Build-127 R5.xx_Build-128
Ofir Luzon [Wed, 31 Oct 2012 12:57:56 +0000 (14:57 +0200)]
wl12xx: fix list_add/list_del

add list_del even if wl in off state

Signed-off-by: Ofir Luzon <ofirluzon@ti.com>
11 years agowl12xx: FW recovery trigger assert bug fix R5.xx_Build-126 ol_R5.SP3.03
Yair Shapira [Wed, 31 Oct 2012 10:48:33 +0000 (12:48 +0200)]
wl12xx: FW recovery trigger assert bug fix

The bug was in the partition mapping. It seems that .mem3 partition that
we used to write 'magic' 0xCAFECAFE to address 0x1C is actually in use (it
contains the struct part of the FW_STATUS). It is in use although the size
of the partition is set to 0

The fix was to save old partition, map a new partition with .mem part set to
address 0x1C and remap previous partition after writing 0xCAFECAFE.

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
11 years agowl12xx: mutually exclude PLT and normal power modes R5.xx_Build-123 R5.xx_Build-124
Yair Shapira [Mon, 29 Oct 2012 17:56:45 +0000 (19:56 +0200)]
wl12xx: mutually exclude PLT and normal power modes

Small fix done to ensure that PLT mode and normal driver power
mode (ifconfig/add_interface) are mutually excluded.

This is partially based on wl18xx (R8) commit 6620ca8fe29d

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
11 years agowl12xx: check for required fw change while enable or disable role R5.xx_Build-122
Eyal Shapira [Thu, 25 Oct 2012 15:33:57 +0000 (17:33 +0200)]
wl12xx: check for required fw change while enable or disable role

In certain scenarios our current hooks for checking required
fw change aren't enough and we could be left in MR even though
we've gone back to a single interface. This is of course not
good as we prefer running with the SR FW which contains goodies
like BTCOEX.

An example scanerio is when running P2P GO + STA and then
removing the P2P GO.

Fix it by adding checks for fw change also while enable or
disable roles.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: disable elp sleep while in plt mode R5.xx_Build-120
Yair Shapira [Mon, 29 Oct 2012 14:38:57 +0000 (16:38 +0200)]
wl12xx: disable elp sleep while in plt mode

We now disable elp sleep during plt mode to allow normal operation of
plt tools such as calibrator.

Having elp_sleep enabled during plt mode is actually not required and
in fact it distupt plt operations such as rx statistics etc...

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
11 years agomac80211: purge offchannel Tx on reconfig R5.xx_Build-119
Arik Nemtsov [Wed, 24 Oct 2012 20:35:27 +0000 (22:35 +0200)]
mac80211: purge offchannel Tx on reconfig

Offchannel Tx occuring during reconfig can cause us the low level driver
to start various operations on the wrong channel, similar to remain on
channel operations. Purge them before reconfig.

Reported-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: Copy FW log as entire mem block R5.xx_Build-100 R5.xx_Build-101 R5.xx_Build-108 R5.xx_Build-109 R5.xx_Build-110 R5.xx_Build-113 R5.xx_Build-114 R5.xx_Build-115 R5.xx_Build-116 R5.xx_Build-97 R5.xx_Build-98 R5.xx_Build-99
Igal Chernobelsky [Thu, 18 Oct 2012 15:08:19 +0000 (17:08 +0200)]
wl12xx: Copy FW log as entire mem block

FW log copy is simplified to copy the entire
memory block as FW logger utility is repsponsible
for parsing of FW log content.
(Similar commit was applied to wl18xx:
wlcore/wl18xx/wl12xx: FW log params per chip arch)

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agowl12xx: decrease elp timeout to 20ms R5.xx_Build-96
Eyal Shapira [Thu, 18 Oct 2012 16:05:24 +0000 (18:05 +0200)]
wl12xx: decrease elp timeout to 20ms

The current elp timeout set to 200 ms is too high.
While its purpose was to avoid going to ELP
during Tx/Rx the problem is that it keeps the
device awake also after issuing commands when there's
no traffic. In Android this is a real problem as
RSSI is polled by the framework every 3 seconds
and keeping the chip out of ELP for 200ms each time
has a significant power consumption effect.

Fix that by changing to 20ms. This prevents excessive
real elp sleeps and wakeups during Rx/Tx with 12xx.
There's no real need any more for setting a hard
coded 5ms while in forced_ps.

The fw won't enter elp anyways before the dynamic-ps
timeout expired as well (and it entered ps
successfully).

(Based on a similar patch by Eliad for wlcore)

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: triggering FW assert to perform recovery R5.xx_Build-91 R5.xx_Build-92 R5.xx_Build-94
Yair Shapira [Sun, 14 Oct 2012 15:10:46 +0000 (17:10 +0200)]
wl12xx: triggering FW assert to perform recovery

Driver based FW recovery was modified. It is now trying to trigger
FW assert and waiting for WATCHDOG interrupt before continuing with
recovery.

This is done to allow FW to perform cleanups and halt gracefully
before recovery is performed. This allows for safe reading of
on-demand fwlog, core_dump, etc...

FW assert triggering is done by writing 0xcafecafe to FW address 0x1c
and then triggering PHY_RX_HEADER FW interrupt which is its highest
priority interrupt.

There is a timeout of 100ms waiting for WATCHDOG interrupt.

In case timeout is reached or we get ELP or SDIO errors, we resume
recovery without reading fwlog, core_dump, etc beacuse we assume that
FW is not responding...

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
11 years agowl12xx: fix some line spacing
Yair Shapira [Sun, 14 Oct 2012 15:10:45 +0000 (17:10 +0200)]
wl12xx: fix some line spacing

Remove trailing blanks...

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
11 years agowl12xx: recovery elp_wakeup optimizations
Yair Shapira [Sun, 14 Oct 2012 15:10:44 +0000 (17:10 +0200)]
wl12xx: recovery elp_wakeup optimizations

We now do several optimizations related to recovery situations:

  We fail elp_wakeup if we have SDIO errors (otherwise we just waste time)

  We now call elp_wakeup inside the recovery work routine to ensure that
  FW is awake for recovery operations (such as ewading core dump, on-
  demand fwlog etc...). This is done prior to disabling wl-interrupts.

  The call to elp_wakeup was removed from userspace recovery trigger routines
  (such as libnl and debugfs) because it is now redundent

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
11 years agomac80211: purge all pending ROCs on reconfig R5.xx_Build-90 ol_R5.SP3.02
Arik Nemtsov [Wed, 10 Oct 2012 16:11:20 +0000 (18:11 +0200)]
mac80211: purge all pending ROCs on reconfig

A remain-on-channel work item may be queued, causing interfaces to start
on the wrong channel during reconfig.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: block sched scan if p2p client is running R5.xx_Build-72 R5.xx_Build-76 R5.xx_Build-77 R5.xx_Build-78 R5.xx_Build-79 R5.xx_Build-81 R5.xx_Build-82 R5.xx_Build-83 R5.xx_Build-84 R5.xx_Build-85 R5.xx_Build-86 R5.xx_Build-87 R5.xx_Build-88 R5.xx_Build-89
Eyal Shapira [Sun, 30 Sep 2012 02:04:04 +0000 (04:04 +0200)]
wl12xx: block sched scan if p2p client is running

sched scan isn't supported by the FW when there's a p2p
role active so block it if any interface is running
p2p client.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agomac80211: increase channel switch request timeout R5.xx_Build-70 R5.xx_Build-71
Victor Goldenshtein [Sun, 30 Sep 2012 10:39:59 +0000 (12:39 +0200)]
mac80211: increase channel switch request timeout

In some heavy loaded MR scenarios with enabled debug
prints the channel switch request + channel switch
command can take some time. Increase the channel
switch request timeout to: beacon_int * dtim_period * 10.

Also clear the "ap_cs_channel" in case of completion
timeout/error.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agowl12xx: initialize per-link FW freed blocks correctly R5.xx_Build-65 R5.xx_Build-66 R5.xx_Build-67 R5.xx_Build-68
Arik Nemtsov [Tue, 25 Sep 2012 12:24:13 +0000 (14:24 +0200)]
wl12xx: initialize per-link FW freed blocks correctly

When a link is allocated, sometimes the "freed packets" counter in FW
is non zero, but we always assumed it is. This caused us to incorrectly
account FW allocated blocks in some cases.

When operating in AP mode, this bug caused some stations to never
come back from PSM.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: restore default channel configuration R5.xx_Build-62 R5.xx_Build-63 R5.xx_Build-64
Victor Goldenshtein [Tue, 25 Sep 2012 10:28:06 +0000 (12:28 +0200)]
wl12xx: restore default channel configuration

wl12xx allocates two static structs wl1271_band_2ghz &
wl1271_band_5ghz which are used/modified by Reg-Domain
e.g. some channel might be marked as passive at some
point. These structs freed only during wl12xx rmmod and
aren't cleared during wl12xx_sdio.ko, this means that
some channel flags might be set regardless reg-domain
rules. Fix this by clearing the channel flags from
the previous usage (before the current wl12xx_sdio.ko
insmod).

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agowl12xx: consolidate free_link and always call it
Arik Nemtsov [Mon, 24 Sep 2012 18:32:08 +0000 (20:32 +0200)]
wl12xx: consolidate free_link and always call it

Make sure free_link is always called when removing an interface. This
ensures all skbs belonging to this interface are returned to mac80211.
Otherwise these dangling skbs might crash the system on the next
call to wl1271_tx_reset_link_queues(). This happens on recovery/stop or
an unsuccessful Tx flush.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: take the mutex before resetting Tx queues
Arik Nemtsov [Mon, 24 Sep 2012 13:55:55 +0000 (15:55 +0200)]
wl12xx: take the mutex before resetting Tx queues

Otherwise we risk contention for private members of our global structure
while op_stop_locked is running.

Reported-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: change packet retry count R5.xx_Build-60 R5.xx_Build-61
Yossi Wortzel [Thu, 20 Sep 2012 11:51:21 +0000 (14:51 +0300)]
wl12xx: change packet retry count

default retry number was 10. we found out that in noisy environment
there were case we were failed to send the packet.
in that case it took time until the upper layer retransmit the
packet which cause degradation in TCP TP.
change the default to 50 in order to solve this problem

Signed-off-by: Yossi Wortzel <yossiw@ti.com>
11 years agowl12xx: fix generic cfg fw command R5.xx_Build-52 R5.xx_Build-53 R5.xx_Build-56 R5.xx_Build-59
Eyal Shapira [Wed, 19 Sep 2012 10:35:50 +0000 (13:35 +0300)]
wl12xx: fix generic cfg fw command

The command struct was missing the header struct.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: increase scan dwell times if no activity R5.xx_Build-40 R5.xx_Build-41 R5.xx_Build-46 R5.xx_Build-47 R5.xx_Build-48 R5.xx_Build-49 R5.xx_Build-50 R5.xx_Build-51 ol_R5.SP3.01
Eyal Shapira [Thu, 13 Sep 2012 16:45:39 +0000 (19:45 +0300)]
wl12xx: increase scan dwell times if no activity

There's a limit on scan dwell times of max 30ms in order
to avoid degrading voip traffic which could be going on
while scanning. However these dwell times increase the
chance of missing out on nearby APs leading to partial
scan results. Allow configuration of longer dwell times
in case there no active interface (i.e. no STA associated
or AP up)

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: prevent channel switch in the MR FW R5.xx_Build-39
Arik Nemtsov [Thu, 13 Sep 2012 11:32:55 +0000 (14:32 +0300)]
wl12xx: prevent channel switch in the MR FW

When a channel switch request arrives and we are in the MR FW, drop the
connection, as the FW command is unsupported. This will hopefully cause
the STA to reconnect on the new channel.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agonl80211: sync nl80211.h with latest wpa_s copy
Arik Nemtsov [Thu, 13 Sep 2012 11:23:45 +0000 (14:23 +0300)]
nl80211: sync nl80211.h with latest wpa_s copy

Also move channel switch related command to the TI private commands
range.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: remove unnecessary WARN_ON in wl12xx_tx_reset
Victor Goldenshtein [Wed, 12 Sep 2012 08:29:44 +0000 (11:29 +0300)]
wl12xx: remove unnecessary WARN_ON in wl12xx_tx_reset

Sometimes the driver can perform a recovery while Tx is
active, this will trigger unnecessary warning which might
delay the recovery for more than 100 mS.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agowl12xx: new module param to set the dominant role
Victor Goldenshtein [Tue, 11 Sep 2012 14:27:24 +0000 (17:27 +0300)]
wl12xx: new module param to set the dominant role

New bool "ap_ch_is_dominant" module param.

By default the STA channel is the dominant one (this flag
is't set) and the AP/GO channel can follow it.

Setting the ap_ch_is_dominant=1 will set the AP/GO channel as
a dominant, which will block any STA attempt to authenticate
on a different channel than the AP/GO operational channel.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agomac80211: if "dominant ap ch"!="sta ch" block the auth
Victor Goldenshtein [Tue, 11 Sep 2012 14:25:58 +0000 (17:25 +0300)]
mac80211: if "dominant ap ch"!="sta ch" block the auth

Add new IEEE80211_HW_AP_CH_IS_DOMINANT flag which blocks
the authentication requests for the STA role if it's tries
to authenticate on a different channel than the AP/GO channel.

By default the STA channel is the dominant one (this flag is't
set) and the AP/GO channel can follow the dominant role channel.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agomac80211: request AP/GO channel switch if needed
Victor Goldenshtein [Thu, 30 Aug 2012 06:46:39 +0000 (09:46 +0300)]
mac80211: request AP/GO channel switch if needed

For devices which support MR on a single channel
we must perform a channel alignment between roles.
This patch handles the case when an AP/GO role is
started on channel X and a second STA role starts
the authentication process on channel Y, in this
case:

1. postpone the auth process of the second role.
2. request from the userspace to switch to channel Y.
3. wait for the channel switch to complete for the first role.
4. continue with auth process.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agowl12xx: add channel switch request debugfs entry
Victor Goldenshtein [Sun, 13 Nov 2011 10:25:13 +0000 (12:25 +0200)]
wl12xx: add channel switch request debugfs entry

Which exposes the current operational AP/GO channel
and simulates channel switch request.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agowl12xx: add channel switch ability for AP & GO
Victor Goldenshtein [Mon, 10 Oct 2011 15:08:13 +0000 (17:08 +0200)]
wl12xx: add channel switch ability for AP & GO

Add channel switch command and handle channel
switch event.

[Arik - added check for role id in the event of STA channel switch. This
will prevent bogus calls to ieee80211_chswitch_done]

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agomac80211: add ap channel switch command/event
Victor Goldenshtein [Mon, 10 Oct 2011 12:55:43 +0000 (14:55 +0200)]
mac80211: add ap channel switch command/event

Add ieee80211_ap_process_chanswitch(), to handle a channel switch
request for AP.

Add ieee80211_ap_ch_switch_done() which updates oper_channel
and notifies upper layers about channel switch complete event.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agonl80211/cfg80211: add ap channel switch command
Victor Goldenshtein [Mon, 10 Oct 2011 12:53:32 +0000 (14:53 +0200)]
nl80211/cfg80211: add ap channel switch command

Add NL80211_CMD_AP_CH_SWITCH command which
triggers an AP channel switch process.

Usermode notified about channel switch complete
event with NL80211_CMD_CH_SWITCH_NOTIFY.

Usermode (hostapd) is responsible to update the
channel switch announcement IE in the beacon
prior and after the channel switch operation.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agocfg80211: add channel switch notify event
Thomas Pedersen [Fri, 6 Apr 2012 20:35:47 +0000 (13:35 -0700)]
cfg80211: add channel switch notify event

The firmware may decide to switch channels while already beaconing, e.g.
in response to a cfg80211 connect request on a different vif. Add this
event to notify userspace when an AP or GO interface has successfully
migrated to a new channel, so it can update its configuration
accordingly.

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm>
Signed-off-by: John W. Linville <linville@tuxdriver>
11 years agomac80211: add channel switch request
Victor Goldenshtein [Tue, 4 Oct 2011 12:21:04 +0000 (14:21 +0200)]
mac80211: add channel switch request

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agonl80211/cfg80211: add channel switch request command
Victor Goldenshtein [Thu, 17 May 2012 15:51:24 +0000 (18:51 +0300)]
nl80211/cfg80211: add channel switch request command

Add new NL80211_CMD_REQ_CH_SW, which requests from usermode
to perform a channel switch operation for GO/AP.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agomac80211: fix sync of rx filters with driver and cfg80211
Eyal Shapira [Thu, 13 Sep 2012 10:53:00 +0000 (13:53 +0300)]
mac80211: fix sync of rx filters with driver and cfg80211

Avoid changing the local saved rx filters in case
the driver fails to set them. As the driver clears
the filters whenever the device is stopped we need
to configure them back when turning on the device to
avoid being out of sync with cfg80211 which reports
back to userspace what's configured.
Also fix missing locking in ieee80211_set_rx_filters.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agonl80211: don't save wowlan triggers if rx_set_filters fails
Eyal Shapira [Thu, 13 Sep 2012 10:51:25 +0000 (13:51 +0300)]
nl80211: don't save wowlan triggers if rx_set_filters fails

In case the device supports rx_set_filters and it fails
avoid replacing the local state so we won't be out of sync
with the lower levels.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: clear RX filters when adding AP/GO interface
Eyal Shapira [Wed, 12 Sep 2012 23:29:58 +0000 (02:29 +0300)]
wl12xx: clear RX filters when adding AP/GO interface

In AP/GO we don't want RX filters configured by upper levels
to be in effect. AP/GO has to be able to get all traffic
including broadcasts (for DHCP for example).
Once the last AP is removed we restore the filters.
Also fix a minor bug in some error paths in remove interface
where we might not go back to ELP sleep.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: fwlog changes and dynamic mem_block
Yair Shapira [Thu, 13 Sep 2012 08:46:13 +0000 (11:46 +0300)]
wl12xx: fwlog changes and dynamic mem_block

fwlog changes (i.e. setting it to on-demand+host by default)
were merged from R8 branch.

In addition, number of fwlog mem_blocks can now be changed
using module param.

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agowl12xx: add sysfs control over disable SGI R5.xx_Build-35 R5.xx_Build-36 R5.xx_Build-37
Eyal Shapira [Wed, 12 Sep 2012 02:28:54 +0000 (05:28 +0300)]
wl12xx: add sysfs control over disable SGI

The FW by default works with Short GI whenever possible.
This is causing trouble with some sniffers used in certification
labs. An option to disable SGI was added to the FW through
a generic command API. Add support for this new API
and enable control over disabling SGI through sysfs.
debugfs cannot be used here as the certification tests are being
run on production devices.
Note that we still publish support for SGI 20 in either STA/AP
however Short GI won't be used effectively when disable_sgi is 1.
This solution is good enough according to the certification folks.

(The generic cmd part is based on Luca's dropbcast patch
which was dropped)

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: add module param to enable/disable core_dump R5.xx_Build-32 R5.xx_Build-34
Yair Shapira [Sun, 9 Sep 2012 19:40:58 +0000 (22:40 +0300)]
wl12xx: add module param to enable/disable core_dump

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agowl12xx: core_dump implementation
Yair Shapira [Sun, 9 Sep 2012 19:40:57 +0000 (22:40 +0300)]
wl12xx: core_dump implementation

Added configuration parameters, defining memory area mapping and if
this service is enabled/disabled

Added recovery routine to read core dump into vmalloc'ed memory area

Added sysfs routines to read the latest core_dump. The read routine is
blocked until core_dump is available. After userspace reads the entire
core_dump, read is blocked again until next core_dump and vice versa...

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agowl12xx: remove some trailing spaces
Yair Shapira [Sun, 9 Sep 2012 19:40:56 +0000 (22:40 +0300)]
wl12xx: remove some trailing spaces

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agowl12xx: elp_wakeup when issuing recovery from userspace
Yair Shapira [Sun, 9 Sep 2012 19:40:55 +0000 (22:40 +0300)]
wl12xx: elp_wakeup when issuing recovery from userspace

When triggering recovery from userspace (through debugfs or libnl) we
now perform elp wakeup prior to queuing the recovery request. The reason
is that the queue operation disables interrupts and ELP wakeup is needed for
recovery operations such as on-demand firmware log and later on firmware
core dump.

The call to elp wakeup from recovery work fwlog function was removed because
it is meaningless - it can only succeed if elp wakeup was alerady done.

Note that in other cases before queuing a recovery request, either elp wakeup is
called or the firmware is stuck (in this case wakeup is not done).

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agowl12xx: disable WARN_ON in case of FW watchdog recovery
Yair Shapira [Sun, 9 Sep 2012 19:40:54 +0000 (22:40 +0300)]
wl12xx: disable WARN_ON in case of FW watchdog recovery

disable WARN_ON backtrace in case recovery was queued becasue of
FW watchdog interrupt

This allows faster recovery time becasue log to console is omitted

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agomac80211: always set in_reconfig=false on wakeup R5.xx_Build-24 R5.xx_Build-25 R5.xx_Build-26 R5.xx_Build-27 R5.xx_Build-28
Eliad Peller [Mon, 2 Jul 2012 12:08:25 +0000 (15:08 +0300)]
mac80211: always set in_reconfig=false on wakeup

If the interfaces were removed just before a restart
work was started, open_count will be 0, and most of
the reconfig work will be skipped, including the
resetting of local->in_reconfig to false.

Leaving local->inconfig = true will result in
dropping any incoming packet.

Fix it by always setting local->in_reconfig = false
(even if there are no active interfaces).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: stop Rx during HW reconfig
Arik Nemtsov [Wed, 6 Jun 2012 08:25:02 +0000 (11:25 +0300)]
mac80211: stop Rx during HW reconfig

While HW reconfig is in progress, drop all incoming Rx. This prevents
incoming packets from changing the internal state of the driver or
calling callbacks of the low level driver while it is in inconsistent
state.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: add stations after AP start on reconfig
Arik Nemtsov [Sun, 3 Jun 2012 20:31:56 +0000 (23:31 +0300)]
mac80211: add stations after AP start on reconfig

When performing a HW restart for an AP mode interface, add stations back
only after the AP is beaconing. This mimics the normal flow of STA
addition on AP.

Some devices (wlcore) do not support adding stations before beaconing,
so this has the added benefit of making recovery work for them.

[Eyal - backported to R5]

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agoRevert "wl12xx: fix BA session after AP recovery"
Eyal Shapira [Thu, 6 Sep 2012 08:12:49 +0000 (11:12 +0300)]
Revert "wl12xx: fix BA session after AP recovery"

This reverts commit 5ec6973c0fd6f3d2744d174576beb2e7ad007e0b.
which introduced a bug where the hlid allocated for the sta during
reconfig wasn't saved in the ieee80211_sta which was passed
from mac80211. Instead a copy of ieee80211_sta was created and
maintained by wl12xx. This is wrong as mac80211 needs to be in
sync with us. The result could be attempting to free the wrong
hlid when mac80211 removes the sta among others. Fix this by
avoiding the copy and instead keep the pending peers list by
linking the driver private struct at the end of ieee80211_sta.

Another bug existed in wl1271_bss_info_changed_ap() where when
adding the peers the state was updated effectively only for the
first peer.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: Always pass DMA-able buffers to mmc functions
Ido Yariv [Wed, 5 Sep 2012 19:17:09 +0000 (22:17 +0300)]
wl12xx: Always pass DMA-able buffers to mmc functions

Some of the mmc drivers initiate DMA transfers with buffers passed from
higher layers. This means that the driver shouldn't ever pass non
DMA-able buffers, such as ones that are unaligned, allocated on the
stack or static.

Fix a couple of calls to the mmc layer in which buffers which weren't
necessarily DMA-able were passed.

Reported-by: "De Cesco, Jonathan" <jonathanc@ti.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
11 years agowl12xx: don't ROC or switch to MR on p2p mgmt on-chan Tx R5.xx_Build-23
Arik Nemtsov [Sun, 2 Sep 2012 17:13:28 +0000 (20:13 +0300)]
wl12xx: don't ROC or switch to MR on p2p mgmt on-chan Tx

When in the SR FW and Tx arrives on the p2p mgmt interface on the
same channel as an existing p2p role, don't switch to MR or ROC on
the newly started device role. Just start the device role and use it
for Tx. Do the ROC as usual in the MR FW.

This avoids problems during p2p operation, when we need to respond
to packets via the p2p-dev interface (i.e. provision discovery in GO).

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: enable the dev role on the p2p mgmt iface
Arik Nemtsov [Sun, 5 Aug 2012 16:55:25 +0000 (19:55 +0300)]
wl12xx: enable the dev role on the p2p mgmt iface

When starting a p2p mgmt interface, enable its device role. This
is used to keep the FW Rx filters down for the p2p dev role MAC address.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agomac80211: mark the p2p0 interface with a special flag
Arik Nemtsov [Sun, 5 Aug 2012 16:51:43 +0000 (19:51 +0300)]
mac80211: mark the p2p0 interface with a special flag

This flag indicates the lower driver the interface will be used for
p2p management operations only (p2p find). This will be superseded
by pending upstream patches making p2p a wdev-only interface.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: disable arp filter only if configured R5.xx_Build-20 R5.xx_Build-22
Eyal Shapira [Mon, 3 Sep 2012 23:36:22 +0000 (02:36 +0300)]
wl12xx: disable arp filter only if configured

Disabling auto arp actually causes FW resources allocation
and it's better to avoid that unless an arp filter was
already configured (i.e. the interface had an IP configured).
This also prevents exceeding the FW arp filters limit (2)
in certain scenarios. Once such case which poses a problem
is having a P2P_GO with an associated client + a connected STA
concurrently. Once you disconnect the GO, for a brief moment
the interface is changed to STA before removal. This leads to
having 3 STA interfaces (the actual STA, P2P device and the
disconnected GO which turned into a STA) and would attempt
allocating 3 FW arp filters which fails.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: don't send the sleep_auth to FW on recovery R5.xx_Build-19
Arik Nemtsov [Sun, 2 Sep 2012 10:34:54 +0000 (13:34 +0300)]
wl12xx: don't send the sleep_auth to FW on recovery

The FW doesn't seem to handle it gracefully, and it's redundant since
recovery will make us load a new FW anyway.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: Fix continuous and on-demand fwlog modes R5.xx_Build-10 R5.xx_Build-11 R5.xx_Build-12 R5.xx_Build-13 R5.xx_Build-14 R5.xx_Build-15 R5.xx_Build-16 R5.xx_Build-57 R5.xx_Build-58 R5.xx_Build-6 R5.xx_Build-7 R5.xx_Build-8 R5.xx_Build-9
Ido Yariv [Wed, 15 Aug 2012 14:51:01 +0000 (17:51 +0300)]
wl12xx: Fix continuous and on-demand fwlog modes

Commit 4d7944cc ("wl12xx: set default FW log mode to dbg-pins") set the
default debug output to debug pins. However, when either continuous or
on-demand fwlog modes are set, the debug output is not overridden
accordingly. Fix this.

Signed-off-by: Ido Yariv <ido@wizery.com>
11 years agowl12xx: Fix unbalanced interrupts enablement
Ido Yariv [Wed, 15 Aug 2012 14:20:16 +0000 (17:20 +0300)]
wl12xx: Fix unbalanced interrupts enablement

The interrupt line is enabled by wl1271_boot_enable_interrupts, but it
will not be disabled in all failure paths. Fix this.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: Don't recover during boot
Ido Yariv [Wed, 15 Aug 2012 14:20:15 +0000 (17:20 +0300)]
wl12xx: Don't recover during boot

While recursive recovery is avoided during shutdown, a new recovery may
be queued when the FW boots. The recovery work will then try to stop an
already stopped hardware, which will most likely result in a kernel
panic.

Fix this by verifying that wl->state is on before queueing a new
recovery.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowlcore: make debug prints work without dynamic debug
Arik Nemtsov [Wed, 8 Aug 2012 23:25:32 +0000 (02:25 +0300)]
wlcore: make debug prints work without dynamic debug

Make debug prints operational when dynamic debug is not defined.
This allows better debugging in production environments.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowlcore: op_tx: pass sta explicitly when inferring frame hlid
Arik Nemtsov [Thu, 26 Jul 2012 18:22:11 +0000 (21:22 +0300)]
wlcore: op_tx: pass sta explicitly when inferring frame hlid

avoid using the skb CB for getting the appropriate sta.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowlcore: don't get the hlid from a queued skb
Arik Nemtsov [Thu, 26 Jul 2012 18:19:44 +0000 (21:19 +0300)]
wlcore: don't get the hlid from a queued skb

There was a bug hiding here since the hlid was sometimes inferred from
the sta, which might be invalid at this point.

Instead, propagate the hlid from the skb-queue where we got the skb
in the first place.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowlcore: Prevent interaction with HW after recovery is queued ol_R5.SP2.04
Ido Yariv [Tue, 24 Jul 2012 16:18:49 +0000 (19:18 +0300)]
wlcore: Prevent interaction with HW after recovery is queued

When a function requests to recover, it would normally abort and will
not send any additional commands to the HW. However, other threads may
not be aware of the failure and could try to communicate with the HW
after a recovery was queued, but before the recovery work began.

Fix this by introducing an intermediate state which is set when recovery
is queued, and modify all state checks accordingly.

[Arik - ported to r5 driver version]

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: Use a dedicated fw for PLT
Eliad Peller [Mon, 6 Feb 2012 10:47:54 +0000 (12:47 +0200)]
wl12xx: Use a dedicated fw for PLT

A special PLT firmware is used for calibration.

Add multiple fw support by introducing a new fw_type member,
representing the currently saved fw (the actual fw state
can be determined by wl->state).

[Arik - Ported to r5_jb. Things are slighty modified here]

Signed-off-by: Gery Kahn <geryk@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: set default FW log mode to dbg-pins
Arik Nemtsov [Mon, 30 Jul 2012 15:05:00 +0000 (18:05 +0300)]
wl12xx: set default FW log mode to dbg-pins

This mode is the most stable with the current FW.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: take the mutex during delayed recovery
Arik Nemtsov [Sun, 29 Jul 2012 09:46:23 +0000 (12:46 +0300)]
wl12xx: take the mutex during delayed recovery

We are touching internal flags and talking to the FW, so we must take
the mutex. Also add an ELP wakeup/sleep before talking to the FW in this
funcion.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: tx_flush - optimize flow and force Tx during the flush
Arik Nemtsov [Sun, 29 Jul 2012 09:18:32 +0000 (12:18 +0300)]
wl12xx: tx_flush - optimize flow and force Tx during the flush

Force Tx during the flush if there are packets pending in the driver.
This actually solves a bug where we would get called from the mac80211
wq context, which would prevent tx_work from getting queued, even when
the mutex is unlocked.

Don't stop the queues needlessly if there's nothing to flush. Use a
larger delay when sleeping to give the driver a chance to flush and
avoid cpu busy looping. Re-arrange the loop so the last iteration is
not wasted.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: lazy-enable device roles
Eliad Peller [Thu, 26 Jul 2012 14:17:06 +0000 (17:17 +0300)]
wl12xx: lazy-enable device roles

Enable device roles just before starting it.
This way, a single device role should be enough
for all vifs, as we can't use concurrent device
roles (which require ROC) anyway.

Signed-off-by: Eliad Peller <eliad@wizery.com>
11 years agowl12xx: always use wlvif->role_id for scans
Eliad Peller [Thu, 26 Jul 2012 14:17:05 +0000 (17:17 +0300)]
wl12xx: always use wlvif->role_id for scans

enabled (but not-started) sta role should be good enough
for scanning (both normal and scheduled), so use it
instead of the device_role.

Signed-off-by: Eliad Peller <eliad@wizery.com>
11 years agowl12xx: disable roaming only when booting the MR FW
Arik Nemtsov [Wed, 25 Jul 2012 20:51:09 +0000 (23:51 +0300)]
wl12xx: disable roaming only when booting the MR FW

Since the SR/MR switch is now delayed, only disable roaming when the
MR FW is booted, and otherwise enable it.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: don't try to free a NULL probe-resp
Arik Nemtsov [Wed, 25 Jul 2012 20:10:28 +0000 (23:10 +0300)]
wl12xx: don't try to free a NULL probe-resp

Can lead to a crash if the probe-resp was never set.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: allow setting 3 mac addresses
Arik Nemtsov [Wed, 18 Jul 2012 11:43:17 +0000 (14:43 +0300)]
wl12xx: allow setting 3 mac addresses

To create the third MAC address, use the first address, but set the LAA
bit. This will allow STA + P2P + AP scenarios.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agomac80211: avoid using synchronize_rcu in ieee80211_set_probe_resp
Eyal Shapira [Wed, 25 Jul 2012 06:06:14 +0000 (09:06 +0300)]
mac80211: avoid using synchronize_rcu in ieee80211_set_probe_resp

This could take a while (100ms+) and may delay sending assoc resp
in AP mode with WPS or P2P GO (as setting the probe resp takes place
there). We've encountered situations where the delay was big enough
to cause connection problems with devices like Galaxy Nexus.
Switch to using call_rcu with a free handler.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agomac80211: avoid using synchronize_rcu in ieee80211_config_beacon
Eyal Shapira [Tue, 24 Jul 2012 18:12:44 +0000 (21:12 +0300)]
mac80211: avoid using synchronize_rcu in ieee80211_config_beacon

This was causing a very long delay (>200ms) which would
delay sending assoc resp in cases of an AP with WPS (where
the beacon gets updated after assoc req is received).
Some devices like Galaxy Nexus don't accept the assoc resp
if it's delayed for too long. This is causing connection issues
in AP mode with WPS and in P2P GO.

Switch instead to using kfree_rcu which wouldn't block here
but is still safe.

(This is based on upstream changes by Johannes)

Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowlcore: don't stop tx queue via watermark if already stopped
Arik Nemtsov [Mon, 25 Jun 2012 19:26:17 +0000 (22:26 +0300)]
wlcore: don't stop tx queue via watermark if already stopped

If a Tx queue is currently stopped because of our Tx watermark flow
control, don't stop it again. This causes a warning to appear.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: stop queues on Tx flush
Arik Nemtsov [Fri, 18 May 2012 04:46:39 +0000 (07:46 +0300)]
wlcore: stop queues on Tx flush

Stop network queues during Tx flush, and also drop other internal
mac80211 packets (mgmt) that may arrive when the queues are stopped.

When flush is done all driver queues are clear, forcefully if needed.

Protect the Tx flush operation with a new mutex, to prevent concurrency
that can mess us queue state.

Based on a patch by Eliad Peller <eliad@wizery.com>

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: add stop reason bitmap for waking/starting queues
Arik Nemtsov [Fri, 18 May 2012 04:46:38 +0000 (07:46 +0300)]
wlcore: add stop reason bitmap for waking/starting queues

Allow the driver to wake/stop the queues for multiple reasons. A queue
is started when no stop-reasons exist.

Convert all wake/stop queue calls to use the new API.

Before, a stopped queue was almost synonymous a high-watermark on Tx.
Remove a bit of code in wl12xx_tx_reset() that relied on it.

Internal packets arriving from mac80211 are also discarded when a queue
is stopped. A notable exception to this is the watermark reason, which
is a "soft"-stop reason. We allow traffic to gradually come to a halt,
but we don't mind spurious packets here and there. This is merely a flow
regulation mechanism.

Based on a similar patch by Eliad Peller <eliadWizery.com>.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowl12xx: make Tx flush timings more verbose
Arik Nemtsov [Mon, 23 Jul 2012 20:50:45 +0000 (23:50 +0300)]
wl12xx: make Tx flush timings more verbose

Print how much time a flush took. This will help debug the time it takes
to switch between channels.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: allow only the lowest OFDM rate for p2p setup frames
Arik Nemtsov [Mon, 23 Jul 2012 12:18:29 +0000 (15:18 +0300)]
wl12xx: allow only the lowest OFDM rate for p2p setup frames

The IEEE80211_TX_CTL_NO_CCK_RATE flag is only set for mgmt packets
transmitted during p2p connection setup. Make sure to use the lowest
OFDM rate guarantee the peer always hears us.
Change the p2p rate policy to contain only the 6mpbs rate to acheive
this effect.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: AP mode - send non-data packets with basic rates
Arik Nemtsov [Mon, 23 Jul 2012 07:38:18 +0000 (10:38 +0300)]
wl12xx: AP mode - send non-data packets with basic rates

This solves interoperability issues with peer that don't seem to "hear"
management packets transmitted in higher rates. Based on a previous
patch by Igal Chernobelsky.

Cc: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agomac80211: skip the ps count of idle STAs
Victor Goldenshtein [Sun, 22 Jul 2012 13:44:36 +0000 (16:44 +0300)]
mac80211: skip the ps count of idle STAs

To be able to enter ps on a SR FW with more than one
interface up, while only one interface is connected
and others are idle.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agowl12xx: change verbose debug print
Victor Goldenshtein [Sun, 22 Jul 2012 13:44:37 +0000 (16:44 +0300)]
wl12xx: change verbose debug print

This print_info might be too verbose in some p2p
scenarios so change the wl1271_info() to
wl1271_debug() in wl12xx_need_fw_change().

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
11 years agocfg80211/nl80211/wl12xx: align to new nl80211.h ABI
Arik Nemtsov [Wed, 18 Jul 2012 11:33:23 +0000 (14:33 +0300)]
cfg80211/nl80211/wl12xx: align to new nl80211.h ABI

This includes some minor changes:
- change NL80211_CQM_RSSI_BEACON_LOSS to
  NL80211_CQM_RSSI_BEACON_LOSS_EVENT
- remove all features concerning advertisement of intermediate scan
  capabilities. These are currently unused.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agomac80211: fix invalid band deref building preq IEs
Arik Nemtsov [Mon, 9 Jul 2012 16:57:28 +0000 (19:57 +0300)]
mac80211: fix invalid band deref building preq IEs

The function building probe-request IEs does not validate the band is
supported before dereferencing it. This can result in a panic when
all bands are traversed, as done during sched-scan start.

Warn when this happens and return an empty probe request. Also fix
sched-scan to not waste memory on unsupported bands.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agowlcore: define number of supported bands internally
Arik Nemtsov [Tue, 3 Jul 2012 06:11:03 +0000 (09:11 +0300)]
wlcore: define number of supported bands internally

Avoid using the IEEE80211_NUM_BANDS constant for arrays sizes etc, as
this can contain bands unsupported by the driver (e.g. 60Ghz). Use an
internal constant to determine the number of bands.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowlcore: use basic rates for non-data packets
Eliad Peller [Wed, 11 Jul 2012 15:01:49 +0000 (18:01 +0300)]
wlcore: use basic rates for non-data packets

After the latest mac80211 changes, the sta has
the ap's sta pointer even before association.

This cause the auth and assoc frames to be sent
with the standard ap's rates, rather than the
basic rates.

Change the tx rate policy logic to use the regular
ap rates only for data packets (so control and mgmt
packets will be sent with basic rates)

Signed-off-by: Eliad Peller <eliad@wizery.com>
11 years agowlcore: send EAPOLs using minimum basic rate for all roles
Igal Chernobelsky [Wed, 27 Jun 2012 08:09:34 +0000 (11:09 +0300)]
wlcore: send EAPOLs using minimum basic rate for all roles

Send EAPOLs using minimum basic rate for AP, STA, p2p GO and Client.
The patch fixes p2p connection issue with Realtek device in p2p
certification test 5.1.13 (DEVUT reinvokes Persistent Group).

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
11 years agomac80211: check sdata_running on ieee80211_set_bitrate_mask
Eliad Peller [Tue, 12 Jun 2012 09:41:15 +0000 (12:41 +0300)]
mac80211: check sdata_running on ieee80211_set_bitrate_mask

Otherwise, we might call the driver callback before
the interface was uploaded.

Solves the following warning:
WARNING: at net/mac80211/driver-ops.h:12 ieee80211_set_bitrate_mask+0xbc/0x18c [mac80211]()
wlan0:  Failed check-sdata-in-driver check, flags: 0x0
Modules linked in: wlcore_sdio wl12xx wl18xx wlcore mac80211 cfg80211 [last unloaded: cfg80211]
[<c001b964>] (unwind_backtrace+0x0/0x12c) from [<c0495550>] (dump_stack+0x20/0x24)
[<c0495550>] (dump_stack+0x20/0x24) from [<c003ee28>] (warn_slowpath_common+0x5c/0x74)
[<c003ee28>] (warn_slowpath_common+0x5c/0x74) from [<c003eefc>] (warn_slowpath_fmt+0x40/0x48)
[<c003eefc>] (warn_slowpath_fmt+0x40/0x48) from [<bf5c1ad0>] (ieee80211_set_bitrate_mask+0xbc/0x18c [mac80211])
[<bf5c1ad0>] (ieee80211_set_bitrate_mask+0xbc/0x18c [mac80211]) from [<bf575960>] (nl80211_set_tx_bitrate_mask+0x350/0x358 [cfg80211])
[<bf575960>] (nl80211_set_tx_bitrate_mask+0x350/0x358 [cfg80211]) from [<c03e9e94>] (genl_rcv_msg+0x1a8/0x1e8)
[<c03e9e94>] (genl_rcv_msg+0x1a8/0x1e8) from [<c03e9164>] (netlink_rcv_skb+0x5c/0xc0)
[<c03e9164>] (netlink_rcv_skb+0x5c/0xc0) from [<c03e9ce0>] (genl_rcv+0x28/0x34)
[<c03e9ce0>] (genl_rcv+0x28/0x34) from [<c03e8e74>] (netlink_unicast+0x158/0x234)
[<c03e8e74>] (netlink_unicast+0x158/0x234) from [<c03e93e0>] (netlink_sendmsg+0x218/0x298)
[<c03e93e0>] (netlink_sendmsg+0x218/0x298) from [<c03b4e5c>] (sock_sendmsg+0xa4/0xc0)
[<c03b4e5c>] (sock_sendmsg+0xa4/0xc0) from [<c03b5af4>] (__sys_sendmsg+0x1d8/0x254)
[<c03b5af4>] (__sys_sendmsg+0x1d8/0x254) from [<c03b5ca8>] (sys_sendmsg+0x4c/0x70)
[<c03b5ca8>] (sys_sendmsg+0x4c/0x70) from [<c0013980>] (ret_fast_syscall+0x0/0x3c)

Note that calling the driver can also result
in undefined behaviour since it doesn't have
to deal with calls while down.

Signed-off-by: Eliad Peller <eliad@wizery.com>
[removed timestamps, added note - Johannes]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agowl12xx: increase WL12XX_MAX_ROLES
Eliad Peller [Wed, 18 Jul 2012 11:43:17 +0000 (14:43 +0300)]
wl12xx: increase WL12XX_MAX_ROLES

when working with AP + 2*STA we have more than
4 active roles. increase WL12XX_MAX_ROLES to 6.

Signed-off-by: Eliad Peller <eliad@wizery.com>
11 years agowl12xx: change recovery on start/stop device role
Eliad Peller [Mon, 9 Jul 2012 12:31:54 +0000 (15:31 +0300)]
wl12xx: change recovery on start/stop device role

since the recovery itself will usually stop the offchannel
operation, on fw boot we will use SR fw again, which will
result in endless recoveries... avoid it by forcing MR fw
for some grace period after it was needed.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: add grace period when changing MR -> SR fw
Eliad Peller [Mon, 9 Jul 2012 12:29:13 +0000 (15:29 +0300)]
wl12xx: add grace period when changing MR -> SR fw

This improves user experience when performing p2p_find for instance.

[Changed grace period to 30 seconds]

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: delay fw switch to start/stop_role_sta/ap
Eliad Peller [Thu, 5 Jul 2012 16:40:44 +0000 (19:40 +0300)]
wl12xx: delay fw switch to start/stop_role_sta/ap

do the fw switch only when the role was started/stopped

Signed-off-by: Eliad Peller <eliad@wizery.com>
11 years agomac80211: count started vifs
Arik Nemtsov [Tue, 17 Jul 2012 05:47:23 +0000 (08:47 +0300)]
mac80211: count started vifs

count the started roles by simply counting the non-idle vifs.

this method also takes care of counting non-associated
stations (when device role is started)

[Arik - backport usage of rcu here]

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: increase command completion timeout r5_3.2 ol_R5.00.21 r5.00.19-build_235 r5.00.19-build_236 r5.00.19-build_237 r5.00.19-build_239 r5.00.19-build_240 r5.00.19-build_241 r5.00.19-build_242 r5.00.19-build_243 r5.00.19-build_245 r5.00.19-build_246 r5.00.19-build_247 r5.00.19-build_248 r5.00.19-build_249 r5.00.19-build_253 r5.00.19-build_254 r5.00.19-build_255 r5.00.19-build_256 r5.00.19-build_257
Luciano Coelho [Wed, 18 Jul 2012 14:15:45 +0000 (17:15 +0300)]
wl12xx: increase command completion timeout

In some rare cases, the CMD_ROC completion may take over 1 second.
The timeout had earlier been increased to 1000ms (from 750ms), but it
is still not enoug.  Increase it to 1500ms.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
11 years agowl12xx: implement SW Tx watchdog
Arik Nemtsov [Sat, 3 Mar 2012 20:18:00 +0000 (22:18 +0200)]
wl12xx: implement SW Tx watchdog

Track freed FW blocks during Tx. If no blocks were freed during a
predefined timeout, initiate a HW recovery. This helps in situations
when the FW watchdog fails.

Don't trigger recovery during activities that can temporarily stop
Tx. This includes:
- scanning
- buffering packets for sleeping stations (AP role)
- ROC on any role

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowl12xx: add an extra block for all data packets in GEM r5.00.19-build_232 r5.00.19-build_233 r5.00.19-build_234
Yoni Divinsky [Sun, 15 Jul 2012 11:21:34 +0000 (14:21 +0300)]
wl12xx: add an extra block for all data packets in GEM

FW does not handle correctly a situation where the STA
is connected using GEM and a non-GEM data packets is sent.
Therefore, when connecting using GEM, add an extra mem
block for all data packets even if they are not encrypted.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
11 years agowlcore: don't issue SLEEP_AUTH command during recovery
Arik Nemtsov [Tue, 10 Jul 2012 07:47:54 +0000 (10:47 +0300)]
wlcore: don't issue SLEEP_AUTH command during recovery

During interface removal, don't adjust sleep_auth if we are during
recovery. Since the FW is potentially dead we shouldn't talk to it.

Reported-by: Yossi Wortzel <yossiw@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
11 years agowl12xx: change return code in case of WD recovery (squash) ol_R5.00.20 r5.00.19-build_226 r5.00.19-build_227 r5.00.19-build_228 r5.00.19-build_229
Yoni Divinsky [Mon, 9 Jul 2012 09:09:01 +0000 (12:09 +0300)]
wl12xx: change return code in case of WD recovery (squash)

In case of WD recovery we will manage to read correctly
FW status thus the return code will be 0. because of that
recovery wont be triggered.

This patch should be squashed into:
"wl12xx: refactor threaded IRQ routine"

Signed-off-by: Yossi Wortzel <yossiw@ti.com>
Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
11 years agowl12xx: add elp_timeout config option r5.00.19-build_224 r5.00.19-build_225
Yoni Divinsky [Sun, 8 Jul 2012 13:51:33 +0000 (16:51 +0300)]
wl12xx: add elp_timeout config option

Add a configuration option which defines the
timeout for which the driver waits until it
sets the chip into elp.

Since the dynamic_ps_timeout default value is
set to 1500 msec, using it in order to
define the elp timeout causes the chip to
stay awake for long periods.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>