Commit graph

276745 commits

Author SHA1 Message Date
Gustavo F. Padovan 03a0019481 Bluetooth: invert locking order in connect path
This move some checking code that was in l2cap_sock_connect() to
l2cap_chan_connect(). Thus we can invert the lock calls, i.e., call
lock_sock() before hci_dev_lock() to avoid a deadlock scenario.

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-18 17:07:57 -02:00
Gustavo F. Padovan f878fcad17 Bluetooth: convert info timer to delayed_work
Another step of remove interrupt context from Bluetooth Core.
Use the system workqueue.

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-18 17:07:57 -02:00
Gustavo F. Padovan 3eff45eaf8 Bluetooth: convert tx_task to workqueue
This should simplify Bluetooth core processing a lot.

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-18 17:07:57 -02:00
Gustavo F. Padovan c347b765fe Bluetooth: Move command task to workqueue
As part of the moving on all the Bluetooth processing to Process context.

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-18 17:07:57 -02:00
Gustavo F. Padovan 3c54711c4f Bluetooth: Don't disable tasklets to call hdev->notify()
It's pointless, we aren't protecting anything since btusb_notify()
schedules a work to run, then all it operation happens without protection.
If protection is really needed here, we will fix it further.

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-18 17:07:57 -02:00
Gustavo F. Padovan bf4c632524 Bluetooth: convert conn hash to RCU
Handling hci_conn_hash with RCU make us avoid some locking and disable
tasklets.

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-18 17:07:56 -02:00
Gustavo F. Padovan 8192edef03 Bluetooth: Use RCU to manipulate chan_list
Instead of using tasklet_disable() to prevent acess to the channel use, we
can use RCU and improve the performance of our code.

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-18 17:07:56 -02:00
Gustavo F. Padovan d01b2ff4e6 Bluetooth: convert chan_lock to mutex
spin lock doesn't fit ok anymore on the new code based on workqueues.

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-18 17:07:56 -02:00
Gustavo F. Padovan 67d0dfb5ec Bluetooth: move hci_task_lock to mutex
Now we can sleep in any path inside Bluetooth core, so mutex can make
sense here.

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-18 17:07:56 -02:00
Gustavo F. Padovan eb403a1b7e Bluetooth: Remove sk_backlog usage from L2CAP
We run everything in the same lock now. The backlog queue is useless now

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-18 17:07:55 -02:00
Gustavo F. Padovan aa2ac881ba Bluetooth: Don't use spin_lock socket lock anymore
We now run everything in process context, so the mutex lock is the best
option. But in some places we still need the bh_lock_sock()

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-18 17:07:55 -02:00
Gustavo F. Padovan 721c41812d Bluetooth: Move L2CAP timers to workqueue
L2CAP timers also need to run in process context. As the works in l2cap
are small we are using the system worqueue.

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-18 17:07:55 -02:00
Gustavo F. Padovan b9cc553f12 Bluetooth: hci_conn_auto_accept() doesn't need locking
It doesn't really touch any sensitive information about hdev. So no need
to lock here.

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-18 17:07:55 -02:00
Gustavo F. Padovan db323f2fff Bluetooth: Use delayed work for advertisiment cache timeout
As HCI rx path is now done in process context it makes sense to do all the
timer in process context as well.

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-18 17:07:55 -02:00
Gustavo F. Padovan 19c40e3bca Bluetooth: Use delayed_work for connection timeout
Bluetooth rx task runs now in a workqueue, so it a good approach run any
timer that share locking with process context code also in a workqueue.

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-18 17:07:54 -02:00
Gustavo F. Padovan 09fd0de5bd Bluetooth: Replace spin_lock by mutex in hci_dev
Now we run everything in HCI in process context, so it's a better idea use
mutex instead spin_lock. The macro remains hci_dev_lock() (and I got rid
of hci_dev_lock_bh()), of course.

Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-18 17:07:54 -02:00
Marcel Holtmann b78752cc71 Bluetooth: Process recv path in a workqueue instead of a tasklet
Run recv process in workqueue helps a lot with our processing as the recv
path will also be in the process context, i.e., now all our tx and rx are
in process context.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-18 17:07:54 -02:00
Gustavo F. Padovan 416dc94baa Bluetooth: make hci_conn_enter_sniff_mode static
It isn't used outside hci_conn.c

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-16 20:51:55 -02:00
John W. Linville 9b682c786f b43: mark some vars __maybe_unused in b43_nphy_pmu_spur_avoid
Avoids this warning when CONFIG_B43_BCMA is not set:

  CC [M]  drivers/net/wireless/b43/phy_n.o
drivers/net/wireless/b43/phy_n.c: In function ‘b43_nphy_pmu_spur_avoid’:
drivers/net/wireless/b43/phy_n.c:4052:6: warning: unused variable ‘pmu_ctl’
drivers/net/wireless/b43/phy_n.c:4051:22: warning: unused variable ‘cc’

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-16 16:29:17 -05:00
Gustavo F. Padovan 3e9c40a6f7 Bluetooth: Use list_for_each_entry in hci_conn_hash_flush()
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-16 18:16:15 -02:00
Gustavo F. Padovan f9c3123b5a Bluetooth: Use chan instead of l2cap_pi macro
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-16 18:16:14 -02:00
Gustavo F. Padovan dc8ed672ca Bluetooth: Initialize LE connection count
le_num needs to be set to zero.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-16 18:16:14 -02:00
Gustavo F. Padovan 01e2821fbe Bluetooth: remove lock from struct conn_hash
It isn't used anywhere.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-16 18:16:14 -02:00
Gustavo F. Padovan 2c33c06a8f Bluetooth: remove struct hci_chan_hash
Only the list member of the struct was used, so we now fold it into
hci_conn.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
2011-12-16 18:16:14 -02:00
Kalle Valo 7e95e365d5 Merge remote branch 'wireless-next/master' into ath6kl-next
Conflicts:
	drivers/net/wireless/ath/ath6kl/init.c
2011-12-16 21:10:39 +02:00
Johannes Berg 69b172f796 iwlagn: remove iwlagn_build_addsta_hcmd
This function is not needed:
 * we already have the "cmd" input to it in the
   same type (and on the stack elsewhere)
 * the "legacy_reserved" parameter is never set,
   so will always be zero

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-12-16 07:22:16 -08:00
Chun-Yeow Yeoh 5bd5e9a6ae ath9k: Support RSN Mesh
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-16 09:30:43 -05:00