Commit Graph

59 Commits (5a66926aa9230810704fd5a127966215fd58881e)

Author SHA1 Message Date
Zhu Yi 5a66926aa9 iwlwifi: delay firmware loading from pci_probe to network interface open
This patch moves the firmware loading (read firmware from disk and load
it into the device SRAM) from pci_probe time to the first network
interface open time. There are two reasons for doing this:

1. To support kernel buildin iwlwifi drivers. Because kernel initializes
   network devices subsystem before hard disk and SATA subsystem, it is
   impossible to get the firmware image from hard disk in the PCI probe
   handler. Thus delaying the firmware loading into the network
   interface open time is the way to go. Note, we only read the firmware
   image from hard disk the first time the interface is open. After this
   is succeeded, we cache the firmware image into the host memory. This
   is a performance gain when user open and close the interface multiple
   times and is necessary for device suspend and resume.

2. For better power saving. When the iwlwifi modules are loaded (or
   buildin the kernel) but the wireless network interface is not being
   used, it is a good practice the wireless device consumes as less
   power as possible. Unloading the firmware from the wireless device
   and unregister the driver's interrupt handler in the network
   interface close handler provides users a way to achieve this. User
   space network configuration tools (i.e NetworkManager) can also
   contribute here when it detects a wired cable is connected and
   close the wireless interface automatically.

This patch also includes the pci_save/restore_state() fixed by Ian Schram
upon the first version.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Ian Schram <ischram@telenet.be>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:57 -08:00
Johannes Berg 32bfd35d4b mac80211: dont use interface indices in drivers
This patch gets rid of the if_id stuff where possible in favour of
a new per-virtual-interface structure "struct ieee80211_vif". This
structure is located at the end of the per-interface structure and
contains a variable length driver-use data area.

This has two advantages:
 * removes the need to look up interfaces by if_id, this is better
   for working with network namespaces and performance
 * allows drivers to store and retrieve per-interface data without
   having to allocate own lists/hash tables

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:36 -08:00
Al Viro 0e5ce1f330 misc wireless annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:11 -08:00
Zhu Yi a0646470e8 iwlwifi: skip mac80211 conf during a hardware scan and replay it afterwards
This patch skips mac80211 configuration setting during a hardware scan
and replays it afterwards for the iwlwifi drivers.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:54 -08:00
Zhu Yi 12342c475f iwlwifi: proper monitor support
This patch changes the iwlwifi driver to properly support
monitor interfaces after the filter flags change.

The patch is originally created by Johannes Berg for iwl4965. I fixed some
of the comments and created a similar patch for iwl3945.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:53 -08:00
Tomas Winkler 4fd1f84146 iwlwifi: fix compliation warnings
This patch fixes compilation warnings introduced by 'fix ucode assertion
for RX queue overrun' patch

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:56 -08:00
Zhu Yi 76bb77e03f iwlwifi: cache mac80211 conf setting during a hardware scan
This patch caches mac80211 configuration setting during a hardware
scan for the iwlwifi drivers.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:39 -08:00
Zhu Yi d128394894 iwlwifi: update version number to 1.2.22
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:38 -08:00
Mohamed Abbas fde3571fd8 iwlwifi: avoid firmware command sending if rfkill is enabled
This patch fixed a ucode timeout issue and worked code with suspend
to disk.

Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:37 -08:00
Mohamed Abbas 5c0eef960b iwlwifi: fix ucode assertion for RX queue overrun
This patch allows the driver to restock the RX queue early if the RX
queue is almost empty. This will help on avoiding any ucode assert
for the RX overrun problem.

Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:36 -08:00
Mohamed Abbas 7878a5a4fc iwlwifi: enhance WPA authenication stability
This patch enhanced WPA authenication stability by avoiding scan
immediately followed by association. We don't do any scanning right
after association in next several seconds. This will allow WPA
authentication to take place without any interruption.

Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:36 -08:00
Cahill, Ben M 6440adb576 iwlwifi: add comments to iwl*-base.c
Add comments to iwlXXXX-base.c

Signed-off-by: Cahill, Ben M <ben.m.cahill@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:23 -08:00
Ben Cahill 9fbab5163a iwlwifi: clean up and clarify some comments after 3945/4965 split
Clean up and clarify some comments after 3945/4965 split.

Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:17 -08:00
Ben Cahill f58177b9c3 iwl3945: re-align 3945 event log data
Re-align 3945 event log data.

Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:14 -08:00
Reinette Chatre 0054b34d29 iwlwifi: continue namespace changes - fix CONFIG variables
- Remove HT code from iwl-3945.h - it is not needed here as 3945
  does not support HT. The code ended up here during the header file
  split.
- Modify a few places where the CONFIG variables were named
  incorrectly: all changes are to comments only.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:13 -08:00
Tomas Winkler 90e759d14c iwlwifi: Support for uCode without init and bsm section
This patch enables loading fw w/o init and bsm section. It also provides
general cleanup of the rutine.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:12 -08:00
John W. Linville 9a62f73b1a iwlwifi: remove redundant initialization of final_mode
Problem identified by Miguel Botón <mboton.lkml@gmail.com>, alternate
solution suggested by Zhu Yi <yi.zhu@intel.com>, patch by me. :-)

Cc: Miguel Botón <mboton.lkml@gmail.com>
Cc: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:04:45 -08:00
Christoph Hellwig bb8c093bde iwlwifi: cleanup namespace
Prefix all symbols with iwl3945_ or iwl4965_ and thus allow building
the driver into the kernel. Also remove all the useless default
statements in Kconfig while we're at it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:04:35 -08:00
Jes Sorensen 49df2b3347 iwlwifi: disable interrupts before calling request_irq
Disable interrupts in the iwl4965 before calling request_irq() for
the case that the previous OS or the BIOS left a pending interrupt in
the chip. This behavior has been observed on some laptops such as T61
Thinkpads and Toshiba Portege R500

Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:03:34 -08:00
Christoph Hellwig c8b0e6e19c iwlwifi: cleanup Kconfig and ifdefs to split 3945 and 4965
Currently the iwl3945 & iwl4965 drivers share some common Kconfig
symbols.  This split it up into options for the individual drivers
and gets rid of all the CONFIG_IWLWIFI cruft.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:03:25 -08:00
Christoph Hellwig 5d08cd1dfd iwlwifi: keep 3945 and 4965 headers separate
The iwl3945 and iwl4965 devices share some common structure, but with a
lot of difference split all over.  Currently the two drivers share a lot
of headers and use ugly preprocessor magic to manage the difference.

This patch keeps two entirely separate copies of the headers to get rid
of these hacks an ease future development.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:03:24 -08:00
Christoph Hellwig 416e1438d5 iwlwifi: mark more functions/variables static
mark more functions/variables static

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:03:23 -08:00
Zhu Yi 80f3e024dc iwlwifi: Update iwlwifi version stamp to 1.1.19
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:03:22 -08:00
Zhu Yi 6ff7520933 iwlwifi: Update iwlwifi version stamp to 1.1.18
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:03:22 -08:00
Tomas Winkler ac17a947a4 iwlwifi: replacing wording restricted to nic access in iwl-io
This patch replaces wording 'restricted' with more appropriate 'nic access'
NIC access is grabbed to prevent NIC entering power save mode
General cleanup of iwl-io.h

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:03:17 -08:00
Tomas Winkler af7cca2a44 iwlwifi: rename restricted_mem to targ_mem
This patch renames restricted_mem suffix with more proper
name targ_mem for function accessing memory on the nic in target mode

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:03:17 -08:00
Tomas Winkler d860965200 iwlwifi: replace restricted_reg with prph
This patch renames restricted_reg suffix with more proper
name prhp for function accessing registers on the periphery bus.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:03:16 -08:00
Ian Schram 3edb059a40 iwlwifi: remove late null-check and duplicate bug_on
These pieces of code appear to be useless. The BUG_ON is also performed in
iwl_send_cmd_async.

Serious karma would be needed to enter iwl_ativate_qos with a null priv.
I had a deja vu when patching this, but for the life of me I couldn't track
down a similar patch.

Signed-off-by: Ian Schram <ischram@telenet.be>
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>
2008-01-28 15:03:13 -08:00
Ian Schram bc434dd296 iwlwifi: Beautify by removing superfluous newlines and code
Moving code around, lindent, and whatnot created several places where
there appeared to be an 75 column "rule" instead of 80. This patch removes
those that I can spot, hopefully increasing readability.

Signed-off-by: Ian Schram <ischram@telenet.be>
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>
2008-01-28 15:03:12 -08:00
Tomas Winkler 6994633357 iwlwifi: remove cck_flag from iwl_driver_hw_info
This patch remove cck_flag from iwl_driver_hw_info, this flag
is unused after spliting the iwl-base.c

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>
2008-01-28 15:03:11 -08:00
Tomas Winkler fc4b6853fb iwlwifi: renaming last_used and first_empty
This patch renames queue pointers to write_ptr and read_ptr
instead of  first_empty and last_used. This is closer to technical
terminology we everyday use

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:03:08 -08:00
Ian Schram 91e1747384 iwlwifi: rename iwl_eeprom_aqcuire_semaphore to _acquire_
Correct the spelling of aqcuire.

Signed-off-by: Ian Schram <ischram@telenet.be>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:03:07 -08:00
Ian Schram 01ebd063e1 iwlwifi: fix various spelling and typos
Fixing various spelling errors and typos. Mostly in comments. In total
27 words were corrected, some of which occurred more than ones.

Signed-Of-By: Ian Schram <ischram@telenet.be>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:03:06 -08:00
Reinette Chatre a781cf94e6 iwlwifi: fix possible read attempt on ucode that is not available
This fixes a NULL pointer dereference that can occur when the
ucode is not loaded at the time __iwl_up is called.

The problem was reported at http://kerneloops.org/raw.php?rawid=2765&msgid=

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-23 03:11:41 -08:00
Jeff Garzik 61c93f4eb4 Merge branch 'fixes-jgarzik' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 into upstream-fixes 2007-12-22 23:25:16 -05:00
Zhu Yi b24d22b1d1 iwlwifi: fix possible priv->mutex deadlock during suspend
This patch moves _cancel_deferred_work out of mutex protection and removes
unnecessary mutex in pci_suspend and pci_resume.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-12-19 21:31:01 -05:00
Zhu Yi 53e490936a iwlwifi: fix rf_kill state inconsistent during suspend and resume
The patch fixes the STATUS_RF_KILL_HW state is not cleared problem if the
device goes to suspend when the rf_kill switch is enabled. The bug causes
the driver always thinks the rf_kill switch is enabled (although it is
disabled) after resume.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-12-17 17:01:40 -05:00
Cyrill Gorcunov a5acc379e5 iwlwifi3945/4965: fix rate control algo reference leak
Fix rate control algo reference leak in case if network device has been
failed to register.  In this case special flag priv->mac80211_registered is
not set and the rate algo reference is not freeing on module unload.  That
leads to OOPs in further ieee80211 rate register/unregister procedure (by
any callee).

It should fix the bug #9470

	http://bugzilla.kernel.org/show_bug.cgi?id=9470

[akpm@linux-foundation.org: build fix]
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Acked-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-12-17 17:01:39 -05:00
Joonwoo Park e47eb6ad41 iwlwifi 3945 Fix race conditional panic.
Signed-off-by: Joonwoo Park <joonwpark81@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-11-29 21:34:54 -05:00
Tomas Winkler 864792e3d9 iwlwifi: fix iwl_mac_add_interface handler
This patch fixes iwl_mac_add_interface.

1. Currently only one interface is supported, instead of silently retuning
 0 now it returns  -EOPNOTSUPP (By Johannes Berg)
2. It enables changing mac address from user space (By Ian Schram)

Signed-off-by: Tomas Winkler <tomas@localhost.localdomain>
Cc: Zhu Yi <yi.zhu@intel.com>
Cc: Reinette Chatre <reinette.chatre@intel.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org
Cc: Ian Schram <ischram@telenet.be>
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-11-29 21:34:53 -05:00
Saleem Abdulrasool c4ba9621f4 iwlwifi: fix possible NULL dereference in iwl_set_rate()
Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-11-29 21:34:51 -05:00
David S. Miller d06fc1d9b5 Merge branch 'fixes-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2007-11-14 19:44:02 -08:00
Mohamed Abbas 14577f239f iwl3945: place CCK rates in front of OFDM for supported rates
The patch fixes association failure (reason = 18) bug by arranging CCK
rates before OFDM rates. This patch will register with mac80211 the
modified rate arrangement with CCK rate first. Change rate scale algorithm
also to deal with rate change. Fix Txpower and rate Table commands to be
constructed correctly after rearrangement.

Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-11-14 21:16:46 -05:00
Oliver Neukum cb4da1a34d [IWLWIFI]: Not correctly dealing with hotunplug.
It makes no sense to enable interrupts if a device has been unplugged.
In addition if in doubt IRQ_HANDLED should be returned.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Acked-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-11-13 21:10:32 -08:00
Johannes Berg f51359a8fb iwlwifi: select proper rate control algorithm
Prior to this patch, iwlwifi would always use the first
registered rate control algorithm which, depending on system
setup, could be anything. After the mac80211 patch to make
the simple algorithm built-in, it would always be simple.

This has always been a bug in iwlwifi.

This fixes it by requesting that mac80211 selects the right
rate control algorithm.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-11-10 22:00:05 -08:00
Mohamed Abbas 6ef89d0afa [PATCH] iwl3945: fix direct scan problem
This patch fix the follwing for 3945:
1. Fix direct scan by make sure we set one_direct_scan only when the
   mac80211 ask for direct scan.
2. Fix mac_stop and mac_remove_interface calles, we make sure we cancel any
   scan and disassoc on these call

Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-25 22:24:49 -04:00
Mohamed Abbas 15e869d86e [PATCH] iwl3945: cancel scan on rxon command
This patch fixes the following for 3945:
1. Make sure we cancel scan if RXON command is called.
2. Call scan abort on scan watchdog.

Signed-off-by: Mohamed Abbas <mabbas@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-25 22:24:48 -04:00
Tomas Winkler c7c466763d [PATCH] iwlwifi: Fix rate setting in probe request for HW sacn
This patch fixes setting of rates in probe request used in
HW scan. The bug was reported by Helmut Schaa <hschaa@suse.de>

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-18 15:56:11 -04:00
Holger Schurig 90ba931fa1 [PATCH] janitorial: fix all double includes in drivers/net/wireless
This patch removes all double includes of the same file. This
makes scripts/checkincludes.pl happy.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-18 15:42:28 -04:00
Johannes Berg 628a140ba0 [MAC80211]: remove ALG_NONE
This "algorithm" is used only internally and is not useful.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Michael Buesch <mb@bu3sch.de>
Acked-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-10 16:54:18 -07:00