safe/jmp/linux-2.6
13 years agoath9k_hw: new initialization values for AR9003
Luis R. Rodriguez [Tue, 11 May 2010 01:42:11 +0000 (21:42 -0400)]
ath9k_hw: new initialization values for AR9003

These changes include:

  * For PAPRD, the TXRF3.capdiv5G, TXRF3.rdiv5G and TXRF3.rdiv2G
    are set to 0x0, the TXRF6.capdiv2G is set to 0x2 for all
    three chains.
  * The d2cas5G/d3cas5G/d4cas5G was updated to 4/4/4 in lowest_ob_db
    Tx gain table.
  * To improve DPPM, three parameters were updated (Released from Madhan):
1. RANGE_OSDAC is set to 0x1 for 2G, 0x0 for 5G
2. offsetC1 is set to 0xc
3. inv_clk320_adc is set to 0x1
  * To reduce PHY error(from spur), cycpwr_thr1 and cycpwr_thr1_ext
    are increased to 0x8 at 2G.
  * The 2G Rx gain tables are updated with mixer gain setting 3,1,0.

The new checksums yield:

initvals -f ar9003
0x00000000c2bfa7d5        ar9300_2p0_radio_postamble
0x00000000ada2b114        ar9300Modes_lowest_ob_db_tx_gain_table_2p0
0x00000000e0bc2c84        ar9300Modes_fast_clock_2p0
0x00000000056eaf74        ar9300_2p0_radio_core
0x0000000000000000        ar9300Common_rx_gain_table_merlin_2p0
0x0000000078658fb5        ar9300_2p0_mac_postamble
0x0000000023235333        ar9300_2p0_soc_postamble
0x0000000054d41904        ar9200_merlin_2p0_radio_core
0x00000000748572cf        ar9300_2p0_baseband_postamble
0x000000009aa5a0a4        ar9300_2p0_baseband_core
0x000000003df9a326        ar9300Modes_high_power_tx_gain_table_2p0
0x000000001cfba124        ar9300Modes_high_ob_db_tx_gain_table_2p0
0x0000000011302700        ar9300Common_rx_gain_table_2p0
0x00000000e3eab114        ar9300Modes_low_ob_db_tx_gain_table_2p0
0x00000000c9d66d40        ar9300_2p0_mac_core
0x000000001e1d0800        ar9300Common_wo_xlna_rx_gain_table_2p0
0x00000000a0c54980        ar9300_2p0_soc_preamble
0x00000000292e2544        ar9300PciePhy_pll_on_clkreq_disable_L1_2p0
0x000000002d3e2544        ar9300PciePhy_clkreq_enable_L1_2p0
0x00000000293e2544        ar9300PciePhy_clkreq_disable_L1_2p0

Cc: Don Breslin <don.breslin@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: drop warning on jumbo frames
Luis R. Rodriguez [Mon, 10 May 2010 19:26:27 +0000 (15:26 -0400)]
ath5k: drop warning on jumbo frames

Jumbo frames are not supported, and if they are seen it is likely
a bogus frame so just silently discard them instead of warning on
them all time. Also, instead of dropping them immediately though
move the check *after* we check for all sort of frame errors. This
should enable us to discard these frames if the hardware picks
other bogus items first. Lets see if we still get those jumbo
counters increasing still with this.

Jumbo frames would happen if we tell hardware we can support
a small 802.11 chunks of DMA'd frame, hardware would split RX'd
frames into parts and we'd have to reconstruct them in software.
This is done with USB due to the bulk size but with ath5k we
already provide a good limit to hardware and this should not be
happening.

This is reported quite often and if it fills the logs then this
needs to be addressed and to avoid spurious reports.

Cc: stable@kernel.org
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1271: remove some unneeded code
Dan Carpenter [Sat, 8 May 2010 16:26:38 +0000 (18:26 +0200)]
wl1271: remove some unneeded code

The goto and the break are equivelent.  I removed the goto in memory of
Edsger Dijkstra who famously hated gotos and who would have been eighty
years old next Tuesday.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1271: fix notifier interface supported test
Dan Carpenter [Sat, 8 May 2010 16:25:51 +0000 (18:25 +0200)]
wl1271: fix notifier interface supported test

The "(wl == NULL)" test doesn't work here because "wl" is always
non-null.  The intent of the code is to return if the interface
was not supported by the driver.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1271: add missing spin_lock()
Dan Carpenter [Sat, 8 May 2010 16:25:17 +0000 (18:25 +0200)]
wl1271: add missing spin_lock()

We should start the loop consistently with the "wl_lock" lock held.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: clear driver stations when going down
Johannes Berg [Fri, 7 May 2010 08:49:15 +0000 (01:49 -0700)]
iwlwifi: clear driver stations when going down

During a hw restart, mac80211 will attempt to
reconfigure all stations. Currently, that fails
and leads to warnings because we still have the
stations marked active. Therefore, clear all
stations when doing down.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: remove pointless HT check
Johannes Berg [Fri, 30 Apr 2010 18:30:50 +0000 (11:30 -0700)]
iwlwifi: remove pointless HT check

Remove the check before invoking iwl_set_ht_add_station(),
since neither of the conditions in this check makes sense,
as either we pass in a NULL ht_info (first branch) or in
the IBSS case an ht_info with ht_enabled=false.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: rename iwl_add_local_station
Johannes Berg [Fri, 30 Apr 2010 18:30:49 +0000 (11:30 -0700)]
iwlwifi: rename iwl_add_local_station

This function is now only used for the special
IBSS BSSID station, so rename it to indicate
this. The new name is iwl_add_bssid_station.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: move iwl_find_station() to 4965
Johannes Berg [Fri, 30 Apr 2010 18:30:48 +0000 (11:30 -0700)]
iwlwifi: move iwl_find_station() to 4965

4965 code is the only thing that now still
needs iwl_find_station(), so move it there
and make it static. Everything else can
rely on the station data passed by mac80211.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: use iwl_sta_id() for TKIP key update
Johannes Berg [Fri, 30 Apr 2010 20:53:37 +0000 (13:53 -0700)]
iwlwifi: use iwl_sta_id() for TKIP key update

With the station ID being stored in the
station struct, which mac80211 gives us
for TKIP phase 1 key updates, we can also
remove the use of iwl_find_station() in
that code path.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlagn: use iwl_sta_id() for aggregation
Johannes Berg [Fri, 30 Apr 2010 18:30:46 +0000 (11:30 -0700)]
iwlagn: use iwl_sta_id() for aggregation

With the station ID being stored in the
station struct, which mac80211 gives us
for aggregation callbacks, we can also
remove the use of iwl_find_station() in
those code paths.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: use iwl_find_station less
Johannes Berg [Fri, 30 Apr 2010 18:30:45 +0000 (11:30 -0700)]
iwlwifi: use iwl_find_station less

Since we now store the station ID in each station
struct, many places need not look at the station
table any more since they can just pull the station
ID out of the struct. Remove iwl_get_sta_id() and
use iwl_sta_id() instead as appropriate.

This reduces the amount of code needed to find the
right station significantly, and works since
mac80211 passes the station only after it has been
fully initialised, ie. even if TX races with
station addition it will only be passed to TX once
the addition is complete.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: add iwl_sta_id()
Johannes Berg [Fri, 30 Apr 2010 18:30:44 +0000 (11:30 -0700)]
iwlwifi: add iwl_sta_id()

In places where the station struct is
guaranteed to exist (presumably), use
this helper to get the station ID out
of it (and warn if there's no station
struct after all).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: track station IDs
Johannes Berg [Fri, 30 Apr 2010 18:30:43 +0000 (11:30 -0700)]
iwlwifi: track station IDs

mac80211 allows us to store private data per
station, so put the station ID there. This
allows us to avoid the station ID lookup when
removing regular stations. To also be able to
avoid the lookup to remove the special IBSS
BSSID station, track its ID in the per-vif
private data.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: provide more comments for cfg structure
Wey-Yi Guy [Fri, 30 Apr 2010 18:35:16 +0000 (11:35 -0700)]
iwlwifi: provide more comments for cfg structure

Provide comments for newly added cfg parameters

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: "tx power per chain" are part of ucode_tx_stats
Wey-Yi Guy [Fri, 30 Apr 2010 18:35:15 +0000 (11:35 -0700)]
iwlwifi: "tx power per chain" are part of ucode_tx_stats

Move "tx power per chain" into ucode_tx_stats, it is debugging
information provided by uCode as part of statistics notification.

The "tx power per chain" parameters are optional parameters which only
supported by 6000 series device today; those are reserved fields for all
the other devices.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlagn: work around rate scaling reset delay
Reinette Chatre [Tue, 13 Apr 2010 23:11:19 +0000 (16:11 -0700)]
iwlagn: work around rate scaling reset delay

When station is using an HT channel to communicate to AP and communication
is lost then driver will first be notified that channel is not an HT
channel anymore before AP station is removed. A consequence of that is that
the driver will know that it is not communicating on HT anymore, but the
rate scaling table is still under the impression it is operating in HT. Any
time after driver has been notified channel is not HT anymore there will
thus be a firmware SYSASSERT when the current active LQ command is sent.

A workaround for this issue is to not send a LQ command in the short time between
being notified channel is not HT anymore and rate scaling table being
updated.

This fixes http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2173

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: rework broadcast station management
Johannes Berg [Thu, 29 Apr 2010 07:53:29 +0000 (00:53 -0700)]
iwlwifi: rework broadcast station management

Currently, the broadcast station is managed along
with the interface type, rather than always being
present. That leads to a bug with injection -- it
is currently not possible to inject frames when
the only virtual interface is a monitor, because
in that the required broadcast station is missing.

Additionally, allocating and deallocating the
broadcast station's LQ all the time is wasteful,
and the code to support this is fairly complex.

So this changes completely the way we manage the
broadcast station. Rather than manage it along
with any interface, we now allocate it when we
bring the device up, and remove it again when we
bring the device down. When we bring the device
up, we don't immediately program the broadcast
station into it, instead we just mark it active
and rely on the next restore cycle to upload it
to the device. This works because an unassociated
RXON is always required at least once to set up
device parameters, which implies a reprogramming
of stations into the device.

As we now manage all stations properly, there no
longer is a need for forcing a clearing of them
via iwl_clear_ucode_stations(), which can become
a lot simpler.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: split allocation/sending local station LQ
Johannes Berg [Thu, 29 Apr 2010 17:41:07 +0000 (10:41 -0700)]
iwlwifi: split allocation/sending local station LQ

Rename iwl_sta_init_lq to iwl_sta_alloc_lq and
move sending it out into the caller.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: fix iwl_sta_init_lq station ID
Johannes Berg [Wed, 28 Apr 2010 21:44:45 +0000 (14:44 -0700)]
iwlwifi: fix iwl_sta_init_lq station ID

The "is_ap" argument to iwl_sta_init_lq is never true,
so it and the corresponding code can be removed. However,
it needs to have the station ID because it is also used
for the IBSS BSSID station, and that doesn't have the
broadcast ID.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: note that priv->bssid is used only by 3945
Johannes Berg [Thu, 29 Apr 2010 11:43:10 +0000 (04:43 -0700)]
iwlwifi: note that priv->bssid is used only by 3945

The bssid member of struct iwl_priv is now
only used by 3945 code, so note that. It
shouldn't be used by any other code in the
future.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: use vif in iwl_ht_conf
Johannes Berg [Thu, 29 Apr 2010 11:43:09 +0000 (04:43 -0700)]
iwlwifi: use vif in iwl_ht_conf

Pass the virtual interface pointer to iwl_ht_conf()
so it doesn't need to rely on iw_mode and other
global variables.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: remove useless priv->vif check
Johannes Berg [Thu, 29 Apr 2010 11:43:08 +0000 (04:43 -0700)]
iwlwifi: remove useless priv->vif check

This check is not useful, since we now no
longer dereference priv->vif at this spot.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlagn: use virtual interface in TX aggregation handling
Johannes Berg [Thu, 29 Apr 2010 11:43:07 +0000 (04:43 -0700)]
iwlagn: use virtual interface in TX aggregation handling

Most of the TX aggregation handling can be passed
the virtual interface directly instead of having
to rely on priv->vif.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: push virtual interface through
Johannes Berg [Thu, 29 Apr 2010 11:43:06 +0000 (04:43 -0700)]
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>
13 years agoiwlwifi: apply filter flags directly
Johannes Berg [Thu, 29 Apr 2010 11:43:05 +0000 (04:43 -0700)]
iwlwifi: apply filter flags directly

Since iwl_configure_filter can now sleep since
the mac80211 callback was changed, we can now
apply filter flags changes directly.

Also, while at it, make the code a bit more
generic with a local macro. There's no need
to check changed_flags since we apply all at
the same time anyway.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlagn: use vif->type to check station
Johannes Berg [Thu, 29 Apr 2010 11:43:04 +0000 (04:43 -0700)]
iwlagn: use vif->type to check station

We need not check iw_mode, since we have
the vif pointer available.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlagn: move iwl_get_ra_sta_id to 4965
Johannes Berg [Thu, 29 Apr 2010 11:43:03 +0000 (04:43 -0700)]
iwlagn: move iwl_get_ra_sta_id to 4965

This function is only needed by 4965, so
it need not be in core code and can be
made static.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: remove rts_threshold
Johannes Berg [Thu, 29 Apr 2010 11:43:02 +0000 (04:43 -0700)]
iwlwifi: remove rts_threshold

We never use that member of struct iwl_priv.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwl3945: add plcp error checking
Abhijeet Kolekar [Wed, 28 Apr 2010 22:47:04 +0000 (15:47 -0700)]
iwl3945: add plcp error checking

Add plcp error checking for 3945. After threshold of plcp
is reached , it resets the radio

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlagn: implement loading a new firmware file type
Johannes Berg [Thu, 29 Apr 2010 06:33:10 +0000 (23:33 -0700)]
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>
13 years agoiwlagn: prepare for new firmware file format
Johannes Berg [Wed, 28 Apr 2010 19:09:16 +0000 (12:09 -0700)]
iwlagn: prepare for new firmware file format

Currently the first four bytes in a firmware file
indicate the major, minor and api versions as well
as the serial number. These combined can never be
zero, so we can use that special case for a new,
future, file format.

This patch simply shuffles the code and prepares
for that new format.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: move eeprom version printout to eeprom init
Johannes Berg [Wed, 28 Apr 2010 19:09:15 +0000 (12:09 -0700)]
iwlwifi: move eeprom version printout to eeprom init

It doesn't belong into firmware loading,
it should instead be printed after loading
the EEPROM.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: remove ucode virtual functions
Johannes Berg [Wed, 28 Apr 2010 19:09:14 +0000 (12:09 -0700)]
iwlwifi: remove ucode virtual functions

AGN devices all use the same ucode operations,
except for 4965, because 4965 uses only v1 file
headers.

Therefore, we can remove all the indirection
we have here and just code the API distinction
in place, with a small special case for 4965.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwl3945: remove ucode access indirection
Johannes Berg [Wed, 28 Apr 2010 19:09:13 +0000 (12:09 -0700)]
iwl3945: remove ucode access indirection

As these function pointers will always point to
the 3945 functions, we can just call them directly
and avoid the indirection.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlagn: show and store firmware build number
Johannes Berg [Wed, 28 Apr 2010 19:09:12 +0000 (12:09 -0700)]
iwlagn: show and store firmware build number

We currently display the build number only if debugging
is enabled, but it is really helpful so show it all the
time. Also store it so it can be retrieved later via
ethtool.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: manage IBSS station properly
Johannes Berg [Wed, 28 Apr 2010 15:44:52 +0000 (08:44 -0700)]
iwlwifi: manage IBSS station properly

Currently iwlwifi will eventually exhaust the station
table when adding the BSSID station for IBSS mode,
unless the interface is set down.

The new mac80211 ibss joined/left notification allows
us to fix that easily by moving the code to add the
IBSS station to the notification, and also adding
code to remove it again when we leave the IBSS.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: pass address to iwl_remove_station
Johannes Berg [Wed, 28 Apr 2010 15:44:51 +0000 (08:44 -0700)]
iwlwifi: pass address to iwl_remove_station

We'll need that function for IBSS station management,
so pass it the address, which is the only thing it
uses from the station struct.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwl3945: use iwl3945_add_bcast_station
Johannes Berg [Wed, 28 Apr 2010 15:44:50 +0000 (08:44 -0700)]
iwl3945: use iwl3945_add_bcast_station

iwl3945 should not use iwl_add_local_station(..., false)
because that would leave the IWL_STA_UCODE_INPROGRESS flag
set for the station, which is not desirable. Instead it
can use iwl3945_add_bcast_station() here.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: make bcast LQ command available for later restore actions
Reinette Chatre [Fri, 23 Apr 2010 17:33:33 +0000 (10:33 -0700)]
iwlwifi: make bcast LQ command available for later restore actions

When adding the broadcast station the link quality command is
generated on demand, sent to device, and disappears. It is thus not
available for later cases when we need to restore stations and need
to send the link quality command afterwards. Now, when first adding the
broadcast station, also generate its link quality command to always be
available for later restoring.

Also fix an issue when adding local stations where the "in progress" state
is never cleared.

Reported-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: dump firmware build info in error case
Shanyu Zhao [Wed, 28 Apr 2010 05:05:15 +0000 (22:05 -0700)]
iwlwifi: dump firmware build info in error case

Dump the firmware version and build number in case of firmware SW
error. This would help firmware engineer analyze the error log.

Requested-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>
13 years agoiwlwifi: checking for all the possible failure cases
Wey-Yi Guy [Wed, 28 Apr 2010 01:43:33 +0000 (18:43 -0700)]
iwlwifi: checking for all the possible failure cases

Multiple error condition require fw/rf reset, driver should check all
the possible errors as long as the error checking functions for the
devices are available.

Reported-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: wimax co-exist code clean up
Wey-Yi Guy [Tue, 27 Apr 2010 21:10:00 +0000 (14:10 -0700)]
iwlwifi: wimax co-exist code clean up

wifi/wimax co-exist command is part of _agn device configuration
sequence; move it to iwl-agn-ucode.c which is more appropriate place for the
function.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: give correct return information for tx power debugfs
Wey-Yi Guy [Mon, 26 Apr 2010 23:08:27 +0000 (16:08 -0700)]
iwlwifi: give correct return information for tx power debugfs

Return -EAGAIN when request tx power information and uCode is not ready;
so it will not confuse with tx power information not available.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: use cfg to configure calibration operation
Wey-Yi Guy [Sun, 25 Apr 2010 22:41:43 +0000 (15:41 -0700)]
iwlwifi: use cfg to configure calibration operation

sensitivity calibration and chain noise calibration are not available
for all the devices; use .cfg to configure the availability of those
calibration functions

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: use .cfg to enable/disable continuous ucode trace
Wey-Yi Guy [Tue, 27 Apr 2010 21:00:28 +0000 (14:00 -0700)]
iwlwifi: use .cfg to enable/disable continuous ucode trace

Instead of checking device type for enable/disable continuous ucode
trace function; put it in .cfg for better control and more
flexibilities.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: remove device type checking for tx power in debugfs
Wey-Yi Guy [Tue, 27 Apr 2010 21:33:33 +0000 (14:33 -0700)]
iwlwifi: remove device type checking for tx power in debugfs

Instead of checking device type for enable/disable tx power control,
move it to .cfg for better control and more flexibilities.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: use vif iwl_bss_info_changed
Johannes Berg [Tue, 27 Apr 2010 10:36:15 +0000 (03:36 -0700)]
iwlwifi: use vif iwl_bss_info_changed

The iw_mode will always follow the only vif we
have, but using the vif directly seems easier.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: rename "tx_power" to "chain_tx_power"
Wey-Yi Guy [Tue, 27 Apr 2010 00:20:07 +0000 (17:20 -0700)]
iwlwifi: rename "tx_power" to "chain_tx_power"

The "chain_tx_power" debugfs function is to display the tx power per
chain based. Name it "tx_power" is misleading.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwlwifi: remove powersave debugfs if it is not supported
Wey-Yi Guy [Sun, 25 Apr 2010 16:39:46 +0000 (09:39 -0700)]
iwlwifi: remove powersave debugfs if it is not supported

For the devices do not have power save support, remove the power save
control related debugfs files.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agoiwl3945: fix scan races
Abhijeet Kolekar [Fri, 23 Apr 2010 21:14:53 +0000 (14:14 -0700)]
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>
13 years agoiwlwifi: rename 6000 series Gen2 devices to Gen2a
Shanyu Zhao [Wed, 21 Apr 2010 18:46:33 +0000 (11:46 -0700)]
iwlwifi: rename 6000 series Gen2 devices to Gen2a

Rename the current 6000 series Gen2 devices to Gen2a.
Rename the ucode name prefix to iwlwifi-6000g2a.
Also corrected the device IDs for Gen2a 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>
13 years agoMerge branch 'wireless-2.6' into wireless-next-2.6
Reinette Chatre [Mon, 10 May 2010 22:08:11 +0000 (15:08 -0700)]
Merge branch 'wireless-2.6' into wireless-next-2.6

Conflicts:
drivers/net/wireless/iwlwifi/iwl-dev.h

13 years agoiwlagn: wait for asynchronous firmware loading
Johannes Berg [Thu, 29 Apr 2010 14:41:53 +0000 (07:41 -0700)]
iwlagn: wait for asynchronous firmware loading

When we kick off a firmware loading process,
and then unbind from the pci device right
away, we get into trouble. Avoid that by
waiting for the firmware loading to finish
(whether successfully or not) before the
unbind in iwl_pci_remove.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
13 years agowireless: depends on NET
Randy Dunlap [Mon, 10 May 2010 16:24:29 +0000 (09:24 -0700)]
wireless: depends on NET

When CONFIG_NET is disabled, the attempt to build wext-priv.c
fails with:

net/wireless/wext-priv.c: In function 'ioctl_private_call':
net/wireless/wext-priv.c:207: error: implicit declaration of function 'call_commit_handler'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowireless: rt2x00: rt2800usb: replace X by x
Xose Vazquez Perez [Mon, 10 May 2010 09:35:36 +0000 (11:35 +0200)]
wireless: rt2x00: rt2800usb: replace X by x

s/X/x

Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Clean up generic procedures on descriptor writing.
Gertjan van Wingerde [Sun, 9 May 2010 19:24:22 +0000 (21:24 +0200)]
rt2x00: Clean up generic procedures on descriptor writing.

With a little bit of restructuring it isn't necessary to have special
cases in rt2x00queue_write_tx_descriptor for writing the descriptor
for beacons.
Simply split off the kicking of the TX queue to a separate function
with is only called for non-beacons.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Fix beaconing on rt2800.
Gertjan van Wingerde [Sat, 8 May 2010 21:40:26 +0000 (23:40 +0200)]
rt2x00: Fix beaconing on rt2800.

According to the Ralink vendor driver for rt2800 we don't need a full
TXD for a beacon but just a TXWI in front of the actual beacon.
Fix the rt2800pci and rt2800usb beaconing code accordingly.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: provide beacon's txdesc to write_beacon callback function.
Gertjan van Wingerde [Sat, 8 May 2010 21:40:25 +0000 (23:40 +0200)]
rt2x00: provide beacon's txdesc to write_beacon callback function.

Preparation to fix rt2800 beaconing.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Clean up all driver's kick_tx_queue callback functions.
Gertjan van Wingerde [Sat, 8 May 2010 21:40:24 +0000 (23:40 +0200)]
rt2x00: Clean up all driver's kick_tx_queue callback functions.

All of the driver's kick_tx_queue callback functions treat the TX queue
for beacons in a special manner.
Clean this up by integrating the kicking of the beacon queue into the
write_beacon callback function, and let the generic code no longer call
the kick_tx_queue callback function when updating the beacon.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Factor out RXWI processing to common rt2800 code.
Gertjan van Wingerde [Sat, 8 May 2010 21:40:22 +0000 (23:40 +0200)]
rt2x00: Factor out RXWI processing to common rt2800 code.

RXWI processing is exactly the same for rt2800pci and rt2800usb, so
make it common code.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Factor out TXWI writing to common rt2800 code.
Gertjan van Wingerde [Sat, 8 May 2010 21:40:21 +0000 (23:40 +0200)]
rt2x00: Factor out TXWI writing to common rt2800 code.

TXWI writing is exactly the same for rt2800pci and rt2800usb, so
make it common code.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Don't check whether hardware crypto is enabled when reading RXD.
Gertjan van Wingerde [Sat, 8 May 2010 21:40:20 +0000 (23:40 +0200)]
rt2x00: Don't check whether hardware crypto is enabled when reading RXD.

We should simply follow what the hardware told us it has done.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Clean up rt2800usb.h.
Gertjan van Wingerde [Sat, 8 May 2010 21:40:19 +0000 (23:40 +0200)]
rt2x00: Clean up rt2800usb.h.

Remove unused RXD_DESC_SIZE define and remove duplicated RXWI definitions
from rt2800.h.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Fix setting of txdesc->length field.
Gertjan van Wingerde [Sat, 8 May 2010 21:40:18 +0000 (23:40 +0200)]
rt2x00: Fix setting of txdesc->length field.

We should take the stripping of the IV into account for the txdesc->length
field.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Tested-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: several off by one range checks
Dan Carpenter [Sat, 8 May 2010 16:24:38 +0000 (18:24 +0200)]
ath5k: several off by one range checks

There are several places that use > ARRAY_SIZE() instead of
>= ARRAY_SIZE().

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k/htc_drv_main: off by one error
Dan Carpenter [Sat, 8 May 2010 16:24:02 +0000 (18:24 +0200)]
ath9k/htc_drv_main: off by one error

I changed "> ATH9K_HTC_MAX_TID" to ">= ATH9K_HTC_MAX_TID" to avoid a
potential overflow.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k/htc_drv_main: null dereference typo
Dan Carpenter [Sat, 8 May 2010 16:23:20 +0000 (18:23 +0200)]
ath9k/htc_drv_main: null dereference typo

This is a stray null dereference.  We initialize "ista" properly later on.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: remove stray mutex_unlock()
Dan Carpenter [Sat, 8 May 2010 16:21:01 +0000 (18:21 +0200)]
iwlwifi: remove stray mutex_unlock()

This mutex_unlock() has been here from the initial commit, but as nearly
as I can tell, there isn't a reason for it.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: enable PCIe low power mode for AR9003
Luis R. Rodriguez [Fri, 7 May 2010 22:23:22 +0000 (18:23 -0400)]
ath9k_hw: enable PCIe low power mode for AR9003

Cc: Paul Shaw <paul.shaw@atheros.com>
Cc: Don Breslin <don.breslin@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortl8180: change PCI DMA mask to DMA_BIT_MASK(32)
John W. Linville [Mon, 10 May 2010 18:24:34 +0000 (14:24 -0400)]
rtl8180: change PCI DMA mask to DMA_BIT_MASK(32)

From the original report:

"I had problems to get my rtl8185 PCI card running on Sparc64: I always
got an error about "No suitable DMA available" followed by an error
that no device could be detected. When comparing the rtl8180 driver to
others I noticed that others are mostly using DMA_BIT_MASK so I changed
the custom mask to DMA_BIT_MASK(32) which fixed my issue."

Reported-by: Tiziano Müller <tm@dev-zero.ch>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: rt2800: use correct txop value in tx descriptor
Helmut Schaa [Fri, 7 May 2010 09:03:08 +0000 (11:03 +0200)]
rt2x00: rt2800: use correct txop value in tx descriptor

rt2800 devices use a different enumeration to specify what IFS values should
be used on frame transmission compared to the other rt2x00 devices. Hence,
create a new enum called txop that contains the valid values.

Furthermore use the appropriate txop values as found in the ralink drivers:
- TXOP_BACKOFF for management frames
- TXOP_SIFS for subsequent fragments in a burst
- TXOP_HTTXOP for all data frames

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1271: Reduce PSM entry hang over period from 128 => 1 ms
Juuso Oikarinen [Fri, 7 May 2010 08:39:02 +0000 (11:39 +0300)]
wl1271: Reduce PSM entry hang over period from 128 => 1 ms

Currently, we configure a 128ms hang over period for the PSM entry
(the firmware will remain active for 128ms after sending the null func for
PSM and getting an ack for it.) This is a huge power consumption issue, and
appears unnecessary. So, configure the value to 1 ms.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Janne Ylalehto <janne.ylalehto@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1271: Increase timeout for command event waiting
Teemu Paasikivi [Fri, 7 May 2010 08:39:01 +0000 (11:39 +0300)]
wl1271: Increase timeout for command event waiting

Incresed the timeout value for command complete event waiting from 100
ms to 750 ms. In some rare cases it can take about 600 ms before
complete event for join command is received. This is most propably
caused by the firmware being busy with scanning related activities.

Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1271: Fix to join and channel number handling
Juuso Oikarinen [Fri, 7 May 2010 08:39:00 +0000 (11:39 +0300)]
wl1271: Fix to join and channel number handling

This patch changes the way JOIN's are performed, and channel numbers updated.
The reason for this is that the firmware JOIN command clears WPA(2) key
material, and if done while associated to a WPA(2) secured AP, will render
the data-path unusable.

While the channel is not usually changed while associated (and currently we
could not even support something like that), after performing a scan operation
while associated, mac80211 will re-set the current channel to the driver. This
caused our problem.

Also, the mac80211 is assuming that the driver channel configuration remains
persistent over periods of IDLE. Therefore remove channel resetting to zero
from the unjoin function.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1271: Fix 32 bit register read related endiannes bug
Juuso Oikarinen [Fri, 7 May 2010 08:38:59 +0000 (11:38 +0300)]
wl1271: Fix 32 bit register read related endiannes bug

Reading single registers did not pay attention to data endianness. This patch
fix that.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agowl1271: Add sysfs file to retrieve HW PG-version and ROM-version
Juuso Oikarinen [Fri, 7 May 2010 08:38:58 +0000 (11:38 +0300)]
wl1271: Add sysfs file to retrieve HW PG-version and ROM-version

This patch reads the HW PG version (along with a ROM-version, embedded in the
same value) from the wl1271 hardware and publishes the value in a sysfs -file.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Handle IDLE LED properly
Sujith [Fri, 7 May 2010 08:07:57 +0000 (13:37 +0530)]
ath9k_htc: Handle IDLE LED properly

Switch LED off/on when handling CONF_CHANGE_IDLE.
Not doing this would leave the radio LED on even
though the chip would be in full sleep mode.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Update initvals for AR9003 for xb113
Luis R. Rodriguez [Fri, 7 May 2010 02:41:14 +0000 (22:41 -0400)]
ath9k_hw: Update initvals for AR9003 for xb113

Generated using the new shiny intivals-tool [1]:

initvals -w -f ar9003 > ar9003_initvals.h

The respective checksums are:

0x000000005a76829d        ar9300_2p0_radio_postamble
0x000000009d90cb74        ar9300Modes_lowest_ob_db_tx_gain_table_2p0
0x00000000e0bc2c84        ar9300Modes_fast_clock_2p0
0x00000000852fca34        ar9300_2p0_radio_core
0x0000000000000000        ar9300Common_rx_gain_table_merlin_2p0
0x0000000078658fb5        ar9300_2p0_mac_postamble
0x0000000023235333        ar9300_2p0_soc_postamble
0x0000000054d41904        ar9200_merlin_2p0_radio_core
0x00000000618455d4        ar9300_2p0_baseband_postamble
0x000000009aa590a4        ar9300_2p0_baseband_core
0x000000004783d946        ar9300Modes_high_power_tx_gain_table_2p0
0x000000006681db44        ar9300Modes_high_ob_db_tx_gain_table_2p0
0x000000001f318700        ar9300Common_rx_gain_table_2p0
0x000000009990cb74        ar9300Modes_low_ob_db_tx_gain_table_2p0
0x00000000c9d66d40        ar9300_2p0_mac_core
0x0000000039139500        ar9300Common_wo_xlna_rx_gain_table_2p0
0x00000000a0c54980        ar9300_2p0_soc_preamble
0x00000000292e2544        ar9300PciePhy_pll_on_clkreq_disable_L1_2p0
0x000000002d3e2544        ar9300PciePhy_clkreq_enable_L1_2p0
0x00000000293e2544        ar9300PciePhy_clkreq_disable_L1_2p0

[1] http://wireless.kernel.org/en/users/Drivers/ath9k_hw/initvals-tool

Cc: Tom Hammel <thammel@atheros.com>
Cc: Enis Akay <Enis.Akay@Atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_common: drop incomming frames with an invalid hardware rate
Luis R. Rodriguez [Fri, 7 May 2010 02:41:13 +0000 (22:41 -0400)]
ath9k_common: drop incomming frames with an invalid hardware rate

ath9k_common (used by ath9k and ath9k_htc) trusts the frames
blessed by hardware as OK are infact correct even if the rate
seen by the driver is unrecognized. ath9k_common just treats
these frames in mac80211 as frames as frames under 1 mbps rate.
It seems this might not be the best thing to do as other parts of
the frame might not be valid so just drop these frames for now.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_common: move the rate status setting into ath9k_process_rate()
Luis R. Rodriguez [Fri, 7 May 2010 02:41:12 +0000 (22:41 -0400)]
ath9k_common: move the rate status setting into ath9k_process_rate()

This has no real functional change, this just moves the setting the
the mac80211 rate index into ath9k_process_rate(). This allows us
to eventually make ath9k_process_rate() return a negative value
in case we have detected a specific case rate situation which should
have been ignored.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortl8180: add software-based support for IBSS mode
John W. Linville [Thu, 6 May 2010 20:49:40 +0000 (16:49 -0400)]
rtl8180: add software-based support for IBSS mode

Device documentation suggests that hardware support for beaconing
is available.  But I implemented software-based beacon generation
as an experiment and it seems better to have that working now rather
than waiting for something better to materialize.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortl8180: assign sequence numbers in the driver
John W. Linville [Thu, 6 May 2010 20:26:23 +0000 (16:26 -0400)]
rtl8180: assign sequence numbers in the driver

This is a step towards support for beaconing modes of operation.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: set IEEE80211_TX_CTL_FIRST_FRAGMENT for beacons
John W. Linville [Thu, 6 May 2010 18:45:17 +0000 (14:45 -0400)]
mac80211: set IEEE80211_TX_CTL_FIRST_FRAGMENT for beacons

Also simplify the flags assignment into a single statement at the
end of ieee80211_beacon_get_tim.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Fix RF3052 channel initialization
Ivo van Doorn [Thu, 6 May 2010 12:45:46 +0000 (14:45 +0200)]
rt2x00: Fix RF3052 channel initialization

Update channel initialization for the RF3052 chipset.
According to the Ralink drivers, the rt3x array must be
used for this chipset, rather then the rt2x array.

Furthermore RF3052 supports the 5GHz band, extend
the rt3x array with the 5GHz channels, and use them
for the RF3052 chip.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: rt2800: don't overwrite SIFS values on erp changes
Helmut Schaa [Thu, 6 May 2010 10:29:44 +0000 (12:29 +0200)]
rt2x00: rt2800: don't overwrite SIFS values on erp changes

The SIFS value is a constant and doesn't need to be updated on erp changes.
Furthermore the code used 10us for both, the OFDM SIFS and CCK SIFS time
which broke CTS protected 11g connections (see patch "rt2x00: rt2800: update
initial SIFS values" for details).

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: rt2800: update initial SIFS values
Helmut Schaa [Thu, 6 May 2010 10:29:04 +0000 (12:29 +0200)]
rt2x00: rt2800: update initial SIFS values

Currently the CCK and OFDM SIFS value is set to 32us. This value is neither
used by the Ralink driver nor specified in 802.11.

Instead of using 10us for CCK SIFS (as defined in 802.11) use 16us like in the
Ralink drivers. And indeed using a SIFS value of 10us breaks connectivity with
11g + CTS protected connections. Add a comment to the code why we don't use 10us
for CCK SIFS value.

The OFDM SIFS value is set to 16us (as defined in 802.11 and also used by the
Ralink drivers).

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_htc: Fix beaconing in IBSS mode
Sujith [Thu, 6 May 2010 09:15:47 +0000 (14:45 +0530)]
ath9k_htc: Fix beaconing in IBSS mode

The current way of managing beaconing in ad-hoc
mode has a subtle race - the beacon obtained from mac80211
is freed in the SWBA handler rather than the TX
completion routine. But transmission of beacons goes
through the normal SKB queue maintained in hif_usb,
leading to a situation where __skb_dequeue() in the TX
completion handler goes kaput.

Fix this by simply getting a beacon from mac80211 for
every SWBA and free it in its completion routine.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: improve HT channel handling
Johannes Berg [Wed, 5 May 2010 13:28:27 +0000 (15:28 +0200)]
mac80211: improve HT channel handling

Currently, when one interface switches HT mode,
all others will follow along. This is clearly
undesirable, since the new one might switch to
no-HT while another one is operating in HT.

Address this issue by keeping track of the HT
mode per interface, and allowing only changes
that are compatible, i.e. switching into HT40+
is not possible when another interface is in
HT40-, in that case the second one needs to
fall back to HT20.

Also, to allow drivers to know what's going on,
store the per-interface HT mode (channel type)
in the virtual interface's bss_conf.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211/mac80211: better channel handling
Johannes Berg [Wed, 5 May 2010 13:25:02 +0000 (15:25 +0200)]
cfg80211/mac80211: better channel handling

Currently (all tested with hwsim) you can do stupid
things like setting up an AP on a certain channel,
then adding another virtual interface and making
that associate on another channel -- this will make
the beaconing to move channel but obviously without
the necessary IEs data update.

In order to improve this situation, first make the
configuration APIs (cfg80211 and nl80211) aware of
multi-channel operation -- we'll eventually need
that in the future anyway. There's one userland API
change and one API addition. The API change is that
now SET_WIPHY must be called with virtual interface
index rather than only wiphy index in order to take
effect for that interface -- luckily all current
users (hostapd) do that. For monitor interfaces, the
old setting is preserved, but monitors are always
slaved to other devices anyway so no guarantees.

The second userland API change is the introduction
of a per virtual interface SET_CHANNEL command, that
hostapd should use going forward to make it easier
to understand what's going on (it can automatically
detect a kernel with this command).

Other than mac80211, no existing cfg80211 drivers
are affected by this change because they only allow
a single virtual interface.

mac80211, however, now needs to be aware that the
channel settings are per interface now, and needs
to disallow (for now) real multi-channel operation,
which is another important part of this patch.

One of the immediate benefits is that you can now
start hostapd to operate on a hardware that already
has a connection on another virtual interface, as
long as you specify the same channel.

Note that two things are left unhandled (this is an
improvement -- not a complete fix):

 * different HT/no-HT modes

   currently you could start an HT AP and then
   connect to a non-HT network on the same channel
   which would configure the hardware for no HT;
   that can be fixed fairly easily

 * CSA

   An AP we're connected to on a virtual interface
   might indicate switching channels, and in that
   case we would follow it, regardless of how many
   other interfaces are operating; this requires
   more effort to fix but is pretty rare after all

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: fix BSS info reconfiguration
Johannes Berg [Wed, 5 May 2010 07:44:02 +0000 (09:44 +0200)]
mac80211: fix BSS info reconfiguration

When reconfiguring an interface due to a previous
hardware restart, mac80211 will currently include
the new IBSS flag on non-IBSS interfaces which may
confuse drivers.

Instead of doing the ~0 trick, simply spell out
which things are going to be reconfigured.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoorinoco: refactor xmit path
David Kilroy [Tue, 4 May 2010 21:54:41 +0000 (22:54 +0100)]
orinoco: refactor xmit path

... so orinoco_usb can share some common functionality.

Handle 802.2 encapsulation and MIC calculation in that function.
The 802.3 header is prepended to the SKB. The calculated MIC is written
to a specified buffer. Also modify the transmit control word that will
be passed onto the hardware to specify whether the MIC is present, and
the key used.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix another source of corrupt frames
Felix Fietkau [Tue, 4 May 2010 07:58:57 +0000 (09:58 +0200)]
ath9k: fix another source of corrupt frames

Atheros hardware supports receiving frames that span multiple
descriptors and buffers. In this case, the rx status of every
descriptor except for the last one is invalid and may contain random
data. Because the driver does not support this, it needs to drop such
frames.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoar9170usb: remove deprecated aggregation code
Christian Lamparter [Sat, 1 May 2010 16:18:18 +0000 (18:18 +0200)]
ar9170usb: remove deprecated aggregation code

This patch removes the incomplete AMPDU implementation in ar9170usb.

The code in question is:
 * too big and complex (more than 550 SLOC.)
   This is enough to qualify for a new separate code file!

 * unbalanced quantity & quality
over-engineered areas like:
* xmit scheduling and queuing frames for multiple HT peers
* redundant frame sorting
are confronted by gaping holes:
* accurate transmission feedback
* firmware error-handling and device reset
* HT rate control algorithm

 * error-prone
Since its inclusion, hardly anything was done to fix
any of the outlined flaws from the initial commit message.

   => This also indicates poor maintainability.

 * relies heavily on several spinlocks.

As a result of this shortcomings, the code is slow and does not
even support the most basic 11n requirement: HT station mode.

Therefore, I request to purge my heap of **** from the kernel:
"ar9170: implement transmit aggregation".

The next item on the agenda is: (re-)start from scratch with
an adequate design to accommodate the special requirements
and features of the available frameworks and tools.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: remove association work when processing deauth request
Reinette Chatre [Tue, 4 May 2010 23:04:49 +0000 (16:04 -0700)]
mac80211: remove association work when processing deauth request

In https://bugzilla.kernel.org/show_bug.cgi?id=15794 a user encountered the
following:

[18967.469098] wlan0: authenticated
[18967.472527] wlan0: associate with 00:1c:10:b8:e3:ea (try 1)
[18967.472585] wlan0: deauthenticating from 00:1c:10:b8:e3:ea by local choice (reason=3)
[18967.672057] wlan0: associate with 00:1c:10:b8:e3:ea (try 2)
[18967.872357] wlan0: associate with 00:1c:10:b8:e3:ea (try 3)
[18968.072960] wlan0: association with 00:1c:10:b8:e3:ea timed out
[18968.076890] ------------[ cut here ]------------
[18968.076898] WARNING: at net/wireless/mlme.c:341 cfg80211_send_assoc_timeout+0xa8/0x140()
[18968.076900] Hardware name: GX628
[18968.076924] Pid: 1408, comm: phy0 Not tainted 2.6.34-rc4-00082-g250541f-dirty #3
[18968.076926] Call Trace:
[18968.076931]  [<ffffffff8103459e>] ?  warn_slowpath_common+0x6e/0xb0
[18968.076934]  [<ffffffff8157c2d8>] ?  cfg80211_send_assoc_timeout+0xa8/0x140
[18968.076937]  [<ffffffff8103ff8b>] ? mod_timer+0x10b/0x180
[18968.076940]  [<ffffffff8158f0fc>] ?  ieee80211_assoc_done+0xbc/0xc0
[18968.076943]  [<ffffffff81590d53>] ?  ieee80211_work_work+0x553/0x11c0
[18968.076945]  [<ffffffff8102d931>] ? finish_task_switch+0x41/0xb0
[18968.076948]  [<ffffffff81590800>] ?  ieee80211_work_work+0x0/0x11c0
[18968.076951]  [<ffffffff810476fb>] ? worker_thread+0x13b/0x210
[18968.076954]  [<ffffffff8104b6b0>] ?  autoremove_wake_function+0x0/0x30
[18968.076956]  [<ffffffff810475c0>] ? worker_thread+0x0/0x210
[18968.076959]  [<ffffffff8104b21e>] ? kthread+0x8e/0xa0
[18968.076962]  [<ffffffff810031f4>] ?  kernel_thread_helper+0x4/0x10
[18968.076964]  [<ffffffff8104b190>] ? kthread+0x0/0xa0
[18968.076966]  [<ffffffff810031f0>] ?  kernel_thread_helper+0x0/0x10
[18968.076968] ---[ end trace 8aa6265f4b1adfe0 ]---

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

We authenticate successfully, and then userspace requests association.
Then we start that process, but the AP doesn't respond. While we're
still waiting for an AP response, userspace asks for a deauth. We do
the deauth, but don't abort the association work. Then once the
association work times out we tell cfg80211, but it no longer wants
to know since for all it is concerned we accepted the deauth that
also kills the association attempt.

Fix this by, upon receipt of deauth request, removing the association work
and continuing to send the deauth.

Unfortunately the user reporting the issue is not able to reproduce this
problem anymore and cannot verify this fix. This seems like a well understood
issue though and I thus present the patch.

Bug-identified-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoar9170: wait for asynchronous firmware loading
Christian Lamparter [Thu, 29 Apr 2010 15:53:33 +0000 (17:53 +0200)]
ar9170: wait for asynchronous firmware loading

This patch fixes a regression introduced by the following patch:
"ar9170: load firmware asynchronously"

When we kick off a firmware loading request and then unbind,
or disconnect the usb device right away, we get into trouble:

> ------------[ cut here ]------------
> WARNING: at lib/kref.c:44 kref_get+0x1c/0x20()
> Hardware name: 18666GU
> Modules linked in: ar9170usb [...]
> Pid: 6588, comm: firmware/ar9170 Not tainted 2.6.34-rc5-wl #43
> Call Trace:
> [<c102b05e>] ? warn_slowpath_common+0x6e/0xb0
> [<c117c93c>] ? kref_get+0x1c/0x20
> [<c102b0b3>] ? warn_slowpath_null+0x13/0x20
> [<c117c93c>] ? kref_get+0x1c/0x20
> [<c117bb2f>] ? kobject_get+0xf/0x20
> [<c124d630>] ? get_device+0x10/0x20
> [<c124e5a0>] ? device_add+0x60/0x530
> [<c117b8b5>] ? kobject_init+0x25/0xa0
> [<c12569f9>] ? _request_firmware+0x139/0x3e0
> [<c1256cc0>] ? request_firmware_work_func+0x20/0x70
> [<c1256ca0>] ? request_firmware_work_func+0x0/0x70
> [<c103ff24>] ? kthread+0x74/0x80
> [<c103feb0>] ? kthread+0x0/0x80
> [<c1003136>] ? kernel_thread_helper+0x6/0x10
>---[ end trace 2d50bd818f64a1b7 ]---
- followed by a random Oops -

Avoid that by waiting for the firmware loading to finish
(whether successfully or not) before the unbind in
ar9170_usb_disconnect.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Bug-fixed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: use fixed channel in ibss join when appropriate
Johannes Berg [Wed, 5 May 2010 13:33:55 +0000 (15:33 +0200)]
mac80211: use fixed channel in ibss join when appropriate

"mac80211: improve IBSS scanning" was missing a hunk.
This adds that hunk as originally intended.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agortl8187: use SET_IEEE80211_PERM_ADDR
John W. Linville [Tue, 4 May 2010 19:48:48 +0000 (15:48 -0400)]
rtl8187: use SET_IEEE80211_PERM_ADDR

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Hin-Tak Leung <htl10@users.sourceforge.net>
13 years agortl8180: use SET_IEEE80211_PERM_ADDR
John W. Linville [Tue, 4 May 2010 19:46:15 +0000 (15:46 -0400)]
rtl8180: use SET_IEEE80211_PERM_ADDR

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agort2x00: Register frame length in TX entry descriptor instead of L2PAD.
Gertjan van Wingerde [Mon, 3 May 2010 20:43:05 +0000 (22:43 +0200)]
rt2x00: Register frame length in TX entry descriptor instead of L2PAD.

And use it consistently in the chipset drivers.
Preparation for further clean ups.

Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>