Commit graph

970 commits

Author SHA1 Message Date
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
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
9eb599e9c6 wl12xx: rearm rx streaming per vif
Currently, the rx streaming doesn't support multi-vif
(the actual wlvif is taken from wl->vif, and the management
is global).

Make the rx streaming timers/works per-vif, and pass the
the actual vif as param.

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
48e93e402a wl12xx: move tx_security_seq into wlvif
The last security seq num has to be saved across reconfigs.
Add a new "persistent" struct into wlvif, which won't get
deleted on wl12xx_init_vif_data()

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:04:23 +03:00
Eliad Peller
4b730b6a81 wl12xx: make event handling support multirole
Some events don't indicate the role they are intended for.
In these cases, iterate through all the relevant vifs,
and pass the event to each one of them.

This is only a workaround. future fw releases should indicate
the relevant role_id for such events.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:04:23 +03:00
Eliad Peller
a4e4130dce wl12xx: configure sleep_policy according to active roles
If there is an active AP role, stay always on.
Otherwise, allow chip to enter elp.

(Note that this is a global configuration, so if the
device is already configured according to our policy,
we don't have to configure it again)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:04:23 +03:00
Eliad Peller
a32d0cdfcb wl12xx: support multiple vifs in the tx path
Pass the wlvif associated with each skb as param.

Note that dummy packet doesn't belong to any
particular vif, so we pass NULL in this case.

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
8762721473 wl12xx: add vifs list
keep a list of all the vifs associated with our hw.
it will be later used in order to iterate through vifs.

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
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
baf6277ae9 wl12xx: move some functions from remove_interface() to stop()
Leave only vif-specific deinit stuff in remove_interface().
Move the global deinit (including power_off) to stop().

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
d6a3cc2ef9 wl12xx: unify STA and AP tx_queue mechanism
Make sta use the global wl->links[hlid].tx_queue (by
considering its links map) instead of wl->tx_queue,
and then unify the tx and tx_reset flows for the
various vifs.

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
4438aca9e1 wl12xx: move last_tx_hlid into wlvif
move last_tx_hlid 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:21 +03:00
Eliad Peller
1d095475f5 wl12xx: refactor fw init into a new function
The fw boot and initialization currently happens inside the
add_interface() callback. This is wrong, as add_interface is
called for each new vif. However, we due to some fw limitation
(we have to know the actual mac address on boot), we can't
completely move it into the start() callback.

Until the fw will be fixed, refactor the fw init into
a new function, and call it from add_interface()

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 15:04:21 +03:00
Eliad Peller
170d0e6732 wl12xx: move recorded_ap_keys into wlvif
move recorded_ap_keys 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:33:50 +03:00
Eliad Peller
c7ffb902cc wl12xx: move ap_hlid_map into wlvif.ap
Add wlvif->links_map bitmap to represent all the links
allocated for this vif.

AP vif also has a sta_hlid_map bitmap, which represents
the links stations connected to it (sta_hlid_bitmap is
a subset of wlvif->links_map, which itself is a subset
of the global wl->links_map)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:33:46 +03:00
Eliad Peller
d0802abdf9 wl12xx: move ba fields into wlvif
move ba_fields 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:54 +03:00
Eliad Peller
04324d9981 wl12xx: move rssi_thold and last_rssi_event into wlvif
move rssi_thold and last_rssi_event 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:53 +03:00
Eliad Peller
74ec839557 wl12xx: move ps_poll_failures and psm_entry_retry into wlvif
move ps_poll_failures and psm_entry_retries 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:52 +03:00
Eliad Peller
6ec45dc282 wl12xx: move ps_compl into wlvif
move ps_compl 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:51 +03:00
Eliad Peller
252efa4f97 wl12xx: move pspoll_work into wlvif
move pspoll_work 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:50 +03:00
Eliad Peller
f75c753f3c wl12xx: move default_key into wlvif
move default_key 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:49 +03:00
Eliad Peller
6a89979643 wl12xx: move beacon_int into wlvif
move beacon_int 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:48 +03:00
Eliad Peller
afaf8bdb2b wl12xx: move dev_hlid into wlvif
move dev_hlid 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:47 +03:00
Eliad Peller
e936bbe0dc wl12xx: move some logic into wl12xx_init_vif_data
Initialize the vif data according to the vif type

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:47 +03:00
Eliad Peller
98b8625301 wl12xx: move session_counter into wlvif
move session_counter 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:46 +03:00
Eliad Peller
a8ab39a4b5 wl12xx: move ap_global_hlid and ap_bcast_hlid into wlvif
move ap_global_hlid and ap_bcast_hlid 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:45 +03:00
Eliad Peller
154da67c7d wl12xx: move sta_hlid into wlvif
move sta_hlid 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:44 +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
6840e37aec wl12xx: move aid into wlvif
move aid 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:41 +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
1fe9f1616e wl12xx: move ssid and ssid_len into wlvif
move ssid and ssid_len 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:39 +03:00
Eliad Peller
fb0e707c83 wl12xx: move p2p into wlvif
move p2p field 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:38 +03:00
Eliad Peller
10bcf745ae wl12xx: remove set_bss_type field
set_bss_type is no longer evaluated, so delete it.

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
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
cdf0949558 wl12xx: replace wl->bssid with vif->bss_conf.bssid
Use the per-interface vif->bss_conf instead of the global wl->bssid.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:36 +03:00
Eliad Peller
d2d66c56cf wl12xx: move basic_rate into wlvif
move basic_rate 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:35 +03:00
Eliad Peller
30d0c8fd5b wl12xx: move rate_set into wlvif
move rate_set 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:34 +03:00
Eliad Peller
87fbcb0f8c wl12xx: define wl12xx_vif
Define a per-vif data struct.
This struct holds all the vif-specifc data, which is
currently being hold by the global wl struct.

Start by moving the basic_rate_set field into it.

NOTE: in order to make the patches a bit smaller, start by
using wl->vif in some functions, instead of changing all
the function prototypes at once. finally, wl->vif will be
removed altogether.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:33 +03:00
Eliad Peller
92c77c734f wl12xx: start reworking the init sequence
Split the init sequence into common commands (non role-specific)
and role-specific commands.

We still need to call the common commands only on add_interface()
(rather than on start()) as the fw must get the mac address
when uploading the nvs.

Future patches will refactor the init sequence further more.

Signed-off-by: Eliad Peller <eliad@wizery.com>
[fixed a couple of sparse warnings]
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:32 +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
694440d93b wl12xx: disable AP-mode-specific quirks
The current wl12xx fw (7.3.0.0.77) supports both STA and AP mode, and
we no longer use AP-mode-specific quirks.

WL12XX_QUIRK_END_OF_TRANSACTION is still used for certain HWs, while
WL12XX_QUIRK_LPD_MODE is not used anymore.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:30 +03:00
Shahar Levi
6d158ff38d wl12xx: Add support for HW channel switch
The wl12xx FW supports HW channel switch.  If we don't use it,
sometimes the firmware gets confused when recalibrating to the new
channel, causing RX problems.  This commit adds HW channel switch
support by implementing the channell_switch op.

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
[added one comment, remove the tx_flush and rephrased the commit message]
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:32:27 +03:00
Luciano Coelho
c9e79a4714 wl12xx: set max_sched_scan_ie_len correctly
The wiphy max_sched_scan_ie_len attribute was not set correctly and
remained as 0, so when IEs were being passed in a scheduled scan, we
were returning -EINVAL.

Fix this by setting the attribute properly.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-07 08:31:44 +03:00
Eliad Peller
4b29886feb wl12xx: configure rate policy for p2p operations
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>
2011-10-07 08:31:43 +03:00
Eliad Peller
8a3a3c85e4 mac80211: pass vif param to conf_tx() callback
tx params should be configured per interface.
add ieee80211_vif param to the conf_tx callback,
and change all the drivers that use this callback.

The following spatch was used:
@rule1@
struct ieee80211_ops ops;
identifier conf_tx_op;
@@
	ops.conf_tx = conf_tx_op;

@rule2@
identifier rule1.conf_tx_op;
identifier hw, queue, params;
@@
	conf_tx_op (
-		struct ieee80211_hw *hw,
+		struct ieee80211_hw *hw, struct ieee80211_vif *vif,
		u16 queue,
		const struct ieee80211_tx_queue_params *params) {...}

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-10-03 15:22:41 -04:00
Eliad Peller
37a41b4aff mac80211: add ieee80211_vif param to tsf functions
TSF can be kept per vif.
Add ieee80211_vif param to set/get/reset_tsf, and move
the debugfs entries to the per-vif directory.

Update all the drivers that implement these callbacks.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-27 14:27:48 -04:00
Arik Nemtsov
6b661895a1 wl12xx: report the stop_ba event to all STAs in AP-mode
Use the AP_MAX_LINKS as the upper boundary for traversing the links array,
thereby guaranteeing BA sessions with all connected STAs are stopped when
the stop_ba event is received.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-23 15:59:55 +03:00
Arik Nemtsov
f80c2d12e5 wl12xx: correct fw_status structure for 8 sta support in AP-mode
Fix an erroneous labeling of array boundaries in the fw_status structure.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-23 15:59:54 +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
Arik Nemtsov
68eaaf6ee5 wl12xx: AP mode - support hidden SSID
If a hidden SSID is requested, generate a probe response template
containing the real SSID.

Depends on the patch "mac80211: add ssid config to bss information
in AP-mode".

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-23 14:43:32 +03:00
Eliad Peller
df4c849f46 wl12xx: Use dev_hlid for auth and assoc req
On roaming, the auth and assoc req are sent with the sta
hlid. This is wrong, as the sta hlid is configured according
to the old ap. Use the dev_hlid instead.

Move the wl1271_tx_update_filters() call into wl1271_tx_get_hlid(),
so wl->dev_hlid will be valid.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-23 14:38:51 +03:00
Eliad Peller
c6930b07b3 wl12xx: send all pending packets on channel change
There is a race condition between wl1271_tx_work() and the
channel switch, so make sure all the pending packets are
being sent before switching channel.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-23 14:38:49 +03:00
Eliad Peller
26b4bf2e0f wl12xx: remove P2P ie from probe response
wl12xx uses a single probe response template, regardless of
the probe request.
However, the P2P spec forbids including the p2p ie in some
cases (e.g. the probe request didn't include the p2p ie).

The fw responds only to probe requests that don't
include the p2p ie, and passes up probe requests that
include them (the supplicant will answer them).

Thus, strip the p2p ie from the probe response template.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-23 14:38:47 +03:00
Eliad Peller
d48055d9fc wl12xx: remove TIM ie from probe response
wl12xx uses the beacon as the probe response template.
However, the beacon includes a TIM ie, which shouldn't
exist in the probe response.

Delete it from the skb before configuring the probe
response template.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-23 14:38:47 +03:00
Shahar Levi
06b660e1a3 wl12xx: Include OFDM rates in IBSS mode
We were including only 11b rates in IBSS mode.  This patch adds OFDM
rates.

[Rephrased commit log and removed one unnecessary comment. -- Luca]

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-23 14:21:36 +03:00
Shahar Levi
d3b104ae22 wl12xx: fix sdio_test module functionality
Due to some changes in PM in recent kernels, the sdio_test module has
been broken for a while.  This patch fixes the code that powers the
card on and off.

Also made some small indentation fixes in the Makefile.

[Rephrased commit log and removed the change in the FW name, since
it's done in another patch. -- Luca]

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-23 14:11:31 +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
John W. Linville
4d8b61490c Merge branch 'master' of git://git.infradead.org/users/linville/wireless
Conflicts:
	drivers/net/wireless/iwlwifi/iwl-pci.c
	drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c
	drivers/net/wireless/rt2x00/rt2800usb.c
	drivers/net/wireless/wl12xx/main.c
2011-09-20 14:11:55 -04:00
Eliad Peller
045c745f8c wl12xx: support p2p interfaces
Declare support for p2p interfaces, and create p2p_cli/p2p_go
roles when being asked for.

Indicate we are using a p2p interface by setting the wl->p2p flag.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-14 13:15:20 +03:00
Arik Nemtsov
93f8c8e025 wl12xx: set mac80211 flags for A-MPDU aggregation support
We set the mac80211 flag for A-MPDU support and also indicate that
Tx-agg session setup is performed in HW.

This patch depends on
"mac80211: add flag to indicate HW only Tx-agg setup support"

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-14 13:15:19 +03:00
Arik Nemtsov
f1acea9a9d wl12xx: AP mode - clean BA and queue state in tx_reset
Reset the BA state of all connected stations and explicitly clear the
Tx queues. The latter is needed for clearing dummy packets from
tx_queue_count.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-14 13:15:19 +03:00
Arik Nemtsov
f4d3b6ab5e wl12xx: AP mode - enable the BA constraint event from the FW
Unblock the RX BA constraint event from firmware in AP mode as well.
This allows us to stop RX BA sessions when the FW requests it.

In addition refactor the handler for this event to make the flow
clearer.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-14 13:15:18 +03:00
Arik Nemtsov
da03209eac wl12xx: don't regulate links when a single STA is connected
When operating as AP track the number of connected stations. When a
single STA is connected don't regulate the PS status of the link.
Since this is the only STA connected, there's no point holding space in
FW for other links. This will speed up communications with a single
connected STA in PSM.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-14 13:15:17 +03:00
Arik Nemtsov
c47e8229fa wl12xx: support up to 8 stations in AP-mode
Change the max number of AP stations to 8, up from 5.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-14 13:15:16 +03:00
Arik Nemtsov
56d4f8f685 wl12xx: AP mode - don't regulate FW blocks for non-active STAs
Check a STA is associated before regulating its PS-status in mac80211.
Should never happen, so warn as a precaution.

[Small cosmetic change wrt Kalle Valo's comment. -- Luca]

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-14 13:15:05 +03:00
Arik Nemtsov
f8e0af6b87 wl12xx: don't indicate up PS-filtered dummy packets
Dummy packets are currently only sent on the system_hlid link. The
system_hlid link should never be filtered for PS (as it is not
a STA link). Even so, for correctness, don't indicate dummy packets up.
The skb does not belong to mac80211 and as such does not contain a
correct skb->cb.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-09-14 12:43:51 +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
221737d24f wl12xx: increase number of allowed SSIDs in sched_scan
The latest firmware supports up to 16 SSIDs in the scheduled scan
lists.  Increase the number we report to cfg80211 and increase the
min/max dwell time to 30 and 60 TUs respectively, because otherwise we
don't have the time to send the probes for all SSIDs.

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