Commit graph

378 commits

Author SHA1 Message Date
Ido Reis ec4f4b76a6 wl18xx: update default mac/phy parameters
Update mac/phy paramters according to the default HP SISO boards.

Signed-off-by: Ido Reis <idor@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-04 16:59:31 +02:00
Arik Nemtsov 3ea186d137 wlcore/wl12xx: make sure session id is always zero for AP
The 12xx FW doesn't support non-zero session ids for AP-mode. Introduce
an appropriate quirk to make sure the session id is always zero when
needed.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-04 16:43:04 +02:00
Luciano Coelho aaabee8b76 Merge branch 'wl12xx-next' into for-linville
Conflicts:
	drivers/net/wireless/ti/wlcore/main.c
2012-12-04 16:39:47 +02:00
Luciano Coelho 2f24456149 wl18xx: ignore irrelevant firmware version fields
For wl18xx, only the chip ID and the minor version number are
relevant.  Ignore the other numbers which are either not used or
relate to internal projects or internal branches.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-04 16:36:12 +02:00
Luciano Coelho 8675f9abdf wlcore/wl12xx/wl18xx: verify multi-role and single-role fw versions
Previously we were only checking the single-role firmware version.
Now add code to check for the firmware versions separately for each
firmware type.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-04 16:36:12 +02:00
Luciano Coelho b3ec9cf205 wl12xx: ignore some of the firmware version fields
The firmware type and the project number fields in the firmware
version number, cannot be checked as if they increase sequentially,
because the former is the firmware type and the latter is an internal
project number.  There's no guarantee that these numbers will remain
incremental, so use WLCORE_FW_VER_IGNORE.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-04 16:36:11 +02:00
Luciano Coelho af4e94c565 wlcore: change way of checking the firmware version
The firmwares version string contain 5 integers.  We used to consider
all the digits (except for the first one, which indicates the chip) as
linearly increasing version numbers.  This is not correct, because
some of the integers indicate type of firmware (eg. single-role
vs. multi-role) or the internal project it was created for.

Besides, this varies a bit from chip to chip, so we need to make the
firmware version checks more flexible (eg. allow the lower driver to
ignore some of the integers).  Additionally, we need to change the
code so that we only check for a linearly increasing number on the
fields where this actually makes sense.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-04 16:36:11 +02:00
Luciano Coelho c3552c0625 wlcore/wl12xx: remove deprecated FW version check
We don't distinguish between STA and AP firmwares anymore, so the
firmware version checking and quirks setting in wl12xx isn't needed
anymore.

Remove implementation of .identify_fw in wl12xx and deprecated
definitions.  Don't remove the op entirely from wlcore, because it may
be needed for more fine-grained checking later.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-04 16:36:10 +02:00
Luciano Coelho 986f3aa166 wlcore/wl12xx: move wl12xx chip ID defines to the lower driver
Move wl12xx-specific chip ID macros to the wl12xx driver and rename
them to 127X and 128X for clarity since both the "1" (2.4GHz) and the
"3" (2.4GHz and 5GHz) variants use the same chip ID.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-04 16:36:10 +02:00
Yair Shapira 7230341f25 wlcore/wl18xx/wl12xx: add recovery settings to conf
add support for recovery settings including bug_on_recovery and
no_recovery options.

These options can now be set using wl18xx-conf.bin file and wlconf
tool.

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-04 16:36:09 +02:00
Luciano Coelho c108c90535 wlcore: gather information about firmware stability
It's sometimes useful to gather information about the firmware
stability in long test runs, especially to see if problems are
recurring frequently or not.  With this commit we count the number of
times a hardware recovery was issued and print it out during recovery
and in the driver_state in debugfs.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-04 16:36:09 +02:00
Eliad Peller 518b680a8e wlcore: move ps change handling to .bss_info_changed()
Adapt the new mac80211 BSS_CHANGED_PS notification,
and do the ps handling in mac80211's per-vif
callback (.bss_info_changed), rather than in
the per-device (.config) callback.

Make sure to configure it only after association.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-04 16:36:08 +02:00
Eliad Peller 873d2a4034 wlcore: mask out CCK rates when starting GO
mask out CCK rates from the AP's local rates
when the interace is p2p interface (GO).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-04 16:36:08 +02:00
Eliad Peller 426001a6aa wlcore: use sta_state-based ROCs for AP mode
Try an opportunistic ROC when a STA is first added and stop the ROC when
the STA is removed or successfully authenticated. This would ensure we
don't miss auth/assoc/EAPOL packets during connection

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-04 16:36:07 +02:00
Arik Nemtsov de40750f4b wlcore/wl18xx/wl12xx: separate channel count between chips
18xx chips are capable of staying on 2 channels at the same time.
Introduce a chip-family specific parameter to set the number of channels
in the interface-combinations published by the driver.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-04 16:36:07 +02:00
Eliad Peller 847cbebd52 wlcore: don't stop fwlog if dbgpins are used
Due to a bug, the fw asserts on fw log stop when dbg-pins are used.
Don't stop the fw log in this case.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-28 11:45:43 +02:00
Arik Nemtsov 5f9b67770b wlcore: use new set bandwidth command to adjusting channel BW
We support changing the channel BW when we started the STA role on
a 40Mhz bandwidth. Otherwise a reconnection is required.
Save the started channel width and use it when channel width updates
arrive.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-28 11:45:42 +02:00
Eliad Peller 7c482c1040 wlcore: configure dwell times according to scan type
Allow configuring different dwell times to the different
scan types (regular and scheduled).

Add new configuration entry (dwell_time_dfs) to
conf_scan_settings, in order to allow setting
different values for normal scan and scheduled scan.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-28 11:45:42 +02:00
Eliad Peller 6507babab4 wl18xx: make driver operational again
we have done updating the driver to the new fw
api, so make the driver operational again.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-28 11:41:45 +02:00
Eliad Peller 1019975640 wlcore: call ieee80211_sched_scan_stopped on interface removal
The interface might go down before we got the SCHED_STOPPED
event, so make sure to call ieee80211_sched_scan_stopped()
if the scanned interface is removed.

Replace sched_scanning with sched_vif in order to save
the scanned interface.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-28 11:41:44 +02:00
Victor Goldenshtein 6b70e7eb70 wlcore: add new reg-domain configuration command
In 18xx the calibration process of the PHY Cortex domain
requires to perform an active calibration of the channel
before it can be used for transmission. To fulfill world
wide regulatory restrictions, fw should be always
synchronized/updated with current CRDA configuration.
Add a new "CMD_DFS_CHANNEL_CONFIG" command to update the
fw with current reg-domain, this command passes a bit map
of channels that are allowed to be used for transmission.

The driver shall update the fw during initialization and
after each change in the current reg-domain
configuration. The driver will save the channel number of
incoming beacons during the scan process, as they might
be a result of the passive scan on
"IEEE80211_CHAN_PASSIVE_SCAN" channel and will update the
fw accordingly once the scan is finished, the purpose of
this is to be ready in case of the authentication request
on one of these disabled (uncalibrated) channels.

The new command requires to wait for the fw completion
event "DFS_CHANNELS_CONFIG_COMPLETE_EVENT".

No scan commands (including the sched scan) can be
executed concurrently with the "CMD_DFS_CHANNEL_CONFIG",
wl->mutex ensures that.

[Arik - move reset of reg_ch_conf_last to safe place inside
op_stop_locked]
[Eliad - adjust to new event waiting api]

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-28 11:41:43 +02:00
Eliad Peller 978cd3a0b8 wlcore: save session_id per-link
A new session_id is generated on link allocation.
it is saved in a global array and used later, on tx.

The new fw api adds new bcast/global_session_id
fields to start_role(ap) command, and a new session_id
field to add_peer command. align the driver with it.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:30 +02:00
Eliad Peller d50529c0d8 wlcore: pass wmm configuration to the fw
New fields were added to start_role(ap) and
set_peer_state commands, so the fw will be
able to know whether the sta/ap supports
wmm (the fw uses it in order to choose the
AC for some of its internally-generated frames)

For sta, take this value right from bss_conf->qos.

For ap, check for wmm support by looking for the
WMM IE in the configured beacon.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:29 +02:00
Eliad Peller c50a282515 wlcore: update events enum/struct to new fw api
The event mailbox in wl18xx has a different
(non-compatible) structure.

Create common functions in wlcore to handle the
events, and call them from the chip-specific
event mailbox parsers.

This way, each driver (wl12xx/wl18xx) extracts
the event mailbox by itself according to its
own structure, and then calls the common
wlcore functions to handle it.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:29 +02:00
Eliad Peller fcab189027 wlcore: update channel_switch/stop_channel_switch commands
Some fields were added to the channel_switch and
stop_channel_switch commands. Unfortunately,
the new 18xx channel_switch struct is not backward
compatible with the 12xx channel switch struct.

Add a new channel_switch op to wlcore, and update
the driver accordingly.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:28 +02:00
Eliad Peller b6acb4e00e wlcore: update acx enum
update the acx enum to the new fw api.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:28 +02:00
Eliad Peller 0a1c720c63 wl18xx: increase MAX_CHANNELS_5GHZ
Some regdomains have more than 23 valid 5ghz channels,
so 18xx's MAX_CHANNELS_5GHZ was increased to 32.

Since now we have different max 5ghz channels values
for wl12xx and wl18xx, add a new wl->max_channels_5ghz
field, and use it for scan channels configuration.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:27 +02:00
Eliad Peller 78e28062fe wlcore: split 18xx and 12xx scan mechanism
The scan APIs of 12xx and 18xx are totally different.
Use some common functions as much as possible (e.g.
for setting scan channels), but split scan.c into
chip-specific scan.c files, each implementing its
own scan mechanism.

(in other words - move most of the current wlcore's
scan.c into wl12xx, and implement a similar mechanism
in 18xx, according to the new api)

New wlcore ops are introduced in order to call the
chip-specific scan functions.

The template indices used for each scan (regular/scheduled)
are also different between the chips, so set the correct
indices used for each scan type after identifying the chip.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:27 +02:00
Eliad Peller e9b9d45507 wlcore: update commands enum to new fw api
Align the commands enum with the new fw api (8.4.0.0.19)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:26 +02:00
Eliad Peller 750a986d6a wl18xx: change fw name and temporarily fail loading
The new fw (8.5.0.0.28) is not backward compatible
with older drivers.

Use a new fw name (along with bumping the min
fw version), and add some code to fail
any boot attempt during the fw api alignment
patches (as the driver is not functional in
these transitional patches).

This code will be removed after the api alignment
will be done.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:26 +02:00
Eliad Peller 512c5385e6 wlcore: make scan scan configuration functions more generic
18xx and 12xx have different scan APIs. In 18xx,
the scan and the sched scan use the same struct.

Prepare the scan configuration functions to it, by taking
more generic params (e.g. ieee80211_channel) instead of
specific structs/requests.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:25 +02:00
Eliad Peller 598b262a06 wlcore: don't call ieee80211_sched_scan_stopped directly
When we stop sched scan during connection, we shouldn't
call ieee80211_sched_scan_stopped directly, but do it
in the normal flow, as part of the SCHED_SCAN_COMPLETED
event handling.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:25 +02:00
Luciano Coelho 48af2eb046 wlcore: remove a bunch of unnecessary parentheses
Some if statements had unnecessary parentheses.  Remove them for
consistency.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:24 +02:00
Luciano Coelho ef08d0281a wlcore: avoid using goto in normal code flow
Remove goto and label in the code where a simple if can be used.  If
nothing else, this is at least confusing git diff, which shows the
label name as the name of the function.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:23 +02:00
Eliad Peller a8e27820f2 wlcore: don't leak wl->mbox
free it on wlcore_free_hw()

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:23 +02:00
Eliad Peller d3f5a1b598 wlcore: print role_id on bss_info_changed
In multi-vif setup it's useful to know the role_id
being configured.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:22 +02:00
Eliad Peller dc62a3dbf3 wlcore: configure the remote rates with our own rates
With the new connection flow, start_sta is called before
the remote rates where updated. Use our own supported rates
instead to make sure we don't disable any potential rate
(the rate policies will be updated later, but there is
currently no way to update the remote rates)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:19 +02:00
Eliad Peller 58321b296d wlcore: refactor CHANGED_HT handling
Pass a variable indicating whether HT is enabled,
instead of duplicating the function call with
different arguments.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:15 +02:00
Eliad Peller ec87011a4a wlcore: reconfigure rate policy on association
When first configuring the rate policy, before auth,
we still don't have the correct rates that were
agreed during association.

Reconfigure the rate policy on association in order
to update them.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:10 +02:00
Eliad Peller 42ec1f82a8 wlcore: specify correct supported_rates
The supported_rates field should contain all our supported
rates, even if the remote peer doesn't support them.

(rename CONF_TX_AP_ENABLED_RATES to CONF_TX_ENABLED_RATES,
as we now use it for both ap and sta)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:06 +02:00
Eliad Peller 6c7b519464 wlcore: set active psm on association
The default ps mode of the fw is auto, while the default
ps mode of mac80211 is active (ps off).
In order to sync them, configure active ps on association.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:49:01 +02:00
Eliad Peller 2993626678 wlcore: initiate ROC/CROC on sta state updates
Use the sta_state notifications to ROC when a station
is about to connect, and CROC respectively on
authorization (success) / deletion (failure).

Change the wl12xx_update_sta_state() flow to bail out
only on error, so multiple code blocks could refer
to the same state.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:48:57 +02:00
Eliad Peller b6970ee582 wlcore: add chanctx implementation
Add some basic chanctx implementation - debug prints,
and save the vif's channel/band/type.

After that, we no longer need to handle channel change
notifications on op_config.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:48:36 +02:00
Eliad Peller cd1810ddcf wlcore: get channel from bss_conf instead of hw->conf
We care only about the operational channel, not
about the temporal hw channel (which won't have
any real meaning in multi-channel env anyway)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:48:31 +02:00
Eliad Peller dabf37dba4 wlcore: implement .remain_on_channel() callback
implement the reamin_on_channel() callback by starting
a dev role (already associated with the current vif)
on the requested channel/band.

This channel is usually different from the channel
of the sta role, so pass it to wl12xx_roc() as well,
and notify mac80211 (async) when the fw is ready
on the new channel.

Now, in case of offchannel tx, we should use the dev
role hlid, instead of the sta hlid.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:48:26 +02:00
Eliad Peller 18eab43070 wlcore: workaround start_sta problem in wl12xx fw
for some reason, the wl12xx fw is not able to rx/tx
on the first start_sta cmd.
Workaround it by issuing a dummy start_sta + stop_sta
before starting the sta for the final time.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:48:20 +02:00
Eliad Peller 3230f35e09 wlcore: start sta role on CHANGED_BSSID
Make the connection flow simpler by starting
sta role on bssid change.

Currently, we start dev role when going idle-off,
and start the sta role only after association
indication. This complicates the connection
flow with some possible intermediate states.

Make it simpler by starting sta role on bssid change,
which now happens *before* auth req get sent.

Update the handling of mac80211's notifications
and change wl1271_join/unjoin accordingly -
* Split wl1271_join() into wlcore_join (tuning on
  a channel/bssid) and wlcore_set_assoc (configure
  sta after association).
* Rename wl1271_unjoin() to wlcore_unset_assoc(), as
  it is no longer the inversion of wl1271_join()
  (now it's only used to disconnect associated sta /
  joined ibss, without stopping the role).
* Set ssid before starting station role (needed for
  start_role(sta)

While on it, split wl1271_bss_info_changed_sta() into
some sub-functions.

since we no longer use dev role in the connection flow,
we now always use the hlid of the sta role.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27 10:47:59 +02:00
Johannes Berg 4bf88530be mac80211: convert to channel definition struct
Convert mac80211 (and where necessary, some drivers a
little bit) to the new channel definition struct.

This will allow extending mac80211 for VHT, which is
currently restricted to channel contexts since there
are no drivers using that which makes it easier. As
I also don't care about VHT for drivers not using the
channel context API, I won't convert the previous API
to VHT support.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-11-26 12:42:59 +01:00
Tushar Behera 8f1fd6cb6a wlcore: Remove redundant check on unsigned variable
No need to check whether unsigned variable is less than 0.

CC: Luciano Coelho <coelho@ti.com>
CC: linux-wireless@vger.kernel.org
CC: netdev@vger.kernel.org
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-11-16 19:53:01 +02:00
Chuansheng Liu 25b08bf662 wlcore: Fix the usage of wait_for_completion_timeout
The return value of wait_for_completion_timeout() is always
>= 0 with unsigned int type.

So the condition "ret < 0" or "ret >= 0" is pointless.

Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-11-16 19:53:01 +02:00