Commit Graph

41 Commits (5b37ddfec23c17e16b99d8b5c5d1815b312af060)

Author SHA1 Message Date
Eyal Shapira 1b04b739f4 wl12xx: minor fix in sched_scan_ssid_list
The user can pass broadcast SSID (ssid="") in the list of SSIDs for active scan.
In this case the loop was attempting to match SSIDs in the filter
list to this empty entry and marking them as HIDDEN (sending probe
request) by mistake

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-08 12:32:40 +02:00
Luciano Coelho e4da3fbfbd Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into wl12xx-next 2011-12-01 12:14:48 +02:00
Eyal Shapira cc438fccd5 wl12xx: fix wl12xx_scan_sched_scan_ssid_list() check that all given ssids are in filters
A minor fix for the check that verifies that all given SSIDs (in req) exist
in the filters (the match sets)

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Acked-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-08 15:02:45 -05:00
Guy Eilam bfafba8a4c wl12xx: set scan probe requests rate according to the no_cck flag
Set the TX rate of probe requests during scanning according to the
no_cck flag in the scan request struct.

Signed-off-by: Guy Eilam <guy@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-11-08 15:50:09 +02:00
Eliad Peller 679a673414 wl12xx: couple role_start_dev with roc
Device role is always started along with ROC.
Couple them together by introducing new wl12xx_start_dev
and wl12xx_stop_dev functions.

By using these functions, we solve a bug that occured during
channel switch - we started the dev role on one channel, and
ROCed on a different one.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-11-08 15:36:45 +02:00
Luciano Coelho 0f4e31222a wl12xx: move debugging definitions to a separate file
Separate the debugging macros and other definitions to a new debug.h
file.  This is be needed because the sdio and spi modules don't need
to depend on the wl12xx module anymore, but still need to include
wl12xx.h.  Currently they do depend on it, because of the debugging
global that wl12xx exports.  A future patch will remove this
dependency.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 16:19:05 +03:00
Eliad Peller 1b92f15ee0 wl12xx: add band field to wlvif
add band field into the per-interface data.

mac80211 configures some values (e.g. band, channel)
globally, while we configure them per-interface.

In order to make it easier to keep track of the
configured value for each value while keeping sync
with mac80211, save these values both globally
and per-vif.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:12:12 +03:00
Eliad Peller eee514e3d6 wl12xx: make WL1271_FLAG_IBSS_JOINED flag per-vif
This flag should be set per-vif, rather than globally.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:09:57 +03:00
Eliad Peller ba8447f641 wl12xx: make WL1271_FLAG_STA_ASSOCIATED flag per-vif
This flag should be set per-vif, rather than globally.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:09:57 +03:00
Eliad Peller 83587505a2 wl12xx: move bitrate_masks into wlvif
move bitrate_masks into the per-interface data, rather than
being global.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:04:22 +03:00
Eliad Peller 7edebf56ca wl12xx: move dev_role_id into wlvif
move dev_role_id into the per-interface data, rather than
being global.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:43 +03:00
Eliad Peller 0603d891c5 wl12xx: move role_id into wlvif
move role_id into the per-interface data, rather than
being global.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:42 +03:00
Eliad Peller bddb29b83a wl12xx: move probereq into wlvif
move probereq into the per-interface data, rather than
being global.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:40 +03:00
Eliad Peller 536129c8ad wl12xx: move bss_type into wlvif
move bss_type into the per-interface data, rather than
being global.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:37 +03:00
Eliad Peller 784f694d0f wl12xx: replace wl->mac_addr with vif->addr
The mac address of the interface already exists in vif->addr.
Use it instead of wl->mac_addr.

It seems that due to some fw bug, we still need to set nvs->mac
to the actual mac addresss, otherwise the fw doesn't function
well (e.g. can't get dhcp address).
Thus, use wl->mac_addr for this purpose, and don't delete it yet.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:31 +03:00
Eliad Peller af7fbb28ef wl12xx: implement set_bitrate_mask callback
Save the configured bitrate, and use the min allowed rate
as the basic rate (e.g. when scanning).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-23 15:59:45 +03:00
Luciano Coelho 6cd9d21a0c wl12xx: fix forced passive scans
We were using incorrect max and min dwell times during forced passive
scans because we were still using the active scan states to scan
(passively) the channels that were not marked as passive.

Instead of doing passive scans in active states, we now skip active
states and scan for all channels in passive states.

Cc: <stable@kernel.org> # 2.6.36+
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-22 13:21:41 +03:00
Luciano Coelho 20a33e52ed wl12xx: ignore sched scan match sets without SSID
For now, cfg80211 only support match sets with SSIDs, but in the
future more parameters will be added.  This patch ignores eventual
matches that do not contain SSIDs in preparation for the future.  This
change also affects the case where broadcast SSIDs are used.  Matching
a broadcast SSID will match everything, so they can be ignored.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-14 12:18:38 +03:00
Luciano Coelho fb55377b2a wl12xx: add support for sched_scan filters
Implement support for filtering in scheduled scans.

With this commit we now use the match sets passed by cfg80211 to
filter on SSIDs.  Due to the nature of the wl12xx firmware API, we
don't allow SSIDs to be sent in the probe requests if they are not
going to match any of the filters.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-14 12:18:38 +03:00
Eliad Peller e0b38265b0 wl12xx: check for ROC on scan_complete
When scan completes, and we are not associated, we should start
the dev role and ROC. however, we might already be in this situation
(e.g. if we got disconnected during scan). check for it.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-14 11:47:26 +03:00
Eliad Peller 2ec7da254c wl12xx: don't use WL1271_SCAN_OPT_PRIORITY_HIGH flag
When setting the WL1271_SCAN_OPT_PRIORITY_HIGH flag, the
driver requests a scan *now*, and the fw doesn't enter psm
before scanning, which in turn might cause packets loss.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-14 11:47:26 +03:00
Luciano Coelho bd4932b8ee wl12xx: use SCAN_SSID_TYPE_PUBLIC when using the wildcard in sched_scan
When we are scanning for the wildcard SSID in a scheduled scan, we
should use SCAN_SSID_TYPE_PUBLIC so that we don't filter out the scan
results.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-25 10:24:29 +03:00
Luciano Coelho f952079a19 wl12xx: add support for multiple SSIDs in sched_scan
The wl12xx firmwares support multiple SSIDs in a single sched_scan
run.  This patch implements support for it.

We use three different types os sched_scan: FILTER_ANY (ie. not
filtering, only wildcard SSID in the probe_reqs); FILTER_LIST (ie. send out
probe_reqs with the specified SSIDs and only report if they are
found); and FILTER_DISABLED (ie. send out probe_reqs with the
specified SSIDs, but report anything found).

Since we still don't have proper filter support in nl80211/cfg80211
yet, we cannot use filters when the wildcard SSID is used.  Thus, we
will not filter anything if the wildcard SSID is specified.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-25 10:24:29 +03:00
Eliad Peller 227e81e184 wl12xx: support IBSS vif type
Start IBSS role when the interface type is IBSS.
As with sta role, use the dev role until the role
is started.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22 12:35:28 +03:00
Eliad Peller 251c177f88 wl12xx: replace dummy_join with ROC/CROC commands
The ROC command asks the fw stay on the channel of the given
hlid. it currently has 2 primary functions:

1. Allow tx/rx from the device role.

In order to tx/rx packets while the stations is not associated
(e.g. auth req/resp), the device role has to be used, along
with ROC on its link.

Keep the logic similiar to the one used in dummy_join. However,
since we can't scan while we ROC, we add CROC before starting
a scan, and ROC again (if needed) on scan complete.

2. Keeping the antenna for a specific link.

We ROC until the connection was completed (after EAPOLs exchange)
in order to prevent BT coex operations from taking the antenna
and failing the connection (after this stage, psm can be used).

During association, we ROC on the station role, and then CROC
the device role, thus assuring being ROC during all the connection
process.

Delete the WL1271_FLAG_JOINED flag, and use a roc bitmap
to indicate what roles are currently ROCed.

Add wl12xx_roc/croc functions in order to wrap the roc/croc
commands while taking care of the roc bitmap.

The current ROC/CROC state-machine is a bit complicated. In
the future we'll probably want to use wpa_supplicant to control
the ROC during connection.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22 12:35:26 +03:00
Eliad Peller a4e02f330a wl12xx: update scan cmd api
Update the scan command to use the new fw api
(fw 6/7.3.0.0.75).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-08-22 12:35:25 +03:00
Eliad Peller 08c1d1c704 wl12xx: remove rx filtering stuff
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>
2011-08-22 12:35:23 +03:00
Eliad Peller 2aa01597eb wl12xx: add stop_scan command
define wl1271_scan_stop() to cancel an ongoing hw scan.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-07-05 21:50:39 +03:00
Ido Yariv baacb9aed0 wl12xx: Avoid recovery while one is already in progress
During recovery work commands sent to the FW could fail and schedule
additional recovery work. Since the chip is going to be powered off,
avoid recursive recoveries.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27 15:05:15 +03:00
Luciano Coelho d2c2bb9fcc wl12xx: split channel array per band in sched_scan
The firmware, in practice, treats the channels in three separate
blocks, one for each band (bg, a and j).  Instead of using a single
array and doing some magic with indices, split the array in 3 to make
it more readable.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27 12:01:20 +03:00
Luciano Coelho 66870b1ccd wl12xx: fix oops in sched_scan when forcing a passive scan
Fix kernel oops when trying to use passive scheduled scans.  The
reason was that in passive scans there are no SSIDs, so there was a
NULL pointer dereference.

To solve the problem, we now check the number of SSIDs provided in the
sched_scan request and only access the list if there's one or more
(ie. passive scan is not forced).  We also force all the channels to
be passive by adding the IEEE80211_CHAN_PASSIVE_SCAN flag locally
before the checks in the wl1271_scan_get_sched_scan_channels()
function.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-31 14:47:26 -04:00
Luciano Coelho 50a66d7f04 wl12xx: add separate config value for DFS dwell time on sched scan
Use a different value for DFS dwell time when performing a scheduled
scan.  Previously we were using the same value as for normal passive
scans.  This adds some flexibility between these two different types
of passive scan.

For now we use 150 TUs for DFS channel dwell time.  This may need to
be fine-tuned in the future.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-31 14:47:25 -04:00
Luciano Coelho 2497a246e8 wl12xx: fix DFS channels handling in scheduled scan
DFS channels were never getting included in the scheduled scans,
because they always contain the passive flag as well and the call was
asking for DFS and active channels.

Fix this by ignoring the passive flag when collecting DFS channels.
Also, move the DFS channels in the channel list before the 5GHz active
channels (this was implemented in the FW differently than specified).

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-31 14:47:25 -04:00
Luciano Coelho dd08682150 wl12xx: fix passive and radar channel generation for scheduled scan
We were comparing bitwise AND results with a boolean, so when the
boolean was set to true, it was not matching as it should.

Fix this by booleanizing the bitwise AND results with !!.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-31 14:47:24 -04:00
Luciano Coelho 683c002447 wl12xx: prevent sched_scan when not idle or not in station mode
The current firmware only supports scheduled scan in station mode and
when idle.  To prevent the firmware from crashing, return -EOPNOTSUPP
when sched_scan start is called in an invalid state.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-13 00:06:33 +03:00
Luciano Coelho 33c2c06cd2 wl12xx: implement scheduled scan driver operations and reporting
This patch adds the mac80211 operations for scheduled scan and the
scheduled scan results reporting.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-13 00:06:33 +03:00
Luciano Coelho 95feadca6d wl12xx: add scheduled scan structures and commands
Add firmware command structures, definitions and code to to configure,
start and stop scheduled scans.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-13 00:06:33 +03:00
Luciano Coelho 4a31c11c7d wl12xx: use a bitmask instead of list of booleans in scanned_ch
We were using an array of booleans to mark the channels we had already
scanned.  This was causing a sparse error, because bool is not a type
with defined size.  To fix this, use bitmasks instead, which is much
cleaner anyway.

Thanks Johannes Berg for the idea.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-04-19 16:49:12 +03:00
Arik Nemtsov 24225b37bd wl12xx: wakeup chip from ELP during scan
Commands are sometimes sent to FW on scan completion. Make sure the chip
is awake to receive them. Sending commands while the chip is in ELP
can cause SDIO read errors and/or crash the FW.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-03-03 16:20:25 +02:00
Juuso Oikarinen 2f6724b245 wl1271: Fix setting of the hardware connection monitoring probe-req template
The probe-request template used in the hardware connection monitoring feature
thus far has been an empty one, without the SSID IE and without supported rate
IEs. This causes problems with some AP's.

Additionally, after connected scans, the template for connection maintenance
would remain to be the one last used for scanning - potentially incorrect.

Fix these by getting a pre-filled directed probe-request template for the
associated-to AP from mac80211.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
2010-11-26 15:33:41 +02:00
Shahar Levi 00d201001b wl1271: Change wl12xx Files Names
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>
2010-11-22 16:45:09 +02:00