firefly-linux-kernel-4.4.55.git
12 years agoath6kl: fix regression in ath6kl_upload_board_file()
Kalle Valo [Mon, 12 Mar 2012 11:22:54 +0000 (13:22 +0200)]
ath6kl: fix regression in ath6kl_upload_board_file()

My patch 24fc32b3 ("ath6kl: add ath6kl_bmi_write_hi32()") caused a regression
in ath6kl_upload_board_file() and the board_address variable was not
properly initialised in some cases:

ath6kl/init.c:1068:6: warning: ‘board_address’ may be used uninitialized
in this function

Most likely this broke ar6004 support but I can't test that right now.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Fix merge error in ath6kl_set_ies()
Aarthi Thiruvengadam [Thu, 8 Mar 2012 20:25:02 +0000 (12:25 -0800)]
ath6kl: Fix merge error in ath6kl_set_ies()

Portion of the commit id 080eec4fb4 ("ath6kl: Clear the IE in firmware
if not set") was overwritten by mistake due to a merge
conflict. This patch fixes the code back to how it should be.

kvalo: more details to the commit log

Signed-off-by: Aarthi Thiruvengadam <athiruve@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: make ath6kl_bmi_[read|write]_hi32() endian safe
Kalle Valo [Wed, 7 Mar 2012 18:04:00 +0000 (20:04 +0200)]
ath6kl: make ath6kl_bmi_[read|write]_hi32() endian safe

ath6kl_bmi_[read|write]_hi32() did not have endian support, fix that.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: fix too long lines
Kalle Valo [Wed, 7 Mar 2012 18:04:00 +0000 (20:04 +0200)]
ath6kl: fix too long lines

Found by checkpatch:

drivers/net/wireless/ath/ath6kl/init.c:78: WARNING: line over 80 characters
drivers/net/wireless/ath/ath6kl/init.c:397: WARNING: line over 80 characters
drivers/net/wireless/ath/ath6kl/init.c:407: WARNING: line over 80 characters
drivers/net/wireless/ath/ath6kl/htc.c:189: WARNING: line over 80 characters
drivers/net/wireless/ath/ath6kl/htc.c:704: WARNING: line over 80 characters
drivers/net/wireless/ath/ath6kl/htc.c:2452: WARNING: line over 80 characters

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: document all spinlocks
Kalle Valo [Wed, 7 Mar 2012 18:04:00 +0000 (20:04 +0200)]
ath6kl: document all spinlocks

Also fixes quite a few checkpatch warnings like this:

ath6kl/hif.h:226: CHECK: spinlock_t definition without comment

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: fix open paranthesis alignment in ath6kl_cfg80211_connect()
Kalle Valo [Wed, 7 Mar 2012 18:04:00 +0000 (20:04 +0200)]
ath6kl: fix open paranthesis alignment in ath6kl_cfg80211_connect()

ath6kl/cfg80211.c:462: CHECK: Alignment should match open parenthesis

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: fix error handling ath6kl_target_config_wlan_params()
Kalle Valo [Wed, 7 Mar 2012 18:03:59 +0000 (20:03 +0200)]
ath6kl: fix error handling ath6kl_target_config_wlan_params()

The error handling in ath6kl_target_config_wlan_params() was just weird,
fix that. This also fixes some of the open parenthesis alignment issues
reported by checkpatch.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: add ath6kl_bmi_read_hi32()
Kalle Valo [Wed, 7 Mar 2012 18:03:59 +0000 (20:03 +0200)]
ath6kl: add ath6kl_bmi_read_hi32()

There are few 32 bit reads from the host interest area. Add
ath6kl_bmi_read_hi32() to make it easier to do that. As code is cleaner
this also fixes few checkpatch warnings.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: add ath6kl_bmi_write_hi32()
Kalle Valo [Wed, 7 Mar 2012 18:03:58 +0000 (20:03 +0200)]
ath6kl: add ath6kl_bmi_write_hi32()

We have a lot of 32 bit writes to the host interest area and the code
doing that is ugly. Clean that up by adding ath6kl_bmi_write_hi32().

This also fixes few checkpatch warnings.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: remove multiple assignments
Kalle Valo [Wed, 7 Mar 2012 18:03:58 +0000 (20:03 +0200)]
ath6kl: remove multiple assignments

Found by checkpatch:

drivers/net/wireless/ath/ath6kl/cfg80211.c:1295: CHECK: multiple assignments should be avoided
drivers/net/wireless/ath/ath6kl/cfg80211.c:3000: CHECK: multiple assignments should be avoided

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: logical continuations should be on the previous line
Kalle Valo [Wed, 7 Mar 2012 18:03:58 +0000 (20:03 +0200)]
ath6kl: logical continuations should be on the previous line

All found by checkpatch:

ath6kl/wmi.c:1036: CHECK: Logical continuations should be on the previous line

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: alignment should match open parenthesis
Kalle Valo [Wed, 7 Mar 2012 18:03:57 +0000 (20:03 +0200)]
ath6kl: alignment should match open parenthesis

Fix the issues which checkpatch found and were easy to fix. Especially
callers of ath6kl_bmi_write() are tricky and that needs to be fixed
separately.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: fix checkpatch error with EPSTAT() macro
Kalle Valo [Wed, 7 Mar 2012 18:03:57 +0000 (20:03 +0200)]
ath6kl: fix checkpatch error with EPSTAT() macro

ath6kl/debug.c:739: ERROR: Macros with complex values should be
enclosed in parenthesis

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: fix pointer style
Kalle Valo [Wed, 7 Mar 2012 18:03:57 +0000 (20:03 +0200)]
ath6kl: fix pointer style

reported by checkpatch:

ath6kl/core.h:748: ERROR: "foo * bar" should be "foo *bar"
ath6kl/core.h:751: ERROR: "foo * bar" should be "foo *bar"

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Set optimal listen intvl,bmiss,scan params while going to wow suspend
Raja Mani [Mon, 20 Feb 2012 13:38:08 +0000 (19:08 +0530)]
ath6kl: Set optimal listen intvl,bmiss,scan params while going to wow suspend

* In order to save the target power in WOW suspend state,
  configure the best optimal values for the below parameters,
     - listen interval.
     - beacon miss interval.
     - scan parameters.

  Default values for above attributes are reverted in
  wow resume operation.

* The default listen interval is set before the host issue
  connect request.

* New function is added to configure beacon miss count.

kvalo: minor changes to fix open parenthesis alignment

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Maintain the listen interval per VIF specific
Raja Mani [Mon, 20 Feb 2012 13:38:07 +0000 (19:08 +0530)]
ath6kl: Maintain the listen interval per VIF specific

Firmware has the option to support the listen interval
per vif specific. Fix this.

Listen interval can be set by the TUs or by the number
of beacons. Current code enables the user to configure
the listen interval in the unit of 'number of beacons'
using debugfs entry "listen_interval". Going forward,
we need to alter the listen interval in the unit of TUs
to get good power numbers while going to WOW suspend/resume.

Allowing the user to change the listen interval in
the unit of "number of beacons"  in debugfs and changing
listen interval in wow suspend/resume in the unit of
time (TUs) would lead us to confuse.

This patch make sures the listen interval is changed only
in the unit of time (TUs).

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Check wow state before sending control and data pkt
Raja Mani [Wed, 7 Mar 2012 06:05:04 +0000 (11:35 +0530)]
ath6kl: Check wow state before sending control and data pkt

Below two scenarios are taken care in this patch which helped
to fix the firmware crash during wow suspend/resume.

* TX operation (ctrl tx and data tx) has to be controlled based
  on suspend state. i.e, with respect to WOW mode, control packets
  are allowed to send from the host until the suspend state goes
  ATH6KL_STATE_WOW and the data packets are allowed until WOW
  suspend operation starts.

* Similarly, wow resume is NOT allowed if WOW suspend is in progress.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Add provision to define suspend policy in disconnected state.
Raja Mani [Tue, 6 Mar 2012 09:33:59 +0000 (15:03 +0530)]
ath6kl: Add provision to define suspend policy in disconnected state.

It gives flexibility to the user to define suspend policy
when the suspend mode is set to WOW and the device is in
disconnected state at the time of suspend.

New module parameter wow_mode is added to get the choice
from the user. This parameter is valid only if the module
parameter suspend_mode is set to WOW.

To force WOW in connected state and cut power
in disconnected state:
  suspend_mode=0x3 wow_mode=0x1

To force WOW in connected state and deep sleep
in disconnected state (this is also the default wow_mode):
   suspend_mode=0x3 wow_mode=0x2

If there is no value specified to wow_mode during insmod,
deep sleep mode will be tried in the disconnected state.

kvalo: clarified commit log

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Fix kernel panic while receiving fwlog during boot
Vasanthakumar Thiagarajan [Tue, 6 Mar 2012 09:09:40 +0000 (14:39 +0530)]
ath6kl: Fix kernel panic while receiving fwlog during boot

"ath6kl: Defer wiphy and netdev registration till the end of ath6kl_core_init()"
causes kernel panic by accessing the unallocated debug resources during
boot time. To fix this, split the debug initialization funtion into two,
one initializes the debug resource and the other takes care of debugfs
initialization. When this issue shows up the kernel crash dump would
look like

 ath6kl_debug_fwlog_event+0x9c/0x10a
 [<c10666c9>] register_lock_class+0x57/0x288
 [<c1065cd3>] ? trace_hardirqs_on+0xb/0xd
 [<f801f4c9>] ? ath6kl_debug_fwlog_event+0x9c/0x10a
 [<c1066a8a>] __lock_acquire+0x96/0xbe5
 [<c106007b>] ? alarmtimer_suspend+0x80/0x127
 [<c10258da>] ? vprintk+0x394/0x3b1
 [<f801f4c9>] ? ath6kl_debug_fwlog_event+0x9c/0x10a
 [<c10676b3>] lock_acquire+0xda/0xf9
 [<f801f4c9>] ? ath6kl_debug_fwlog_event+0x9c/0x10a
 [<c1532ce3>] _raw_spin_lock+0x28/0x58
 [<f801f4c9>] ? ath6kl_debug_fwlog_event+0x9c/0x10a
 [<f801f4c9>] ath6kl_debug_fwlog_event+0x9c/0x10a
 [<f80310a4>] ath6kl_wmi_control_rx+0x69d/0xb50 [ath6kl_core]
 [<f802d2e1>] ? ath6kl_rx+0x3c/0x839 [ath6kl_core]
 [<f802d35d>] ath6kl_rx+0xb8/0x839 [ath6kl_core]
 [<c104b81e>] ? local_clock+0x2d/0x4e
 [<c102a0af>] ? _local_bh_enable_ip+0x94/0x98
 [<f802bfc0>] ? ath6kl_alloc_amsdu_rxbuf+0xb7/0xb7
 [<f8023b28>] ath6kl_htc_rxmsg_pending_handler+0x891/0x988 [ath6kl_core]
 [<f802bf00>] ? ath6kl_refill_amsdu_rxbufs+0x89/0x92
 [<f802d2a5>] ? aggr_timeout+0xed/0xed [ath6kl_core]
 [<f802bfc0>] ? ath6kl_alloc_amsdu_rxbuf+0xb7/0xb7
 [<f802c420>] ? ath6kl_tx_complete+0x376/0x376 [ath6kl_core]
 [<f8020e92>] ath6kl_hif_intr_bh_handler+0xf7/0x33e
 [<c138ab00>] ? mmc_host_disable+0x15/0x3a
 [<f8123b5c>] ath6kl_sdio_irq_handler+0x3c/0x90 [ath6kl_sdio]
 [<c1392f56>] sdio_irq_thread+0xb6/0x29c
 [<c1392ea0>] ? sdio_claim_irq+0x1cb/0x1cb
 [<c103d4c0>] kthread+0x67/0x6c
 [<c103d459>] ? __init_kthread_worker+0x42/0x42
 [<c153903a>] kernel_thread_helper+0x6/0xd
 BUG: unable to handle kernel NULL pointer dereference at
EIP: [<f801f4d4>] ath6kl_debug_fwlog_event+0xa7/0x10a

kvalo: rename new function to ath6kl_debug_init_fs() and add a comment
why it's needed

Reported-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoMerge remote branch 'wireless-next/master' into ath6kl-next
Kalle Valo [Mon, 5 Mar 2012 17:32:58 +0000 (19:32 +0200)]
Merge remote branch 'wireless-next/master' into ath6kl-next

Conflicts:
drivers/net/wireless/ath/ath6kl/cfg80211.c

12 years agoath6kl: Restrict memcpy to bounce buffer only for write request
Raja Mani [Fri, 2 Mar 2012 12:32:08 +0000 (18:02 +0530)]
ath6kl: Restrict memcpy to bounce buffer only for write request

No need to copy received local buffer content to bounce buffer
(DMA buffer) while performing sync READ operation from the chip.

It's applicable for only WRITE operation.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Fix random system lockup
Raja Mani [Thu, 9 Feb 2012 07:27:12 +0000 (12:57 +0530)]
ath6kl: Fix random system lockup

The commit "ath6kl: Use a mutex_lock to avoid
race in diabling and handling irq" introduces a
state where ath6kl_sdio_irq_handler() would be waiting
to claim the sdio function for receive indefinitely
when things happen in the following order.

ath6kl_sdio_irq_handler()
- aquires mtx_irq
- sdio_release_host()
ath6kl_sdio_irq_disable()
- sdio_claim_host()
- sleep on mtx_irq
ath6kl_hif_intr_bh_handler()
- (indefinitely) wait for the sdio
  function to be released to exclusively claim
  it again for receive operation.

Fix this by replacing the mtx_irq with an atomic
variable and a wait_queue.

kvalo: add ath6kl_sdio_is_on_irq() due to open parenthesis alignment

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Collect residue firmware logs
Etay Luz [Wed, 29 Feb 2012 01:18:04 +0000 (17:18 -0800)]
ath6kl: Collect residue firmware logs

Collect residue firmware logs following firmware assert.
Firmware sends logs to host once the 1500 byte log buffer
has been filled. At time of assert, there could be residue
logs lying in the firmware. This patch pulls those residue
logs. This would give the full picture of the firmware.

Signed-off-by: Etay Luz <eluz@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: add padding to firmware log records
Etay Luz [Wed, 29 Feb 2012 01:17:15 +0000 (17:17 -0800)]
ath6kl: add padding to firmware log records

firmware debug utility expects firmware log record size
to be 1500 bytes. This patch ensures that the
firmware record will be exactly 1500 bytes.

kvalo: remove trailing space

Signed-off-by: Etay Luz <eluz@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: implement hidden ssid
Thomas Pedersen [Tue, 28 Feb 2012 23:08:46 +0000 (15:08 -0800)]
ath6kl: implement hidden ssid

The ath6kl FW does not distinguish between different types of hidden
SSIDs (empty or null), so treat all cfg80211 requests for hidden ssid
the same.

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Clear the IE in firmware if not set
Aarthi Thiruvengadam [Tue, 28 Feb 2012 17:17:04 +0000 (09:17 -0800)]
ath6kl: Clear the IE in firmware if not set

Remove check so that IE in firmware is cleared if not set. Without this fix, any
previously set IE will be used incorrectly in the next frame. For example,
consider the scenario where a P2P device scan is followed by a regular station
scan. The P2P IE set by the P2P scan needs to be cleared, otherwise the station
scan will contain the P2P IE.

kvalo: indentation fixes

Signed-off-by: Aarthi Thiruvengadam <athiruve@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Make sure wiphy is registered before calling regulatory_hint()
Vasanthakumar Thiagarajan [Sat, 25 Feb 2012 09:13:17 +0000 (14:43 +0530)]
ath6kl: Make sure wiphy is registered before calling regulatory_hint()

As regulatory events are processed even before the wiphy is registered,
calling regulatory_hint() at early stage should be fixed.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Defer wiphy and netdev registration till the end of ath6kl_core_init()
Vasanthakumar Thiagarajan [Tue, 28 Feb 2012 14:50:23 +0000 (20:20 +0530)]
ath6kl: Defer wiphy and netdev registration till the end of ath6kl_core_init()

This makes the wiphy and initial netdev registration the last step
in dev initialization. Apart from the fact that this looks right,
it can also be used to setup wiphy with the regulatory information
received from firmware after uploading the firmware. Also it fixes
a FIXME in ath6kl_core_init() where mac address is copied into
netdev->dev_addr, ath6kl_interface_add() takes care of this as well.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Skip vif index validation in ath6kl_rx() for wmi events
Vasanthakumar Thiagarajan [Tue, 28 Feb 2012 14:50:22 +0000 (20:20 +0530)]
ath6kl: Skip vif index validation in ath6kl_rx() for wmi events

When the wmi event is vif specific, the validation of vif index
is taken care in ath6kl_wmi_proc_events_iface(). This also avoids
the need for a netdev to be registered while receiving initial events
like "target_ready" and "regulatory domain".

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Refactor ath6kl_wmi_control_rx()
Vasanthakumar Thiagarajan [Tue, 28 Feb 2012 14:50:21 +0000 (20:20 +0530)]
ath6kl: Refactor ath6kl_wmi_control_rx()

Split the wmi event processing into the one which needs to be
vif specific and the reset. This is a step towards avoiding
the need for wiphy and a netdev registration before getting
any message from firmware.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Initialize netdev hw_features for every interface
Vasanthakumar Thiagarajan [Tue, 28 Feb 2012 14:50:20 +0000 (20:20 +0530)]
ath6kl: Initialize netdev hw_features for every interface

Move netdev->hw_features setting from ath6kl_core_init() to
init_netdev() so that it is done for every interface.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Group wiphy initialization into ath6kl_cfg80211_init()
Vasanthakumar Thiagarajan [Tue, 28 Feb 2012 14:50:19 +0000 (20:20 +0530)]
ath6kl: Group wiphy initialization into ath6kl_cfg80211_init()

There are some code which initializes various wiphy members
left outside ath6kl_cfg80211_init(), in ath6kl_core_init().
Move them into a single palce.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agocarl9170: fix breakage from "mac80211: handle non-bufferable MMPDUs correctly"
John W. Linville [Wed, 29 Feb 2012 20:08:33 +0000 (15:08 -0500)]
carl9170: fix breakage from "mac80211: handle non-bufferable MMPDUs correctly"

That commit intended for 3.4 renamed IEEE80211_TX_CTL_POLL_RESPONSE as
IEEE80211_TX_CTL_NO_PS_BUFFER.  Meanwhile, "carl9170: fix frame delivery
if sta is in powersave mode" added a reference to
IEEE80211_TX_CTL_POLL_RESPONSE in the fixes stream for 3.3.  This simple
patch fixes that merge boo-boo.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
John W. Linville [Wed, 29 Feb 2012 19:53:21 +0000 (14:53 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless

12 years agoath9k: decouple RX error checking for DFS
Zefir Kurtisi [Mon, 27 Feb 2012 11:52:06 +0000 (12:52 +0100)]
ath9k: decouple RX error checking for DFS

Previous RX error checking was done exclusive-or for different error
types and caused DFS pulse events to be dropped when other error
flags (e.g. CRC) were set simultaneously.

This patch decouples PHY error processing from other types and ensures
that all pulses detected by HW are accounted by the pattern detector.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlegacy: remove unused enum il4965_calib_enabled_state
Greg Dietsche [Mon, 27 Feb 2012 18:25:33 +0000 (12:25 -0600)]
iwlegacy: remove unused enum il4965_calib_enabled_state

Remove the enum il4965_calib_enabled_state because it is not used.

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlegacy: remove enum iw_calib and related code
Greg Dietsche [Mon, 27 Feb 2012 18:25:32 +0000 (12:25 -0600)]
iwlegacy: remove enum iw_calib and related code

Remove the enum il_calib. It defined one identifier: IL_CALIB_MAX.
Remove the function il4965_calib_free_results. It was doing nothing
because IL_CALIB_MAX is zero. Next, remove calib_results from the
il_priv structure and also remove the associated return
type/struct il_calib_result.

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlegacy: Kconfig: Change Debug Option to be more clear
Greg Dietsche [Mon, 27 Feb 2012 18:25:31 +0000 (12:25 -0600)]
iwlegacy: Kconfig: Change Debug Option to be more clear

Since the menuconfig system doesn't indent the debug options
for the 3945 /4965, add some text to make it clear which
debug options are being configured.

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlegacy: Kconfig: Move Debugging Options
Greg Dietsche [Mon, 27 Feb 2012 18:25:30 +0000 (12:25 -0600)]
iwlegacy: Kconfig: Move Debugging Options

Move the debug options so they appear below the 3945 / 4965 options.

Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: handle non-bufferable MMPDUs correctly
Johannes Berg [Mon, 27 Feb 2012 11:18:30 +0000 (12:18 +0100)]
mac80211: handle non-bufferable MMPDUs correctly

This renames the IEEE80211_TX_CTL_POLL_RESPONSE
TX flag to IEEE80211_TX_CTL_NO_PS_BUFFER and also
uses it for non-bufferable MMPDUs (all MMPDUs but
deauth, disassoc and action frames.)

Previously, mac80211 would let the MMPDU through
but not set the flag so drivers supporting some
hardware aids for avoiding the PS races would
then reject the frame.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: remove unnecessary enum MWIFIEX_802_11_WEP_STATUS
Amitkumar Karwar [Sat, 25 Feb 2012 05:36:04 +0000 (21:36 -0800)]
mwifiex: remove unnecessary enum MWIFIEX_802_11_WEP_STATUS

Instead of defining an 'enum', we can simply use 'u8' flag for WEP
status. Rename 'wep_status' to 'wep_enabled' to match with
'wpa_enabled' and 'wpa2_enabled'.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: remove redundant scan operation
Amitkumar Karwar [Sat, 25 Feb 2012 05:35:36 +0000 (21:35 -0800)]
mwifiex: remove redundant scan operation

It should have been removed by commit "mwifiex: use cfg80211 dynamic
scan..." (7c6fa2a843..) after adding code to avoid an extra scan
during association because scan entries are valid for 15 seconds in
cfg80211 stack.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: make deauth/disassoc sequence more natural
Johannes Berg [Fri, 24 Feb 2012 12:50:54 +0000 (13:50 +0100)]
mac80211: make deauth/disassoc sequence more natural

The association sequence looks (roughly) like
this now:
 * set BSSID
 * set station to EXIST state
 * send auth
 * set station to AUTH state
 * send assoc
 * set station to ASSOC state
 * set BSS info to associated

In contrast, the deauth/disassoc sequence is
the other way around:
 * clear BSSID/BSS info state
 * remove station
 * send deauth/disassoc
(in some cases the last two steps are reversed.)

This patch encodes the entire sequence in the
ieee80211_set_disassoc() function and changes
it to be like this, for good measure with an
explicit flush:
 * send deauth/disassoc
 * flush
 * remove station
 * clear BSSID/BSS info state

At least iwlwifi gets confused with the other
sequence in P2P mode and complains that it
wasn't able to flush the queues.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: fix ieee80211_set_disassoc() sending DelBA
Johannes Berg [Fri, 24 Feb 2012 12:50:53 +0000 (13:50 +0100)]
mac80211: fix ieee80211_set_disassoc() sending DelBA

When ieee80211_set_disassoc() is called with the
tx argument set to true, it will send DelBA out
to the peer. This isn't useful or necessary in a
few cases where we do it today, those being when
we lost the connection or when the supplicant
explicitly asked us to not tell the AP.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: dont call cfg80211 from ieee80211_send_deauth_disassoc
Johannes Berg [Fri, 24 Feb 2012 12:50:52 +0000 (13:50 +0100)]
mac80211: dont call cfg80211 from ieee80211_send_deauth_disassoc

Instead of calling cfg80211 in ieee80211_send_deauth_disassoc()
pass out the frame and call it from the caller. That saves the
SKB allocation if we don't actually want to send the frame and
enables us to make the ordering smarter in the future.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocfg80211: remove cookies from callbacks
Johannes Berg [Fri, 24 Feb 2012 12:50:51 +0000 (13:50 +0100)]
cfg80211: remove cookies from callbacks

In "cfg80211: no cookies in cfg80211_send_XXX()"
Holger Schurig removed the cookies in the calls
from mac80211 to cfg80211, but the ones in the
other direction were left in. Remove them now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoipw2x00: remove ipw2100_rates_11b[]
Stanislav Yakovlev [Fri, 10 Feb 2012 01:23:52 +0000 (20:23 -0500)]
ipw2x00: remove ipw2100_rates_11b[]

It's just a duplicate of ipw2100_bg_rates[].

Signed-off-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agozd1211rw: wait between setting hash table and powering radio on
Florian Fainelli [Wed, 29 Feb 2012 13:00:13 +0000 (14:00 +0100)]
zd1211rw: wait between setting hash table and powering radio on

I am running Debian testing kernel 3.1.0-1-amd64, using a 079b:0062 Sagem
XG-76NA 802.11bg stick.

Upon zd1211rw interface
bringup (ifconfig wlan0 up) I get the following timeout:

[  950.330573] zd1211rw 1-3:1.0: phy2
[  955.108510] zd1211rw 1-3:1.0: firmware version 4725
[  955.148532] zd1211rw 1-3:1.0: zd1211b chip 079b:0062 v4810 high 00-19-70
AL2230_RF pa0 g--NS
[snip]
[  955.204072] zd1211rw 1-3:1.0: error ioread32(CR_REG1): -110

A second ifconfig wlan0 up brings the interface up without problems.

After a bit more debugging, the call trace is the following:

[10241.028130] zd1211rw 1-3:1.0: zd_chip_lock_phy_regs: error
ioread32(CR_REG1): -110
[10241.028140] zd1211rw 1-3:1.0: zd_switch_radio_on: failed to lock PHY regs
[10241.028148] zd1211rw 1-3:1.0: zd_op_start: failed to set radio on

Adding a 10 milliseconds delay between the call to set_mc_hash() and
zd_chip_switch_radio_on() allows successful interface bringups in all
cases and matches what the vendor driver did.

Acked-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: reset encryption mode flag before association
Amitkumar Karwar [Sat, 25 Feb 2012 05:35:35 +0000 (21:35 -0800)]
mwifiex: reset encryption mode flag before association

Recent commit
"mwifiex: clear previous security setting during association"
fixes association failure problems observed in some corner cases
by clearing previous security setting before each association.

We should reset encryption mode flag as well. This patch takes care
of it.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocarl9170: fix frame delivery if sta is in powersave mode
Christian Lamparter [Sat, 25 Feb 2012 20:36:36 +0000 (21:36 +0100)]
carl9170: fix frame delivery if sta is in powersave mode

Nicolas Cavallari discovered that carl9170 has some
serious problems delivering data to sleeping stations.

It turns out that the driver was not honoring two
important flags (IEEE80211_TX_CTL_POLL_RESPONSE and
IEEE80211_TX_CTL_CLEAR_PS_FILT) which are set on
frames that should be sent although the receiving
station is still in powersave mode.

Cc: stable <stable@vger.kernel.org>
Reported-by: Nicolas Cavallari <Nicolas.Cavallari@lri.fr>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocarl9170: Fix memory accounting when sta is in power-save mode.
Nicolas Cavallari [Thu, 23 Feb 2012 15:53:34 +0000 (16:53 +0100)]
carl9170: Fix memory accounting when sta is in power-save mode.

On Access Point mode, when transmitting a packet, if the destination
station is in powersave mode, we abort transmitting the packet to the
device queue, but we do not reclaim the allocated memory.  Given enough
packets, we can go in a state where there is no packet on the device
queue, but we think the device has no memory left, so no packet gets
transmitted, connections breaks and the AP stops working.

This undo the allocation done in the TX path when the station is in
power-save mode.

Signed-off-by: Nicolas Cavallari <cavallar@lri.fr>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath6kl: Register driver ht capabilities in wiphy
Vasanthakumar Thiagarajan [Mon, 27 Feb 2012 06:14:19 +0000 (11:44 +0530)]
ath6kl: Register driver ht capabilities in wiphy

Register driver's ht capabilities in wiphy to avoid failures
in setting ht channels from hostapd.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Lower SDIO pad drive strength for hw2.1.1 board
Raja Mani [Wed, 22 Feb 2012 06:33:51 +0000 (12:03 +0530)]
ath6kl: Lower SDIO pad drive strength for hw2.1.1 board

Without this change, SDIO shuts down due to CRC error during
data communication to the firmware in some of the platform.
for example, scan request issued to the firmware doesn't
return scan completed events and cause the socket interface
to always return -16 (device busy).

SDIO pad drive strength should be reduced for hw2.1.1 board
to avoid such errors.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Make foreground scan a deterministic one
Vasanthakumar Thiagarajan [Tue, 21 Feb 2012 10:00:42 +0000 (15:30 +0530)]
ath6kl: Make foreground scan a deterministic one

This makes the device get into scan state as soon as a
scan request is received, instead of blocking the scan
request till the traffic comes down. It is  necessary
for the deterministic foreground scan particularly when
having multiple vif operating where, if the scan is non-
deterministic, scan on one interface will not start
as long as there are traffic on the other interface. This
change passes 50 msec as foreground scan interval to fix this.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Fix memory leak of rx packets in endpoint 0
Vasanthakumar Thiagarajan [Fri, 10 Feb 2012 15:10:33 +0000 (20:40 +0530)]
ath6kl: Fix memory leak of rx packets in endpoint 0

htc_packet and htc_packet->buf_start are separately allocated
for endpoint 0. This is different for other endpoints where
packets are allocated as skb where htc_packet is skb->head
and they are freed properly. Free htc_packet and htc_packet->buf_start
separatly for endpoint 0.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Make sure to allocate rx buffers after the endpoint connection
Vasanthakumar Thiagarajan [Fri, 10 Feb 2012 15:10:32 +0000 (20:40 +0530)]
ath6kl: Make sure to allocate rx buffers after the endpoint connection

Rx buffers should be allocated for control and best effort endpoints only
after the enpoints connection is esablished. But this is done before the
endpoint connection is complete, we don't even the control and BE endpoints
that time. Move the buffer allocation after endpoint connection is over,
after ath6kl_init_hw_start(). Found in review, never seen any real issue
with this.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoiwlwifi: fix IDI compilation
Emmanuel Grumbach [Thu, 23 Feb 2012 08:18:00 +0000 (10:18 +0200)]
iwlwifi: fix IDI compilation

This is a fixup for my:
iwlwifi: kill iwl_bus.h

Please fold them into one patch for upstream

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: update pci subsystem id
Wey-Yi Guy [Wed, 22 Feb 2012 18:21:09 +0000 (10:21 -0800)]
iwlwifi: update pci subsystem id

Update the pci subsystem id and product name for 6005 series devices

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: one more sku added to 6x35 series
Wey-Yi Guy [Wed, 22 Feb 2012 16:18:55 +0000 (08:18 -0800)]
iwlwifi: one more sku added to 6x35 series

Add new sku to 6x35 series

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: iwl-trans.h doesn't need all these includes
Emmanuel Grumbach [Thu, 16 Feb 2012 07:47:01 +0000 (09:47 +0200)]
iwlwifi: iwl-trans.h doesn't need all these includes

We can use forward declaration for the relevant struct since they
aren't dereferenced in the header file.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: document the operational mode
Emmanuel Grumbach [Thu, 16 Feb 2012 07:35:19 +0000 (09:35 +0200)]
iwlwifi: document the operational mode

Also add a might_sleep to enforce the context requirements.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: remove iwl_reset_traffic_log from shared
Emmanuel Grumbach [Wed, 15 Feb 2012 10:48:04 +0000 (12:48 +0200)]
iwlwifi: remove iwl_reset_traffic_log from shared

It is op_mode related

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: remove iwl_print_rx_config_cmd from shared
Emmanuel Grumbach [Wed, 15 Feb 2012 10:48:04 +0000 (12:48 +0200)]
iwlwifi: remove iwl_print_rx_config_cmd from shared

It is op_mode related

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: kill iwl_bus.h
Emmanuel Grumbach [Mon, 27 Feb 2012 21:53:32 +0000 (13:53 -0800)]
iwlwifi: kill iwl_bus.h

No one needs it any more

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: eeprom gets transport and not bus
Emmanuel Grumbach [Mon, 13 Feb 2012 09:24:47 +0000 (11:24 +0200)]
iwlwifi: eeprom gets transport and not bus

This is temporary, but at least we can now throw the bus away
and move the iwl_pci_{probe,remove} functions.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: move eeprom defines to iwl-eeprom.c
Emmanuel Grumbach [Mon, 13 Feb 2012 09:17:57 +0000 (11:17 +0200)]
iwlwifi: move eeprom defines to iwl-eeprom.c

They don't need to be in iwl-dev.h

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: remove a few dereferences to iwl_priv from the tansport
Emmanuel Grumbach [Sun, 12 Feb 2012 13:21:08 +0000 (15:21 +0200)]
iwlwifi: remove a few dereferences to iwl_priv from the tansport

The transport should not dereference the iwl_priv pointer. Remove a
few of those.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: virtualize op_mode's fw_error
Emmanuel Grumbach [Thu, 9 Feb 2012 14:08:15 +0000 (16:08 +0200)]
iwlwifi: virtualize op_mode's fw_error

Export it as "nic_error" notification, the error handling will be in
the op_mode.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: virtualize op_mode's set_hw_rf_kill
Emmanuel Grumbach [Thu, 9 Feb 2012 14:08:15 +0000 (16:08 +0200)]
iwlwifi: virtualize op_mode's set_hw_rf_kill

Export it as "hw_rf_kill" notification.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: virtualize op_mode's stop/start queue
Emmanuel Grumbach [Thu, 9 Feb 2012 14:08:15 +0000 (16:08 +0200)]
iwlwifi: virtualize op_mode's stop/start queue

Export them as "queue_full" and "queue_not_full" notification.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: virtualize op_mode's rx
Emmanuel Grumbach [Thu, 9 Feb 2012 14:08:15 +0000 (16:08 +0200)]
iwlwifi: virtualize op_mode's rx

This is the op_mode's Rx handler.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: virtualize op_mode's free skb
Emmanuel Grumbach [Thu, 9 Feb 2012 14:08:15 +0000 (16:08 +0200)]
iwlwifi: virtualize op_mode's free skb

This handler allows the transport layer to free an skb from the
op_mode. This can happen when the driver is stopped while Tx
packets are pending in the transport layer.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: use sparse compliant __aligned__ attribute
Emmanuel Grumbach [Wed, 15 Feb 2012 07:25:06 +0000 (09:25 +0200)]
iwlwifi: use sparse compliant __aligned__ attribute

Sparse prefers __aligned(sizeof(void *));

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: virtualize the op_mode
Emmanuel Grumbach [Thu, 9 Feb 2012 14:08:15 +0000 (16:08 +0200)]
iwlwifi: virtualize the op_mode

Define the op_mode as an interface with its ops. All the functions
of the op_mode are "private", but its ops is made public in
iwl-op-mode.h.
The drv object starts the op_mode by using the start function in the
public ops.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: rename iwl_remove to iwl_op_mode_dvm_stop
Emmanuel Grumbach [Thu, 9 Feb 2012 09:46:06 +0000 (11:46 +0200)]
iwlwifi: rename iwl_remove to iwl_op_mode_dvm_stop

iwl_remove stops the wifi flows, so rename.
Moreover, we can possibly stop the wifi flows even if the driver
is statically compiled in the kernel, so remove the __devexit pragma.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: drv object can release its own memory
Emmanuel Grumbach [Tue, 7 Feb 2012 12:27:31 +0000 (14:27 +0200)]
iwlwifi: drv object can release its own memory

Move that code to the iwl-drv.c

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: introducing the drv object's flows
Emmanuel Grumbach [Tue, 7 Feb 2012 12:18:40 +0000 (14:18 +0200)]
iwlwifi: introducing the drv object's flows

Fetch the fw and spawn the op_mode. The op_mode that we need
to fetch is determined from the fw file.
Since the fw is fetched very early in the init flow, we can
determine what op_mode to spawn.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: move uCode flags handling to op_mode
Johannes Berg [Tue, 21 Feb 2012 16:31:06 +0000 (18:31 +0200)]
iwlwifi: move uCode flags handling to op_mode

The uCode flags modification is op_mode dependent
since the P2P config is an op-mode config.

This also fixes P2P enabling: due to the uCode
loading code shuffle moving the SKU check before
the EEPROM was read it was always false and would
always disable PAN/P2P.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: move content of iwl_probe to post fetch_fw
Emmanuel Grumbach [Tue, 7 Feb 2012 08:35:18 +0000 (10:35 +0200)]
iwlwifi: move content of iwl_probe to post fetch_fw

This will allow to have different behavior depending on the fw.
Different fw APIs require completely different implementation
of the mac80211 APIs. Each of these implementations is called an
op_mode.

The current op_mode is called DVM which states for dual virtual MAC.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agoiwlwifi: parse_tlv functions set the fw_version string
Emmanuel Grumbach [Thu, 9 Feb 2012 06:42:43 +0000 (08:42 +0200)]
iwlwifi: parse_tlv functions set the fw_version string

struct iwl_fw contains a string that describe the fw. This string
is now set by the iwl_parse_*_firmware.
This string is later used to update the cfg80211 data.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
12 years agort2800pci: Fix 'Error - MCU request failed' during initialization
Jakub Kicinski [Wed, 22 Feb 2012 20:58:58 +0000 (21:58 +0100)]
rt2800pci: Fix 'Error - MCU request failed' during initialization

Bring MCU operations during device initialization to sync
with legacy driver.

This should fix following error:
phy0 -> rt2800pci_mcu_status: Error - MCU request failed,
no response from hardware

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agort2800: Add documentation on MCU requests
Jakub Kicinski [Wed, 22 Feb 2012 20:58:57 +0000 (21:58 +0100)]
rt2800: Add documentation on MCU requests

Add documentation on MCU communication, some of known commands and
their arguments. Supplement command ids.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
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>
12 years agoiwlwifi: iwl-agn.h included twice
Danny Kukawka [Wed, 15 Feb 2012 17:55:16 +0000 (18:55 +0100)]
iwlwifi: iwl-agn.h included twice

drivers/net/wireless/iwlwifi/iwl-core.c included 'iwl-agn.h' twice,
remove the duplicate.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211_hwsim: correctly line up a multiline printk
Antonio Quartulli [Sun, 26 Feb 2012 17:40:04 +0000 (18:40 +0100)]
mac80211_hwsim: correctly line up a multiline printk

The second line of a printk statement must line up to the opening bracket.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: remove local_to_hw
Johannes Berg [Sun, 26 Feb 2012 10:24:35 +0000 (11:24 +0100)]
mac80211: remove local_to_hw

That's a lot longer than open-coding it and
doesn't really add value, so just remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: fix sta_info_flush() return value
Johannes Berg [Sat, 25 Feb 2012 20:40:46 +0000 (21:40 +0100)]
mac80211: fix sta_info_flush() return value

The comment for sta_info_flush() states
"Returns the number of removed STA entries"
but that isn't actually true. Consequently,
the warning when a station is still around
on interface removal can never trigger and
this delayed finding the timer issue the
previous patch fixed. Fix the return value
here to make that warning useful again.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: fix auth/assoc data & timer leak
Johannes Berg [Sat, 25 Feb 2012 20:48:08 +0000 (21:48 +0100)]
mac80211: fix auth/assoc data & timer leak

When removing an interface while it is in the
process of authenticating or associating, we
leak the auth_data or assoc_data, and leave
the timer pending. The timer then crashes the
system when it fires as its data is gone.

Fix this by explicitly deleting all the data
when the interface is removed. This uncovered
another bug -- this problem should have been
detected by the sta_info_flush() warning but
that function doesn't ever return non-zero,
I'll fix that in a separate patch.

Reported-by: Hieu Nguyen <hieux.c.nguyen@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcm80211: fmac: use correct firmware filename
Rafał Miłecki [Fri, 24 Feb 2012 06:22:51 +0000 (07:22 +0100)]
brcm80211: fmac: use correct firmware filename

Also don't use so generic BRCMF_USB_FW_NAME as we may need different
firmwares in the future.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcm80211: fmac: fix a couple checking after dereference bugs
Dan Carpenter [Fri, 24 Feb 2012 06:22:27 +0000 (09:22 +0300)]
brcm80211: fmac: fix a couple checking after dereference bugs

There were two dereferencing before checking for NULL static checker
complaints in this new file.  The list cursor is never NULL so that
check can be removed.  I moved the other dereference after the check.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agonet/wireless: ipw2x00: Use IW_HANDLER macro from linux/wireless.h
Stanislav Yakovlev [Thu, 23 Feb 2012 22:31:24 +0000 (17:31 -0500)]
net/wireless: ipw2x00: Use IW_HANDLER macro from linux/wireless.h

Use IW_HANDLER macro in ipw2100.c to declare wireless handlers.

Note: ipw2200.c already uses it.

Signed-off-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: use proper sub_if_data on suspend path
Jakub Kicinski [Thu, 23 Feb 2012 01:17:48 +0000 (02:17 +0100)]
mac80211: use proper sub_if_data on suspend path

Use interface data from sta instead of invalid pointer
to list head in calls to drv_sta_state.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: Cleanup mci.c
Sujith Manoharan [Wed, 22 Feb 2012 09:13:52 +0000 (14:43 +0530)]
ath9k: Cleanup mci.c

Cleanup whitespace, fix indentation and coding style.
Also remove debug messages that were flooding the log.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_hw: MCI whitespace/debug cleanup
Sujith Manoharan [Wed, 22 Feb 2012 07:12:21 +0000 (12:42 +0530)]
ath9k_hw: MCI whitespace/debug cleanup

This patch fixes indentation and the general coding style
in ar9003_mci.c. Also, minimize the amount of debug log
output generated by MCI.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_hw: Remove HW revision checks
Sujith Manoharan [Wed, 22 Feb 2012 07:12:15 +0000 (12:42 +0530)]
ath9k_hw: Remove HW revision checks

They are not needed since MCI will be enabled only for
AR9462 v2.0

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_hw: Cleanup MCI reset routine
Sujith Manoharan [Wed, 22 Feb 2012 07:12:10 +0000 (12:42 +0530)]
ath9k_hw: Cleanup MCI reset routine

* Use a separate function to enable/disable
  OneStepLookAhead.

* Remove unnecessary hardware SREV checks.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: Modify ATH9K_BTCOEX_SUPPORT
Sujith Manoharan [Wed, 22 Feb 2012 07:12:04 +0000 (12:42 +0530)]
ath9k: Modify ATH9K_BTCOEX_SUPPORT

ATH9K_BTCOEX_SUPPORT is now used by both ath9k and ath9k_htc
to enable BT coexistence. Fix Kbuild to allow this.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: Remove ATH9K_HW_CAP_MCI checks
Sujith Manoharan [Wed, 22 Feb 2012 07:11:59 +0000 (12:41 +0530)]
ath9k: Remove ATH9K_HW_CAP_MCI checks

With the ability to remove BTCOEX support at compile time,
these checks are no longer needed.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: Remove ATH_BTCOEX_CFG_NONE checks
Sujith Manoharan [Wed, 22 Feb 2012 07:11:52 +0000 (12:41 +0530)]
ath9k: Remove ATH_BTCOEX_CFG_NONE checks

Since BTCOEX code can be compiled out cleanly now,
remove these checks.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_htc: Use CONFIG_ATH9K_BTCOEX_SUPPORT
Sujith Manoharan [Wed, 22 Feb 2012 07:11:47 +0000 (12:41 +0530)]
ath9k_htc: Use CONFIG_ATH9K_BTCOEX_SUPPORT

ath9k_htc can also make use of CONFIG_ATH9K_BTCOEX_SUPPORT
to be compiled without BTCOEX support.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_htc: Init BTCOEX inside htc_drv_gpio.c
Sujith Manoharan [Wed, 22 Feb 2012 07:11:41 +0000 (12:41 +0530)]
ath9k_htc: Init BTCOEX inside htc_drv_gpio.c

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>