History log of /drivers/net/wireless/iwlwifi/iwl-agn-tx.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1745e4405b2c0da6db2ec4b6bc0ad930612d8295 09-Mar-2012 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: fix the delta for remove max_txq_num patch

BIg portion of "iwlwifi: remove max_txq_num from hw_params" was
missing during merge, here is the fix for it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
83626404a70da74c67f32f119e53c0ba032ba2d8 07-Mar-2012 Don Fry <donald.h.fry@intel.com> iwlwifi: more status bit factoring

Continue splitting the status bits between transport and op_mode.
All but a few are separated.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
3251715dc51a8cbd2cd030ff94fe36f37b4b9e74 07-Mar-2012 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: log stop / wake queues

There were a few missing occurences when we get PASSIVE_NO_RX
notification.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
354928dd00d0437149991fad7637c411ba1c62f0 07-Mar-2012 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: make tx_cmd_pool kmem cache global

Otherwise we are not able to run more than one device per driver:

[ 24.743045] kmem_cache_create: duplicate cache iwl_dev_cmd
[ 24.743051] Pid: 3165, comm: NetworkManager Not tainted 3.3.0-rc2-wl+ #5
[ 24.743054] Call Trace:
[ 24.743066] [<ffffffff811717d5>] kmem_cache_create+0x655/0x700
[ 24.743101] [<ffffffffa03b9f8b>] iwl_alive_notify+0x1cb/0x1f0 [iwlwifi]
[ 24.743111] [<ffffffffa03ba442>] iwl_load_ucode_wait_alive+0x1b2/0x220 [iwlwifi]
[ 24.743142] [<ffffffffa03ba893>] iwl_run_init_ucode+0x73/0x100 [iwlwifi]
[ 24.743152] [<ffffffffa03b8fa1>] __iwl_up+0x81/0x220 [iwlwifi]
[ 24.743161] [<ffffffffa03b91c0>] iwlagn_mac_start+0x80/0x190 [iwlwifi]
[ 24.743188] [<ffffffffa03307b3>] ieee80211_do_open+0x293/0x770 [mac80211]

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
e755f882b7e72c48da820acc24196532977cfd07 07-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: redesign PASSIVE_NO_RX workaround

The PASSIVE_NO_RX workaround currently crosses
through the op_mode and transport layers, which
is a bit odd. This also isn't necessary, if the
transport simply reports when queues are full
(or no longer full) the op_mode can keep track
of this state, and report to mac80211 only what
*it* thinks is appropriate. What is appropriate
can then be based on whether queues should be
stopped to wait for RX or not.

This significantly simplifies the transport API,
it no longer needs to expose anything to stop a
queue, nor to wake "any" queue, this can all be
handled in the upper layer completely.

Also simplify the handling to not be dependent
on the context, that makes little sense as the
queues are shared and both contexts have to be
on the same channel anyway.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
955570fc662194c6a1128028a579d7e9014c30aa 07-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: move iwl_sta_id_or_broadcast to user

There's only one user, so the function
can be moved into the correct file. It
also loses an argument along the way.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
f8d7c1a18d5e77b17b5cc1ebefa21eaea7f2d0fa 06-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: move packet to transport

The base packet structure will (hopefully) be
the same for all transports, but what is in it
differs. Remove the union of all the possible
contents and move the packet itself into the
transport header file. This requires changing
all users of the union to just use pkt->data.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
b9ad70da6a7ed166539b188a95e0aef119555e14 06-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: put use_rts_for_aggregation into hw_params

The hardware config ht_params shouldn't be modified,
so copy the use_rts_for_aggregation parameter into
hw_params and use/modify it there.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
48a2d66f58d2bf1818acf5ff7ed9897a9977a96e 05-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: don't pass iwl_rx_mem_buffer to upper layers

struct iwl_rx_mem_buffer implementation details
(DMA address, list pointers) that the upper
layers don't need. Introduce iwl_rx_cmd_buffer
that is passed upstream and only contains the
needed data (the page). Additionally, access
this data only via accessor functions, allowing
us to change the implementation in the future.
These accessors are rxb_addr() (as before) and
rxb_steal_page() to take ownership of the data.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
2c6ab7ff8fa9af22a2a616656da6e5a0567da285 05-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: use ieee80211_tx_status

We currently use the _irqsafe version, but that
isn't recommended together with ieee80211_rx()
as it can cause races. If the device reports
a TX-status and RX in that order then with the
current combination mac80211 might process them
in the other order, which can cause issues with
powersaving clients.

Use ieee80211_tx_status() to avoid this race.
Since we don't want to call it with locks held,
process the frame queues later -- this is fine
as they are on the stack.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
15b86bff995525a38126eb44a951765a57ea2f4c 05-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: move wowlan bool into priv

With the new WoWLAN flow into the transport
there no longer is a need for this to be
shared, so move it into priv.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
08ae86ac3f9d9c9a60d2883c82cd72a5c66b94db 05-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: remove shared lock

Some data doesn't need protection, some of the
lock places are simply useless, and some data
can be protected with the mutex instead. Thus
the shared lock can be removed by making those
changes.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
fa23cb04b38a9950b21ee756e4419a737d496371 05-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: make sta lock private & BH lock

Now that the transport has its own locking,
there's no need to have the sta_lock in the
shared data. Also, it can be a BH lock as
it's not used from IRQ handlers.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
71cb99241d63b26a41c9cce6ed441bc30f90224a 05-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: reduce sta_lock hold time in TX

When we TX, we hold the sta_lock for a long
time, a lot of which isn't needed. Reduce
the time we hold the lock. Note that this
doesn't really change anything as the code
is already under the other spinlock, but it
makes the code easier to read.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
f2b69ef022aba3fe436bb03664cf12b261cb64d1 05-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: remove an unused argument

The station ID argument to the function
iwlagn_tx_cmd_build_hwcrypto isn't used
so remove it.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
02f2f1a951f87644166926862ec32fb13511e2f3 27-Feb-2012 Johannes Berg <johannes.berg@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
1ee158d83853a9f5c1465be56d56ff56e6698e92 17-Feb-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: move workqueue to priv

In order to separate the different parts of the
driver better, we are reducing the shared data.
This moves the workqueue to "priv", and removes
it from the transport. To do this, simply use
schedule_work() in the transport.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
ca994a36f585432458ead9133fcfe05440edbb7b 15-Feb-2012 John W. Linville <linville@tuxdriver.com> Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless

Conflicts:
net/mac80211/debugfs_sta.c
net/mac80211/sta_info.h
3d29dd9b5b160ba4542a9b8f869a220559e633a0 01-Feb-2012 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: don't mess up QoS counters with non-QoS frames

In my AMPDU rework, I rely on the sequence numbers of frames. But
I didn't check that the frame has a valid tid before updating the
tracking counters. As a result, the Tx queues were stalled. People
who hit this bug saw that we simply didn't let any data out.

This bug was introduced in 3.3.

This patch fixes that and checks that the frame is a QoS frame before
looking at its tid and changing the counters.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
5fb8c182d26472ea24cbbadb6a3e355d7621cca4 31-Jan-2012 John W. Linville <linville@tuxdriver.com> iwlwifi: make "Tx aggregation enabled on ra =" be at DEBUG level

Average users either don't care or they think that message indicates a
problem...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
fb4961dbc27d40cdbed297aa9bd74fa4a0e2ba6c 06-Jan-2012 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: update Copyright

Update Copyright to 2012

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
b5326db8bb058a32c22ed82a8e359a8fe6f0bf9b 07-Dec-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
fdf426a34afe7b1c17a6783f273062e3464cceaa 07-Dec-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
04cf6824a5e92e6f86c0abcb38ac65ee744c3d34 23-Nov-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
97756fb1c39d58b76ee1488ac894ee81eaf17ba9 23-Nov-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
34b5321e4f8bb71fd9b2190d6aad4646486c4ba6 21-Nov-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
76bc10fcd128ad028cf77c62e179cd20dc2ffecf 21-Nov-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
20addec6ac77fbffa1c913f8d07d3a78a9e50321 16-Dec-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
822e8b2a2d708f99daf1ae4cd9b9e4c9d84069c6 21-Nov-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
3c69b5954225b41cfa57338b17466816072d55a2 21-Nov-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
bc23773059ecea24cb653994686d230b6be08536 21-Nov-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
eb9a372a73ea3e2b7e795a7ea03a5b8d92815672 21-Nov-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
aca15f81fffb71e5df8fd72e76ef5f1a3128bd11 21-Nov-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
3862241945026a8fa165ab73c57739df77b8e1fb 16-Dec-2011 Don Fry <donald.h.fry@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
5d22df200beccb1dea26fe4d8684ed93ae2f0aeb 14-Dec-2011 John W. Linville <linville@tuxdriver.com> Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless

Conflicts:
drivers/net/wireless/iwlwifi/iwl-agn.c
123877b80ed62c3b897c53357b622574c023b642 09-Dec-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
b8deb4925f88c5052fc42dc52e9c7057f05deb0d 02-Dec-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
5ef15ccc648638a2cf00b3a13caa770559aa4e91 30-Nov-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: rename CONFIG_IWLWIFI_DEVICE_SVTOOL to CONFIG_IWLWIFI_DEVICE_TESTMODE

Change the name to match the works

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
b88f5be0074fef306f9346175088491867905ebd 08-Nov-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: fix endianity issues in debug prints

Use the CPUed version of the variables when printing data from the
BA notification.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
32faad90b81dc64b1edf43bdf1f280bb3de5be0d 08-Nov-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: improve the prints in the reclaim path

Some information was redundation, other was missing.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
81a3de1ce2929fef2b112c048c50bc52b686f94d 10-Nov-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: add debug information on queue stop / wake

Users complain that the traffic gets stalled sometimes. This will
allow easier debugging.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
79d3eef89190ee0a7ee585e3949873241bc382e3 10-Nov-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: add P2P NoA to probe responses

Whether to use NoA or not is entire controlled
by the uCode right now, and it also adds the
attribute to beacons. We do need to add it to
probe responses in the driver though.

Keep track of the NoA notification from the
uCode and add the data to probe responses when
such are transmitted. Use RCU to manage the
lifetime.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
6a686c600268b71619f93d35f9373e2b6ab5947b 10-Oct-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: move iwl_enable_rfkill_int and kill iwl-helpers.h

Move iwl_enable_rfkill_int to iwl-core.h, and remove the empty
iwl-helpers.h

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
c745f55baf63d08d6e9bb20682102fb8bae8f67a 10-Oct-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: merge station management functions

After driver split, no need to separate station management functions
in two files, merge it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
f3129b73889086f326d810c1cf4e807849321d64 10-Oct-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: use low retry limit for WoWLAN

When in D3 state, use low retry limit for both data and rts

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
78558cb4415919cae5ebc0213abd75fa86d7933b 10-Oct-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: set rts retry limit

setup the rts rety limit for tx command

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
47086fc51aa2220f58049704a8b73e4fcdf372b9 29-Sep-2011 Johannes Berg <johannes.berg@intel.com> mac80211: implement uAPSD

Add uAPSD support to mac80211. This is probably not
possible with all devices, so advertising it with
the cfg80211 flag will be left up to drivers that
want it.

Due to my previous patches it is now a fairly
straight-forward extension. Drivers need to have
accurate TX status reporting for the EOSP frame.
For drivers that buffer themselves, the provided
APIs allow releasing the right number of frames,
but then drivers need to set EOSP and more-data
themselves. This is documented in more detail in
the new code itself.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
1a8496137d3707061758df1f7df1e7700a4863fd 23-Sep-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: update rate scaling with BA notifications

In the current code, the rate scaling isn't fed with
statistics from the BA notifications.

This is since my patch:

iwlagn: reclaim the packets in transport layer

Fix that.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
02dc84fe18482badbc8f2e45174d1147f8ebde0a 23-Sep-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: set the sequence control from the transport layer

Since all the queue logic has been moved to the transport layer,
the sequence number is set in the transport layer.
While doing that I forgot that the mac header is copied to the
TB of the TX cmd in the upper layer before the call to the transport
layer. So basically we used the sequence number from mac80211...
This was fine for the first assocation but after the second, mac80211
resets its counters while we don't hence a shift that led to terrible
impact on performance.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
08ecf10441c79ebebe5ce6b6ff9a06c586f5895c 21-Sep-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: pending frames musn't be incremented if agg is on

During my works on the transport layer I removed code that updated
a local variable (is_agg) that is needed to keep the pending_frames
count up to date. Fix this.

Also, there should be no way to have a packet with TX_CTL_AMPDU set
while the internal aggregation state machine is not in AGG_ON state.
Add a WARN_ON to ensure that.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
132f98c2dc702940ed2bb58e7aa48432c2c62f7b 21-Sep-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: simplify the iwl_device_cmd layout

This simplifies both the transport layer and the upper layer.

Kill the union in the device command, which avoids the funny syntax
we had: cmd->cmd.payload.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
247c61d625154e18a105d663281c52376a882762 21-Sep-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: remove the callback in host commands

Before this patch, the upper layer could register a callback for each
host command. This mechanism allowed the upper layer to have
different callbacks for the same command ID. In fact, it wasn't used
and the rx_handlers is enough: same callback for all the command with
a specific command ID.

The iwl_send_add_station needs the access the command that was sent
while handling the response (regardless if the command was sent in
SYNC or ASYNC mode). So now, all the handlers receive the host
command that was sent. This implies a change in the handler signature.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
21023e2696679bea2a42aa963de74ce37c049b13 15-Sep-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: add documentation to the transport layer

and do a few clean up fixes on the way

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
ff620849110649b5f94989ddfd7a72b2bd43bd42 06-Sep-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: fix compilation when debug flags is unset

Trivial fixes to allow compilation without warnings when debug
compilation flag isn't set.
Also fix the compilation when debugfs flag isn't set.
Fix a warning: unused priv pointer on the way.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
8ad71bef4a9d8173cbcfbb2f796b08d33d4ca01b 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: move tx queues to transport layer

This finalizes the move of the data path to the transport layer.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
e20d434170c3a7f388d5e916825499c9c0738606 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: move the stop / wake queue logic to transport layer

priv->mac80211_registered and priv->hw needed to move to shared.
stop_queue API was added in order to allow the upper layer to stop
the SW queues for regulatory purposes.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
7f01d567c5b9e136d9b070e00be88169d5b2227e 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: move the disable agg logic to transport layer

Since all the check_empty logic is now in the transport layer,
the upper layer doesn't need to know anything about tx queues.
The disable aggregation flow was the last to know what a tx queue
is, so move it too.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
464021ffc1c080283e67729d966d76612728a08c 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: move the check_empty logic to the transport layer

This logic is responsible to tell mac80211 when the HW queues are
empty and the BA session can be started / torn down.

Fix a bug on the way:
When the the Tx BA session is stopped and the HW queues aren't empty,
we stop the SW queue to drain the HW queue and then switch to the
legacy HW queue. This is the IWL_EMPTYING_HW_QUEUE_DELBA state.

While in this state, we never wake the SW queue, even when the HW
queue is almost empty, since we need to drain it completely. Look
at iwl_trans_pcie_reclaim regarding this.

Once the HW queue is really empty, we must wake the SW queue in order
to get traffic to the legacy queue.
This step was missing leading to an odd situation were the traffic
would just stall after we tore down a Tx BA session while the HW
queue was not empty.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
288712a6ccf47b9df104f800616f6659ecadc940 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: allocate resources for TX BA session in transport

The queues and all the related logic suits to the transport layer.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
e13c0c59e0ec38558ac853d56555e915b4dc7dc2 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: move the mapping ac to queue / fifo to transport

This mapping is transport related.
This allows us to remove the notion of tx queue from the tx path in
the upper layer.
iwl_wake_any_queue moved to transport layer since it needs to access
these mappings.
The TX API is nicer now:

int (*tx)(struct iwl_trans *trans, struct sk_buff *skb,
struct iwl_device_cmd *dev_cmd, u8 ctx, u8 sta_id);

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
dfa2bdbab70901ddda3ec41f2e55f8396af9095f 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: upper layer uses slabs to allocate tx cmds

In a near future, the upper layer won't be aware of the tx queues.
This allows to remove one place where the upper layer needed to
provide the tx queue index to the transport layer.
This also saves around 1.5MB.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
ba562f71198a2cb03bb8d20640ffdf996275c3f0 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: set tx_fifo for ampdu in transport layer

the mapping tx_queue -> fifo is really transport related. The upper
layer should be involved in such things.

Note that upon agg_disable, the queue is always mapped to fifo 0, but
this doesn't matter since when the queue will be setup again for a
new BA session, it will be configured to the good fifo anyway.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
2c452297ff3eaafad41d24fa03d54a169ced8de1 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: upper layer stores iwl_rxon_context in skb's CB

This removes the need for iwl_tx_info.
Each tx queue holds an array of skbs, the transport layer doesn't
need to know anything about the context in which a specific skb is
sent.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
fd656935cd05f522d7db97386633f6a0d7751218 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: remove dereferences of priv from transport

There are still quite a few, but much less.
A few fields have been moved /copied to hw_params which sits in the
shared area:
* priv->cfg->base_params->num_of_ampdu_queues
* priv->cfg->base_params->shadow_reg_enable
* priv->cfg->sku
* priv->ucode_owner

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
5f85a7890cbfd2be8f4c6620b2a6774d6b5ac647 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: iwl_tid_data moves to iwl-shared

The rate scaling and the transport need to access the data in
iwl_tid_data, hence the move.

Note that the only component in the upper layer that needs this data
is the rate scaling. Refactoring the rate scaling may help to move
iwl_tid_data from the shared area to the transport area.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
845a9c0d8acea87dede740bc5feb9ec2d00505d9 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: move all iwl_is_XXX helpers to iwl-shared.h

Logic move after all priv->status moved to struct iwl_shared

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
04e1cabe4294fdf744489deb1e91edb1ec02e9a4 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: move reclaim related functions

Now that the reclaim flow has been moved to the transport layer, a lot of
functions can be made static or don't need to be exported outside the transport
layer.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
a0eaad713f6fc1f63fe293ad6ce63cb01e05c03c 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: reclaim the packets in transport layer

The reclaim flow is really transport related. Define a simple API to allow the
upper layer to request from the transport layer to reclaim packets until an
index written in the Tx response / BA notification.
The transport layer prepares a list of the packets that are being freed and
passes this list to the upper layer.
Between the two layers, the CB of the skb is used to pass a pointer to the
context (BSS / PAN) in which the skb was sent.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
e6bb4c9c00892c488f3218ea317dc6a71674faf4 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: bus layer chooses its transport layer

Remove iwl_transport_register which was a W/A. The bus layer knows what
transport to use. So now, the bus layer gives the upper layer a pointer to the
iwl_trans_ops struct that it wants to use. The upper layer then, allocates the
desired transport layer using iwl_trans_ops->alloc function.

As a result of this, priv->trans, no longer exists, priv holds a pointer to
iwl_shared, which holds a pointer to iwl_trans. This required to change all the
calls to the transport layer from upper layer. While we were at it, trans_X
inlines have been renamed to iwl_trans_X to avoid confusions, which of course
required to rename the functions inside the transport layer because of
conflicts in names. So the static API functions inside the transport layer
implementation have been renamed to iwl_trans_pcie_X.

Until now, the IRQ / Tasklet were initialized in iwl_transport_layer. This is
confusing since the registration doesn't mean to request IRQ, so I added a
handler for that.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
f39c95e8d7a152b409977687a999356f0e54bde6 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: priv->sta_lock moves to iwl_shared

Since it is used by all the layers, it needs to move to iwl_shared.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
10b15e6f67ba4d9abb8788100a5267341cc98b7b 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: priv->lock moves to iwl_shared

Since it is used by all the layers, it needs to move to iwl_shared.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
d618912417fbce4f6514fe1cbef7df2e73bdb6c2 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: hw_params moves to iwl_shared

Since it is used by all the layers, it needs to move to iwl_shared.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
c6baf7fb40cb141c4b510372f7dac829621ccf3f 23-Jul-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: support new P2P implementation

The previous P2P implementation turned out to
not work well and new uCode capabilities were
added to support P2P. Modify the driver to
take advantage of those, and also discover P2P
support automatically based on a uCode flag
instead of having a Kconfig symbol for P2P.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
c10e2c102ff180998bf91404c2d76ca66ced46a0 13-Jul-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: testmode fixed rate available for testmode only

Move tm_fixed_rate inside CONFIG_IWLWIFI_DEVICE_SVTOOL and only
available when the option is enable.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
41c50542669cd7aec45ad708f5120ff8fdaa1194 11-Jul-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: transport layer receives struct iwl_trans*

It still holds a pointer to iwl_priv. But hopefully this will disappear at some point.
Also add the multiple inclusion protection to iwl-trans.h that was forgotten.
Move iwl-trans structures to iwl-trans.h

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
48d42c426947d8ffba0caa3cf9c58be6903302e0 10-Jul-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: SCD configuration for AMPDU moves to transport layer

All the configurations of the HW for AMPDU are now 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
b3c2ce131c7cd8c53b72b0cc04241cde17ce0c1d 07-Jul-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: add tx start API to transport layer

tx start will start the tx queues: basically configure the SCD
Remove the IWLAGN prefix to SCD defines on the way.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
2c2def10d03554c0f8ed02f5b5a2a8526958f6a3 07-Jul-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: simplify TX flags assignments

The first assignment of TX_CMD_FLG_SEQ_CTL_MSK for
ack-expected mgmt frames is overwritten later in
the function, so it's useless. Also, probe response
frames, BACK request and others there are mutually
exclusive so can be moved into an else branch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
47c1b496015e41e1068878814596af9a45d4fa84 03-Jul-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: move Tx datapath to transport layer

Split the Tx datapath in two parts:
* the first deals with the Tx cmd composition
* the second attaches the skb + Tx cmd to the queues

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
5c3d29fc0d083e674c09407f1bc78e9dbf4ae8a5 08-Jul-2011 Don Fry <donald.h.fry@intel.com> iwlagn: remove iwlagn_hcmd_utils structure and call directly

Not needed since the driver split. Move single use routines to
calling location and keep static where possible.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
4e308119771573f949203f9f4732bcbfb9628279 08-Jul-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: separate and enhance the fixed rate from

For testing purpose, we need better control of msc from user application.
Separate the fixed_rate between debugfs and testmode and enforce it.

Signed-off-by: Kenny Hsu <kenny.hsu@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
06f491ef4b659fa6f6850f31d05a4a03db0d9d96 08-Jul-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: remove code duplication

Code duplication was needed during the move, 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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
c170b867cc119fb9f6e9cac3a8245a3347bc718c 08-Jul-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: add an API for TX stop

Tx stop moves to transport layer.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
1359ca4f305a1680ea6a1347a43bea76c352097c 08-Jul-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: add an API to free the TX context

Tx free functions move to the transport layer. Unify the functions that deal with tx queues and cmd queue.

Since the CMD queue is not fully allocated, but uses the q->n_bd / q->window trick, the release flow of TX queue and CMD queue was different.
iwlagn_txq_free_tfd receives now the index of the TFD to be freed, which allows to unify the release flow for all the queues.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
523b02ea23b175dd3e46e3daf1bc9354376640a3 07-Jul-2011 Johannes Berg <johannes.berg@intel.com> mac80211: fix TKIP races, make API easier to use

Our current TKIP code races against itself on TX
since we can process multiple packets at the same
time on different ACs, but they all share the TX
context for TKIP. This can lead to bad IVs etc.

Also, the crypto offload helper code just obtains
the P1K/P2K from the cache, and can update it as
well, but there's no guarantee that packets are
really processed in order.

To fix these issues, first introduce a spinlock
that will protect the IV16/IV32 values in the TX
context. This first step makes sure that we don't
assign the same IV multiple times or get confused
in other ways.

Secondly, change the way the P1K cache works. I
add a field "p1k_iv32" that stores the value of
the IV32 when the P1K was last recomputed, and
if different from the last time, then a new P1K
is recomputed. This can cause the P1K computation
to flip back and forth if packets are processed
out of order. All this also happens under the new
spinlock.

Finally, because there are argument differences,
split up the ieee80211_get_tkip_key() API into
ieee80211_get_tkip_p1k() and ieee80211_get_tkip_p2k()
and give them the correct arguments.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
02aca585f58a331288026cf78fd4f4ca404cbe12 28-Jun-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: move the tx allocation funcs to the transport layer

These functions allocate all the Tx context. Only the simple tx_init is exported as API.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
795414db8607a195541fe1a8f072021011b73386 18-Jun-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: don't use the PCI wrappers for DMA operation

Get a pointer to the struct device during probe and get the rid of all the PCI
specific DMA wrappers.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
3599d39a8525b01540e2c7ec8c5d0df0dd11d6cf 31-May-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: add get_dev to iwl_bus_ops

Bus specific layer must know how to return the struct device* of the device.
Implement that as a callback of iwl_bus_ops and use that callback instead of
using the priv->pdev pointer which is meant to disappear soon.

Since the struct device * is needed in hot path, iwl_bus holds a pointer to it
instead of calling get_dev all the time.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
5bc9890ff114cdd39de8561610f6af3bb4b08cfb 27-May-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: change log to better represent the state of aggregation process

Multiple A-MPDU actions will received from mac80211 while setting up the
aggregation queue, change the message log to better represent the states.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
2e5d04dad1934d97057cbecce59834f78dafc067 27-May-2011 Daniel Halperin <dhalperi@cs.washington.edu> iwlwifi: disambiguate invalid DMA index warnings

The exact same error message is used in three different functions in
iwlagn. Add the function name to the error string to disambiguate where
the error is coming from.

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
31ec97d9cebac804814de298592648f7c18d8281 24-May-2011 John W. Linville <linville@tuxdriver.com> Merge ssh://master.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
e00cf3b9eb7839b952e434a75bff6b99e47337ac 16-May-2011 John W. Linville <linville@tuxdriver.com> Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem

Conflicts:
drivers/net/wireless/iwlwifi/iwl-agn-tx.c
net/mac80211/sta_info.h
4c42db0f04e55d48f0ea9f424144a5211b7a155c 04-May-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: remove unused pad argument

The pad argument to iwlagn_txq_free_tfd
isn't used, remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
214d14d4d323aab5d455b409e279f9e1e6631123 04-May-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: clean up TXQ indirection

All of these functions no longer need to be
accessed indirectly since they're shared in
all AGN devices.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
2c46f72e069eef5e98f2b04df08cde6bdc673aa7 28-Apr-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: check DMA mapping errors

DMA mappings can fail, but the current code
doesn't check for that. Add checking, which
requires some restructuring for proper error
paths.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
94b00658ffc719427c9c09d7920957bc35915c6f 28-Apr-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: remove bytecount indirection

All AGN devices need the bytecount table, so
remove the indirection and make the functions
static again.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
ccb6c1c0ec2b76a41c8c85747b1a671e71b97e64 28-Apr-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: dont update bytecount table for command queue

The device doesn't use the bytecount table for the
command queue, only for aggregation queues to make
aggregation decisions. So don't update it for the
command queue (and we even updated it with wrong
values).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
7143b7d41218d4fc2ea33e6056c73609527ae687 05-May-2011 David S. Miller <davem@davemloft.net> Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Conflicts:
drivers/net/tg3.c
bfd36103ec26599557c2bd3225a1f1c9267f8fcb 29-Apr-2011 Stanislaw Gruszka <sgruszka@redhat.com> iwlagn: fix "Received BA when not expected"

Need to use broadcast sta_id for management frames, otherwise we broke
BA session in the firmware and get messages like that:

"Received BA when not expected"

or (on older kernels):

"BA scd_flow 0 does not match txq_id 10"

This fix regression introduced in 2.6.35 during station management
code rewrite by:

commit 2a87c26bbe9587baeb9e56d3ce0b4971bd777643
Author: Johannes Berg <johannes.berg@intel.com>
Date: Fri Apr 30 11:30:45 2010 -0700

iwlwifi: use iwl_find_station less

Patch partially resolve:
https://bugzilla.kernel.org/show_bug.cgi?id=16691
However, there are still 11n performance problems on 4965 and 5xxx
devices that need to be investigated.

Cc: stable@kernel.org # 2.6.35+
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
429576b97c623b9c4e3375fb7c37bce377f51e68 26-Apr-2011 John W. Linville <linville@tuxdriver.com> Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
2bd93d7af1581d40e3c4b25242472661cb7c637a 26-Apr-2011 David S. Miller <davem@davemloft.net> Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Resolved logic conflicts causing a build failure due to
drivers/net/r8169.c changes using a patch from Stephen Rothwell.

Signed-off-by: David S. Miller <davem@davemloft.net>
b25026981aecde3685dd0e45ad980fff9f528daa 20-Apr-2011 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: fix skb usage after free

Since

commit a120e912eb51e347f36c71b60a1d13af74d30e83
Author: Stanislaw Gruszka <sgruszka@redhat.com>
Date: Fri Feb 19 15:47:33 2010 -0800

iwlwifi: sanity check before counting number of tfds can be free

we use skb->data after calling ieee80211_tx_status_irqsafe(), which
could free skb instantly.

On current kernels I do not observe practical problems related with
bug, but on 2.6.35.y it cause random system hangs when stressing
wireless link.

Cc: stable@kernel.org # 2.6.32+
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
901069c71415a76d731857ccda814e18ded062f7 05-Apr-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: change Copyright to 2011

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
d0eb633431ec922f8f9b2040f46d9b42a4cec193 17-Mar-2011 Daniel Halperin <dhalperi@cs.washington.edu> iwlwifi: cleanup and bugfix tx aggregation code

Since the driver split, there's no need for no_agg_framecnt_info since
all devices have this set to false. Secondly, the compressed block ack
handling code was broken. Fix this.

(1) A shift less than zero simply implies that the buffer wrapped, this
is expected. Remove the incorrect comment.

(2) The (agg->frame_count > (64-sh)) condition can happen if the last
frame is dropped. E.g., if I send 7 frames and the 6th is received but
the 7th is lost, the other side may only shift the window 6, not 7
frames since the last bit is a 0. This is perfectly fine behavior and
doesn't invalidate the feedback.

(3) Store the feedback from a Compressed BA in the first newly received
frame, rather than the start of the window. This way it will get
processed by the rate selection code. Feedback stored in a non-received
frame is likely to get overwritten by the retransmission.
This is based on the approach taken by minstrel_ht.

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
c8823ec1337017e23b99fb0814e2f3d62537f811 15-Mar-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: fix aggregation queue scheduler setup

iwlagn's hardware scheduler needs to be set up
with the right aggregation frame limit and
buffer sizes. To achieve this, we need to move
the hardware queue setup to when the session
becomes operational.

Tested-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
7ffef13d7a24654292c4641450f2794224b9eb5d 15-Mar-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: clean up TX aggregation code

Since the driver split, there's no need for
function pointers any more for aggregation
queue setup and teardown as all devices now
share the same code. Simplify this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
387f3381f732d8fa1b62213ae3276f2ae712dbe2 28-Feb-2011 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: fix dma mappings and skbs leak

Since commit commit 470058e0ad82fcfaaffd57307d8bf8c094e8e9d7
"iwlwifi: avoid Tx queue memory allocation in interface down" we do
not unmap dma and free skbs when down device and there is pending
transfer. What in consequence may cause that system hung (waiting
for free skb's) when performing shutdown at iptables module unload.

DMA leak manifest itself following warning:

WARNING: at lib/dma-debug.c:689 dma_debug_device_change+0x15a/0x1b0()
Hardware name: HP xw8600 Workstation
pci 0000:80:00.0: DMA-API: device driver has pending DMA allocations while released from device [count=240]
Modules linked in: iwlagn(-) aes_x86_64 aes_generic fuse cpufreq_ondemand acpi_cpufreq freq_table mperf xt_physdev ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 ext3 jbd dm_mirror dm_region_hash dm_log dm_mod uinput hp_wmi sparse_keymap sg wmi microcode serio_raw tg3 arc4 ecb shpchp mac80211 cfg80211 rfkill ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif firewire_ohci firewire_core crc_itu_t mptsas mptscsih mptbase scsi_transport_sas pata_acpi ata_generic ata_piix ahci libahci floppy nouveau ttm drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: iwlagn]
Pid: 9131, comm: rmmod Tainted: G W 2.6.38-rc6-wl+ #33
Call Trace:
[<ffffffff810649ef>] ? warn_slowpath_common+0x7f/0xc0
[<ffffffff81064ae6>] ? warn_slowpath_fmt+0x46/0x50
[<ffffffff812320ab>] ? dma_debug_device_change+0xdb/0x1b0
[<ffffffff8123212a>] ? dma_debug_device_change+0x15a/0x1b0
[<ffffffff8149dc18>] ? notifier_call_chain+0x58/0xb0
[<ffffffff8108e370>] ? __blocking_notifier_call_chain+0x60/0x90
[<ffffffff8108e3b6>] ? blocking_notifier_call_chain+0x16/0x20
[<ffffffff812f570c>] ? __device_release_driver+0xbc/0xe0
[<ffffffff812f5808>] ? driver_detach+0xd8/0xe0
[<ffffffff812f45d1>] ? bus_remove_driver+0x91/0x100
[<ffffffff812f6022>] ? driver_unregister+0x62/0xa0
[<ffffffff8123d5d4>] ? pci_unregister_driver+0x44/0xa0
[<ffffffffa05632d1>] ? iwl_exit+0x15/0x1c [iwlagn]
[<ffffffff810ab492>] ? sys_delete_module+0x1a2/0x270
[<ffffffff81498da9>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[<ffffffff8100bf42>] ? system_call_fastpath+0x16/0x1b

I still can observe above warning after apply patch, but it is very
hard to reproduce it, and have count=1. Whereas that one is easy to
reproduce using debugfs force_reset while transmitting data, and have
very big counts eg. 240, like quoted here. So count=1 WARNING seems
to be different issue that need to be resolved separately.

v1 -> v2: fix infinity loop bug I made during "for" to "while" loop transition.
v2 -> v3: remove unneeded EXPORT_SYMBOL

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
9b9190d9688ccf531a3a5dac84d7b9654a08bfc5 06-Jan-2011 Johannes Berg <johannes.berg@intel.com> iwlwifi: implement remain-on-channel

For device supporting PAN/P2P, use the PAN
context to implement the remain-on-channel
operation using device offloads so that the
filters in the device will be programmed
correctly -- otherwise we cannot receive
any probe request frames during off-channel
periods.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
9decde95be8a77a16f5668544bee45d41a7ae665 30-Nov-2010 Johannes Berg <johannes.berg@intel.com> iwlagn: fix debug variable access

The compiler correctly warns:
iwl-agn-tx.c: In function ‘iwlagn_tx_status_reply_compressed_ba’:
iwl-agn-tx.c:1240: warning: ‘bitmap’ may be used uninitialized in this function

Move the debug print to the branch that reads the
bitmap, and move the variables too so it's more
obvious where they are needed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
0c4ac342997c9597706a8fcbb0ccf920b3d33570 17-Nov-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: use mac80211 AC defines

Instead of hardcoding the numbers that must
match mac80211, use the constants. Not that
this means we could change the constants,
but at least this way it's clearer.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
2e34034e8c9755ff144379d410d5227926e91cce 16-Nov-2010 Johannes Berg <johannes.berg@intel.com> iwlagn: fix station powersave accounting for aggregation

Since aggregation queues are station-specific, the
device will not reject packets in them but rather
will stop the appropriate aggregation queues when
a station goes to sleep. I forgot to account for
this in the driver, so if a station went to sleep
that had aggregation enabled, traffic would stop
indefinitely.

Fix this by only accounting frames queued on the
normal AC queues for associated station.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
67158b67cea0c92dba1dda74cde926d149cc1a2e 16-Nov-2010 Johannes Berg <johannes.berg@intel.com> iwlagn: remove powersave warning

Through races, a packet may be enqueued for
transmission to a station while that station
is going to sleep, in which case the warning
here triggers. Instead of warning, check the
condition -- if this packet is not a PS-poll
response then we still enqueue it but it will
be rejected by the device since the station
is marked as asleep.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
840fd8ff64f7b6c9cbfa9b7d0419f015f33303ff 22-Nov-2010 John W. Linville <linville@tuxdriver.com> Merge branch 'wireless-next-2.6' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-2.6
70f3876f09ccf1f2819aee6caee9266b2c4b1622 12-Nov-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlagn: simplify iwlagn_tx_skb

We can simplify length calculation in iwlagn_tx_skb, that function
is enough complex, without fuzz it more than necessary.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
ea9b307f8e859186a6791e0d508c5993448ac900 11-Nov-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: always build swq_id as virtual queue ID

Previously, we used the swq_id's mechanism
to have AC and HW queue different only for
aggregation queues. To be able to fix a bug
with iPAN simply always build the swq_id as
ac | (hwq << 2) and remove the flag bit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
549a04e092e5e043df82fd0541f3b67ab488359b 11-Nov-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: pass txq to wake/stop queue

Instead of passing the txq->swq_id, pass the
txq struct directly to make sure that in the
future nobody will pass an invalid number.
Only three places actually change from using
the txq_id or the skb's queue_mapping to now
using txq->swq_id as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
8d56396ac3926412dd97dcb9dd8d0cef556b908e 11-Nov-2010 Johannes Berg <johannes.berg@intel.com> iwlagn: remove unused variable swq_id

Simply remove the unused variable swq_id.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
8829c9e2ec144baeb3cee599e1e653a396ad521b 10-Nov-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: used frame count info in compressed ba packet

For newer devices, uCode provide both "number of frames sent"
and "number of frames acked" information inside the compressed_ba
packet. So instead of figure the success/failure information through
the bitmap, use those information which is much betrer approach.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
822395b591db32ad3cf8a5b57b0fe30fb8d12c37 23-Oct-2010 Don Fry <donald.h.fry@intel.com> iwlwifi: quiet a noisy printk

Timing issues in microcode for some devices can cause a compressed BA to
be sent to the driver prior to returning any a-MPDU notification.
Traces show RTS-CTS is exchanged and then the timer fires which causes an
empty BA to be sent which acknowledges nothing. This results in a noisy
printk. Only print the message if the bitmap is non-zero.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
69fdb710b29d096bc50123f7c97891e31ffe45f9 22-Sep-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: move tx fail code to agn

The code to print out TX failure reasons is
AGN specific, so it can be in the AGN module.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
7cb1b0887fcc61918e3d64827fbef968bb67a57a 06-Oct-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: reduce redundant parameter definitions

move paramater definitions to a device paramater structure only
leaving the device name, which antennas are used and what firmware
file to use in the iwl_cfg structure. this will not completely
remove the redundancies but greatly reduce them for devices that
only vary by name or antennas. the parameters that are more
likely to change within a given device family are left in iwl_cfg.
also separate bt param structure added to help reduce more.

Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
e72f368be61d9835c98cd00ee1f330d28e2488ef 23-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlagn: queue frames according to context

Frames for different contexts need to be put
on different queues, and multicast after DTIM
frames have a special queue yet which also
depends on the context, so put all this into
the context.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
8bd413e611d4324f17e54a2a89b4d09216c22a37 23-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: move virtual interface pointer into context

iwlwifi occasionally needs to find the virtual
interface pointer to give it to mac80211, but right
now it only keeps one. Move it into the context so
that we can keep one pointer each.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
c90cbbbd78e45abbefd5e9e1c3c179d6126e3ddf 23-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: add context into tx descriptor

In status processing we'll need to find the context
for a given frame, so add a context pointer to the
TX info for each frame.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
a194e3249baf954dc34c67cdad5b8bed36f49e72 27-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: contextify broadcast station

The broadcast station ID is per context, so
add a variable for the ID in the context and
use it everywhere we previously hardcoded it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
13bb9483e190b95b04b22280ec9efa6b48469fd6 23-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: prepare for PAN queue/fifo assignment

PAN ucode will require a different queue assignment,
in particular queue 9 instead of 4 should be used for
commands.

This is required because the ucode will stop/start
queues 4 and 8 depending on the PAN state, since
queue 8 will be used for PAN multicast (after DTIM).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
18c121d7558a550e8e48956fbd389759a850ab53 23-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: disable aggregation queue if stopped early

When aggregation is stopped again for some reason
before the queue we selected has drained, we will
currently leak the TX queue and keep it enabled
for aggregation. Normally this doesn't happen, so
the problem is rarely seen.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
bee008b78307ccc2e17c7ec152dd2098d5f2e1fa 23-Aug-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: add bt full concurrency support

Adding the bluetooth full concurrency support for WiFi/BT combo devices.

Driver should configure uCode to operate in "full concurrency" mode (via
LUT) if both conditions are met:
- Antenna Coupling is more than 35dB
- WiFi Channel Inhibition Request is hornored by BT Core

Currently, there is no antenna coupling information provided by uCode;
use module parameter to specified the antenna coupling in dB.

When in "full concurrency" mode, driver need to download different LUT
to uCode while sending bt configuration command; also, driver need to
configure the device operate in 1x1 while in full concurrency mode.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
d44ae69e80358ff88d39a14d92c27dba4e90c0c5 23-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlagn: set BT IGNORE for some frames

The BT ignore bit should be set when transmitting
auth, assoc response and eap frames.

Also, scanning should set the BT ignore bit for the
probe request transmission; Note that we only use
the non-shared antenna.

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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
97359d1235eaf634fe706c9faa6e40181cc95fb8 10-Aug-2010 Johannes Berg <johannes.berg@intel.com> mac80211: use cipher suite selectors

Currently, mac80211 translates the cfg80211
cipher suite selectors into ALG_* values.
That isn't all too useful, and some drivers
benefit from the distinction between WEP40
and WEP104 as well. Therefore, convert it
all to use the cipher suite selectors.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
94597ab23ea10b3bdcba534be00a9f7b35791c07 09-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlagn: fix rts cts protection

Currently the driver will try to protect all frames,
which leads to a lot of odd things like sending an
RTS with a zeroed RA before multicast frames, which
is clearly bogus.

In order to fix all of this, we need to take a step
back and see what we need to achieve:
* we need RTS/CTS protection if requested by
the AP for the BSS, mac80211 tells us this
* in that case, CTS-to-self should only be
enabled when mac80211 tells us
* additionally, as a hardware workaround, on
some devices we have to protect aggregated
frames with RTS

To achieve the first two items, set up the RXON
accordingly and set the protection required flag
in the transmit command when mac80211 requests
protection for the frame.

To achieve the last item, set the rate-control
RTS-requested flag for all stations that we have
aggregation sessions with, and set the protection
required flag when sending aggregated frames (on
those devices where this is required).

Since otherwise bugs can occur, do not allow the
user to override the RTS-for-aggregation setting
from sysfs any more.

Finally, also clean up the way all these flags get
set in the driver and move everything into the
device-specific functions.

Cc: stable@kernel.org [2.6.35]
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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
a24d52f390a77ce90dc8cf0cd75d27ec0a6ea3f8 06-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: fix locking assertions

spin_is_locked() can return zero on some (UP?)
configurations because locks don't exist, and
that causes an endless amount of warnings. Use
lockdep_assert_held() instead, which has two
advantages:
1) it verifies the current task is holding
the lock or mutex
2) it compiles away completely when lockdep
is not enabled

Cc: stable@kernel.org [2.6.34+, maybe only parts of patch]
Reported-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
735df29a0641d9d8d65117c48ee460284ffcfc05 31-Jul-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: BA scd_flow not match condition detected

It is a uCode bug which cause the tx queue id not match scd_flow
in compressed block ack frame, and it need to be addressed in uCode.
Currently, driver will log the information when it happen.

Since it is possible happen very often and we do not want to fill the syslog,
so don't enable the logging by default.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
9726f347f82b0ce802530deb00ee2dde369e1d2f 29-Jun-2010 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: fix the bit mask of a FH register in stop Tx DMA flow

When we stop the Tx DMA channels, we poll bits 16:31 in
FH_TSSR_RX_STATUS_REG. From 4965 and up, only the bits 16:26 are legal.
Bits 27:31 are not used and are always unset.
Polling them will lead to fail on timeout but since the timeout is quite
small, the stall was not felt.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
4620fefa59d8aeae400b21d60d9a86aa11ebffa7 16-Jun-2010 Johannes Berg <johannes.berg@intel.com> iwlagn: use mutex for aggregation

Now that the ampdu_action callback can sleep,
we can use the mutex to properly protect the
aggregation data, and return useful errors if
they should happen.

Also, add some sleep and mutex debugging so
we won't call any of the functions that now
require being able to sleep and/or the mutex
to be held in an invalid context.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
abf52f86aa0a49a7377350cafa8f218c4cd227e7 17-Jun-2010 John W. Linville <linville@tuxdriver.com> Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6

Conflicts:
net/mac80211/mlme.c
b561e8274f75831ee87e4ea378cbb1f9f050a51a 02-Jun-2010 Shanyu Zhao <shanyu.zhao@intel.com> iwlagn: verify flow id in compressed BA packet

The flow id (scd_flow) in a compressed BA packet should match the txq_id
of the queue from which the aggregated packets were sent. However, in
some hardware like the 1000 series, sometimes the flow id is 0 for the
txq_id (10 to 19). This can cause the annoying message:
[ 2213.306191] iwlagn 0000:01:00.0: Received BA when not expected
[ 2213.310178] iwlagn 0000:01:00.0: Read index for DMA queue txq id (0),
index 5, is out of range [0-256] 7 7.

And even worse, if agg->wait_for_ba is true when the bad BA is arriving,
this can cause system hang due to NULL pointer dereference because the
code is operating in a wrong tx queue!

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Pradeep Kulkarni <pradeepx.kulkarni@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
6db6340c42d027b6364d49fa99d69019aca24de4 07-Jun-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: add missing rcu_read_lock

Using ieee80211_find_sta() needs to be under
RCU read lock, which iwlwifi currently misses,
so fix it.

Cc: stable@kernel.org
Reported-by: Miles Lane <miles.lane@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Tested-by: Miles Lane <miles.lane@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
02cd8dee6e10d6ab7161a3c6f36a60f8894fafdd 25-May-2010 Daniel Halperin <dhalperi@cs.washington.edu> iwlwifi: parse block ack responses correctly

Compressed BlockAck frames store the ACKs/NACKs in a 64-bit bitmap that starts
at the sequence number of the first frame sent in the aggregated batch. Note
that this is a selective ACKnowledgement following selective retransmission;
e.g., if frames 1,4-5 in a batch are ACKed then the next transmission will
include frames 2-3,6-10 (7 frames). In this latter case, the Compressed
BlockAck will not have all meaningful information in the low order bits -- the
semantically meaningful bits of the BA will be 0x1f3 (where the low-order frame
is seq 2).

The driver code originally just looked at the lower (in this case, 7) bits of
the BlockAck. In this case, the lower 7 bits of 0x1f3 => only 5 packets,
maximum, could ever be ACKed. In reality it should be looking at all of the
bits, filtered by those corresponding to packets that were actually sent. This
flaw meant that the number of correctly ACked packets could be significantly
underreported and might result in asynchronous state between TX and RX sides as
well as driver and uCode.

Fix this and also add a shortcut that doesn't require the code to loop through
all 64 bits of the bitmap but rather stops when no higher packets are ACKed.

In my experiments this fix greatly reduces throughput swing, making throughput
stable and high. It is also likely related to some of the stalls observed in
aggregation mode and maybe some of the buffer underruns observed, e.g.,

http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=1968
http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2098
http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2018

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
0e1654fa2b91324ab91019c7dfabf3518aca54dd 18-May-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: generic scan TX antenna forcing

In "iwlwifi: make scan antenna forcing more generic"
I introduced generic scan RX antenna forcing, which
here I rename to make it more evident. Also add scan
TX antenna forcing, since I will need that as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
ff0d91c3eea6e25b47258349b455671f98f1b0cd 17-May-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: reduce memory allocation

Currently, the driver allocates up to 19 skb pointers
for each TFD, of which we have 256 per queue. This
means that for each TX queue, we allocate 19k/38k
(an order 4 or 5 allocation on 32/64 bit respectively)
just for each queue's "txb" array, which contains only
the SKB pointers.

However, due to the way we use these pointers only the
first one can ever be assigned. When the driver was
initially written, the idea was that it could be
passed multiple SKBs for each TFD and attach all
those to implement gather DMA. However, due to
constraints in the userspace API and lack of TCP/IP
level checksumming in the device, this is in fact not
possible. And even if it were, the SKBs would be
chained, and we wouldn't need to keep pointers to
each anyway.

Change this to only keep track of one SKB per TFD,
and thereby reduce memory consumption to just one
pointer per TFD, which is an order 0 allocation per
transmit queue.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
2e724443f328cca90aa3b62d65852a5d7f5223f7 03-Jun-2010 FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> iwlwifi: use the DMA state API instead of the pci equivalents

This can be cleanly applied to wireless-2.6 and iwlwifi git trees.

=
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: [PATCH] iwlwifi: use the DMA state API instead of the pci equivalents

This replace the PCI DMA state API (include/linux/pci-dma.h) with the
DMA equivalents since the PCI DMA state API will be obsolete.

No functional change.

For further information about the background:

http://marc.info/?l=linux-netdev&m=127037540020276&w=2

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
095dfdb0c479661f437b24b85e31f0d0b841eab6 26-May-2010 Johannes Berg <johannes@sipsolutions.net> mac80211: remove tx status ampdu_ack_map

There's a single use of this struct member, but
as it is write-only it clearly not necessary.
Thus we can free up some space here, even if we
don't need it right now it seems pointless to
carry around the variable.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
9c5ac091b269912cd30fade987f4bc615ef3be90 05-May-2010 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: fix and add missing sta_lock usage

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

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

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
0af8bcae6f44aa440e51b1925635fb835cd68058 30-Apr-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: introduce iwl_sta_id_or_broadcast

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

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

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
619753ff57a2e15b58546b856536928d1a3daef9 30-Apr-2010 Johannes Berg <johannes.berg@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
2a87c26bbe9587baeb9e56d3ce0b4971bd777643 30-Apr-2010 Johannes Berg <johannes.berg@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
832f47e333c7d0db632b57e9f07956ae40dd481d 29-Apr-2010 Johannes Berg <johannes.berg@intel.com> 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>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
e3a3cd8789e1daf1b5af70d3252cab50cd3824c9 18-Apr-2010 Daniel Halperin <dhalperi@cs.washington.edu> iwlwifi: set AMPDU status variables correctly

The TX status code is currently abusing the ampdu_ack_map field (a bitmap) to
count the number of successfully received frames. The comments in mac80211.h
show there are actually three different, relevant variables, of which we are
currently using two, both incorrectly. Fix this by making

- ampdu_ack_len -> the number of ACKed frames (i.e. successes)
- ampdu_ack_map -> the bitmap
- ampdu_len -> the total number of frames sent (i.e., attempts)

to match the header file (and verified with ath9k's usage) and updating Intel's
RS code to match.

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
c2845d010b0e58a17cd2301e657b614962331550 15-Apr-2010 Shanyu Zhao <shanyu.zhao@intel.com> iwlwifi: set correct AC to swq_id for aggregation

When starting an aggregation session, the swq_id is generated in function
iwl_virtual_agg_queue_num() where the first parameter is supposed to be
the Access Class, but it used the tx fifo ID instead. This means the AC
value stored in swq_id is incorrect. To test this, look at the tx_queue
file in debugfs while transmitting Best Effort flow (ac=2), it shows:
hwq 10: read=0 write=0 stop=0 swq_id=0xa9 (ac 1/hwq 10)
After this fix, it will show:
hwq 10: read=0 write=0 stop=0 swq_id=0xaa (ac 2/hwq 10)

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
f4388adc92464397bb08a62c62c98b3b654bccc2 13-Apr-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: more code clean up for agn devices

Since multiple new devices having similar uCode architecture and use same
registers address, remove more reference to 5000 series to eliminate the
confusion.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
470058e0ad82fcfaaffd57307d8bf8c094e8e9d7 02-Apr-2010 Zhu Yi <yi.zhu@intel.com> iwlwifi: avoid Tx queue memory allocation in interface down

We used to free all the Tx queues memory when interface is brought
down and reallocate them again in interface up. This requires
order-4 allocation for txq->cmd[]. In situations like s2ram, this
usually leads to allocation failure in the memory subsystem. The
patch fixed this problem by allocating the Tx queues memory only at
the first time. Later iwl_down/iwl_up only initialize but don't
free and reallocate them. The memory is freed at the device removal
time. BTW, we have already done this for the Rx queue.

This fixed bug https://bugzilla.kernel.org/show_bug.cgi?id=15551

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
91dd6c27a29f97d81d2f71651d3b6bb55a4c1788 24-Mar-2010 Frans Pop <elendil@planet.nl> iwlwifi: remove trailing space in messages

Includes minor improvements in debugging messages in iwl-4965.c,
function iwl4965_is_temp_calib_needed().

Signed-off-by: Frans Pop <elendil@planet.nl>
Cc: Zhu Yi <yi.zhu@intel.com>
Cc: Reinette Chatre <reinette.chatre@intel.com>
Cc: Intel Linux Wireless <ilw@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
b744cb79aec7d95905943c0bc64699eb02de143b 23-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: code cleanup for generic defines

Some defines used by all agn devices, but the definitions were in
iwl-4965-hw.h, move those to iwl-agn-hw.h which is the better place for
those.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
8d801080dd8d28bf7d85cacba131f18b7653ee49 17-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: more clean up to move agn only rx functions from iwlcore to iwlagn

Move more functions only used by agn driver from iwlcore to iwlagn.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
74bcdb33e99f49ef5202dd2f8109945b4570edc2 17-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: move agn only tx functions from iwlcore to iwlagn

Identify the tx functions only used by agn driver and move those from
iwlcore to iwlagn.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
19e6cda094002e9756a3d181cbb4c31ef2a9b6bb 17-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: move hw related defines to separate file

Multiple iwlagn based devices shared the same hw definitions.
Move device hardware related defines from iwl-5000-hw.h to iwl-agn-hw.h
file.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
b305a08058f794c8a99c5ee87827b92d6b8c24ae 17-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: move tx queue related code to separate file

Multiple iwlagn based devices shared the same tansmit queue functions.
Move tx queue related code from iwl-5000.c to iwl-agn-tx.c file.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
/drivers/net/wireless/iwlwifi/iwl-agn-tx.c