Commit Graph

1039 Commits

Author SHA1 Message Date
Eliad Peller cdaac62811 wl12xx: fw api change - add role_id to set_template
The set_template commands now takes the role_id as
parameter.

Usually, we'll use the vif's main role_id.
However, sometimes we'll want to use
wlvif->dev_role_id instead of wlvif->role_id,
so pass the wanted role_id as param.

Update WL127X_FW_NAME/WL128X_FW_NAME.

(This commit starts a series of fw update patches,
and changes the start() callback to return an error
in order to prevent the use of the driver during the
transition. This change will be reverted in the
last patch of series)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:30 +02:00
Eliad Peller 1ebaa2d041 wl12xx: don't release/claim sdio on suspend/resume
Since we reverted to claiming the host only when needed,
we no longer need to release/claim the host on suspend/resume.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:30 +02:00
Eliad Peller b474830636 Revert "wl12xx: Change claiming of the SDIO bus"
This reverts commit 393fb560d3.

Commit b6ad726 ("mmc: core: Prevent too long response times
for suspend") fails the suspend if the mmc host can't be
claimed before suspend. As the host is claimed by us as long
as the chip is powered on, suspend will always fail.

Revert to claiming the sdio bus only when needed.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:30 +02:00
Eliad Peller 2801d69e84 wl12xx: remove wl1271_tx_update_filters
wl1271_tx_update_filters() is used as some workaround
to open filters while roaming on the same channel.

However, it doesn't handle roaming to a different channel,
and it might also sleep in the tx path, which is a bug.

With the new auth/assoc redesign, roaming is much simpler,
and this function is not needed anymore.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:30 +02:00
Eliad Peller 7db4ee6d0a wl12xx: check bss_conf->assoc on CHANGED_BSSID
with the new auth/assoc redesign, we get CHANGED_BSSID
indication before CHANGED_ASSOC indication, while our
CHANGED_BSSID handling block assumes we are already
associated.

Fix it by checking we are either in ibss mode, or
already associated.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:30 +02:00
Luciano Coelho 2c882fa475 wl12xx: fix typo in fwlog module param description
Fix a copy and paste bug in the MODULE_PARAM_DESC for fwlog.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:29 +02:00
Luciano Coelho 775e1a4bd5 wl12xx: remove unnecessary shadow declaration
The vif variable was being declared inside one of the internal blocks
of wl1271_event_process.  This is not necessary, since this variable
is already declared in the function context.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:29 +02:00
Luciano Coelho 75f25548be wl12xx: add testmode operation to read the BD_ADDR from Fuse ROM
Add a testmode command to retrieve the BD_ADDR that is stored in the
Fuse ROM in newer PGs.  In old PGs this operation is not supported.
The caller can then derive the MAC addresses from it.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:29 +02:00
Luciano Coelho 5e037e7480 wl12xx: use two MAC addresses based on the NVS or from fuse ROM
Add support for two MAC addresses.  If the NVS has a valid MAC
address, that takes precedence and we use two sequential address
starting from the one specified.

If the NVS doesn't contain a valid MAC address (ie. if it is set to
00:00:00:00:00:00), we check if the HW PG version in use has the
BD_ADDR written in the fuse ROM.  If it does, we read it and derive
the two subsequent addresses for WLAN.

During production, 3 addresses are reserved per device.  The first for
Bluetooth (burnt in the fuse ROM) and the following two for WLAN.

This patch has some code by Igal and Arik (squashed from internal
patches).

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:29 +02:00
Luciano Coelho 30c5dbd1ee wl12xx: read chip ID and HW PG version during probe
In order to read the MAC addresses from the fuse ROM, we need to know
the chip ID and the HW PG version.  We need to know the MAC address
during probe, because that's when we register our HW with mac80211.

To prepare for that, this patch reads the chip ID and HW PG version
during probe instead of doing it at boot time.  We power the chip on
briefly in order to do that.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:29 +02:00
Luciano Coelho 0becb14ab4 wl12xx: move partition table definition to io.c
Up till now we only needed to access the partition table in boot.c.
But to add support for reading the MAC address from the FUSE in
testmode, we will have to change the partition in testmode.c.

Thus, we move the partition table to io.c and export it via io.h.  It
makes more sense to have it in the io part anyway.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:28 +02:00
Luciano Coelho f6fbeccd3e wl12xx: cancel delayed elp work and clear flags when stopping PLT
In some cases a race condition can happen if we don't cancel any
pending ELP work before stopping PLT.  With this commit we cancel ELP
work and clear the wl->flags bitmask.  Also clean up the wl elements
after powering off.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:28 +02:00
Ido Yariv 46b0cc9ffc wl12xx: Fix potential interrupt storm
The interrupt threaded handler exits immediately if the driver's state
is WL1271_STATE_OFF. As a result, the interrupt status is not read. If
the interrupt is level triggered, it will be fired again.

Fix this by disabling interrupts before setting the state to OFF.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:28 +02:00
Ido Yariv a454969ede wl12xx: Power off after flushing work
When stopping plt, the chip is powered off before all current work items
are flushed and interrupts are disabled. This might introduce a race in
which the driver tries to communicate with a powered off chip.

Fix this by powering off the device only after interrupts are disabled
and all work items are flushed.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:28 +02:00
Ido Yariv f3df1331f2 wl12xx: Acquire lock before stopping plt
__wl1271_plt_stop is called from both wl1271_plt_stop and
wl1271_unregister_hw. While wl1271_plt_stop acquires a mutex,
wl1271_unregister_hw does not.

Fix this by calling wl1271_plt_stop instead of __wl1271_plt_stop from
wl1271_unregister_hw.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:28 +02:00
Pontus Fuchs 9e0dc890ce wl12xx: Make sure HW is available in sched scan ops
The sched_scan_(stop|start) ops fails to check for WL1271_STATE_OFF.
This can lead to a race where the driver tries to access the HW
while it's off.

Fix this by checking for WL1271_STATE_OFF before accessing the HW.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:28 +02:00
Luciano Coelho 15944aef29 wl12xx: enable sparse endianess check by default
Following the good example of the Intel (and more recently Atheros)
drivers, enable endianess check by default when running sparse.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:27 +02:00
Johannes Berg ea086359a6 mac80211: make CQM RSSI support per virtual interface
Similar to the previous beacon filtering patch,
make CQM RSSI support depend on the flags that
the driver set for virtual interfaces.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-01-27 14:56:54 -05:00
Johannes Berg c1288b1278 mac80211: make beacon filtering per virtual interface
Due to firmware limitations, we may not be able to
support beacon filtering on all virtual interfaces.
To allow this in mac80211, introduce per-interface
driver capability flags that the driver sets when
an interface is added.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-01-27 14:56:53 -05:00
Eyal Shapira ee91d18551 wl12xx: mark no sched scan only after FW event
stop sched scan isn't an immediate operation
and we need to wait for PERIODIC_SCAN_COMPLETE_EVENT_ID
after sending a stop before changing internal state
and notifying upper layers.
Not doing this caused problems when canceling an existing sched
scan and immediately requesting to start a new one
with a different configuration as the FW was still
in the middle of the previous sched scan.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-20 22:30:16 +02:00
Eyal Shapira fea2a613cf wl12xx: fix sched scan of DFS channels
DFS channels weren't scanned properly because
min/max_duration weren't set for these channels
even though they're required by the FW.
The change sets passive_duration and min/max_duration
for all channels as the FW uses the correct parameters
according to the channel type.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-20 22:30:16 +02:00
Luciano Coelho 180d9fc334 wl12xx: add missing copyright notice
The wl12xx_platform_data.c file did not have a proper copyright
notice.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-20 22:30:15 +02:00
Eliad Peller 6ab7091693 wl12xx: check the actual vif operstate in wl1271_dev_notify
The current wl1271_dev_notify implementation sets the
new operstate to all associated stations (while only
a specific vif was changed).

Until we'll have a method to get the actual vif from
the given dev, check the current operstate of each vif.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-20 22:30:15 +02:00
Eliad Peller b890f4c363 wl12xx: stop device role on remove_interface
When removing a sta/ibss role, the device role has to
stopped (and disabled) as well.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-20 22:30:15 +02:00
Eliad Peller 92e712da55 wl12xx: fix checking of started dev role
dev_role_id only indicates whether the dev role
is enabled, not started (e.g. on IBSS merge,
the device role is enabled, but not started).

Checking for any role in ROC (in order to determine
whether dev role was started) is wrong as well,
especially in multi-vif env.

Check for started dev role only by checking the dev_hlid.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-20 22:30:15 +02:00
Eliad Peller 8aefffeaae wl12xx: flush packets before stopping dev role
During sta disconnection, a deauth packet is being queued to
the dev role queue. However, the dev role is being stopped
before the packet was sent.

Flush the tx queue before stopping the dev role.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-20 22:30:14 +02:00
Eliad Peller a0c7b7825e wl12xx: make WL1271_FLAG_IDLE flag per-vif
This flag should be set per-vif, rather than globally.

Rename the flag to indicate IN_USE (rather than IDLE), as
in the default configuration (i.e. flag is clear) the vif
should be idle.

Change all the bit operations (and elp conditions) appropriately.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-20 22:30:14 +02:00
Eliad Peller 5b37ddfec2 wl12xx: remove redundant code from wl1271_op_conf_tx
Since the conf_tx callback passes the vif as param,
we must have been added first (and mac80211 verifies it).

Remove the handling of such case.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-20 22:30:14 +02:00
Eliad Peller c0fad1b76e wl12xx: implement change_interface
Implement the change_interface callback by simply removing the
current vif and adding a new one after updating the vif type.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-20 22:30:14 +02:00
Luciano Coelho c99f895a23 wl12xx: alloc buffer in driver_state_read to prevent compilation warning
When compiling wl12xx for x86, there was a warning complaining about
the size of the buffer we were allocating in the stack:

drivers/net/wireless/wl12xx/debugfs.c: In function 'driver_state_read':
drivers/net/wireless/wl12xx/debugfs.c:380:1: warning: the frame size of 1040 bytes is larger than 1024 bytes

To prevent this, allocate the buffer in the heap instead.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-15 16:11:29 +02:00
Pontus Fuchs ef1870673d Set wlvif->ps_compl to NULL in before return
wl1271_configure_suspend_sta leaves a stale stack declared
completion in wlvif->ps_compl. Set it to NULL before returning.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
[small fix to use wlvif->ps_compl instead of wl->ps_compl]
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-15 10:19:46 +02:00
Luciano Coelho 7f74484a46 wl12xx: remove unused firmware version macros
We don't use WL12XX_BA_SUPPORT_FW_COST_VER2_START nor
WL12XX_BA_SUPPORT_FW_COST_VER2_END anymore.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-15 09:58:42 +02:00
Luciano Coelho 36b2082434 wl12xx: remove deprecated packet detection threshold config
The ACX_PD_THRESHOLD configuration command is deprecated and should
not be used anymore.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-15 09:58:42 +02:00
Eliad Peller 5de8eef4fd wl12xx: use ieee80211_free_txskb()
Use the newly introduced ieee80211_free_txskb() instead
of dev_kfree_skb() for failed tx packets.

Additionally, if the skb is a dummy packet, re-enqueue
it (as the fw expects it) instead of freeing it.

Reported-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-15 09:58:42 +02:00
Luciano Coelho 2c8f82eabc wl12xx: call extended radio parameters for wl127x AP mode
We need to set the extended radio parameters for wl127x only.
Currently, we were only calling this command with wl127x STA mode, but
we should also do it for AP mode.

Move the call to the extended radio paramaters to the common hw_init
and use a single if for the chip type to do everything at once.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-15 09:58:41 +02:00
Luciano Coelho f414218ed8 wl12xx: don't write out of bounds when hlid > WL12XX_MAX_LINKS
We should not get an hlid value bigger than WL12XX_MAX_LINKS from
wl1271_rx_handle_data().  We have a WARN_ON in case it happens.  But
despite the warning, we would still go ahead and write the hlid bit
into active_hlids (a stack variable).  This would cause us to
overwrite other data in the stack.

To avoid this problem, we now skip the write when issuing the warning,
so at least we don't corrupt data.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-15 09:58:41 +02:00
Pontus Fuchs 3f1764945e wl12xx: Restore testmode ABI
Commit 80900d0140 accidently broke
the ABI for testmode commands. Restore the ABI again.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-15 09:58:41 +02:00
John W. Linville cf00f379d8 wl12xx: silence tx_attr uninitialized warning in wl1271_tx_fill_hdr
CC [M]  drivers/net/wireless/wl12xx/tx.o
drivers/net/wireless/wl12xx/tx.c: In function ‘wl1271_tx_fill_hdr’:
drivers/net/wireless/wl12xx/tx.c:288:6: warning: ‘tx_attr’ may be used uninitialized in this function

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-09 14:57:49 -05:00
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
Eliad Peller 3dbb5846db wl12xx: send testmode reply in wl1271_tm_cmd_interrogate
wl1271_tm_cmd_interrogate creates a reply skb, but doesn't
send it (and thus just leaks it).
Add the missing cfg80211_testmode_reply() call.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-08 12:32:36 +02:00
Eliad Peller 188e7f54c3 wl12xx: remove redundant commands from plt init
During plt init we configure some redundant commands,
which are not needed for plt (specifically, we shouldn't
configure any role-specific params, as there are no
active roles). remove them.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-08 12:32:36 +02:00
Eliad Peller abc47470ef wl12xx: fix testmode test/interrogate commands
fix several issues in testmode test/interrogate commands:
1. check the driver state is not OFF.
2. wakeup the chip from elp (if needed)
3. fix memory leak in wl1271_tm_cmd_interrogate()

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-08 12:32:36 +02:00
Eliad Peller e0d62536d0 wl12xx: don't explicitly check for unjoined ibss
After the ibss carrier issue was fixed, we can revert
the following patch:

commit 48309fd477
Author: Shahar Lev <shahar@wizery.com>
Date:   Fri Oct 7 18:17:25 2011 +0200

    wl12xx: remove warning message during IBSS Tx

    mac80211 sets the carrier on an IBSS interface even when no network is
    joined. Ignore garbage frames transmitted on a disconnected IBSS
    interface without printing warnings.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-01 15:56:17 +02:00
Arik Nemtsov 12d4b97591 wl12xx: leave IV calculation to HW for CCMP
Use an appropriate mac80211 flags in CCMP keys to indicate we are
calculating the CCMP IV in HW, but require room for the IV to be reserved
in the skb. The space is reserved by mac80211.

depends on "mac80211: support adding IV-room in the skb for CCMP keys".

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-01 15:56:13 +02:00
Pontus Fuchs 358989352e wl12xx: Print nvs/fw file name if loading fails.
Print the name of nvs/fw if request_firmware fails. This will make
troubleshooting a bit easier.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-01 15:55:57 +02:00
Arik Nemtsov 341f2c11b5 wl12xx: avoid bail out when probe-resp is not set by mac80211
During reconfig we can get the BSS_CHANGED_AP_PROBE_RESP indication
even if a probe-resp has not been set in the first place. Therefore
ignore the error when not getting a probe-resp from mac80211. Resort to
the legacy probe-resp in this case.

Also take this opportunity to add a vif argument to the set_probe_resp
function.

Reported-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-01 15:55:54 +02:00
Eliad Peller 97127e6721 wl12xx: init CMD_TEMPL_KLV to sizeof(ieee80211_qos_hdr)
The keep alive template should have a max size of
sizeof(struct ieee80211_qos_hdr).

Additionally, Remove the redundant wl12xx_qos_null_data_template
struct.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-01 15:55:49 +02:00
Arik Nemtsov 9c1b190b10 wl12xx: indicate probe-resp offloading support
The wl12xx driver supports probe-response offloading, and the  WPS, WPS2
and P2P special cases as well.

Signed-off-by: Guy Eilam <guy@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-01 15:55:46 +02:00
Arik Nemtsov 560f00241b wl12xx: configure probe-resp template according to notification
When operating in AP-mode, replace our probe-response template when a
notification is recieved from mac80211. We preserve the "legacy" way of
configuring a probe-response according to beacon for IBSS mode and for
versions of hostapd that do not support this feature.

Signed-off-by: Guy Eilam <guy@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-01 15:55:46 +02:00
Pontus Fuchs f6efe96edd wl12xx: Check buffer bound when processing nvs data
An nvs with malformed contents could cause the processing of the
calibration data to read beyond the end of the buffer. Prevent this
from happening by adding bound checking.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Cc: stable@kernel.org
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-01 15:55:42 +02:00
Pontus Fuchs 2131d3c2f9 wl12xx: Validate FEM index from ini file and FW
Check for out of bound FEM index to prevent reading beyond ini
memory end.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Cc: stable@kernel.org
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-01 15:55:42 +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
Lars-Peter Clausen 4e3309ba95 wireless: Remove redundant spi driver bus initialization
In ancient times it was necessary to manually initialize the bus field of an
spi_driver to spi_bus_type. These days this is done in spi_driver_register(),
so we can drop the manual assignment.

The patch was generated using the following coccinelle semantic patch:
// <smpl>
@@
identifier _driver;
@@
struct spi_driver _driver = {
	.driver = {
-		.bus = &spi_bus_type,
	},
};
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Dan Williams <dcbw@redhat.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: Christian Lamparter <chunkeey@googlemail.com>
Cc: Luciano Coelho <coelho@ti.com>
Cc: libertas-dev@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Acked-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28 14:43:58 -05:00
John W. Linville 515db09338 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
Conflicts:
	drivers/net/wireless/iwlegacy/iwl-debugfs.c
	drivers/net/wireless/iwlegacy/iwl-rx.c
	drivers/net/wireless/iwlegacy/iwl-scan.c
	drivers/net/wireless/iwlegacy/iwl-tx.c
	include/net/bluetooth/bluetooth.h
2011-11-22 14:05:46 -05: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
Eyal Shapira b693289406 wl12xx: fix SDIO suspend/resume
wl1271_suspend/resume() accessed the wrong struct and not wl1271
which caused it to think that wow was enabled when it wasn't.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-11-08 16:00:35 +02:00
Eliad Peller c31e494689 wl12xx: handle idle changes per-interface
Idle changes are currently handled per hardware.
However, some operations should be done only per-interface.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-11-08 15:58:46 +02:00
Eliad Peller 8a0f2ee378 wl12xx: use p2p rate index when the skb has the NO_CCK flag
If the skb contains the NO_CCK flag, use the p2p rate index
(which contains only the OFDM rates)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-11-08 15:50:09 +02: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
Luciano Coelho 3f3fd78e33 wl12xx: increase firmware upload chunk size
The chunk size used during firmware upload was set to 512, which is
the size of a single SDIO block (or two).  This is very inneficient
because we send one or two blocks only per SDIO transaction and don't
get the full benefits of sdio block transfers.

This patch increases the chunk size to 16K.  This more than doubles
the transfer speed both in wl127x and wl128x chips, with greater
impact on the latter:

wl127x:   512 bytes chunk -> ~132ms
        16384 bytes chunk ->  ~57ms
wl128x:   512 bytes chunk -> ~216ms
        16384 bytes chunk ->  ~37ms

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-11-08 15:36:53 +02:00
Luciano Coelho e62c9ce4a4 wl12xx: use the same SDIO block size for all different chips
The sdio driver uses a block size of 512 bytes by default.  With our
card, this doesn't work correctly because it sets the block size FBR
in the chip too early (ie. before the chip is powered on).  Thus, if
we don't set it explicitly, block mode remains disabled in the chip.
If we try to send more data than fits in one block, the sdio driver
will split it into separate blocks before sending to the chip.  This
causes problems because the chip is not expecting multiple blocks.

At the moment this is not a problem, because we use chunks of 512
bytes for firmware upload and the data is always sent in byte mode.
In the next patch, we will change the chunk size to a bigger value, so
this patch is a preparation for that.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-11-08 15:36:53 +02:00
Luciano Coelho ce39defb5c wl12xx: change blocksize alignment quirk to negative
SDIO blocksize alignment support is now the rule, not the exception.
To simplify the code in patches to come, invert the meaning of the
quirk to be negative (ie. the quirk is set if the device does _not_
support blocksize alignment).

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-11-08 15:36:53 +02:00
Eliad Peller 2f8e81ad42 wl12xx: clear wl->vif on remove_interface
wl->vif should be cleared on remove_interface()
(rather than on stop()) even when only a single
vif is supported, because during vif mode change
stop() might not get called (e.g. because of
monitor interface existence)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-11-08 15:36:46 +02:00
Eliad Peller fa5e13756a wl12xx: add vifs_state debugfs key
Add debugfs key to dump information regarding the
active vifs (similar to the driver_state debugfs key)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-11-08 15:36:46 +02:00
Arik Nemtsov a693534b1a wl12xx: keep beacon-filtering enabled during STA operation
Enable beacon filtering on STA init, and don't disable it when entering
active mode. Otherwise dynamic-PS supports means we receive beacons from
the current AP during any Tx/Rx performed by the driver.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-11-08 15:36:46 +02:00
Eliad Peller d6fa37c9ff wl12xx: reconfigure rate policies on set_bitrate_mask
The rate policies are configured only after association,
resulting in auth req being sent in wrong rates.

Reconfigure rate policies on bitrate mask change.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-11-08 15:36:45 +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
Paul Gortmaker ee40fa0656 drivers/net: Add export.h to files using EXPORT_SYMBOL/THIS_MODULE
These were getting the macros from an implicit module.h
include via device.h, but we are planning to clean that up.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

drivers/net: Add export.h to wireless/brcm80211/brcmfmac/bcmsdh.c

This relatively recently added file uses EXPORT_SYMBOL and hence
needs export.h included so that it is compatible with the module.h
split up work.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-31 19:31:08 -04:00
Eliad Peller 0f1680147c wl12xx: handle injected packets
Injected packets are sent with no vif, causing the wl12xx
to NULL-dereference in multiple places.

Furthermore, injected packets are currently not sent at all,
as system_hlid doesn't belong to any specific role, so
wl1271_skb_dequeue() never return its packets.

Handle both these problems.

Reported-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 22:24:51 +03:00
Luciano Coelho ccb62000d5 wl12xx: use the same plat dev name for both SPI and SDIO
There's no need to have the bus name included in the platform device
name that we create.  The core driver doesn't need to know about the
type of bus it uses.  Any differences between the buses that need to
be handled differently in the core, can be passed in the platform data
(as the pwr_in_suspend boolean does).

Use "wl12xx" for the device name in both bus drivers.  Rename the
platform driver name to "wl12xx_driver", just to differentiate from
the platform device names.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 20:11:10 +03:00
Shahar Lev 48309fd477 wl12xx: remove warning message during IBSS Tx
mac80211 sets the carrier on an IBSS interface even when no network is
joined. Ignore garbage frames transmitted on a disconnected IBSS
interface without printing warnings.

Signed-off-by: Shahar Lev <shahar@wizery.com>
[merged with wlvif changes]
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 19:16:23 +03:00
Luciano Coelho e5d3625e87 wl12xx: spi: use dev_err instead of wl1271_error
To prevent a useless dependency between the spi module and the wl12xx
module, we need to replace the wl1271_error macros with dev_err.

At the same time, remove the SPI data hexdump, since this produces way
too much data and is not particularly useful.  There's no
print_hex_dump() equivalent for dynamic debug, so it's hard to control
when the dumps are printed out.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 16:24:56 +03:00
Luciano Coelho 3c4d386868 wl12xx: sdio: use dev_dbg instead of wl1271_debug
To prevent a useless dependency between the sdio module and the wl12xx
module, we need to replace the wl1271_debug macros (and friends) for
dev_dbg and other equivalents.

At the same time, remove the SDIO data hexdump, since this produces
way too much data and is not particularly useful.  There's not
print_hex_dump() equivalent for dynamic debug, so it's hard to control
when the dumps are printed out.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 16:24:45 +03: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
Felipe Balbi f79f890c9c wl12xx: drop unneeded plat_dev
now that useless plat_dev is unnecessary,
we can remove it.

Signed-off-by: Felipe Balbi <balbi@ti.com>
[forward ported and fixed sysfs file creation]
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 16:01:19 +03:00
Felipe Balbi 4b32a2c9a6 wl12xx: mark some symbols static
after re-factoring a bunch of symbols are only
used inside main.c which allows us to mark
them as static.

Signed-off-by: Felipe Balbi <balbi@ti.com>
[forward-ported]
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 16:01:14 +03:00
Felipe Balbi a390e85cfe wl12xx: move common init code from bus modules to main
Move all common parts from sdio.c and spi.c to main.c, since they now
can be handled as part of the platform driver.

Signed-off-by: Felipe Balbi <balbi@ti.com>
[forward-ported, cleaned-up and rephrased commit message]
[added a bunch of fixes and a new pdata element]
[moved some new code into main.c as well]
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 16:01:09 +03:00
Felipe Balbi ce2a217c82 wl12xx: add platform driver to the core module
Nnow that we have a platform_device on both glue layers, add a
platform_driver to the core driver.

It's currently an empty platform_driver but more functionality will be
added on later patches.

Signed-off-by: Felipe Balbi <balbi@ti.com>
[forward-ported, cleaned-up and rephrased commit message]
[added platform_driver.driver initialization]
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 16:01:05 +03:00
Felipe Balbi 0969d6793f wl12xx: add a platform device to the spi module
The platform device will be used to match the platform driver that
will be implemented by the core module.

Signed-off-by: Felipe Balbi <balbi@ti.com>
[forward-ported, cleaned-up and rephrased commit message]
[call platform_device_add() instead of platform_device_register()]
[store alloc'ed device platform directly in glue->core]
[fixed the length of memset(res...)]
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 16:01:00 +03:00
Felipe Balbi 025aef8fcf wl12xx: add a platform device to the sdio module
The platform device will be used to match the platform driver that
will be implemented by the core module.

Signed-off-by: Felipe Balbi <balbi@ti.com>
[forward-ported, cleaned-up and rephrased commit message]
[call platform_device_add() instead of platform_device_register()]
[store alloc'ed device platform directly in glue->core]
[fixed the length of memset(res...)]
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 16:00:55 +03:00
Felipe Balbi b65019f661 wl12xx: add an spi glue struct to keep wl and device side-by-side
In order to fully abstract the bus, we need to save the device
structure *beside* wl1271, instead of inside it.

This will help re-structuring the driver so that we avoid the
duplicated code in the bus modules.

Signed-off-by: Felipe Balbi <balbi@ti.com>
[forward-ported and cleaned up and rephrased commit message]
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 16:00:51 +03:00
Felipe Balbi fbe936bcb5 wl12xx: add an sdio glue struct to keep wl and device side-by-side
In order to fully abstract the bus, we need to save the device
structure *beside* wl1271, instead of inside it.

This will help re-structuring the driver so that we avoid the
duplicated code in the bus modules.

Signed-off-by: Felipe Balbi <balbi@ti.com>
[forward-ported and cleaned up and rephrased commit message]
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 16:00:46 +03:00
Luciano Coelho c7e7c227b6 wl12xx: remove sdio_test module
This module has been causing more trouble than being useful.  It only
tests the SDIO speed by connecting to the wl12xx chip and does some
throughput calculations.  It is an ugly quick hack and, if we really
want to have it as part of wl12xx we need to clean it up and implement
it properly.

A tarball of the code has been created and posted here, with some
instructions:

http://wireless.kernel.org/en/users/Drivers/wl12xx#SDIO_performance_test_module

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 16:00:38 +03:00
Eliad Peller e4120df982 wl12xx: use round-robin policy for tx
Currently, a single vif might starve all the other vifs.
Save the last vif we dequeued a packet from, and continue
with the following one using a round-robin policy.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:29:57 +03:00
Eliad Peller f750c82045 wl12xx: add elp wakeup/sleep calls to add_interface
add_interface might be called while the chip is
in elp. add elp_wakeup/sleep calls to handle it.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:29:56 +03:00
Eliad Peller e5a359f873 wl12xx: use dynamic rate policies
allocate the rate policies dynamically, instead of using hardcoded
indexes. this is needed for proper multi-role configuration.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:28:02 +03:00
Eliad Peller f027743430 wl12xx: call stop() on recovery
The recovery work should call stop() after it removed
all the existing interfaces.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:12:13 +03:00
Eliad Peller 6e8cd33104 wl12xx: replace all remaining wl->vif references
wl->vif is appropriate only when a single vif is being used.
Instead, pass wlvif as parameter or iterate through all
the vifs (e.g. when a global configuration was changed)

Leave wl->vif only to determine whether a vif was already
added (this check will be removed as well after both the
driver and fw will support multiple vifs)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:12:13 +03:00
Eliad Peller 9f259c4e5e wl12xx: make op_config configure all vifs
When mac80211 changes a global (hw) config, iterate
through all the relevant vifs and update them.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:12:13 +03:00
Eliad Peller 6bd6502990 wl12xx: add power_level field to wlvif
move power_level 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:13 +03:00
Eliad Peller 61f845f4f4 wl12xx: add channel field to wlvif
add channel 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:13 +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 52630c5d89 wl12xx: make WL1271_FLAG_CS_PROGRESS 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:12:12 +03:00
Eliad Peller 836d6600ea wl12xx: make WL1271_FLAG_PSPOLL_FAILURE 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:12:12 +03:00
Eliad Peller 10c8cd01e3 wl12xx: make WL1271_FLAG_IF_INITIALIZED per-vif
Make the initialization flag per-vif, and add some checks for it.

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 0744bdb60b wl12xx: make WL1271_FLAG_RX_STREAMING_STARTED 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:58 +03:00
Eliad Peller 8181aecce9 wl12xx: make WL1271_FLAG_STA_STATE_SENT 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:58 +03:00
Eliad Peller c29bb001e4 wl12xx: make WL1271_FLAG_PSM flag per-vif
move WL1271_FLAG_PSM and WL1271_FLAG_PSM_REQUESTED into
per-vif flags.
These flags 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:58 +03:00
Eliad Peller 53d40d0b86 wl12xx: make WL1271_FLAG_AP_STARTED 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 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