History log of /drivers/net/wireless/iwlwifi/iwl-scan.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
83626404a70da74c67f32f119e53c0ba032ba2d8 07-Mar-2012 Don Fry <donald.h.fry@intel.com> iwlwifi: more status bit factoring

Continue splitting the status bits between transport and op_mode.
All but a few are separated.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
b443d8d8a2b4c3def4b47c17a44bb17ea0a3202f 06-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: make iwl_fill_probe_req static

This function is only used in iwl-scan.c, so
if we move it up a little in the file it can
be made static.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
f8d7c1a18d5e77b17b5cc1ebefa21eaea7f2d0fa 06-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: move packet to transport

The base packet structure will (hopefully) be
the same for all transports, but what is in it
differs. Remove the union of all the possible
contents and move the packet itself into the
transport header file. This requires changing
all users of the union to just use pkt->data.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
b1eea297d6b522b801c95b60b1e64fb61228c6c7 06-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: move mutex out of shared

Now the mutex no longer needs to be
shared, so move it into iwl_priv.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
e10a0533a9172471b52bd9512838d766420a3baf 06-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: add wrappers for command sending

Add wrappers to send commands from the DVM
op-mode (which essentially consists of the
current driver). This will allow us to move
specific sanity checks there.

Also, this removes iwl_trans_send_cmd_pdu()
since that can now be taken care of in the
DVM-specific wrapper.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
48a2d66f58d2bf1818acf5ff7ed9897a9977a96e 05-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: don't pass iwl_rx_mem_buffer to upper layers

struct iwl_rx_mem_buffer implementation details
(DMA address, list pointers) that the upper
layers don't need. Introduce iwl_rx_cmd_buffer
that is passed upstream and only contains the
needed data (the page). Additionally, access
this data only via accessor functions, allowing
us to change the implementation in the future.
These accessors are rxb_addr() (as before) and
rxb_steal_page() to take ownership of the data.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
65b94a4abfd55b3304be25ffed9832455d41e1dd 05-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: pass response packet directly

When CMD_WANT_SKB is set for a (synchronous)
command, the response is passed back to the
caller which is then responsible for freeing
it. Make this more abstract with real API,
passing directly the response packet in the
new cmd.resp_pkt member and also introduce
iwl_free_resp() to free the pages -- this
way the upper layers don't have to directly
touch the page implementation.

NOTE: This breaks IDI -- the new code isn't reflected there yet!

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
5c40d8603d8ed03aa851d20ad8a9155fc79a1b07 05-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: make EXIT_PENDING depend on mac80211

There's no reason to set EXIT_PENDING when we
start removing the module, as mac80211 will
cleanly shut down the device in this case.
Additionally, there's no point in rejecting
commands to the device when we're cleaning up
as that only leads to unwanted errors from
mac80211 being printed, such as
failed to remove key (...) from hardware (-16)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
1ee158d83853a9f5c1465be56d56ff56e6698e92 17-Feb-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: move workqueue to priv

In order to separate the different parts of the
driver better, we are reducing the shared data.
This moves the workqueue to "priv", and removes
it from the transport. To do this, simply use
schedule_work() in the transport.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
2ed81710ccc0ccebe177481b8d4ac584f9c2b569 28-Jan-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: always restrict scan dwell in P2P

Whenever the PAN (P2P) context is active, it
has timers in the uCode that prevent sleep,
so scanning can't be out of channel for more
than the beacon interval programmed into the
device.

Before this patch, a full scan including any
passive channels when P2P was active would
stall forever because it wouldn't find time
to execute the passive requests (for default
beacon intervals of 100 TU.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
fb4961dbc27d40cdbed297aa9bd74fa4a0e2ba6c 06-Jan-2012 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: update Copyright

Update Copyright to 2012

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
331d9301ed4d0fe33e9762c62f2870243bcf77eb 16-Jan-2012 Fabio Estevam <festevam@gmail.com> wireless: iwlwifi: iwl-scan.c: Fix build warning

Fix the following build warning:

drivers/net/wireless/iwlwifi/iwl-scan.c: In function ‘iwlagn_request_scan’:
drivers/net/wireless/iwlwifi/iwl-scan.c:572: warning: ‘cmd_len’ may be used uninitialized in this function

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
3862241945026a8fa165ab73c57739df77b8e1fb 16-Dec-2011 Don Fry <donald.h.fry@intel.com> iwlwifi: move iwl_cfg from iwl_priv to iwl_shared

Move the configuration pointer from the upper level iwl_priv to the
lower level iwl_shared structure, with associated code fixes.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
eb32043f430d74d4381b29273d174b376593d072 10-Nov-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: don't always split remain-on-channel

Due to the P2P context always having the associated
bit set when we got to this code, we were splitting
up the remain-on-channel durations unconditionally.
This isn't needed -- if the P2P context is in P2P
device type mode it doesn't impose restrictions on
timing to skip it in that case.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
ba4c531984d480dff554e2ccb442958052482773 10-Nov-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: move hw_scan into _mac80211 file

iwlagn_mac_hw_scan should belong to _mac80211 callback.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
3a8aea098c8ebe3437d877542d138085be33346c 14-Oct-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: use 6 Mbps rate for no-CCK scans

When userspace requested that a scan not be
done with CCK rates, use 6 Mbps. This is used
for example for P2P scanning.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
6a686c600268b71619f93d35f9373e2b6ab5947b 10-Oct-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: move iwl_enable_rfkill_int and kill iwl-helpers.h

Move iwl_enable_rfkill_int to iwl-core.h, and remove the empty
iwl-helpers.h

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
c745f55baf63d08d6e9bb20682102fb8bae8f67a 10-Oct-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: merge station management functions

After driver split, no need to separate station management functions
in two files, merge it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
ade4c649a0e9e862751fe1c98f43fbee86554c8a 10-Oct-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: rename all the mac80211 callback functions

Use the same calling style for all the mac80211 callback functions

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
84b1bec6d716fc8c289e2530cab109a6e097455b 23-Sep-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: fix scan complete processing

When we cancel a scan, the completion runs
only from the workqueue. This can cause the
remain-on-channel scan to fail when another
one was just canceled, because we're still
aborting it.

To fix this, run the completion inline with
the lock still held before returning from
iwl_scan_cancel_timeout().

Also, to avoid the scan complete work from
completing a new scan prematurely, add a
new STATUS_SCAN_COMPLETE bit.

Reported-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Tested-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
a2fa2462f05115722beb2443d081a72f4f4450ea 23-Sep-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: move iwl_process_scan_complete up

To make the next patch easier to read, move
the function up, it'll be needed earlier in
this file in the next patch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
f253247a944fcf5f48ca434331d9e4f72f5fef8d 23-Sep-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: refactor scan complete

We'll need to be able to run scan complete
inline, not from the workqueue, so refactor
it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
98efb4a52b5c64c79647ea4fdb2c6a3f3db6e743 23-Sep-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: make iwl_scan_cancel_timeout void

The return value of iwl_scan_cancel_timeout()
isn't used anywhere, so let's just remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
8bd2c1ead5e2b67270aedfc95dcac8d6955db4e5 23-Sep-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: fix dangling scan request

If iwl_scan_initiate() fails for any reason,
priv->scan_request and priv->scan_vif are left
dangling. This can lead to a crash later when
iwl_bg_scan_completed() tries to run a pending
scan request.

In practice, this seems to be very rare due to
the STATUS_SCANNING check earlier. That check,
however, is wrong -- it should allow a scan to
be queued when a reset/roc scan is going on.
When a normal scan is already going on, a new
one can't be issued by mac80211, so that code
can be removed completely. I introduced this
bug when adding off-channel support in commit
266af4c745952e9bebf687dd68af58df553cb59d.

Cc: stable@kernel.org [3.0]
Reported-by: Peng Yan <peng.yan@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
1895b36bfb6165feb8f0b2060114632e46798dfe 23-Sep-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: add debugging to show probe related info in scan notification

Add debugging to show the status of probe in scan notification
to help debug probe related issues

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
247c61d625154e18a105d663281c52376a882762 21-Sep-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: remove the callback in host commands

Before this patch, the upper layer could register a callback for each
host command. This mechanism allowed the upper layer to have
different callbacks for the same command ID. In fact, it wasn't used
and the rx_handlers is enough: same callback for all the command with
a specific command ID.

The iwl_send_add_station needs the access the command that was sent
while handling the response (regardless if the command was sent in
SYNC or ASYNC mode). So now, all the handlers receive the host
command that was sent. This implies a change in the handler signature.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
390808db4ab5c658dc1eb8078d82027ce7d0ea78 21-Sep-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: split remain-on-channel

If we're associated and want to do P2P at the same
time, the scan for remain-on-channel is currently
limited to 80ms because of the way the device will
behave in that case. Instead of doing that, split
up the dwell times into little pieces. It will not
actually be a single big dwell time then, but will
be close enough. This improves robustness of P2P
in such scenarios.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
6e809a16d98efa8b1483a25ab8886dd2aa200d0f 21-Sep-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: move scan code to scan file

Since the driver split there's no longer a need
to have the scan code scattered across multiple
files, so move it all back to iwl-scan.c

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
790428b6552c698b2f295457b5dee686323cb732 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: move iwl_free_pages to iwl-shared.h

This helper is used by the transport and the upper layer.
Kill __iwl_free_pages which was used in the transport only.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
845a9c0d8acea87dede740bc5feb9ec2d00505d9 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: move all iwl_is_XXX helpers to iwl-shared.h

Logic move after all priv->status moved to struct iwl_shared

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
e6bb4c9c00892c488f3218ea317dc6a71674faf4 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: bus layer chooses its transport layer

Remove iwl_transport_register which was a W/A. The bus layer knows what
transport to use. So now, the bus layer gives the upper layer a pointer to the
iwl_trans_ops struct that it wants to use. The upper layer then, allocates the
desired transport layer using iwl_trans_ops->alloc function.

As a result of this, priv->trans, no longer exists, priv holds a pointer to
iwl_shared, which holds a pointer to iwl_trans. This required to change all the
calls to the transport layer from upper layer. While we were at it, trans_X
inlines have been renamed to iwl_trans_X to avoid confusions, which of course
required to rename the functions inside the transport layer because of
conflicts in names. So the static API functions inside the transport layer
implementation have been renamed to iwl_trans_pcie_X.

Until now, the IRQ / Tasklet were initialized in iwl_transport_layer. This is
confusing since the registration doesn't mean to request IRQ, so I added a
handler for that.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
6ac2f839b0b21225a65f41802c5f0df5eff4f16c 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: priv->mutex moves to iwl_shared

Since it is used by all the layers, it needs to move to iwl_shared.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
63013ae30159c90d2a873e20e680e7810fa533fa 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: priv->status moves to iwl_shared

Since it is used by all the layers, it needs to move to iwl_shared.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
74e28e44095e30ffd2d0258e4fe91826a15247e7 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: workqueue moves to iwl_shared

Since it is used by all the layers, it needs to move to iwl_shared.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
d618912417fbce4f6514fe1cbef7df2e73bdb6c2 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: hw_params moves to iwl_shared

Since it is used by all the layers, it needs to move to iwl_shared.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
c6baf7fb40cb141c4b510372f7dac829621ccf3f 23-Jul-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: support new P2P implementation

The previous P2P implementation turned out to
not work well and new uCode capabilities were
added to support P2P. Modify the driver to
take advantage of those, and also discover P2P
support automatically based on a uCode flag
instead of having a Kconfig symbol for P2P.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
898ed67be047d0762cc7592f67bf1313dff53ca9 13-Jul-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: remove un-necessary "_agn"

After driver split, extra _agn in priv structure is no needed, remove it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
41c50542669cd7aec45ad708f5120ff8fdaa1194 11-Jul-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: transport layer receives struct iwl_trans*

It still holds a pointer to iwl_priv. But hopefully this will disappear at some point.
Also add the multiple inclusion protection to iwl-trans.h that was forgotten.
Move iwl-trans structures to iwl-trans.h

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
5c3d29fc0d083e674c09407f1bc78e9dbf4ae8a5 08-Jul-2011 Don Fry <donald.h.fry@intel.com> iwlagn: remove iwlagn_hcmd_utils structure and call directly

Not needed since the driver split. Move single use routines to
calling location and keep static where possible.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
bdfbf0924ab05e02d28e50bd2d5024097642a78d 08-Jul-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: provide heplers to access the transport ops

This removes the for priv->trans.ops->...

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
e419d62d72b23392e7f9a5da047fb17d70edc54a 08-Jul-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: consolidate the API that sends host commands and move to transport

Now, there are only two functions to send a host command:
* send_cmd that receives a iwl_host_cmd
* send_cmd_pdu that builds the iwl_host_cmd itself and received flags

The flags CMD_ASYNC / CMD_SYNC / CMD_WANT_SKB are not changed by the API
functions.

Kill the unused flags CMD_SIZE_NORMAL / CMD_NO_SKB on the way.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
e80d70e98b993a7ece93e29a408da4a7d57a4da2 03-Jun-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: direct call to post_scan function

After driver split, no need to use function "ops" for post_scan.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
c2b821d7a59e5d6b53c906d0a8fecc68e2aee540 03-Jun-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: move all post scan functions in one place

Both tx power and power save are being done after scan complete, move into
post_scan function

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
252f4bf400df1712408fe83ba199a66a1b57ab1d 12-Apr-2011 John W. Linville <linville@tuxdriver.com> Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem

Conflicts:
drivers/net/wireless/ath/ar9170/main.c
drivers/net/wireless/ath/ar9170/phy.c
drivers/net/wireless/zd1211rw/zd_rf_rf2959.c
901069c71415a76d731857ccda814e18ded062f7 05-Apr-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: change Copyright to 2011

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
25985edcedea6396277003854657b5f3cb31a628 31-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi> Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
/drivers/net/wireless/iwlwifi/iwl-scan.c
266af4c745952e9bebf687dd68af58df553cb59d 11-Mar-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: support off-channel TX

Add support to iwlagn for off-channel TX. The
microcode API for this is a bit strange in that
it uses a hacked-up scan command, so the scan
code needs to change quite a bit to accomodate
that and be able to send it out.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
be663ab67077fac8e23eb8e231a8c1c94cb32e54 21-Feb-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: split the drivers for agn and legacy devices 3945/4965

Intel WiFi devices 3945 and 4965 now have their own driver in the folder

drivers/net/wireless/iwlegacy

Add support to build these drivers independently of the driver for
AGN devices. Selecting the 3945 builds iwl3945.ko and iwl_legacy.ko,
and selecting the 4965 builds iwl4965.ko and iwl_legacy.ko. iwl-legacy.ko
contains code shared between both devices.

The 3945 is an ABG/BG device, with no support for 802.11n. The 4965 is a 2x3
ABGN device.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Acked-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
4bc85c1324aaa4a8bb0171e332ff762b6230bdfe 21-Feb-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> Revert "iwlwifi: split the drivers for agn and legacy devices 3945/4965"

This reverts commit aa833c4b1a928b8d3c4fcc2faaa0d6b81ea02b56.
/drivers/net/wireless/iwlwifi/iwl-scan.c
aa833c4b1a928b8d3c4fcc2faaa0d6b81ea02b56 21-Feb-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: split the drivers for agn and legacy devices 3945/4965

Intel WiFi devices 3945 and 4965 now have their own driver in the folder

drivers/net/wireless/iwlegacy

Add support to build these drivers independently of the driver for
AGN devices. Selecting the 3945 builds iwl3945.ko and iwl_legacy.ko,
and selecting the 4965 builds iwl4965.ko and iwl_legacy.ko. iwl-legacy.ko
contains code shared between both devices.

The 3945 is an ABG/BG device, with no support for 802.11n. The 4965 is a 2x3
ABGN device.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Acked-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
88e58fc5d940c3463c7070a2a7a8a0ce65af3fdc 28-Jan-2011 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: introduce iwl_advanced_bt_coexist()

We use priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist
conditional in few places, merge it into one function.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
ef1b21f7eb074a8c8ddfea70ed70e988545c8d54 12-Nov-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: kill elapsed_jiffies

Subtract of jiffies is fine even if one variable overwrap.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
ac4f5457c7617999967e9740f8903b922714bab4 22-Oct-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: defer update power mode while scan

Do not set power mode when scanning, and defer that when scan finish.
We still set power mode in force case i.e. when device is overheated.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
a25a66ac94db88190653d5725c563e3f8faeee61 22-Oct-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: fix set_tx_power vs scan

According to comment in iwl_bg_scan_completed, setting tx power should
be deferred during pending scan, but we are not doing this.

This patch change code to really defer setting tx power after scan
complete. Additionally refactor iwl_set_tx_power code and call
lib->send_tx_power() directly from iwlagn_commit_rxon.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
57934dc1fb7ef65a8a0f5d7a1578536b36043c0a 22-Sep-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: remove spurious exports

A number of exports, especially related to
thermal throttling, are unnecessary because
the code lives in the same module that it
is used in, so remove them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
a77029ee3fc03a37238b73892e55b789273991aa 22-Sep-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: introduce post_scan hook

The different drivers need to do different things
after a scan, so create a post_scan hook to allow
them to do this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
7cb1b0887fcc61918e3d64827fbef968bb67a57a 06-Oct-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: reduce redundant parameter definitions

move paramater definitions to a device paramater structure only
leaving the device name, which antennas are used and what firmware
file to use in the iwl_cfg structure. this will not completely
remove the redundancies but greatly reduce them for devices that
only vary by name or antennas. the parameters that are more
likely to change within a given device family are left in iwl_cfg.
also separate bt param structure added to help reduce more.

Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
20c956dfbeec823082054954b2443e736455418b 15-Sep-2010 John W. Linville <linville@tuxdriver.com> iwlwifi: fix sparse warning about wrong enum for band parameter

drivers/net/wireless/iwlwifi/iwl-scan.c:386:27: warning: mixing different enum types
drivers/net/wireless/iwlwifi/iwl-scan.c:386:27: int enum nl80211_band versus
drivers/net/wireless/iwlwifi/iwl-scan.c:386:27: int enum ieee80211_band
drivers/net/wireless/iwlwifi/iwl-scan.c:435:57: warning: mixing different enum types
drivers/net/wireless/iwlwifi/iwl-scan.c:435:57: int enum ieee80211_band versus
drivers/net/wireless/iwlwifi/iwl-scan.c:435:57: int enum nl80211_band
drivers/net/wireless/iwlwifi/iwl-scan.c:474:53: warning: mixing different enum types
drivers/net/wireless/iwlwifi/iwl-scan.c:474:53: int enum ieee80211_band versus
drivers/net/wireless/iwlwifi/iwl-scan.c:474:53: int enum nl80211_band
drivers/net/wireless/iwlwifi/iwl-scan.c:588:72: warning: mixing different enum types
drivers/net/wireless/iwlwifi/iwl-scan.c:588:72: int enum ieee80211_band versus
drivers/net/wireless/iwlwifi/iwl-scan.c:588:72: int enum nl80211_band

Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
3a160a5b5fc7d45fa2f869b23f8fcd27a4c05f8f 13-Sep-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: apply settings when finishing scan

Even is someone else complete scanning in mac80211, apply rxon and
tx power settings if gets scan complete notification from hardware.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
7cf24421292d92556d53630e6973b34324c94103 13-Sep-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: use IWL_DEBUG_SCAN for debug scanning

Replace IWL_DEBUG_{INFO,HC,RC} to IWL_DEBUG_SCAN in iwl-scan.c file. Add
some more IWL_DEBUG_SCAN messages. This will allow to fully debug
scanning using only IWL_DL_SCAN flag.

Also start one message sentence with capital letter, since that
convention in iwl-scan.c file.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
74d81b259d6c8493f066e34c939cb6fb7d3129e5 13-Sep-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: cleanup scan initiate check

Remove redundant checks and use iwl_is_ready_rf().

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
e7e16b90b477a07d17af37dceb2e8af1ddbd9712 13-Sep-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: do not force complete scan too early

Currently we force scan complete at the end of iwl_scan_cancel_timeout
function. This cause race condition when we can get a new scan request
from mac80211 and complete it by iwl_bg_complete from older scan. Change
code to force scan complete only when really needed: device goes down,
interface is removed or scan timeout occurs.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
6bd1758d978f917dc0804f44e3528ef1a80d9d43 13-Sep-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: assure we complete scan in scan_abort and scan_check works

Assure we complete scan in mac80211 when we abort scanning (scan_abort
work) or scan timeout occurs (scan_check work). Currently
iwl_scan_cancel_timeout() procedure force scan finish in mac80211
at the end of timeout loop, so we can use it in proper work functions.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
f5354c17dc29681c241f2774f3ef9478fb586673 13-Sep-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: force scan complete after timeout

If we do not get notification from hardware about scan complete, after
timeout do mac80211 scan completion anyway. This assure we end scan
in case of firmware hung.

Patch fix one of the causes of wdev_cleanup_work warning reported at
https://bugzilla.redhat.com/show_bug.cgi?id=593566

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
02d8c14b590f583fd6e8c16fe779f845845effd9 13-Sep-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: rewrite scan completion

Assure (partially) we call ieee80211_scan_completed() only once when
scan was requested from mac80211.

Code path that first clear STATUS_SCANNING bit is responsible to call
ieee80211_scan_completed(). Before the call, we check if mac80211
really request the scan.

Still persist some cases when we behave wrong, that will be addressed
in the next patches.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
e693a802f06f538b711333a32a83e2732dc4773d 13-Sep-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: rework iwl_scan_cancel_timeout

Since on timeout version of iwl_scan_cancel procedure we can sleep,
do not have to schedule abort_scan work to begin and perform scanning,
can do this directly. Also now, as we do not queue abort_scan from
restart work anymore, we can queue abort_scan to priv->workqueue.

Don't drop mutex when waiting for scan complete. Use STATUS_HW_SCAN bit
to check if scanning is currently pending, because STATUS_SCANNING will
be cleared only with priv->mutex taken.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
cd44600fdd89832c0bc898189270a81be0db01cd 13-Sep-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: report scan completion when abort fail

When we are not able to send abort command to firmware, notify mac80211
that we complete scan, as we will newer do it lately. Check for all
possible errors that low level sending command procedure does not check,
to assure we catch all failures cases.

Patch fix one of the causes of wdev_cleanup_work warning reported at
https://bugzilla.redhat.com/show_bug.cgi?id=593566

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
d745d472afcbc6354ebfee008123894a7f37e97e 13-Sep-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: cancel scan when down the device

Always cancel scan when stooping device and scan is currently pending,
we should newer have scan running after down device.

To assure we start scan cancel from restart work we have to schedule
abort_scan to different workqueue than priv->workqueue.

Patch fix not cancel scanning when restarting firmware, what is
one of the causes of wdev_cleanup_work warning (together with permanent
network connection lost) reported at
https://bugzilla.redhat.com/show_bug.cgi?id=593566

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
d5926d9d6a183d109060f68c0b96ea2b33c15377 13-Sep-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: move scan completed flags handling

Move the scan completed flags handling so that we
can notify mac80211 about aborted scans with the
correct status. Also queue the scan_completed work
before the BT status update so that it won't see
the bits still set (unless a new scan was started
in which case that's fine.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
3eecce527c7434dfd16517ce08b49632c8a26717 13-Sep-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: unify scan start checks

Rather than duplicating all the checks and even
in case of errors accepting the scan request
from mac80211, we can push the checks to the
caller and in all error cases reject the scan
request right away (rather than accepting and
then saying it was aborted).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
52a02d1500e4cbb347006e407d1c0bd941eee7fc 27-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: send PAN parameters

In order for the microcode to be able to handle
multiple interfaces, we need to give it the PAN
parameters that state how to allocate the time
between the two interfaces. Do this, and update
it wherever necessary.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
95c38dd429712366739299579b0785625cba66d6 23-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: clamp scanning dwell time to all contexts

The dwell time should at least fit into all
context's beacon intervals.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
246ed355221076884d225f9d8a4c30a048be8162 23-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: initial contextification

In order to support multiple interfaces, we must move
a lot of data into per-context structures so we can
use the contexts the device offers. To start with,
this makes a lot of code context-aware, more changes
will move more things into the context structure.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
903786a5626e7214d97b232bece88ee75e37d021 24-Aug-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: fix compile error without debugging support

Encounter compiler error when iwlwifi debugging support is
disabled, fix it.

This compiler error was introduced by the previous WiFi/BT coexist patchset.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
f78e545449bb07a28b419d888c4c558b13d9e5e1 23-Aug-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: update bt status upon scan complete

Update bt status upon receive scan complete notification

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
672ddeffeb2afad18fe1a2fc5aa14a07b4da1551 18-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: do not spuriously call ieee80211_scan_completed

When a scan is aborted because the corresponding
virtual interface is removed, we may still later
attempt to tell mac80211 that the scan completed.
This is obviously wrong, since we already told it
that it was aborted, so don't do that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
c240879f3488ae0904a7ba5bdaaa54638b2d8852 30-Jul-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: make scan workqueue functions static

We do not need export iwl_bg.*scan.*() functions just for initialize
workqueue in other module. Making that functions static helps with
iwl-scan.c code review a bit.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
a24d52f390a77ce90dc8cf0cd75d27ec0a6ea3f8 06-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: fix locking assertions

spin_is_locked() can return zero on some (UP?)
configurations because locks don't exist, and
that causes an endless amount of warnings. Use
lockdep_assert_held() instead, which has two
advantages:
1) it verifies the current task is holding
the lock or mutex
2) it compiles away completely when lockdep
is not enabled

Cc: stable@kernel.org [2.6.34+, maybe only parts of patch]
Reported-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
d28232b461b8d54b09e59325dbac8b0913ce2049 29-Jul-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: fix scan abort

Fix possible double priv->mutex lock introduced by commit
a69b03e941abae00380fc6bc1877fb797a1b31e6
"iwlwifi: cancel scan watchdog in iwl_bg_abort_scan" .
We can not call cancel_delayed_work_sync(&priv->scan_check) with
priv->mutex locked because workqueue function iwl_bg_scan_check()
take that lock internally.

We do not need to synchronize when canceling priv->scan_check work.
We can avoid races (sending double abort command or send no
command at all) using STATUS_SCAN_ABORT bit. Moreover
current iwl_bg_scan_check() code seems to be broken, as
we should not send abort commands when currently aborting.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
CC: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
cfecc6b492162fb49209a83dc207f182b87ea27a 18-Jun-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: turn on RTS/CTS after aggregation become operational

If RTS/CTS protection is needed for HT, wait until get operational
notification from mac80211, then inform uCode to switch to RTS/CTS
through RXON command.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
abf52f86aa0a49a7377350cafa8f218c4cd227e7 17-Jun-2010 John W. Linville <linville@tuxdriver.com> Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6

Conflicts:
net/mac80211/mlme.c
a69b03e941abae00380fc6bc1877fb797a1b31e6 14-Jun-2010 John W. Linville <linville@tuxdriver.com> iwlwifi: cancel scan watchdog in iwl_bg_abort_scan

Avoids this:

WARNING: at net/mac80211/scan.c:312 ieee80211_scan_completed+0x5f/0x1f1
[mac80211]()
Hardware name: Latitude E5400
Modules linked in: aes_x86_64 aes_generic fuse ipt_MASQUERADE iptable_nat
nf_nat rfcomm sco bridge stp llc bnep l2cap sunrpc cpufreq_ondemand
acpi_cpufreq freq_table xt_physdev ip6t_REJECT nf_conntrack_ipv6
ip6table_filter ip6_tables ipv6 kvm_intel kvm uinput arc4 ecb
snd_hda_codec_intelhdmi snd_hda_codec_idt snd_hda_intel iwlagn snd_hda_codec
snd_hwdep snd_seq snd_seq_device iwlcore snd_pcm dell_wmi sdhci_pci sdhci
iTCO_wdt tg3 dell_laptop mmc_core i2c_i801 wmi mac80211 snd_timer
iTCO_vendor_support btusb joydev dcdbas cfg80211 bluetooth snd soundcore
microcode rfkill snd_page_alloc firewire_ohci firewire_core crc_itu_t
yenta_socket rsrc_nonstatic i915 drm_kms_helper drm i2c_algo_bit i2c_core video
output [last unloaded: scsi_wait_scan]
Pid: 979, comm: iwlagn Tainted: G W 2.6.33.3-85.fc13.x86_64 #1
Call Trace:
[<ffffffff8104b558>] warn_slowpath_common+0x77/0x8f
[<ffffffff8104b57f>] warn_slowpath_null+0xf/0x11
[<ffffffffa01bb7d9>] ieee80211_scan_completed+0x5f/0x1f1 [mac80211]
[<ffffffffa02a23f0>] iwl_bg_scan_completed+0xbb/0x17a [iwlcore]
[<ffffffff81060d3d>] worker_thread+0x1a4/0x232
[<ffffffffa02a2335>] ? iwl_bg_scan_completed+0x0/0x17a [iwlcore]
[<ffffffff81064817>] ? autoremove_wake_function+0x0/0x34
[<ffffffff81060b99>] ? worker_thread+0x0/0x232
[<ffffffff810643c7>] kthread+0x7a/0x82
[<ffffffff8100a924>] kernel_thread_helper+0x4/0x10
[<ffffffff8106434d>] ? kthread+0x0/0x82
[<ffffffff8100a920>] ? kernel_thread_helper+0x0/0x10

Reported here:

https://bugzilla.redhat.com/show_bug.cgi?id=590436

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reported-by: Mihai Harpau <mishu@piatafinanciara.ro>
Cc: stable@kernel.org
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
f84b29ec0a1ab767679d3f2428877b65f94bc3ff 18-May-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: queue user-initiated scan when doing internal scan

The internal scanning created a problem where
when userspace tries to scan, the scan gets
rejected. Instead of doing that, queue up the
user-initiated scan when doing an internal
scan.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
3a0b9aad0a8166e9fb23d420fdc08ee2820d4c39 12-May-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: use virtual interface address for scan

For probe request frames sent during scan, we
should use the virtual interface's mac address
that the scan was initiated on to avoid issues
when the wrong address is used.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
073d5eab6fc85b6c278d507a5633b759a85dc878 13-May-2010 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: fix internal scan race

It is possible for internal scan to race against itself if the device is
not returning the scan results from first requests. What happens in this
case is the cleanup done during the abort of the first internal scan also
cleans up part of the new scan, causing it to access memory it shouldn't.

Here are details:
* First internal scan is triggered and scan command sent to device.
* After seven seconds there is no scan results so the watchdog timer
triggers a scan abort.
* The scan abort succeeds and a SCAN_COMPLETE_NOTIFICATION is received for
failed scan.
* During processing of SCAN_COMPLETE_NOTIFICATION we clear STATUS_SCANNING
and queue the "scan_completed" work.
** At this time, since the problem that caused the internal scan in first
place is still present, a new internal scan is triggered.
The behavior at this point is a bit different between 2.6.34 and 2.6.35
since 2.6.35 has a lot of this synchronized. The rest of the race
description will thus be generalized.
** As part of preparing for the scan "is_internal_short_scan" is set to
true.
* At this point the completion work for fist scan is run. As part of this
there is some locking missing around the "is_internal_short_scan"
variable and it is set to "false".
** Now the second scan runs and it considers itself a real (not internal0
scan and thus causes problems with wrong memory being accessed.

The fix is twofold.
* Since "is_internal_short_scan" should be protected by mutex, fix this in
scan completion work so that changes to it can be serialized.
* Do not queue a new internal scan if one is in progress.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=15824

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
6fe70aae0d128339febfabc073ba4c4a03de4f45 17-May-2010 John W. Linville <linville@tuxdriver.com> Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
1dda6d28377bec52f96767e8d4a59aa95102b9dd 29-Apr-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: push virtual interface through

Rather than keeping every bit of information
around in priv and the virtual interface, add
a virtual interface to many functions and use
the information directly from it.

This removes beacon_int, assoc_capability and
assoc_id from struct iwl_priv.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
1e460535ab3978b7a23e08e9f556af2f84c43235 23-Apr-2010 Abhijeet Kolekar <abhijeet.kolekar@intel.com> iwl3945: fix scan races

Port following patch to 3945.

"commit 90c4162ff59a3281b6d2f7206740be6217bd6758
Author: Johannes Berg <johannes.berg@intel.com>
Date: Wed Apr 7 00:21:36 2010 -0700
iwlwifi: fix scan races"

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
83163244f845c296a118ce85c653872dbff6abfe 05-May-2010 John W. Linville <linville@tuxdriver.com> Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem

Conflicts:
drivers/net/wireless/libertas_tf/cmd.c
drivers/net/wireless/libertas_tf/main.c
a060bbfe4ee95d115e8f9705a66894ac34e2c475 27-Apr-2010 Johannes Berg <johannes@sipsolutions.net> mac80211: give virtual interface to hw_scan

When scanning, it is somewhat important to scan
on the correct virtual interface. All drivers
that currently implement hw_scan only support a
single virtual interface, but that may change
and then we'd want to be ready.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
3b51cc996e81d8a113416d8094fa4a88f8360a51 23-Apr-2010 John W. Linville <linville@tuxdriver.com> Merge branch 'master' into for-davem

Conflicts:
drivers/net/wireless/ath/ath9k/phy.c
drivers/net/wireless/iwlwifi/iwl-6000.c
drivers/net/wireless/iwlwifi/iwl-debugfs.c
87eb367003887cdc81a5d183efea227b5b488961 21-Apr-2010 David S. Miller <davem@davemloft.net> Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Conflicts:
drivers/net/wireless/iwlwifi/iwl-6000.c
net/core/dev.c
e46754f8c9333170f11780d8e3a70da1b1a88338 21-Apr-2010 David S. Miller <davem@davemloft.net> Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
76026660c3699a82d1df2d04f6dd81af01d9d19a 19-Apr-2010 John W. Linville <linville@tuxdriver.com> Merge branch 'wireless-next-2.6' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-2.6
b6e4c55aaee4fd40526a6816e60c68dd62e565c4 06-Apr-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: trigger scan synchronously

Scan requesting doesn't need to be asynchronous
since all code paths leading up to it can sleep.
Make the scan request a new util operation that
is hw-specific (to account for 3945 vs. agn)
and call it right in place.

This patch moves a lot of code into iwlagn as
it need not be in iwlcore.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
811ecc995b18eb58067ffa75b961ece3b84a1f03 06-Apr-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: rename priv->scan to priv->scan_cmd

I keep checking what "priv->scan" is, so rename
it to "priv->scan_cmd" which more clearly tells
us what it is.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
b165cf09c0248262232c7566df5ae40284cee7d6 06-Apr-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: remove scan_pass_start

Since we no longer do a multi-pass scan,
keeping track of how long each pass took
is pointless since there will only be one.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
92ae80eec7ac642f249b7a2fc02f41441d128a62 06-Apr-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: remove next_scan_jiffies

This logic is just confusing, if anything it
belongs into mac80211. Also, even if we do
scan during the EAPOL handshake, that will
not cause any problems, just a short delay.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
6708dc863880777ffe5fc55c86bfd80f886f53d6 06-Apr-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: correct atomic bitops usage

With atomic bitops, test_and_{set,clear}_bit
should be used instead of separate test_bit
and set_bit/clear_bit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
00700ee007cf842ef2eb20201080ceddcfdaf9ad 06-Apr-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: remove scan_bands logic

Since mac80211 will now never request scanning
multiple bands, we can remove all the associated
logic and scan a single band only in each scan.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
8715fa28fb4fad62f6004d276ec8e1aa5e664e76 16-Apr-2010 Reinette Chatre <reinette.chatre@intel.com> Merge branch 'wireless-2.6' into wireless-next-2.6

Conflicts:
drivers/net/wireless/iwlwifi/iwl-6000.c
88be026490ed89c2ffead81a52531fbac5507e01 07-Apr-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: fix scan races

When an internal scan is started, nothing protects the
is_internal_short_scan variable which can cause crashes,
cf. https://bugzilla.kernel.org/show_bug.cgi?id=15667.
Fix this by making the short scan request use the mutex
for locking, which requires making the request go to a
work struct so that it can sleep.

Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
eb2ec0fb3c2fe85d42b2d5131e526daa0e298b9e 16-Apr-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: check scan request ie_len

In mac80211 we always check both scan_req->ie and scan_req->ie_len
against zero before usage, in iwlwifi we should do the same.

Remove not needed "left -= ie_len" while at it.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
5c01d5669356e13f0fb468944c1dd4c6a7e978ad 15-Apr-2010 John W. Linville <linville@tuxdriver.com> Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem

Conflicts:
Documentation/feature-removal-schedule.txt
drivers/net/wireless/ath/ath5k/phy.c
drivers/net/wireless/wl12xx/wl1271_main.c
871039f02f8ec4ab2e5e9010718caa8e085786f1 11-Apr-2010 David S. Miller <davem@davemloft.net> Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Conflicts:
drivers/net/stmmac/stmmac_main.c
drivers/net/wireless/wl12xx/wl1271_cmd.c
drivers/net/wireless/wl12xx/wl1271_main.c
drivers/net/wireless/wl12xx/wl1271_spi.c
net/core/ethtool.c
net/mac80211/scan.c
0f2df9eac70423838a1f8d410fd3899ddd88317b 08-Apr-2010 John W. Linville <linville@tuxdriver.com> Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 into merge

Conflicts:
Documentation/feature-removal-schedule.txt
drivers/net/wireless/ath/ath5k/phy.c
drivers/net/wireless/iwlwifi/iwl-4965.c
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-core.h
drivers/net/wireless/iwlwifi/iwl-tx.c
91dd6c27a29f97d81d2f71651d3b6bb55a4c1788 24-Mar-2010 Frans Pop <elendil@planet.nl> iwlwifi: remove trailing space in messages

Includes minor improvements in debugging messages in iwl-4965.c,
function iwl4965_is_temp_calib_needed().

Signed-off-by: Frans Pop <elendil@planet.nl>
Cc: Zhu Yi <yi.zhu@intel.com>
Cc: Reinette Chatre <reinette.chatre@intel.com>
Cc: Intel Linux Wireless <ilw@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
d28667f871991e0eea983b398421b8db2c8bdf8c 19-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: avoid device type checking in generic code

Avoid checking for specified device type to perform certain function,
switch to .cfg approach as more generic and better implementation
method.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
33e2bf6aa16061bae1253514e7c32af27d2b4b31 23-Mar-2010 David S. Miller <davem@davemloft.net> Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6

Conflicts:
Documentation/feature-removal-schedule.txt
drivers/net/wireless/ath/ath5k/phy.c
1382c71c764540880d35485b033a44ce104d8e2e 25-Feb-2010 Reinette Chatre <reinette.chatre@intel.com> Revert "iwlwifi: Send broadcast probe request only when asked to"

This reverts commit 21b2d8bd2f0d4e0f21ade147fd193c8b9c1fd2b9.

As explained by Johannes:
When we
build a probe request frame in the buffer with the SSID, we could
arrive over the limit of 200 bytes. When we build it in the buffer
without the SSID (wildcard) we don't arrive over 200 bytes, but the
ucode still allows direct probe in addition because it has an internal
buffer that is larger when it inserts the SSID...

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
13115ba76b3200fca62d1bfd54f917f208e7d2e5 23-Feb-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: remove unnecessary parameter in scan function

small change to remove unnecessary "ret" parameter since it not being
used.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
f8e200de3af29c36ec93b72e3fc36350f8fbec84 19-Feb-2010 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: remove needlessly exported symbols

iwl_apm_stop_master and iwl_internal_short_hw_scan
are only used within iwlcore and thus do not need to be exported.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
bbcbb9ef9735c67da303d30bd6beb9e699f0f508 02-Feb-2010 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: fix scan race

There is a problem if an "internal short scan" is in progress when a
mac80211 requested scan arrives. If this new scan request arrives within
the "next_scan_jiffies" period then driver will immediately return success
and complete the scan. The problem here is that the scan has not been
fully initialized at this time (is_internal_short_scan is still set to true
because of the currently running scan), which results in the scan
completion never to be sent to mac80211. At this time also, evan though the
internal short scan is still running the state (is_internal_short_scan)
will be set to false, so when the internal scan does complete then mac80211
will receive a scan completion.

Fix this by checking right away if a scan is in progress when a scan
request arrives from mac80211.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
a93e7973d0983d22fcbe5f691244736211639fe7 03-Feb-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: multiple force reset mode

Provide the function to perform different type of uCode reset/reload operation.
When uCode detect error and can not fix itself, this iwl_force_reset()
function allow driver to perform the necessary reset/reload functions and help
to bring uCode back to normal operation state.

Currently only 2 type of force reset are available:
- reset radio
- reload firmware

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
21b2d8bd2f0d4e0f21ade147fd193c8b9c1fd2b9 05-Feb-2010 Samuel Ortiz <sameo@linux.intel.com> iwlwifi: Send broadcast probe request only when asked to

When running directed active scans we currently end up sending both the SSID
probe requests and an additional broadcast one.
This is due to the fact that we always leave the probe request template SSID IE
length to 0. Instead we should set it to the first SSID to scan, and fill the
direct_scan array with the remaining SSIDs to scan for. This way we only send
what we've been asked to: a broadcast probe request when no directed scan is
requested, and directed probe requests otherwise.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
d4d59e88cb746165c6fe33eacb6f582d525c6ef1 22-Jan-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: Logic to control how frequent radio should be reset if needed

Add additional logic for internal scan routine to control how
frequent this function should be performed.

The intent of this function is to reset/re-tune the radio and bring the
RF/PHY back to normal state, it does not make sense calling it too
frequent,
if reset the radio can not bring it back to normal state, it indicate
there are other reason to cause the radio not operate correctly.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
220575f78fb0b8d2a1c41cd28115d52ae8d132ee 22-Jan-2010 Henry Zhangh <hongx.c.zhang@intel.com> iwlwifi: Fix A band scanning when associated

This patch allows A band to be scanned when driver is associated to AP.
Scan mechanism is that mac80211/cfg80211 requests driver to scan G band
first and then immediately to scan A band. Original code require
driver to wait for 2 seconds after any scan before another scan will be
performed. This caused driver to service G band scan request from
mac80211/cfg80211 but deny the A band scan request.

Signed-off-by: Henry Zhangh <hongx.c.zhang@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
afbdd69af0e6a0c40676d4d4b94a0a4414708eaa 22-Jan-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: add function to reset/tune radio if needed

Adding "radio reset" function to help reset and stabilize the radio.

During normal operation, sometime for unknown reason, radio encounter
problem and can not recover by itself; the best way to
recover from it is to reset and re-tune the radio. Currently, there is
no RF reset command available, but since radio will get reset when
switching channel, use internal hw scan request to force radio
reset and get back to normal operation state.

The internal hw scan will only perform passive scan on the first
available channel (not the channel being used) in associated state. The
request should be ignored if already performing scan operation or STA is
not in associated state.

Also include an "internal_scan" debugfs file to help trigger the
internal scan from user mode.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
1f44780827c6bbbcd1f12d5c6b6ce84f49a96bc0 15-Jan-2010 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: update copyright year to 2010

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
64a76b504b04b5da16d1e7658a95dd126594e02f 10-Dec-2009 Zhu Yi <yi.zhu@intel.com> iwlwifi: allocated rx page accounting cleanup

In iwlwifi, priv->alloc_rxb_page is used to keep track of the Rx
pages allocated by the driver. This cleans up the page free routines
by introducing __iwl_free_pages/iwl_free_pages so that the accounting
is more accurate and less error prone. This also fixes two instances where
the counter was not updated.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
b23aa883678aec0f5d9e96c9b3e416ec4fdf735e 06-Nov-2009 Shanyu Zhao <shanyu.zhao@intel.com> iwlwifi: use configured valid rx chain for scan

Use configured valid rx chains in scan command instead of ANT_ABC, correcting
valid rx chain configuration of 4965, should be ANT_ABC instead of ANT_AB.

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
f1e3d7d428616c04ef71bee3c2b6f274b8947755 06-Nov-2009 Shanyu Zhao <shanyu.zhao@intel.com> iwlwifi: use only one chain for scan in PS

When doing scan in power saving mode, choose only 1 valid RX chain instead of
turning all chains on.

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
89f186a8b64a4c90a219cfd94c26de5cfea54b84 30-Oct-2009 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: move iwl_[un]init_drv to iwlagn

Since iwlagn is the only user of these functions, move it to this module.
This results in a bit more code moving than just these functions since the
functions only used by them are also moved and we need to export the
symbols previously available to them directly.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
2f301227a1ede57504694e1f64839839f5737cac 09-Oct-2009 Zhu Yi <yi.zhu@intel.com> iwlwifi: use paged Rx

This switches the iwlwifi driver to use paged skb from linear skb for Rx
buffer. So that it relieves some Rx buffer allocation pressure for the
memory subsystem. Currently iwlwifi (4K for 3945) requests 8K bytes for
Rx buffer. Due to the trailing skb_shared_info in the skb->data,
alloc_skb() will do the next order allocation, which is 16K bytes. This
is suboptimal and more likely to fail when the system is under memory
usage pressure. Switching to paged Rx skb lets us allocate the RXB
directly by alloc_pages(), so that only order 1 allocation is required.

It also adjusts the area spin_lock (with IRQ disabled) protected in the
tasklet because tasklet guarentees to run only on one CPU and the new
unprotected code can be preempted by the IRQ handler. This saves us from
spawning another workqueue to make skb_linearize/__pskb_pull_tail happy
(which cannot be called in hard irq context).

Finally, mac80211 doesn't support paged Rx yet. So we linearize the skb
for all the management frames and software decryption or defragmentation
required data frames before handed to mac80211. For all the other frames,
we __pskb_pull_tail 64 bytes in the linear area of the skb for mac80211
to handle them properly.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
c099752ae06784fcd9cd393cbf3dfbc6b54f4569 18-Sep-2009 Christian Lamparter <chunkeey@googlemail.com> iwlwifi: drop lib80211 dependency

Ever since Johannes' "iwlwifi: improve scan support" iwlwifi
no longer needs any of lib80211's functions or definitions.

This patch updates iwlwifi's Kconfig _selections_ and
removes all left lib80211.h inclusions from the source files.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
5bddf54962bf68002816df710348ba197d6391bb 21-Aug-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: fix unloading driver while scanning

If NetworkManager is busy scanning when user
tries to unload the module, the driver can not be unloaded
because HW still scanning.

Make sure driver sends abort scan host command to uCode if it
is in the middle of scanning during driver unload.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
c2acea8e9b86ba5a5469ff477445676a223af4e2 24-Jul-2009 Johannes Berg <johannes@sipsolutions.net> iwlwifi: fix up command sending

The current command sending in iwlwifi is a bit of a mess:
1) there is a struct, iwl_cmd, that contains both driver
and device data in a single packed structure -- this
is very confusing
2) the on-stack data and the command metadata share a
structure by embedding the latter in the former, which
is also rather confusing because it leads to weird
unions and similarly odd constructs
3) each txq always has enough space for 256 commands,
even if only 32 end up being used

This patch fixes these things:
1) rename iwl_cmd to iwl_device_cmd and keep track of
command metadata and device command separately, in
two arrays in each tx queue
2) remove the 'meta' member from iwl_host_cmd and only
put in the required members
3) allocate the cmd/meta arrays separately instead of
embedding them into the txq structure

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
4e05c2347a50f1d0892ff3475d7609eec428f781 19-Jun-2009 Johannes Berg <johannes@sipsolutions.net> iwlwifi: scan requested channels only

When userspace requests only certain channels to be scanned,
we currently ignore that request entirely.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
c649c0e31d5736a4b7c5c3454182091dda4bbe62 25-May-2009 David S. Miller <davem@davemloft.net> Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Conflicts:
drivers/net/wireless/ath/ath5k/phy.c
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl3945-base.c
a2b0f02e4795bfde5f11720a10af8923cb98b654 22-May-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: support "pure 40MHz" in RXON command

Fix the bug when using 11n "pure 40MHz" mode cause uCode
crashing by adding support for "pure 40MHz" in RX_ON command flag.
the "mode" field (bits 25:26) has value of 0-3
0 = 20 MHz only
1 = 40MHz only
2 = Mixed
3 = Reserved
Control Channel ID (bit 22) is valid only in Mixed mode.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
fbc9f97bbf5e1eaee562eba93dc60faaff3f3bfa 16-May-2009 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: do not cancel delayed work inside spin_lock_irqsave

Calling cancel_delayed_work() from inside
spin_lock_irqsave, introduces a potential deadlock.

As explained by Johannes Berg <johannes@sipsolutions.net>

A - lock
T - timer

phase CPU 1 CPU 2
---------------------------------------------

some place that calls
cancel_timer_sync()
(which is the | code)
lock-irq(A)
| "lock-irq"(T)
| "unlock"(T)
| wait(T)
unlock(A)

timer softirq
"lock"(T)
run(T)
"unlock"(T)

irq handler
lock(A)
unlock(A)

Now all that again, interleaved, leading to deadlock:

lock-irq(A)
"lock"(T)
run(T)
IRQ during or maybe
before run(T) --> lock(A)
"lock-irq"(T)
wait(T)

We fix this by moving the call to cancel_delayed_work() into workqueue.
There are cases where the work may not actually be queued or running
at the time we are trying to cancel it, but cancel_delayed_work() is
able to deal with this.

Also cleanup iwl_set_mode related to this call. This function
(iwl_set_mode) is only called when bringing interface up and there will
thus not be any scanning done. No need to try to cancel scanning.

Fixes http://bugzilla.kernel.org/show_bug.cgi?id=13224, which was also
reported at http://marc.info/?l=linux-wireless&m=124081921903223&w=2 .

Tested-by: Miles Lane <miles.lane@gmail.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Acked-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
fff7a4346c07c30a39910c3b627434fc0e7ccc33 08-May-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: use #define instead of hard coded value

Instead of hard coded value, use the define in iwl-commands.h for
better code maintenance

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
aba7453037c3a90714caae77a622dceaf1173786 30-Apr-2009 David S. Miller <davem@davemloft.net> Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Conflicts:
Documentation/isdn/00-INDEX
drivers/net/wireless/iwlwifi/iwl-scan.c
drivers/net/wireless/rndis_wlan.c
net/mac80211/main.c
74aa9be0ea0ffeb233f45c39f3cf594b68bbbb89 23-Apr-2009 Johannes Berg <johannes@sipsolutions.net> iwlwifi: notify on scan completion even when shutting down

Under certain circumstances iwlwifi can get stuck and will no
longer accept scan requests, because the core code (cfg80211)
thinks that it's still processing one. This fixes one of the
points where it can happen, but I've still seen it (although
only with my radio-off-when-idle patch).

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
279b05d4362472ae9269f982f00e644265bdbf94 20-Apr-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: clean up unused NL80211_IFTYPE_MONITOR for Monitor mode

This patch clean up the code for NL80211_IFTYPE_MONITOR mode,
priv->iw_mode is set in add_interface, but add_interface is never called
for monitor mode.
The only way mac80211 informs us about monitor mode is through
configuring filter; since iw_mode will never set to
NL80211_IFTYPE_MONITOR, modify and remove all the code refer to
NL80211_IFTYPE_MONITOR and replace with iwl_is_monitor_mode() function
call.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
b097ad29752f909ec1121ac3dc57d348f08dd8d7 20-Apr-2009 Johannes Berg <johannes@sipsolutions.net> iwlwifi: support truly passive scanning

If passive scanning is requested we should not ask the
microcode to do active scanning after detecting traffic
on a channel -- that should only be used when an active
scan is requested but some channels are marked passive.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
1ecf9fc1317f8df91eb1d74360f408558d657478 20-Apr-2009 Johannes Berg <johannes@sipsolutions.net> iwlwifi: improve scan support

This modifies iwlwifi to
* no longer build its own probe request, but use mac80211's
* therefore, support arbitrary scan IEs (up to the max len)
* support multiple scan SSIDs
* support passive scanning

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
e9dde6f6edf9954e2c75d2d738cae0f00e9b0fbc 19-Feb-2009 Abhijeet Kolekar <abhijeet.kolekar@intel.com> iwl3945: use iwl_mac_hw_scan callback

3945 can use iwl_mac_hw_scan callback instead of
iwl3945_mac_hw_scan callback.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Acked-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
2a5193119269062608582418deba7af82844159a 10-Feb-2009 Johannes Berg <johannes@sipsolutions.net> cfg80211/nl80211: scanning (and mac80211 update to use it)

This patch adds basic scan capability to cfg80211/nl80211 and
changes mac80211 to use it. The BSS list that cfg80211 maintains
is made driver-accessible with a private area in each BSS struct,
but mac80211 doesn't yet use it. That's another large project.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
e1623446bb1de1834ff1c57b3e8ed341d5d4a927 27-Jan-2009 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: don't use implicit priv in IWL_DEBUG

Call IWL_DEBUG macro with explicit priv argument.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
17f841cd6cb0837ba0599ad18a746c30ddd83e08 23-Jan-2009 Samuel Ortiz <samuel.ortiz@intel.com> iwl3945: Remaining host command cleanups

With the recent host command routines merge, we can now look at the various
host command helpers and get rid of the duplicated ones.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
77fecfb88f8ad64420e06a96f1bd3b38498bfb4f 23-Jan-2009 Samuel Ortiz <samuel.ortiz@intel.com> iwl3945: Use iwlcore scan code

A lot of the scanning related code is duplicated between 3945 and agn. Let's
use the iwlcore one and get rid of the 3945.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
01f8162a854df7f9c259c839ad3c1168ac13b7b8 08-Jan-2009 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: update copyright year to 2009

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
39aadf8c29ad959e823efca15381bea9d0770b1e 19-Dec-2008 Winkler, Tomas <tomas.winkler@intel.com> iwlwifi: replace IWL_WARNING with IWL_WARN

IWL_WARN doesn't use hidden priv pointer.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
759ef89fb096c4a6ef078d3cfd5682ac037bd789 09-Dec-2008 Winkler, Tomas <tomas.winkler@intel.com> iwlwifi: change email contact information

This patch replaces personal emails with hopefully
always valid Intel Linux Wireless, which will be routed
to a current maintainer

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
a57a59f247b651e8ed6d3eeb7e2f9d83b83134c9 28-Oct-2008 Johannes Berg <johannes@sipsolutions.net> iwlwifi: remove implicit direct scan

When an undirected scan is requested and iwlwifi is not associated but
the user has set an SSID (and maybe was associated with that network at
some point) then iwlwifi will assume the user wanted to scan for this
SSID which seems wrong. Remove this code.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
a96a27f97f2bbfc1fca54bc3c0b0d41484152740 24-Oct-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: run through spell checker

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
951891c7ef844919d30aac7b1fc7396fd8be23ff 24-Oct-2008 Mohamed Abbas <mohamed.abbas@intel.com> iwlwifi: clear scanning bits upon failure

In iwl_bg_request_scan function, if we could not send a
scan command it will go to done.
In done it does the right thing to call mac80211 with
scan complete, but the problem is STATUS_SCAN_HW is still
set causing any future scan to fail. Fix by clearing the scanning status
bits if scan fails.

Signed-off-by: Mohamed Abbas <mohamed.abbas@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
9387b7caf3049168fc97a8a9111af8fe2143af18 01-Oct-2008 John W. Linville <linville@tuxdriver.com> wireless: use individual buffers for printing ssid values

Also change escape_ssid to print_ssid to match print_mac semantics.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
7e272fcff6f0a32a3d46e600ea5895f6058f4e2d 25-Sep-2008 John W. Linville <linville@tuxdriver.com> wireless: consolidate on a single escape_essid implementation

Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
76eff18bdc5feaa53f1be33709b67df02f1d55e9 14-Oct-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: unify tx antenna toggling

TX antenna toggling is requested for management frames in tx and
scanning. I addition toggling in scanning was incorrect;

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Reviewed-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
d9fe60dea7779d412b34679f1177c5ca1940ea8d 09-Oct-2008 Johannes Berg <johannes@sipsolutions.net> 802.11: clean up/fix HT support

This patch cleans up a number of things:
* the unusable definition of the HT capabilities/HT information
information elements
* variable names that are hard to understand
* mac80211: move ieee80211_handle_ht to ht.c and remove the unused
enable_ht parameter
* mac80211: fix bug with MCS rate 32 in ieee80211_handle_ht
* mac80211: fix bug with casting the result of ieee80211_bss_get_ie
to an information element _contents_ rather than the
whole element, add size checking (another out-of-bounds
access bug fixed!)
* mac80211: remove some unused return values in favour of BUG_ON
checking
* a few minor other things

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
eedda3670ea8e6d7649e3c8847759b0a6e532f8d 06-Oct-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: remove STATUS_CONF_PENDING in scanning

This patch removes STATUS_CONF_PENDING usage that called from
iwl4965_mac_config internally after scan completed.

It's called anyway from the mac80211 ieee80211_scan_completed():

if (local->hw_scanning) {
local->hw_scanning = false;
if (ieee80211_hw_config(local))
...
}

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
5118303f7cc0520ce2969ea3d890dc05d586ceb2 06-Oct-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: scan fix comment

This patch moves comment to proper line, it has moved during
code shuffling.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
d588be6bae40f7965f1b681a4dbc3254411787b9 06-Oct-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: scan correct setting of valid rx_chains

This patch sets rx_chain bitmap correctly according hw configuration.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
8d09a5e1c36d0dec5728e6c8b0bb5412de09b27b 24-Sep-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: don't fail if scan is issued too early

This patch returns success and empty scan on scans requests that were
rejected because issued too early. The cached bss list from previous
scanning will be returned by mac80211.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
05c914fe330fa8e1cc67870dc0d3809dfd96c107 11-Sep-2008 Johannes Berg <johannes@sipsolutions.net> mac80211: use nl80211 interface types

There's really no reason for mac80211 to be using its
own interface type defines. Use the nl80211 types and
simplify the configuration code a bit: there's no need
to translate them any more now.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
a33c2f47bd4618b0483d5ec4c5bc793e6d02c1f7 03-Sep-2008 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: remove uneeded declarations

This patch cleans up iwlwifi by removing uneeded declarations and removing
uneeded symbol export reducing the namespace pollution. It also fixes some
typos in comments.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
0ffe014a8c548f88694815ae7b25d6e86550917e 03-Sep-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi: fix hidden ssid discovery in passive channels

This enables sending of direct probes on passive channels, as long as
traffic was detected on that channel. This enables connectivity to
hidden/non broadcasting SSIDs APs on passive channels. Note 5000 HW
declares all 5.2 spectrum as passive.

Signed-off-by: Cahill Ben <ben.m.cahill@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
14652562364dad636ddce2cd11e71702ca21bfbd 04-Aug-2008 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: decrement rx skb counter in scan abort handler

This patch decrements rx skb counter in scan abort handler.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
cb9289cb798502a5010c8f1d8d003842cd1449a4 18-Jul-2008 Denis V. Lunev <den@openvz.org> iwlwifi: small compile warnings without CONFIG_IWLWIFI_DEBUG

CC [M] drivers/net/wireless/iwlwifi/iwl-scan.o
drivers/net/wireless/iwlwifi/iwl-scan.c: In function 'iwl_rx_scan_complete_notif':
drivers/net/wireless/iwlwifi/iwl-scan.c:274: warning: unused variable 'scan_notif'

Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Tomas Winkler <tomasw@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
fe905f1d5a8404f45fa0df26e6a870bf1e3b5983 11-Jul-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: enable active scanning

This patch enables active scan on active channels.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
d16dc48a2ea14af9980d0ea79d041f4b53e47b62 11-Jul-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: unify 4965 and 5000 scanning code

This patch unifies 4965 and 5000 scanning code.

We increases the version number to 1.3.27. Since new uCode
iwlwifi-4965-2.ucode is required for 4965 cards.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
1b63ba8a86c85524a8d7e5953b314ce71ebcb9c9 28-Jun-2008 David S. Miller <davem@davemloft.net> Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Conflicts:

drivers/net/wireless/iwlwifi/iwl4965-base.c
f53696de6722a4aac00b76e25a5321c01e88a55f 12-Jun-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: cleans up scanning code

This patch
1. cleans up scanning code.
2. It adds round robin of TX antannas/chains.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
e7d326ac437e9e9425dcd79382f4e5f6ca31fb16 12-Jun-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: move rate helpers to iwlcore

This patch moves rate helpers to iwlcore.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c
2a421b91d6fe89e27ded7544a25449c0b050098f 12-Jun-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: move scan to iwl-scan.c iwlcore

This patch moves scan code to iwl-scan.c file in iwlcore module.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-scan.c