Commit Graph

482 Commits

Author SHA1 Message Date
Wey-Yi Guy
8b3ee29626 iwlagn: remove structure name reference to gen2
Give the corresponding name for .cfg data structure

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-02 08:35:12 -08:00
Johannes Berg
6fb5511ab9 iwlagn: advertise reliable TX status
Our hardware has reliable TX status, but we're
not currently advertising that to mac80211.
Since the packet loss monitoring will depend
on it, advertise it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-24 16:58:26 -08:00
Wey-Yi Guy
9e2e7422d0 iwlwifi: set STATUS_READY before commit_rxon
Have the STATUS_READY bit set before commit_rxon call to avoid fail
to send tx power to uCode.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-16 07:47:35 -08:00
Shanyu Zhao
6163a3735a iwlagn: check change before commit RXON cmd
When setting rxon chain and filter, no need to commit RXON when the
chain flag is not changed. This reduces the number of RXON commands
we send down to uCode.

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-16 07:47:22 -08:00
Wey-Yi Guy
21a5b3c6b1 iwlagn: use SKU information in the EEPROM
EEPROM contain the SKU information for the device, use it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-16 07:47:10 -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
e39fdee1d7 iwlwifi: put all the isr related function under ops
There were two type of isr supported by iwlwifi devices.
  legacy isr - only used by legacy devices (3945 & 4965)
  ict isr - used by all new generation of iwlwifi devices

Move all the isr related functions into ops, the ict type of isr
supports only needed for newer devices.

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:45 -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
2a21ff446c iwlagn: update PCI ID for 100 series devices
Update the supported PCI ID list for 100 series devices

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:41 -05:00
Wey-Yi Guy
fb30eaf387 iwlagn: update PCI ID for 6000g2a series devices
Update the supported PCI ID list for 6000g2a series devices

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:40 -05:00
Wey-Yi Guy
8b37d9f0a1 iwlagn: update PCI ID for 6000g2b series devices
Update the supported PCI ID list for 6000g2b series devices

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:39 -05:00
Johannes Berg
d4daaea656 iwlwifi: implement switching iftype while up
Implement switching the interface while an
interface is up in iwlwifi. Interfaces have
to stay on the context they were created on.

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:24:55 -05:00
Johannes Berg
2295c66b68 iwlagn: new RXON processing for modern devices
In order to simplify the flow, and make new
enhancements easier, separate out the RXON
processing for modern AGN (5000 and newer)
from RXON processing for the older 3945 and
4965 devices. Avoid changing these old ones
to avoid regressions and move their code to
a new file (iwl-legacy.c). 4965 gets the
commit_rxon that used to be common for all
AGN devices, but with removed PAN support.

The new RXON processing is more central and
does more work in committing, so that it is
easier to follow.

To make it more evident what is split out
for legacy, split the necessary operations
for that into a new struct iwl_legacy_ops.
Those parts that still exist in the new AGN
code don't need to be parametrized.

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:24:53 -05:00
Johannes Berg
2d4e43c3c6 iwlagn: don't resend RXON timing
Resending RXON timing here caused issues with
dual-mode under certain circumstances, so avoid
doing it here right now.

This effectively reverts b01efe434b
and partially 2491fa42d9. The next
patch will make all this cleaner for just the
devices that need 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>
2010-11-15 13:24:51 -05:00
Johannes Berg
dc21b54532 iwlwifi: make mac80211 ops a device config
In the future, 4965 and modern AGN devices will
need to have different mac80211 callbacks since
they have different capabilities. Prepare for
that by making the mac80211 operations a device
config.

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:24:50 -05:00
John W. Linville
f60dc0138a iwlwifi: Convert to new PCI PM framework
Use the new PCI PM and let the PCI core code handle the PCI-specific
details of power transitions.

Based on similarly titled ath9k patch posted by Rafael J. Wysocki.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-11-15 13:24:40 -05:00
Stanislaw Gruszka
749ff4efa1 iwlwifi: avoid commit rxon during scan in iwlagn_configure_filter
Almost anywhere in the code we avoid committing rxon while performing
scan, and make rxon commit when scan complete. However in some places
in the code we do not follow that rule. This patch fix that problem in
iwlagn_configure_filter().

Since we do not commit directly in iwl3945_configure_filter, we can
also do the same for agn, so I just remove iwlcore_commit_rxon()
function and add a comment. Also change comment for iwl3945.

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:26 -05:00
Stanislaw Gruszka
a25a66ac94 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>
2010-11-15 13:24:24 -05:00
Johannes Berg
40bbfd4c1b iwlagn: check beacon frame size
When the beacon_skb is NULL, we might still
attempt to use it in this code path (if we
ever get here) -- make the code a bit more
defensive and check the return value of
iwl_fill_beacon_frame() against zero.

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:47:35 -07:00
Johannes Berg
77834543a5 iwlwifi: clean up some beacon handling
There's no need to check for NULL before
calling dev_kfree_skb() since it is valid
to call it on NULL -- it becomes a no-op.

There's also no need to initialise the
beacon_skb variable to NULL just after
the memory it is in has been kzalloc'ed.

Some minor whitespace cleanups, and a
lock assertion in a function that needs
the mutex (to access the beacon_skb var)
complete the patch.

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:50 -07:00
Johannes Berg
12e934dc60 iwlwifi: rename ibss_beacon variable
Since we're also going to support AP (GO) mode,
the variable isn't used for just IBSS beacons
any more -- rename it to not mislead readers.

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:42 -07:00
Wey-Yi Guy
bc795df1d2 iwlagn: prio_tbl need to download before calibration
For WiFi/BT combo devices, priority table always need to download
before perform any calibration operation.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-12 08:33:25 -07:00
Wey-Yi Guy
a5901cbb57 iiwlagn: always download priority table
For advance BT/WiFi co-exist, always download bt priority table
before sending bt_config command

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-12 08:33:09 -07:00
Shanyu Zhao
642454cc07 iwlagn: fix default calibration table size
iwlagn driver uses the IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE
as the chain noise reset calibration index and
IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE+1 as the chain noise gain
calibration index, if not specified by the TLV value in the new
firmware format.

However, this is broken if we need to add more calibrations like
the temperature offset calibration because we increased
IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE by 1.

To fix this issue, define IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE
and use it as the calibration index instead. We still keep the
IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE as a sanity check for
the TLV value given by ucode.

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
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:49 -07:00
Wey-Yi Guy
65cccfb03d iwlagn: no version check for experimental uCode
For experimental uCode, it should work with the driver
if driver has experimental uCode support option enabled;
remove the API version checking.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-07 15:53:36 -07:00
Johannes Berg
0de7673655 iwlwifi: clean up declarations
A number of declarations in iwl-core.h should
be in agn specific files, and also rename the
iwl-calib.h file to iwl-agn-calib.h to better
reflect that it belongs to agn.

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:44 -07:00
Johannes Berg
14e8e4afeb iwlwifi: remove apm_ops.stop
Since all devices share the same operation here,
there's no need to call it indirectly.

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:34 -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
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
7314c2b377 iwlagn: rename iwl_commit_rxon
iwl_commit_rxon really should be named
iwlagn_commit_rxon, so rename it.

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:48:53 -07:00
Wey-Yi Guy
58a39090a1 iwlagn: define 130 series of WiFi/BT combo devices
add new structures and defines need to identify 130 devices.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-06 08:14:21 -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
72645eff4b iwlwifi: schedule to deprecate software scan support
Hardware scan is the prefer method for all iwlwifi devices;
especially for dual-mode functions. Schedule to deprecate the
software scan support in kernel 2.6.40

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-10-06 07:42:43 -07:00
Shanyu Zhao
6d6a1afdc5 iwlwifi: send DC calib config to runtime ucode
Since uCode is responsible for doing DC calibration, there's no need
to let init uCode to do initial DC calibration then send results
back to driver, then driver sends the results to runtime uCode.
Driver can simply tell runtime uCode to do DC calibration.

Actually, this patch does not disable DC calib for init uCode. It just
prevent driver from saving and sending the DC calib results (from init
ucode) to runtime uCode. The driver still uses 0xffffffff in
CALIB_CFG_CMD for init ucode.

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-09-28 16:57:06 -07:00
Jay Sternberg
1de19eccb3 iwlwifi: define 100 devices
add new structures and defines need to identify 100 devices.

Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-09-28 16:52:35 -07:00
Stanislaw Gruszka
e7e16b90b4 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>
2010-09-14 16:14:25 -04:00
Stanislaw Gruszka
d745d472af 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>
2010-09-14 16:08:04 -04:00
Wey-Yi Guy
8f1d968721 iwlwifi: make sure runtime calibration is enabled after association
Clear the "start calib" flag only for new association,
The flag will be set in post_associate function to trigger
the runtime calibration. Set this flag to "0" will stop the
runtime sensitivity calibration

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-09-11 08:52:11 -07:00
Johannes Berg
763cc3bf5c iwlwifi: avoid sending too many commands
When the PAN context is unused, there's no
need to continually update it in the device.
So track which contexts are active (with the
special case that the WLAN context is always
active ...) and only send their commands to
the device when needed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-09-11 08:51:39 -07:00
Wey-Yi Guy
6e6ebf4bef iwlwifi: remember the last uCode sysassert error code
When sysassert happen, uCode will report the error code,
driver dump the information to dmesg. Here also remember
the last error code for future reference.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-09-11 08:50:59 -07:00
Julia Lawall
950094cb06 drivers/net/wireless/iwlwifi/iwl-agn.c: Fix return value from an unsigned function
The function has an unsigned return type, but returns a negative constant
to indicate an error condition.  Another error condition in the same
function is indicated by returning 0, and indeed the only call to the
function checks for 0 to detect errors, so the return of a negative value
it converted to a return of 0.

A sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@exists@
identifier f;
constant C;
@@

 unsigned f(...)
 { <+...
*  return -C;
 ...+> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-09-07 13:54:34 -04:00
Wey-Yi Guy
f7322f8f05 iwlagn: open/close envlope to force move BT state machine
In uCode, BT state machine need to receive open envlope
command before perform calibration; followed by close envlope
command to move to next stage.

Since Linux has two separated uCode, one for init and the second
one for runtime; we use open envlope commands for init uCode to
indicate we are ready to perform calibration operation.
But for runtime uCode, we are not doing any init calibration,
so we issue open/close envlope commands to force uCode move to
"BT COEX ON" state.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-09-03 12:31:35 -07:00
Johannes Berg
d0fe478c9f iwlwifi: allow using multiple contexts
We're now ready to start using multiple contexts.
We do this by keeping track of the valid interface
types per context (exclusive [ibss] and normal)
and checking which context is "free" when a new
interface is added.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-08-27 09:49:38 -07:00
Johannes Berg
b01efe434b iwlagn: always send RXON timing
The PAN context requires also getting
RXON timing when we send an unassociated
RXON in some cases.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-08-27 09:48:38 -07:00
Johannes Berg
47313e340e iwlwifi: pass context to iwl_send_rxon_timing
Sometimes we need to send RXON timing even
when we don't have a virtual interface yet,
so pass the context and allow passing one
without a virtual interface pointer.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-08-27 09:48:16 -07:00
Johannes Berg
52a02d1500 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>
2010-08-27 09:47:46 -07:00
Johannes Berg
08abc53cf4 iwlagn: send beacon before committing associated RXON
Newer AGN microcode requires know the beacon
before starting the AP so that it can start
beaconing right away. Implement that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-08-27 09:30:20 -07:00
Johannes Berg
2491fa42d9 iwlagn: send RXON timing before associating
The PAN functionality requires us to send the
timing including a valid DTIM period to the
microcode before associating, so request this
data from mac80211 and send it to the device.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-08-27 09:29:55 -07:00
Johannes Berg
e72f368be6 iwlagn: queue frames according to context
Frames for different contexts need to be put
on different queues, and multicast after DTIM
frames have a special queue yet which also
depends on the context, so put all this into
the context.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-08-27 09:29:32 -07:00
Johannes Berg
60744f6297 iwlagn: remove iw_mode check for beacon
Since we have the beacon context now, we no
longer need to rely on iw_mode but can check
the beacon context interface's type. However,
that check must be in the work item instead
due to locking constraints (mutex must be
held when dereferencing beacon_ctx pointer).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-08-27 09:29:00 -07:00