p2p packets should go out only with OFDM rates.
Configure a new rate policy that will (later) be used
during p2p_find (when the p2p_cli / p2p_go interfaces
are in use, we won't have to use this policy, as
the configured rates should already be OFDM-only).
Additionally, update CONF_TX_MAX_RATE_CLASSES to reflect
the current value from the fw api.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Add wl12xx_acx_config_hangover() and respective conf values.
This command configures how long the chip will stay awake
after it was configured to enter psm.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
In addition, set global HT operation mode via ACX_HT_BSS_OPERATION when
a change is detected by usermode
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Incorporate interface changes for HT support.
Add ba_bitmap field to the wl1271_link struct, to indicate
activate RX BA sessions (for AP mode).
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
The BT coex params api have been changed.
Update it, and init coex for both sta and ap.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Use ACX_BEACON_FILTER_OPT for both station and ap roles
(use the generic wl1271_acx_beacon_filter_opt()
instead of wl1271_acx_set_ap_beacon_filter() ).
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Update the acx commands according to the new fw api
(fw >= 6/7.3.0.0.75).
The main change in most of the ACXs is the addition
of a new role_id/link_id field, which is required
for multi-role operation.
Currently, we don't really support multi-role, as
most of our data (inside wl) is global.
As the current fw doesn't support concurrent roles
yet, keep it this way and add wl->role_id and
wl->sta_hlid to save the active role/link.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
The new fw doesn't support rx_filtering configuration (as a
stand-alone command. the rx filtering is done automatically
according to the active role).
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
In each case, the freed data should be freed in the error handling code
as
well.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@exists@
local idexpression x;
statement S,S1;
expression E;
identifier fl;
expression *ptr != NULL;
@@
x = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
when != if (...) { <+...kfree(x)...+> }
when any
when != true x == NULL
x->fl
...>
(
if (x == NULL) S1
|
if (...) { ... when != x
when forall
(
return \(0\|<+...x...+>\|ptr\);
|
* return ...;
)
}
)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sometimes we only get the Tx power level via op->config when the FW is
off. Record the received power level when this happens and use it to
initialize the firmware during boot.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
In AP mode we register for the MAX_TX_RETRY and INACTIVE_STA events.
Both are reported to the upper layers as a TX failure in the offending
stations.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
A recently added feature to the firmware enables the driver to retrieve
firmware logs via the host bus (SDIO or SPI).
There are two modes of operation:
1. On-demand: The FW collects its log in an internal ring buffer. This
buffer can later be read, for example, upon recovery.
2. Continuous: The FW pushes the FW logs as special packets in the RX
path.
Reading the internal ring buffer does not involve the FW. Thus, as long
as the HW is not in ELP, it should be possible to read the logs, even if
the FW crashes.
A sysfs binary file named "fwlog" was added to support this feature,
letting a monitor process read the FW messages. The log is transferred
from the FW only when available, so the reading process might block.
Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
crc7 is used only in wl12xx_spi.
Remove redundant crc7.h includes, and update Kconfig to select CRC7
only if WL12XX_SPI is being selected.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
wl12xx supports the "rx streaming" feature:
When in ps mode, and @timeout msecs have been passed since
the last rx/tx, it issues trigger packets (QoS-null/PS-Poll packets,
according to the ac type) in const intervals (in order to reduce
the rx time).
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Use the minimal rate configured in the basic rates set as the AP
broadcast and multicast rate. The minimal rate is used to ensure weak
links can still communicate.
When the basic rates contains at least one OFDM rate, configure all
unicast TX rates to OFDM only.
Unify rate configuration on initialization and on change notification
into a single function.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
New AP-mode FWs filter external beacons by default. Disable this
filtering on start up so we can properly configure ERP protection.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Use the wiphy RTS and fragmentation thresholds for initializing the FW
when possible. This mitigates a bug where previously set values are
forgotten after interface down/up.
Add checks before settings these values to ensure they are valid. Use
default values when invalid thresholds are configured.
Update the default RTS threshold to the maximum value given by the
specification.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Initialize AP specific BT coexitance parameters to default values and
enable them in AP mode.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
The 128x/AP firmware does not yet support dynamic memory. Temporarily,
the memory configuration for the 127x was used both for 127x/AP as well
as 128x/AP. Since the two chips don't have the same number of memory
blocks, TP was significantly degraded.
This hasn't been fine tuned yet, but using the base 128x numbers
(without dynamic memory) seems to yield much better results (around 30%
more). Additional fine tuning will be required in the future.
Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Add support to FM WLAN coexistence (STA only). Some WiFi harmonics
may interfere with FM operation, to avoid this problem special
coexistence techniques are activated around some FM frequencies.
Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
In AP mode we register for the MAX_TX_RETRY and INACTIVE_STA events.
Both are reported to the upper layers as a TX failure in the offending
stations.
In STA mode we register only for the MAX_TX_RETRY event. A TX failure is
interpreted as a loss of connection.
Support for IEEE80211_HW_REPORTS_TX_ACK_STATUS has been removed to avoid
the inherent race condition of a mac80211 TX failure counter in addition
to the FW counter.
This patch depends on "mac80211: allow low level driver to report packet
loss"
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
The total number of TX memory blocks may change when the dynamic memory
option is enabled. The current implementation only tracks the available
memory blocks, which over-complicates TX blocks accounting.
By tracking the number of allocated blocks, calculation of the number of
available blocks becomes simpler and cleaner. It simply equals the total
number of TX memory blocks minus the allocated ones.
Also, remove some unnecessary castings and use union member accesses
instead.
Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Separate the memory configuration to chip-specific structures and
implement dynamic memory for wl128x.
This feature allows us to move TX memory blocks to the RX pool when
the RX path is overloaded.
Thanks for Arik Nemtsov <arik@wizery.com> for helping simplify the
wl1271_fw_status() code.
[Rewrote the commit subject and message for clarity; improved some
comments and changed "spare" to "padding" for consistency; added a
FIXME for the AP memory configuration -- Luca]
Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
New acx command that sets: Rx fifo enable reduced bus transactions
in RX path. Tx bus transactions padding to SDIO block size that
improve preference in Tx and essential for working with SDIO HS (48Mhz).
The max SDIO block size is 256 when working with Tx bus transactions
padding to SDIO block.
Add new ops to SDIO & SPI that handles the win size change in case of
transactions padding (relevant only for SDIO).
[Fix endianess issues; simplify sdio-specific block_size handling;
minor changes in comments; use "aligned_len" in one calculation
instead of "pad" to avoid confusion -- Luca]
Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Set the gf_protection bit when calling ACX_HT_BSS_OPERATION according
to the GF bit passed by mac80211 in ht_operation_mode.
[Added a proper commit message -- Luca]
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
If a sta starts transmitting immediately after authentication, sometimes
the FW deauthenticates it. Fix this by marking the sta "in-connection"
in FW before sending the autentication response.
The "in-connection" entry is automatically removed when connection
succeeds or after a timeout.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
The mac_address should be set also when ht caps are disabled.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Instead of looking for supported_rates change on every tx packet,
just extract the supported_rates after association completes (station only).
Remove wl1271.sta_rate_set and WL1271_FLAG_STA_RATES_CHANGED which are
not used anymore.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
make the configuration management more flexible by using the
conf struct, rather than predefined macros.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
This patch adds support for the new wl12xx firmware (Rev 6.1.3.50.49)
Since this fw is not backward compatible with previous fw versions,
a new fw (with different name) is being fetched.
(the patch is big because it contains all the required fw api changes.
splitting it into multiple patches will result in corrupted intermediate
commits)
Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
mcp2.5 uses this acx to configure the fw only once, rather than
passing the params in every enter psm command.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Add new ampdu_action ops to support receiver BA.
The BA initiator session management in FW independently.
Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Add 80211n BA initiator session support wl1271 driver.
Include BA supported FW version auto detection mechanism.
BA initiator session management included in FW independently.
Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Rate class configuration has been split up for AP and STA modes.
Template related configuration likewise separated.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Note that wl1271_write32() calls cpu_to_le32() by itself, so calling
wl1271_write32(addr, cpu_to_le32(val)) is in fact a bug on BE systems.
Fix the following sparse warnings:
drivers/net/wireless/wl12xx/cmd.c:662:16: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/cmd.c:662:16: expected unsigned short [unsigned] [addressable] [usertype] llc_type
drivers/net/wireless/wl12xx/cmd.c:662:16: got restricted __be16 [usertype] <noident>
drivers/net/wireless/wl12xx/cmd.c:674:17: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/cmd.c:674:17: expected unsigned int [unsigned] [addressable] [usertype] sender_ip
drivers/net/wireless/wl12xx/cmd.c:674:17: got restricted __be32 [usertype] ip_addr
drivers/net/wireless/wl12xx/rx.c:202:4: warning: incorrect type in argument 3 (different base types)
drivers/net/wireless/wl12xx/rx.c:202:4: expected unsigned int [unsigned] [usertype] val
drivers/net/wireless/wl12xx/rx.c:202:4: got restricted __le32 [usertype] <noident>
drivers/net/wireless/wl12xx/acx.c:1247:23: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/acx.c:1247:23: expected restricted __le32 [usertype] ht_capabilites
drivers/net/wireless/wl12xx/acx.c:1247:23: got unsigned long
drivers/net/wireless/wl12xx/acx.c:1250:24: warning: invalid assignment: |=
drivers/net/wireless/wl12xx/acx.c:1250:24: left side has type restricted __le32
drivers/net/wireless/wl12xx/acx.c:1250:24: right side has type unsigned long
drivers/net/wireless/wl12xx/acx.c:1253:24: warning: invalid assignment: |=
drivers/net/wireless/wl12xx/acx.c:1253:24: left side has type restricted __le32
drivers/net/wireless/wl12xx/acx.c:1253:24: right side has type unsigned long
drivers/net/wireless/wl12xx/acx.c:1256:24: warning: invalid assignment: |=
drivers/net/wireless/wl12xx/acx.c:1256:24: left side has type restricted __le32
drivers/net/wireless/wl12xx/acx.c:1256:24: right side has type unsigned long
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
The auto-arp feature of wl12xx allows the firmware to automatically
response to arp requests asking for its ip.
in order to use it, we configure the arp response template and
enable the corresponding bit in wl1271_acx_arp_filter (along with
passing its ip)
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Indicate to mac80211 we support HW fragmentation.
Support updates of the fragmentation threshold via the
set_frag_threshold callback.
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
All files name prefix removed due to the fact that wl12xx driver supports
wl1271 and wl1273.
Also the definition in Kconfig and header files changed respectively.
Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Now that all 1271 files are split, we can add wl1251_ prefix to the files.
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Reviewed-by: Vidhya Govindan <vidhya.govindan@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
The patch "wl12xx: cmd and acx interface rework" failed to assign MSDU
lifetime value in wl12xx_acx_rx_msdu_life_time() and breaks the functionality.
This patch fixes the regression by assigning the correct value.
Signed-off-by: Vidhya Govindan <vidhya.govindan@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
A warning message in wl12xx_acx_event_mbox_mask has a copy/paste
error. Fix it to print the correct acx command.
Signed-off-by: Ari Kauppi <Ext-Ari.Kauppi@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Changed the function wl12xx_acx_wake_up_conditions() so that it receives an
argument with the actual wake up condition, instead of having
WAKE_UP_EVENT_DTIM_BITMAP hardcoded. This is needed because we have to use
different conditions in 1271.
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rework cmd and acx interfaces, it was just too confusing earlier. Now
all commands need to contain all the needed headers, either just cmd
headers or both cmd and acx headers. This accomplish to remove the
extra copy done for each command. The interfaces are now properly
documented as well.
Also try to make all commands safe for DMA transfers. I might have missed
some, but most of them should be fixed now.
And this is not all! As a free bonus you will also get some cosmetic
cleanups and code reorganisation. Order today!
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
wl12xx is a driver for TI wl1251 802.11 chipset designed for embedded
devices, supporting both SDIO and SPI busses. Currently the driver
supports only SPI. Adding support 1253 (the 5 GHz version) should be
relatively easy. More information here:
http://focus.ti.com/general/docs/wtbu/wtbuproductcontent.tsp?contentId=4711&navigationId=12494&templateId=6123
(Collapsed original sequence of pre-merge patches into single commit for
initial merge. -- JWL)
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>