Commit graph

104 commits

Author SHA1 Message Date
Johannes Berg 266af4c745 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>
2011-03-11 14:15:55 -05:00
Stanislaw Gruszka 466a19a003 iwlwifi: move rx handlers code to iwl-rx.c
Put generic rx_handlers (except iwlagn_rx_reply_compressed_ba) to
iwl-rx.c . Make functions static and change prefix from iwlagn_ to
iwl_ . Beautify iwl_setup_rx_handlers and do some other minor coding
style changes.

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>
2011-03-04 14:06:50 -05:00
Fry, Donald H f8f79a5dbe iwlagn: report correct temperature for WiFi/BT devices.
The temperature reported by 'cat /sys/class/net/wlan?/device/temperature'
is incorrect for devices with BT capability.  Report the value from the
correct statistics structure.  Tested with 130, 100, 6205 and 5300.

Signed-off-by:  Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-03-03 10:05:11 -08:00
Stanislaw Gruszka b7977ffaab iwlwifi: add {ack,plpc}_check module parameters
Add module ack_check, and plcp_check parameters. Ack_check is disabled
by default since is proved that check ack health can cause troubles.
Plcp_check is enabled by default.

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>
2011-02-28 14:06:57 -05:00
Wey-Yi Guy 6013270a03 iwlagn: enable BT session 2 type UART for 2000 series
For 2000 series device, use session 2 type of BT UART message

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-26 10:29:02 -08:00
Wey-Yi Guy 399f66fda0 iwlagn: split BT page and inquiry UART msg
Both inquiry and page was combine in frame7 of UART message, separate it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-26 10:28:56 -08:00
Wey-Yi Guy 5596026081 iwlagn: name change for BT config command
No functional changes, name changes to reflect the structure used by
6000 series.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-26 10:28:27 -08:00
Johannes Berg 6ebacbb79d mac80211: rename RX_FLAG_TSFT
The flag isn't very descriptive -- the intention
is that the driver provides a TSF timestamp at
the beginning of the MPDU -- make that clearer
by renaming the flag to RX_FLAG_MACTIME_MPDU.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:29 -05:00
Wey-Yi Guy c4197c6298 iwlagn: donot process bt update when bt coex disable
If bt coex is disabled, do not process any bt related information
from uCode even received.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-11 11:51:49 -08:00
Johannes Berg 2f115cf24e iwlwifi: remove unnecessary locking
This code, and the places that set the variable
is_internal_short_scan and the vif pointers are
all protected by the mutex, there's no point in
locking the spinlock here as well (any more).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-06 09:30:54 -08:00
Wey-Yi Guy c52bf9b73a iiwlagn: remove unused parameter
sco_cmd is not being used, remove it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-31 13:22:35 -08:00
Wey-Yi Guy 187bc4f6b2 iwlagn: remove unsupported BT SCO command
During the period of BT coex changes, REPLY_BT_COEX_SCO host command
is no longer needed to support SCO/eSCO type of traffic. delete it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-31 13:22:25 -08:00
Bruno Randolf 59eb21a650 cfg80211: Extend channel to frequency mapping for 802.11j
Extend channel to frequency mapping for 802.11j Japan 4.9GHz band, according to
IEEE802.11 section 17.3.8.3.2 and Annex J. Because there are now overlapping
channel numbers in the 2GHz and 5GHz band we can't map from channel to
frequency without knowing the band. This is no problem as in most contexts we
know the band. In places where we don't know the band (and WEXT compatibility)
we assume the 2GHz band for channels below 14.

This patch does not implement all channel to frequency mappings defined in
802.11, it's just an extension for 802.11j 20MHz channels. 5MHz and 10MHz
channels as well as 802.11y channels have been omitted.

The following drivers have been updated to reflect the API changes:
iwl-3945, iwl-agn, iwmc3200wifi, libertas, mwl8k, rt2x00, wl1251, wl12xx.
The drivers have been compile-tested only.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: Brian Prodoehl <bprodoehl@gmail.com>
Acked-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-01-21 15:34:17 -05:00
Johannes Berg 7194207cee iwlagn: add support for waiting for notifications
In order to implement waiting for notifications,
add a structure that captures the information,
and a list of such structures that will be
traversed when a command is received from the
ucode.

Use sparse checking to make sure calls to the
prepare/wait/cancel functions are always nested
correctly.

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>
2011-01-21 15:32:20 -05:00
Stanislaw Gruszka cd017f25e3 iwlagn: fix scan tx antenna setting on 5Ghz band
Looks that we do not set correctly antennas when scanning
on 5Ghz band and when bluetooth is enabled, because
priv->cfg->scan_tx_antennas[band] is only defined for
IEEE80211_BAND_2GHZ.

To fix we check band before limiting antennas to first one.
This allow to remove hard coded cfg->scan_tx_antennas[band].

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>
2011-01-04 14:35:11 -05:00
Wey-Yi Guy f21dd005df iwlwifi: keep track of bt coex enable/disable stage
For debugging purpose, keep track of the bt coex enable/disable state.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13 15:53:38 -08:00
Johannes Berg 8d6748ca73 iwlagn: implement layout-agnostic EEPROM reading
The current EEPROM reading code has some layout
assumptions that now turned out to be false with
some newer versions of the EEPROM. Luckily, we
can avoid all such assumptions by using data in
the EEPROM itself, so implement using that.

However, for risk mitigation purposes, keep the
old reading code for current hardware for now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13 15:52:11 -08:00
Stanislaw Gruszka 22de94de7d iwlwifi: jiffies based tx queues watchdog
This patch replace monitor/recover timer by watchdog based on time
stamp. New code allow to discover hangs more precisely.

Timeout values are currently doubled monitoring period values of
previous timer. This have to be tuned based of firmware timing
capabilities.

Tested on 3945, 4965, 5300, 6300.

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>
2010-12-06 16:01:29 -05:00
Wey-Yi Guy 9a67d761b3 iwlagn: minor change in bt coex normal LUT
Minor changes in LUT

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-24 17:26:43 -08:00
Wey-Yi Guy 506aa156fa iwlagn: use different kill mask when SCO active
use different kill_ack_mask and kill_cts_mask when detect SCO
is active.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-24 17:25:03 -08:00
Wey-Yi Guy e366176e5c iwlwifi: consider BT for power management
Check the BT PSPoll flag when fill PM command to uCode

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-24 16:19:37 -05:00
Joe Perches 20407ed8a5 iwlwifi: Use static const
Using static const generally increases object text and decreases data size.
It also generally decreases overall object size.

   text	   data	    bss	    dec	    hex	filename
  48644	     57	  12120	  60821	   ed95	drivers/net/wireless/b43/phy_n.o.new
  48661	     57	  12120	  60838	   eda6	drivers/net/wireless/b43/phy_n.o.old
  37906	     86	   7904	  45896	   b348	drivers/net/wireless/iwlwifi/iwl-agn-lib.o.new
  37937	     86	   7904	  45927	   b367	drivers/net/wireless/iwlwifi/iwl-agn-lib.o.old
  37781	    523	   6752	  45056	   b000	drivers/net/wireless/iwlwifi/iwl-3945.o.new
  37781	    523	   6752	  45056	   b000	drivers/net/wireless/iwlwifi/iwl-3945.o.old

Changed b43_nphy_write_clip_detection to take a const u16 *

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-22 15:58:48 -05:00
Johannes Berg ea9b307f8e iwlwifi: always build swq_id as virtual queue ID
Previously, we used the swq_id's mechanism
to have AC and HW queue different only for
aggregation queues. To be able to fix a bug
with iPAN simply always build the swq_id as
ac | (hwq << 2) and remove the flag bit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-16 07:46:00 -08:00
Johannes Berg 549a04e092 iwlwifi: pass txq to wake/stop queue
Instead of passing the txq->swq_id, pass the
txq struct directly to make sure that in the
future nobody will pass an invalid number.
Only three places actually change from using
the txq_id or the skb's queue_mapping to now
using txq->swq_id as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-16 07:45:49 -08:00
Johannes Berg 4bea9b9902 iwlagn: remove a bogus AGG_OFF check
Even if this check were to happen, using the
txq_id here (which is a HW queue) would lead
to confusion in mac80211. Luckily, it doesn't
seem like this can ever happen.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-16 07:45:35 -08:00
Wey-Yi Guy 66e863a527 iwlagn: support dynamic aggregation for BT coex
Use dynamic aggregation threshold if bt traffic load is high
to reduce the impact on aggregated frame.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-16 07:44:00 -08:00
Wey-Yi Guy f81c1f4838 iwlagn: enable shadow register
For 6000 series devices and up, enable automatic update MAC's register
for better power usage in PSP mode

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-15 13:26:59 -05:00
Johannes Berg ae79d23d0b iwlagn: fix non-5000+ build
When building 4965 without 5000+ there were a
lot of build errors due to functions being used
that weren't even compiled in. To fix this move
some code around and only compile the HCMD code
for 5000+ series as it's not used for 4965.

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>
2010-11-15 13:26:43 -05:00
Wey-Yi Guy f5682c01eb iwlagn: turn dynamic smps on while BT is on
While BT is on and doing iscan and/or pscan, BT is in listen
mode which will impact WiFi throughput, we need to
enable dynamic smps in order to improve the rx throughput.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-15 13:24:57 -05:00
Stanislaw Gruszka 5eda74a405 iwlwifi: avoid commit rxon during scan in iwlagn_bt_traffic_change_work
Avoid sending commands to firmware (including commit_rxon) when scan
is pending and we are calling iwlagn_bt_traffic_change_work simultaneously.

Also comment some innocent race conditions.

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>
2010-11-15 13:24:27 -05:00
Stanislaw Gruszka 4cbf1b1249 iwlwifi: send tx_power_cmd synchronously
On 5xxx and 6xxx change to send tx_power_cmd command synchronously,
to do not start other commands when setting tx power is pending.
We currently do the same for 4956 and 3945.

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>
2010-11-15 13:24:23 -05:00
Stanislaw Gruszka 4beeba7dc5 iwlwifi: warn when send tx power settings during scan
Add WARN_ONCE when scanning is pending. Use STATUS_SCAN_HW bit since we
can have scan canceled or completed but STATUS_SCANNING bit still set.

v1 -> v2: replace EIO to EAGAIN

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-15 13:24:22 -05:00
Johannes Berg 085fbca29d iwlwifi: allow probe-after-rx on 2.4 GHz
There are two passive 2.4 GHz channels: 12 and 13.
If you have a hidden SSID on those, you will not
be able to connect to it because we don't send out
probe requests there. We can allow this by using
the firmware's probe-after-rx functionality on
those channels as well.

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

Reported-by: Daniel J Blueman <daniel.blueman@gmail.com>
Tested-by: Daniel J Blueman <daniel.blueman@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-14 09:46:33 -07:00
Johannes Berg 1cf2637360 iwlwifi: fix dual-mode scanning
The recent scanning code shuffle accidentally
moved the SCAN_HW bit setting _after_ the PAN
parameters are modified, which means that they
don't take the scan into account -- fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07 15:53:14 -07:00
Johannes Berg 9597ebac91 iwlwifi: remove set_pwr_src operation
The set_pwr_src operation is only ever used from
within the same sub-driver that it is declared
in, so it can just be called directly instead of
being an operation. Also, it is never called to
set the power source to V_aux, so change the two
functions accordingly (but keep the V_aux code
for documentation purposes in a comment).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07 15:52:25 -07:00
Johannes Berg 84fac3d960 iwlwifi: move iwl_dump_fh to agn
The iwl_dump_fh function is only used
by the agn module, so it can be there
instead of being exported by the core.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07 15:51:59 -07:00
Johannes Berg fed732920b iwlwifi: move iwl_dump_csr to agn
The iwl_dump_csr function is only used
within the agn module, so it can be
moved there instead of being exported
by the core.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07 15:51:49 -07:00
Johannes Berg facd982e82 iwlwifi: move iwl_toggle_rx_ant to agn
The iwl_toggle_tx_ant function is only used
by agn code, so it can be moved into the
agn module instead of being exported from
the core.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07 15:51:36 -07:00
Johannes Berg a30e3112a8 iwlwifi: move agn specific station code there
By duplicating a little bit of code between 3945
and agn, we can move a lot of code into an agn
specific station management file and thus reduce
the amount of code in core that is dead to 3945.

before:
   text	   data	    bss	    dec	    hex	filename
 212886	   3872	     96	 216854	  34f16	iwlcore.ko
 620542	  10448	    304	 631294	  9a1fe	iwlagn.ko
 314013	   3264	    196	 317473	  4d821	iwl3945.ko

after:
   text	   data	    bss	    dec	    hex	filename
 202857	   3872	     92	 206821	  327e5	iwlcore.ko
 629102	  10448	    308	 639858	  9c372	iwlagn.ko
 314240	   3264	    196	 317700	  4d904	iwl3945.ko

delta:
 -10029   iwlcore.ko
   8560   iwlagn.ko
    227   iwl3945.ko

so it's a net win even if you have both loaded,
likely because a lot of EXPORT_SYMBOLs go away.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07 15:50:33 -07:00
Johannes Berg 5de33068a2 iwlwifi: move chain settings to agn
The core module doesn't need to carry around
the code for chain settings that is used for
HT drivers (agn) only.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07 15:49:34 -07:00
Johannes Berg a77029ee3f 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>
2010-10-07 15:49:05 -07:00
Wey-Yi Guy 898dade116 iwlagn: rename iwl5000_tx_resp
iwl5000_tx_resp really should be iwlagn_tx_resp, rename it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-06 08:12:02 -07:00
Wey-Yi Guy ab63c68ada iwlagn: rename iwl5000_tx_power_dbm_cmd
iwl5000_tx_power_dbm_cmd really should be iwlagn_tx_power_dbm_cmd,
so rename it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-06 08:11:27 -07:00
Wey-Yi Guy 7cb1b0887f 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>
2010-10-06 08:10:00 -07:00
Wey-Yi Guy 09f250ac8f iwlagn: initialize both tx/rx prio boost parameters
For config bt command, initialize both tx_prio_boost and
rx_prio_boost to "0".

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-09-17 13:18:57 -07:00
Wey-Yi Guy 1d270075be iwlagn: correct naming for failure reply tx status
For failure tx status 0x90 and 0x91, give the correct name to reflect
the errors.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-09-17 13:18:39 -07:00
Wey-Yi Guy 814665fef7 iwlagn: keep track of aggregated tx frames failure counter
When uCode completed the aggregated frames transmission attempt,
it will send tx command response with aggregated frame status.

Keep track of the failure counter which help indicate any transmission
error condition.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-09-17 13:18:02 -07:00
Wey-Yi Guy e1b3fa0c22 iwlagn: log aggregation tx command status
For aggregated frames with block ack, different status flag
will be used as part of tx command response.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-09-17 13:17:50 -07:00
Wey-Yi Guy 91835ba401 iwlagn: keep track fail tx reason counter
If uCode fail to transmit frame, it will send reply tx back
to driver with failure status; keep the counters of each failure
cases for debugging.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-09-17 13:17:19 -07:00
Johannes Berg 3eecce527c 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>
2010-09-14 16:08:03 -04:00