iwlagn: implement loading a new firmware file type

The old firmware file type does not allow indicating
any firmware capabilities, which we frequently want
to make things easier.

This implements a new firmware type that is based on
a TLV structure, and adds a TLV for the maximum length
of probe requests in scans.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@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>

Conflicts:
	drivers/net/wireless/iwlwifi/iwl-agn.h
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

Conflicts:
	drivers/net/wireless/ath/ath9k/ar9003_initvals.h
	drivers/net/wireless/rt2x00/rt2500usb.c
	drivers/net/wireless/rt2x00/rt2800usb.c
	drivers/net/wireless/rt2x00/rt2x00queue.c
	drivers/net/wireless/rtl818x/rtl8180_dev.c
	net/mac80211/chan.c
	net/wireless/chan.c
iwlwifi: introduce iwl_sta_id_or_broadcast

There are now five places where we need to
look up the station ID, but the sta pointer
may be NULL due to mac80211 passing that to
indicate a certain special state.

Replace all these by a new inline function,
called iwl_sta_id_or_broadcast(), and add
documentation about when to use it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
iwlwifi: move _agn statistics related structure

agn and 3945 has different statistics_notif data structure; since 3945
has it statistics_notif data structure inside the _3945 portion of
iwl_priv, it make sense to move the agn statistics_notif into _agn portion.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
iwlwifi: separate statistics flag function for agn & 3945

Since agn and 3945 have different statistics_notif data structure, each
should has its own statistics_flag function.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
iwlwifi: don't crash on firmware file missing info

If a firmware file misses one of the required
instruction or data pieces, the driver currently
crashes. Let it gracefully refuse that firmware
file instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
iwl3945: remove sequence number assignment

Unlike agn, where the sequence numbers must
match with the TFD index, the driver for 3945
devices can use the sequence numbers provided
by mac80211 for QoS frames.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
iwlwifi: move iwl_free_tfds_in_queue to iwlagn

This function is only used by the agn drivers,
so doesn't have to be in core and exported.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
iwlwifi: improve station debugfs

The stations debugfs entry doesn't even show
the stations' MAC addresses Also, the TID
information is formatted very oddly, and
misses the important tfds_in_queue variable.
Fix this to make the file more useful.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
iwlwifi: remove IWL_MULTICAST_ID

This constant is not used, and incorrect, since
the broadcast ID must be used for multicast too.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
iwlwifi: fix and add missing sta_lock usage

There are a few places where sta_lock is used, but the
station information protected by it is accessed outside
of the lock. Address this in two ways, if the access
won't sleep then just move the access into the lock, if
the access can sleep then copy the needed station
information to the stack to be accessed without risk of
it changing while access in progress.

Additionally, a number of other places access station
station information without holding the sta_lock, fix
those as well.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
iwlagn: use firmware event/error log information

In order to debug problems before the ALIVE
notification is received, new firmware files
contain the event/error log information in
the file. Use that information.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
iwlwifi: enable remaining 6000 Gen2 devices

This patch enables all remaining 6000 series Gen2 devices.
To work-around a firmware crash problem, we disable sending
bt coex command for 6000g2b series devices.

Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com>
Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
iwlwifi: code cleanup for _agn devices

Move configuration structure for _agn devices from iwl-dev.h to
iwl-agn.h. Those data structures are for _agn devices and should be keep
for _agn devices only.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
iwlwifi: modify out-dated comments

Some comments in iwl-dev.h still refer to 4965 but used by all the _agn
devices.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
iwlwifi: split debug and debugfs options

It may be desirable in some systems to have
insight into the driver via debugfs, but not
affect its operation via the debug logging
code that is inserted everywhere when DEBUG
is configured.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
iwlwifi: use proper short slot/preamble settings

The short preamble setting might change on the
fly, and then we already use the right mac80211
variable. However, in other places we don't,
which is especially wrong in the AP code since
in that case the assoc_capability is invalid.
Also, the IBSS special case is not needed since
"use_short_slot" will be properly cleared, but
the "assoc_capability" might be invalid (which
must be the reason for the special case).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
iwlwifi: move ucode related function to iwl-agn-ucode.c

Cleanup the code and move all the uCode related functions specific to _agn
devices to iwl-agn-ucode.c

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
iwlwifi: add new PCI IDs for 6000g2 devices

Add new PCI IDs for 6000 Series Gen2 devices
and also defines a new sku of device: 6000g2b 2x2 bgn.

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>