Commit graph

2921 commits

Author SHA1 Message Date
Fabio Estevam
331d9301ed wireless: iwlwifi: iwl-scan.c: Fix build warning
Fix the following build warning:

drivers/net/wireless/iwlwifi/iwl-scan.c: In function ‘iwlagn_request_scan’:
drivers/net/wireless/iwlwifi/iwl-scan.c:572: warning: ‘cmd_len’ may be used uninitialized in this function

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-01-16 15:01:16 -05:00
John W. Linville
1032c736e8 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts:
	drivers/net/wireless/b43legacy/dma.c
2012-01-05 10:13:24 -05:00
Djalal Harouni
84c816dad5 drivers/iwlwifi: use dma_zalloc_coherent() for DMA allocation
Replace dma_alloc_coherent()+memset() with the new dma_zalloc_coherent()

Signed-off-by: Djalal Harouni <tixxdz@opendz.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-01-04 14:30:41 -05:00
John W. Linville
57adc1fcba Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts:
	drivers/net/wireless/b43/dma.c
	drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
2012-01-03 15:16:34 -05:00
David S. Miller
abb434cb05 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
	net/bluetooth/l2cap_core.c

Just two overlapping changes, one added an initialization of
a local variable, and another change added a new local variable.

Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-23 17:13:56 -05:00
Johannes Berg
106671369e iwlagn: fix (remove) use of PAGE_SIZE
The ICT code erroneously uses PAGE_SIZE. The bug
is that PAGE_SIZE isn't necessarily 4096, so on
such platforms this code will not work correctly
as we'll try to attempt to read an index in the
table that the device never wrote, it always has
4096-byte pages.

Additionally, the manual alignment code here is
unnecessary -- Documentation/DMA-API-HOWTO.txt
states:
  The cpu return address and the DMA bus master address are both
  guaranteed to be aligned to the smallest PAGE_SIZE order which
  is greater than or equal to the requested size.  This invariant
  exists (for example) to guarantee that if you allocate a chunk
  which is smaller than or equal to 64 kilobytes, the extent of the
  buffer you receive will not cross a 64K boundary.

Just use appropriate new constants and get rid of
the alignment code.

Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-21 15:06:10 -05:00
John W. Linville
b4949b8456 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem 2011-12-21 13:18:22 -05:00
Venkataraman, Meenakshi
885765f148 iwlwifi: Execute runtime calibration always
Runtime DC calibration was previously conditional. Remove this
behaviour, as new devices support runtime DC calibration,
while older devices ignore the runtime DC calibration request.

This patch addresses low TX throughput issues seen with the 6205.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-19 13:33:57 -08:00
Wey-Yi Guy
fb6c1c6c35 iwlwifi: use bus_get_hw_id for IWL_TM_CMD_APP2DEV_GET_DEVICE_ID
instead of doing all the work in IWL_TM_CMD_APP2DEV_GET_DEVICE_ID, just use
the information from bus_get_hw_id()

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-19 13:33:52 -08:00
Wey-Yi Guy
0ba958ebf1 iwlwifi: set hw_version in wiphy
Set the hw_version in wiphy structure

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-19 13:33:46 -08:00
Wey-Yi Guy
62e731695d iwlwifi: deliver hw version in both string and u32 format
Add function to get hw version in both strind and u32 format

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-19 13:33:39 -08:00
Johannes Berg
7428994d79 iwlagn: finer-grained HT disable
At least while debugging, a lot of people use
11n_disable=1 to disable HT completely. To be
able to figure out what parts of HT cause the
problems we see, make the parameter a bitmap,
allowing to disable all of HT and aggregation
(TX/RX) separately.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-19 13:17:55 -08:00
Johannes Berg
b80667eee2 iwlagn: add IRQ tracing
The legacy IRQs could be read from a trace by their
IO accesses, but reading the ICT doesn't leave any
trace (pun intended ;-) ) so in order to see what
input they get we need to add specific tracepoints.

While at it, fix whitespace in two related places.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-19 13:17:44 -08:00
Emmanuel Grumbach
96f1f05af7 iwlwifi: update SCD BC table for all SCD queues
Since we configure all the queues as CHAINABLE, we need to update the
byte count for all the queues, not only the AGGREGATABLE ones.

Not doing so can confuse the SCD and make the fw assert.

Cc: stable@vger.kernel.org
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-19 14:20:39 -05:00
Johannes Berg
69b172f796 iwlagn: remove iwlagn_build_addsta_hcmd
This function is not needed:
 * we already have the "cmd" input to it in the
   same type (and on the stack elsewhere)
 * the "legacy_reserved" parameter is never set,
   so will always be zero

Remove the function and the stack copy of the
input command.

This is still left from when iwlegacy was part
of the driver -- then we needed a translation
for the command for 3945.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:24:09 -08:00
Hsu, Kenny
ee8ba8800b iwlwifi: add IO function for continuous write of target memory
Add new IO function _iwl_write_targ_mem_words() to support
target memory write for a continuous area. It will return
error code -EBUSY if iwl_grab_nic_access() fails to indicate
the memory write does not be performed. Meanwhile the existing
function iwl_write_targ_mem() also been updated by using
_iwl_write_targ_mem_words() in a single word case.

Signed-off-by: Kenny Hsu <kenny.hsu@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:24:03 -08:00
Johannes Berg
7a0b3b08df iwlwifi: remove unused AMPDU factor/density configuration
These are unused, so can be removed safely. They also
don't make a lot of sense in Bluetooth configuration.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:23:58 -08:00
Don Fry
69a679b0dc iwlwifi: remove most of the iwl_priv references from iwl-ucode.c
Remove all but the last few references to iwl_priv from the lower
level iwl-ucode.c, with resulting code changes.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:23:53 -08:00
Don Fry
09af14030d iwlwifi: create iwl_mac80211 unregister routine
The mac80211 setup_register operations are collected in one routine,
but the cleanup routines are not.  Create a routine for this.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:23:48 -08:00
Emmanuel Grumbach
23fd7b029f iwlwifi: add missing documentation for iwl_shared
A few descriptions were missing

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:23:44 -08:00
Emmanuel Grumbach
b5326db8bb iwlwifi: don't accept Tx packets when draining HW queues
If the agg SM is in IWL_EMPTYING_HW_QUEUE_ADDBA or in
IWL_EMPTYING_HW_QUEUE_DELBA, we are not supposed to get Tx packets
from mac80211. mac80211 is supposed to buffer these packets for us.
A few issues have been identified in this mechanism, not all of them
were fixed.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:23:39 -08:00
Emmanuel Grumbach
fdf426a34a iwlwifi: kill iwl_{start,stop}_tx_ba_trans_ready
Since my latest patches, the upper layer reports to mac80211 that the
driver is ready to continue the start / stop BA flow as opposed to
the transport layer. Hence, iwl_{start,stop}_tx_ba_trans_ready are
not needed any more.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:23:34 -08:00
Emmanuel Grumbach
631b84c5c6 iwlwifi: add debug in Tx path in AGG flow
This will allow us to catch bad cases in which the packets aren't in
the right place on the ring.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:23:30 -08:00
Emmanuel Grumbach
855c2ee85c iwlwifi: reset the tid_data when a station is removed
Since the station is removed, we need to reset the information that
was accounted for this station.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:23:25 -08:00
Emmanuel Grumbach
04cf6824a5 iwlwifi: tid_data moves to iwl_priv
The transport doesn't need to access it any more.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2011-12-16 07:23:20 -08:00
Emmanuel Grumbach
97756fb1c3 iwlwifi: transport layer shouldn't access the AGG SM
This is another step towards the move of tid_data from the shared
area.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:23:15 -08:00
Emmanuel Grumbach
34b5321e4f iwlwifi: tid_data logic move to upper layer - seq_number
The tid_data is not related to the transport layer, so move
the logic that depends on it to the upper layer.
This patch deals with the seq_number.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:23:10 -08:00
Emmanuel Grumbach
76bc10fcd1 iwlwifi: tid_data logic move to upper layer - txqid
The tid_data is not related to the transport layer, so move
the logic that depends on it to the upper layer.
This patch deals with the mapping of RA / TID to HW queues in AGG.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:23:06 -08:00
Emmanuel Grumbach
20addec6ac iwlwifi: tid_data logic move to upper layer - check_empty
The tid_data is not related to the transport layer, so move
the logic that depends on it to the upper layer.
This patch deals with the code that checks if there are still
pending packets for an RA / TID.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:23:01 -08:00
Emmanuel Grumbach
822e8b2a2d iwlwifi: tid_data logic move to upper layer - tx AGG setup
The tid_data is not related to the transport layer, so move
the logic that depends on it to the upper layer.
This patch deals with tx AGG setup.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:22:57 -08:00
Emmanuel Grumbach
3c69b59542 iwlwifi: tid_data logic move to upper layer - tx AGG alloc
The tid_data is not related to the transport layer, so move
the logic that depends on it to the upper layer.
This patch deals with tx AGG alloc.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:22:52 -08:00
Emmanuel Grumbach
bc23773059 iwlwifi: tid_data logic move to upper layer - tx AGG stop
The tid_data is not related to the transport layer, so move
the logic that depends on it to the upper layer.
This patch deals with tx AGG stop.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:22:48 -08:00
Emmanuel Grumbach
1f40e145eb iwlwifi: don't rely on the wr / rd pointers in DELBA flow
In the same spirit as the previous patch. Eventually this will
allow us to remove the tid_data knowledge from the transport layer.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:22:43 -08:00
Emmanuel Grumbach
1ba42da479 iwlwifi: we can wake SW queues even when draining HW queues
In the very first implementation of HT, the driver was responsible
for the queueing: stopping and waking the queues while the HW queues
where being drained. In this implementation, we had to deal with the
case where we were draining the AGG queue because we wanted to tear
down the BA agreement.
In the normal flow (when we don't drain any HW queue), when packets
are reclaimed, we wake the SW queue in case the SW queue was stopped
which can happen when the HW queues are too full.
While draining a HW queue, we must make sure that we don't wake the
SW queue, since the whole point of the draining is to empty totally
the HW queue and not only get below a certain threshold.
This is why there is condition in the reclaim function:

if (NOT EMPTYING DELBA)
	wake the SW queue is applicable

Since then, a lot has changed and mac80211 is now able to buffer
packets that are being sent to a packet list that will be spliced
after the driver has reported it has drained its HW queues.
Hence, there is no need for the for aforementioned if, and we can
safely wake up the queue even if we are draining HW queues.
Removing this if, also allows us to remove the wake_queue in
check_empty that was there in order to deal with a corner case
created by the if.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:22:38 -08:00
Emmanuel Grumbach
eb9a372a73 iwlwifi: don't count the tfds in HW queue any more
Since packets sent to an RA / TID in AGG are sent from a
separate HW Tx queue, we may get into a race:
the regular queue isn't empty while we already begin to
send packets from the AGG queue. This would result in sending
packets out of order.

In order to cope with this, mac80211 waits until the driver
reports that the legacy queue is drained before it can send
packets to the AGG queue. During that time, mac80211 buffers
packets for the driver. These packets will be sent in order
after the driver reports it is ready.

The way this was implemented in the driver is as follows:
We held a counter that monitors the number of packets for
an RA / TID in the HW queues. When this counter reached 0,
we knew that the HW queues were drained and we reported to
mac80211 that were ready to proceed.

This patch changes the implementation described above. We
now remember what is the wifi sequence number of the first
packet that will be sent in the AGG queue (lets' call it
ssn). When we reclaim the packet before ssn, we know that
the queue is drained, and we are ready to proceed.

This will allow us to move this logic in the upper layer and
eventually remove the tid_data from the shared area.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:22:33 -08:00
Emmanuel Grumbach
aca15f81ff iwlwifi: fix endianity issue in debug prints
ba_resp->seq_ctl is __le16, need to translate to cpu endianity.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:22:28 -08:00
Don Fry
6195d135b7 iwlwifi: Add official names for new devices
Replace the engineering names with the marketing names for the
new devices.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:22:23 -08:00
Don Fry
3862241945 iwlwifi: move iwl_cfg from iwl_priv to iwl_shared
Move the configuration pointer from the upper level iwl_priv to the
lower level iwl_shared structure, with associated code fixes.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:22:16 -08:00
John W. Linville
42a3b63bb2 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem 2011-12-15 13:47:58 -05:00
John W. Linville
5d22df200b Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Conflicts:
	drivers/net/wireless/iwlwifi/iwl-agn.c
2011-12-14 14:35:41 -05:00
Wey-Yi Guy
78feb35b81 iwlwifi: allow to switch to HT40 if not associated
My previous patch
34a5b4b6af iwlwifi: do not re-configure
HT40 after associated

Fix the case of HT40 after association on specified AP, but it break the
association for some APs and cause not able to establish connection.
We need to address HT40 before and after addociation.

CC: stable@vger.kernel.org #3.0+
Reported-by: Andrej Gelenberg <andrej.gelenberg@udo.edu>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Tested-by: Andrej Gelenberg <andrej.gelenberg@udo.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-14 13:56:55 -05:00
Johannes Berg
81670a4918 iwlwifi: tx_sync only on PAN context
Ted reported that he couldn't connect to some APs
and bisected it to the tx_sync implementation.
Disable it for the BSS context to fix this issue.

Reported-by: Ted Ts'o <tytso@mit.edu>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-14 13:56:55 -05:00
Wey-Yi Guy
123877b80e iwlwifi: do not set the sequence control bit is not needed
Check the IEEE80211_TX_CTL_ASSIGN_SEQ flag from mac80211, then decide how to
set the TX_CMD_FLG_SEQ_CTL_MSK bit. Setting the wrong bit in BAR frame whill
make the firmware to increment the sequence number which is incorrect and
cause unknown behavior.

CC: stable@vger.kernel.org #3.0+
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-12 14:23:27 -05:00
Johannes Berg
a844855344 iwlagn: use IWL_MAX_TID_COUNT instead of TID_MAX_LOAD_COUNT
We track the load only on 8 TIDs, previously this
was TID_MAX_LOAD_COUNT. Since IWL_MAX_TID_COUNT
is now 8 as well, use that to make the code more
easily understandable.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-08 15:55:52 -08:00
Johannes Berg
e0467a3073 iwlagn: use IWL_MAX_TID_COUNT for WoWLAN
Now that I corrected IWL_MAX_TID_COUNT to be 8
instead of 9, we can use it in WoWLAN suspend.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-08 15:55:46 -08:00
Johannes Berg
9a215e40d7 iwlagn: fix TID use bug
The driver everywhere uses max TID count as 9,
which is wrong, it should be 8.

I think the reason it uses 9 here is off-by-one
confusion by whoever wrote this. We do use the
value IWL_MAX_TID_COUNT for "not QoS/no TID"
but that is completely correct even if it is 8
and not 9 since 0-7 are only valid.

As a side effect, this fixes the following bug:

 Open BA session requested for 00:23:cd:16:8a:7e tid 8
 ------------[ cut here ]------------
 kernel BUG at drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h:350!
 ...

when you do
echo "tx start 8" > /sys/kernel/debug/ieee80211/*/*/*/*/agg_status

Cc: stable@vger.kernel.org
Reported-by: Nikolay Martynov <mar.kolya@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-08 15:55:35 -08:00
Don Fry
45c30dba1c iwlwifi: move calib_results list from iwl_priv to iwl_trans
Move the calib_results list from the upper layer iwl_priv structure
to the lower layer iwl_trans structure.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-08 15:55:24 -08:00
Don Fry
ae6130fc9b iwlwifi: move device_pointers from iwl_priv to iwl_shared
Move the low level ucode device_pointers structure to iwl_shared.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-08 15:55:15 -08:00
Don Fry
ab36eab24e iwlwifi: move eeprom pointer from iwl_priv to iwl_shared
The eeprom image is a device level component, move from iwl_priv
to iwl_shared, with associated code changes.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-08 15:55:08 -08:00
Wey-Yi Guy
b8deb4925f iwlwifi: set TX_CMD_FLG_STA_RATE_MSK for BAR frame
It is needed by firmware to use the correct rate for BAR frame transmission

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-08 15:54:59 -08:00