pandora-kernel.git
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Tue, 11 May 2010 18:24:55 +0000 (14:24 -0400)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-next-2.6 into for-davem

Conflicts:
drivers/net/wireless/ath/ar9170/main.c

13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
David S. Miller [Tue, 11 May 2010 06:03:26 +0000 (23:03 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/kaber/nf-next-2.6

13 years agowireless: depends on NET
Randy Dunlap [Mon, 10 May 2010 16:24:29 +0000 (09:24 -0700)]
wireless: depends on NET

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

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

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

s/X/x

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

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

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

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

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

Preparation to fix rt2800 beaconing.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

From the original report:

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

Reported-by: Tiziano Müller <tm@dev-zero.ch>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonetfilter: use rcu_dereference_protected()
Patrick McHardy [Mon, 10 May 2010 16:47:57 +0000 (18:47 +0200)]
netfilter: use rcu_dereference_protected()

Restore the rcu_dereference() calls in conntrack/expectation notifier
and logger registration/unregistration, but use the _protected variant,
which will be required by the upcoming __rcu annotations.

Based on patch by Eric Dumazet <eric.dumazet@gmail.com>

Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agoMerge branch 'master' of /repos/git/net-next-2.6
Patrick McHardy [Mon, 10 May 2010 16:39:28 +0000 (18:39 +0200)]
Merge branch 'master' of /repos/git/net-next-2.6

Conflicts:
net/bridge/br_device.c
net/bridge/br_forward.c

Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonetfilter: nf_conntrack_proto: fix warning with CONFIG_PROVE_RCU
Patrick McHardy [Mon, 10 May 2010 15:45:56 +0000 (17:45 +0200)]
netfilter: nf_conntrack_proto: fix warning with CONFIG_PROVE_RCU

===================================================
[ INFO: suspicious rcu_dereference_check() usage. ]
---------------------------------------------------
include/net/netfilter/nf_conntrack_l3proto.h:92 invoked rcu_dereference_check()
without protection!

other info that might help us debug this:

rcu_scheduler_active = 1, debug_locks = 0
2 locks held by iptables/3197:
 #0:  (sk_lock-AF_INET){+.+.+.}, at: [<ffffffff8149bd8c>]
ip_setsockopt+0x7c/0xa0
 #1:  (&xt[i].mutex){+.+.+.}, at: [<ffffffff8148a5fe>]
xt_find_table_lock+0x3e/0x110

stack backtrace:
Pid: 3197, comm: iptables Not tainted 2.6.34-rc4 #2
Call Trace:
 [<ffffffff8105e2e8>] lockdep_rcu_dereference+0xb8/0xc0
 [<ffffffff8147fb3b>] nf_ct_l3proto_module_put+0x6b/0x70
 [<ffffffff8148d891>] state_mt_destroy+0x11/0x20
 [<ffffffff814d3baf>] cleanup_match+0x2f/0x50
 [<ffffffff814d3c63>] cleanup_entry+0x33/0x90
 [<ffffffff814d5653>] ? __do_replace+0x1a3/0x210
 [<ffffffff814d564c>] __do_replace+0x19c/0x210
 [<ffffffff814d651a>] do_ipt_set_ctl+0x16a/0x1b0
 [<ffffffff8147a610>] nf_sockopt+0x60/0xa0
...

The __nf_ct_l3proto_find() call doesn't actually need rcu read side
protection since the caller holds a reference to the protocol. Use
rcu_read_lock() anyways to avoid the warning.

Kernel bugzilla #15781: https://bugzilla.kernel.org/show_bug.cgi?id=15781

Reported-by: Christian Casteyde <casteyde.christian@free.fr>
Signed-off-by: Patrick McHardy <kaber@trash.net>
13 years agonet: trans_start cleanups
Eric Dumazet [Mon, 10 May 2010 12:01:31 +0000 (05:01 -0700)]
net: trans_start cleanups

Now that core network takes care of trans_start updates, dont do it
in drivers themselves, if possible. Drivers can avoid one cache miss
(on dev->trans_start) in their start_xmit() handler.

Exceptions are NETIF_F_LLTX drivers

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agoBluetooth: Fix issues where sk_sleep() helper is needed now
Marcel Holtmann [Mon, 10 May 2010 09:33:10 +0000 (11:33 +0200)]
Bluetooth: Fix issues where sk_sleep() helper is needed now

There were some left-overs that used sk->sk_sleep instead of the new
sk_sleep() helper.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Use strict_strtoul instead of simple_strtoul
Tomas Winkler [Tue, 9 Mar 2010 19:38:03 +0000 (21:38 +0200)]
Bluetooth: Use strict_strtoul instead of simple_strtoul

Use strict_strtoul as suggested by checkpatch.pl for more strict input
checking.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Set hdev->dev_type based on Marvell device type
Bing Zhao [Wed, 3 Mar 2010 22:37:37 +0000 (14:37 -0800)]
Bluetooth: Set hdev->dev_type based on Marvell device type

Get the device type from MODULE_BRINGUP_REQ command response.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Separate btmrvl_register_hdev() from btmrvl_add_card()
Bing Zhao [Wed, 3 Mar 2010 22:37:36 +0000 (14:37 -0800)]
Bluetooth: Separate btmrvl_register_hdev() from btmrvl_add_card()

Move btmrvl hdev registration code out of btmrvl_add_card().
New function btmrvl_register_hdev() is added.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Decode btmrvl MODULE_BRINGUP_REG response correctly
Bing Zhao [Wed, 3 Mar 2010 22:37:35 +0000 (14:37 -0800)]
Bluetooth: Decode btmrvl MODULE_BRINGUP_REG response correctly

The MODULE_BRINGUP_REQ command response returns success with
either 0x00 or 0x0c.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Fix storing negative values as unsigned char
Dan Carpenter [Mon, 8 Mar 2010 12:15:59 +0000 (15:15 +0300)]
Bluetooth: Fix storing negative values as unsigned char

This is mostly cleanup. There is only one caller and it just checks for
non-zero return values. Still "ret" should be int because we want to return
-EINVAL on errors.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Create per controller workqueue
Marcel Holtmann [Sat, 20 Mar 2010 14:20:04 +0000 (15:20 +0100)]
Bluetooth: Create per controller workqueue

Instead of having a global workqueue for all controllers, it makes
more sense to have a workqueue per controller.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Fix spec error in the RemoteBusy Logic
Gustavo F. Padovan [Wed, 5 May 2010 02:16:01 +0000 (23:16 -0300)]
Bluetooth: Fix spec error in the RemoteBusy Logic

On the receipt of an RR(P=1) under RemoteBusy set to TRUE(on the RECV
state table) we have to call sendIorRRorRNR(F=1) and just after set
RemoteBusy to False. This leads to a freeze in the sending process since
it's not allowed send data with RemoteBusy set to true and no one
call SendPending-I-Frames after set RemoteBusy to false(The last action
for that event).

Actually sendIorRRorRNR() calls SendPending-I-Frames but at that moment
RemoteBusy is still True and we cannot send any frame, after, no one
calls SendPending-I-Frames again and the sending process stops.

The solution here is to set RemoteBusy to false inside
SendPending-I-Frames just before call SendPending-I-Frames. That will
make SendPending-I-Frames able to send frames. This solution is similar
to what RR(P=0)(F=0) on the RECV table and RR(P=1) on the SREJ_SENT
table do.

Actually doesn't make any sense call SendPending-I-Frames if we can send
any frame, i. e., RemoteBusy is True.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Prevents buffer overflow on l2cap_ertm_reassembly_sdu()
Gustavo F. Padovan [Sat, 1 May 2010 19:15:45 +0000 (16:15 -0300)]
Bluetooth: Prevents buffer overflow on l2cap_ertm_reassembly_sdu()

The checks should be done before the the memcpy to avoid buffer
overflow.

Reported-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Fix race condition on l2cap_ertm_send()
Gustavo F. Padovan [Sat, 1 May 2010 19:15:45 +0000 (16:15 -0300)]
Bluetooth: Fix race condition on l2cap_ertm_send()

l2cap_ertm_send() can be called both from user context and bottom half
context. The socket locks for that contexts are different, the user
context uses a mutex(which can sleep) and the second one uses a
spinlock_bh. That creates a race condition when we have interruptions on
both contexts at the same time.

The better way to solve this is to add a new spinlock to lock
l2cap_ertm_send() and the vars it access. The other solution was to defer
l2cap_ertm_send() with a workqueue, but we the sending process already
has one defer on the hci layer. It's not a good idea add another one.

The patch refactor the code to create l2cap_retransmit_frames(), then we
encapulate the lock of l2cap_ertm_send() for some call. It also changes
l2cap_retransmit_frame() to l2cap_retransmit_one_frame() to avoid
confusion

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Add wait_queue to wait ack of all sent packets
Gustavo F. Padovan [Sat, 1 May 2010 19:15:44 +0000 (16:15 -0300)]
Bluetooth: Add wait_queue to wait ack of all sent packets

To guarantee that all packets we sent were received we need to wait for
theirs ack before shutdown the socket.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Implement Local Busy Condition handling
Gustavo F. Padovan [Sat, 1 May 2010 19:15:44 +0000 (16:15 -0300)]
Bluetooth: Implement Local Busy Condition handling

Supports Local Busy condition handling through a waitqueue that wake ups
each 200ms and try to push the packets to the upper layer. If it can
push all the queue then it leaves the Local Busy state.

The patch modifies the behaviour of l2cap_ertm_reassembly_sdu() to
support retry of the push operation.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Completes the I-frame tx_seq check logic on RECV
João Paulo Rechi Vita [Sat, 1 May 2010 19:15:44 +0000 (16:15 -0300)]
Bluetooth: Completes the I-frame tx_seq check logic on RECV

Add checks for invalid tx_seq and fixes the duplicated tx_seq check.

Signed-off-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Acked-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Implement missing parts of the Invalid Frame Detection
Gustavo F. Padovan [Sat, 1 May 2010 19:15:44 +0000 (16:15 -0300)]
Bluetooth: Implement missing parts of the Invalid Frame Detection

There is a plenty of situation where ERTM shall close the channel, this
commit treats the cases regarding Invalid Frame Detection.
It create one reassembly SDU function for ERTM and other for Streaming
Mode to make the Invalid Frame Detection handling less complex.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Refactor l2cap_retransmit_frame()
Gustavo F. Padovan [Sat, 1 May 2010 19:15:44 +0000 (16:15 -0300)]
Bluetooth: Refactor l2cap_retransmit_frame()

Make the code flow cleaner and changes the function to void.
It also fixes a potential NULL dereference with skb.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Make hci_send_acl() void
Gustavo F. Padovan [Sat, 1 May 2010 19:15:43 +0000 (16:15 -0300)]
Bluetooth: Make hci_send_acl() void

hci_send_acl can't fail, so we can make it void. This patch changes
that and all the funcions that use hci_send_acl().
That change exposed a bug on sending connectionless data. We were not
reporting the lenght send back to the user space.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Fix lockdep annotation on ERTM
Gustavo F. Padovan [Thu, 6 May 2010 01:09:15 +0000 (22:09 -0300)]
Bluetooth: Fix lockdep annotation on ERTM

A spin_lock_init() call was missing. :)

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Check if we really are in WAIT_F when F bit comes
Gustavo F. Padovan [Wed, 5 May 2010 23:05:57 +0000 (20:05 -0300)]
Bluetooth: Check if we really are in WAIT_F when F bit comes

F-bit set should be processed only if we are in the WAIT_F state.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Remove unneeded control vars
Gustavo F. Padovan [Wed, 5 May 2010 22:58:27 +0000 (19:58 -0300)]
Bluetooth: Remove unneeded control vars

Trivial clean up.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Remove set of SrejSaveReqSeq under receipt of REJ frame
Gustavo F. Padovan [Wed, 5 May 2010 23:56:43 +0000 (20:56 -0300)]
Bluetooth: Remove set of SrejSaveReqSeq under receipt of REJ frame

That action is not specified by the ERTM spec, so removing it.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Fix errors reported by checkpatch.pl
Gustavo F. Padovan [Sat, 1 May 2010 19:15:43 +0000 (16:15 -0300)]
Bluetooth: Fix errors reported by checkpatch.pl

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Don't set control bits to zero first
Gustavo F. Padovan [Sat, 1 May 2010 19:15:43 +0000 (16:15 -0300)]
Bluetooth: Don't set control bits to zero first

We can set the SAR bits in the control field directly.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Close L2CAP channel on invalid ReqSeq
João Paulo Rechi Vita [Sat, 1 May 2010 19:15:43 +0000 (16:15 -0300)]
Bluetooth: Close L2CAP channel on invalid ReqSeq

Signed-off-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Acked-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Fix SDU reassembly under SREJ
Gustavo F. Padovan [Sat, 1 May 2010 19:15:43 +0000 (16:15 -0300)]
Bluetooth: Fix SDU reassembly under SREJ

The code was reusing the control var without its reinitialization.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Check if mode is supported on getsockopt
João Paulo Rechi Vita [Sat, 1 May 2010 19:15:42 +0000 (16:15 -0300)]
Bluetooth: Check if mode is supported on getsockopt

Add this check to getsockopt makes possible to fail early instead of
waiting until listen / connect.

Signed-off-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Acked-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Add SOCK_STREAM support to L2CAP
Gustavo F. Padovan [Sat, 1 May 2010 19:15:42 +0000 (16:15 -0300)]
Bluetooth: Add SOCK_STREAM support to L2CAP

if enable_ertm is true and we have SOCK_STREAM the default mode will be
ERTM, otherwise Basic Mode.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Add Kconfig option for L2CAP Extended Features
Gustavo F. Padovan [Sat, 1 May 2010 19:15:42 +0000 (16:15 -0300)]
Bluetooth: Add Kconfig option for L2CAP Extended Features

The L2CAP Extended Features are still unstable and under development,
so we are adding them under the EXPERIMENTAL flag to get more feedback
on them. L2CAP Extended Features includes the Enhanced Retransmission
and Streaming Modes, Frame Check Sequence (FCS), and Segmentation and
Reassemby (SAR).

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Optimize SREJ_QUEUE append
Gustavo F. Padovan [Sat, 1 May 2010 19:15:42 +0000 (16:15 -0300)]
Bluetooth: Optimize SREJ_QUEUE append

When the I-frame received is the expected, i.e., its tx_seq is equal to
expected_tx_seq and we are under a SREJ, we can just add it to the tail
of the list. Doing that we change the complexity from O(n) to O(1).

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Fix drop of acked packets on ERTM
Gustavo F. Padovan [Sat, 1 May 2010 19:15:42 +0000 (16:15 -0300)]
Bluetooth: Fix drop of acked packets on ERTM

l2cap_drop_acked_frames() was droping not sent packets, causing them to
be not transmitted.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Fix crash when monitor timeout expires
Gustavo F. Padovan [Sat, 1 May 2010 19:15:41 +0000 (16:15 -0300)]
Bluetooth: Fix crash when monitor timeout expires

The code was crashing due to a invalid access to hci_conn after the
channel disconnect.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Fix bug when retransmitting I-frames
Gustavo F. Padovan [Sat, 1 May 2010 19:15:41 +0000 (16:15 -0300)]
Bluetooth: Fix bug when retransmitting I-frames

If there is no frames to retransmit l2cap was crashing the kernel, now
we check if the queue is empty first.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Enable option to configure Max Transmission value via sockopt
Gustavo F. Padovan [Sat, 1 May 2010 19:15:41 +0000 (16:15 -0300)]
Bluetooth: Enable option to configure Max Transmission value via sockopt

With the sockopt extension we can set a per-channel MaxTx value.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Add module parameter for txWindow size on L2CAP
Gustavo F. Padovan [Sat, 1 May 2010 19:15:41 +0000 (16:15 -0300)]
Bluetooth: Add module parameter for txWindow size on L2CAP

Very useful for testing purposes.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
[jprvita@profusion.mobi: improved parameter description]
Signed-off-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Change acknowledgement to use the value of txWindow
Gustavo F. Padovan [Sat, 1 May 2010 19:15:41 +0000 (16:15 -0300)]
Bluetooth: Change acknowledgement to use the value of txWindow

Now that we can set the txWindow we need to change the acknowledgement
procedure to ack after each (pi->txWindow/6 + 1). The plus 1 is to avoid
the zero value.
It also renames pi->num_to_ack to a better name: pi->num_acked.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Add sockopt configuration for txWindow on L2CAP
Gustavo F. Padovan [Sat, 1 May 2010 19:15:40 +0000 (16:15 -0300)]
Bluetooth: Add sockopt configuration for txWindow on L2CAP

Now we can set/get Transmission Window size via sockopt.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Send Ack after clear the SREJ list
Gustavo F. Padovan [Sat, 1 May 2010 19:15:40 +0000 (16:15 -0300)]
Bluetooth: Send Ack after clear the SREJ list

As specified by Bluetooth 3.0 spec we shall send an acknowledgment using
the Send-Ack() after clear the SREJ list.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Check the SDU size against the MTU value
Gustavo F. Padovan [Sat, 1 May 2010 19:15:40 +0000 (16:15 -0300)]
Bluetooth: Check the SDU size against the MTU value

If the SDU size is greater than the MTU something is wrong, so report
an error.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
[jprvita@profusion.mobi: set err to appropriate errno value]
Signed-off-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Add le16 macro to Retransmission and Monitor Timeouts values
Gustavo F. Padovan [Sat, 1 May 2010 19:15:40 +0000 (16:15 -0300)]
Bluetooth: Add le16 macro to Retransmission and Monitor Timeouts values

Fix a possible problem with Big Endian machines.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Fix configuration of the MPS value
Gustavo F. Padovan [Sat, 1 May 2010 19:15:40 +0000 (16:15 -0300)]
Bluetooth: Fix configuration of the MPS value

We were accepting values bigger than we can accept. This was leading
ERTM to drop packets because of wrong FCS checks.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Read RFC conf option on a successful Conf RSP
Gustavo F. Padovan [Sat, 1 May 2010 19:15:39 +0000 (16:15 -0300)]
Bluetooth: Read RFC conf option on a successful Conf RSP

On Enhanced Retransmission Mode and Streaming Mode a entity can send, on
a successful Conf RSP, new values for the RFC fields. For example, the
entity can send txWindow and MPS values less than the value received on
a Conf REQ.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Ignore Tx Window value with Streaming mode
Gustavo F. Padovan [Sat, 1 May 2010 19:15:39 +0000 (16:15 -0300)]
Bluetooth: Ignore Tx Window value with Streaming mode

Tx Window value shall not be used with Streaming Mode and the receiver
of the config Request shall ignore its value.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Add timer to Acknowledge I-frames
Gustavo F. Padovan [Sat, 1 May 2010 19:15:39 +0000 (16:15 -0300)]
Bluetooth: Add timer to Acknowledge I-frames

We ack I-frames on each txWindow/5 I-frames received, but if the sender
stop to send I-frames and it's not a txWindow multiple we can leave some
frames unacked.
So I added a timer to ack I-frames on this case. The timer expires in
200ms.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Finish implementation for Rec RR (P=1) on ERTM
Gustavo F. Padovan [Sat, 1 May 2010 19:15:39 +0000 (16:15 -0300)]
Bluetooth: Finish implementation for Rec RR (P=1) on ERTM

Now the code handles the case under SREJ_SENT state.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Remove duplicate use of __get_reqseq() macro on L2CAP
Gustavo F. Padovan [Sat, 1 May 2010 19:15:38 +0000 (16:15 -0300)]
Bluetooth: Remove duplicate use of __get_reqseq() macro on L2CAP

tx_seq var already has the value of __get_reqseq().

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Group the ack of I-frames into l2cap_data_channel_rrframe()
Gustavo F. Padovan [Sat, 1 May 2010 19:15:38 +0000 (16:15 -0300)]
Bluetooth: Group the ack of I-frames into l2cap_data_channel_rrframe()

It also fix a bug: we weren't acknowledging I-frames when P=1.
Note that when F=1 we are acknowledging packets before setting
RemoteBusy to False. The spec says we should do that in the opposite
order, but acknowledment of packets doesn't care about RemoteBusy flag
so we can do that in the order we want.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Handle all cases of receipt of RNR-frames into L2CAP
Gustavo F. Padovan [Sat, 1 May 2010 19:15:38 +0000 (16:15 -0300)]
Bluetooth: Handle all cases of receipt of RNR-frames into L2CAP

We weren't handling the receipt under SREJ_SENT state table.
It also introduce l2cap_send_srejtail(). It will be used in the nexts
commits too.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Split l2cap_data_channel_sframe()
Gustavo F. Padovan [Sat, 1 May 2010 19:15:38 +0000 (16:15 -0300)]
Bluetooth: Split l2cap_data_channel_sframe()

Create a function for each type fo S-frame and avoid a lot of nested
code.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Add Recv RR (P=0)(F=0) for SREJ_SENT state on ERTM
Gustavo F. Padovan [Sat, 1 May 2010 19:15:38 +0000 (16:15 -0300)]
Bluetooth: Add Recv RR (P=0)(F=0) for SREJ_SENT state on ERTM

This finishes the implementation of Recv RR (P=0)(F=0) for the Enhanced
Retransmission Mode on L2CAP.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Move set of P-bit to l2cap_send_sframe()
Gustavo F. Padovan [Sat, 1 May 2010 19:15:37 +0000 (16:15 -0300)]
Bluetooth: Move set of P-bit to l2cap_send_sframe()

Abstract the send of of P-bit and avoids code duplication like we
did with the setting of F-bit.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Implement SendAck() Action on ERTM.
Gustavo F. Padovan [Sat, 1 May 2010 19:15:37 +0000 (16:15 -0300)]
Bluetooth: Implement SendAck() Action on ERTM.

Shall be used to ack received frames, It must decide type of
acknowledgment between a RR frame, a RNR frame or transmission of
pending I-frames.
It also modifies l2cap_ertm_send() to report the number of frames sent.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Check if SDU size is greater than MTU on L2CAP
Gustavo F. Padovan [Sat, 1 May 2010 19:15:37 +0000 (16:15 -0300)]
Bluetooth: Check if SDU size is greater than MTU on L2CAP

After reassembly the SDU we need to check his size. It can't overflow
the MTU size.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Check the minimum {I,S}-frame size into L2CAP
Gustavo F. Padovan [Sat, 1 May 2010 19:15:37 +0000 (16:15 -0300)]
Bluetooth: Check the minimum {I,S}-frame size into L2CAP

All packets with size fewer than the minimum specified is dropped.
Note that the size of the l2cap basic header, FCS and SAR fields are
already subtracted of len at the moment of the size check.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Support case with F bit set under WAIT_F state.
Gustavo F. Padovan [Sat, 1 May 2010 19:15:37 +0000 (16:15 -0300)]
Bluetooth: Support case with F bit set under WAIT_F state.

On receipt of a F=1 under WAIT_F state ERTM shall stop monitor timer and
start retransmission timer (if there are unacked frames).

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Implement 'Send IorRRorRNR' event
Gustavo F. Padovan [Sat, 1 May 2010 19:15:36 +0000 (16:15 -0300)]
Bluetooth: Implement 'Send IorRRorRNR' event

After receive a RR with P bit set ERTM shall use this funcion to choose
what type of frame to reply with F bit = 1.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Use a l2cap_pinfo struct instead l2cap_pi() macro
Gustavo F. Padovan [Sat, 1 May 2010 19:15:36 +0000 (16:15 -0300)]
Bluetooth: Use a l2cap_pinfo struct instead l2cap_pi() macro

Trivial clean up.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Fix ACL MTU issue
Gustavo F. Padovan [Sat, 1 May 2010 19:15:36 +0000 (16:15 -0300)]
Bluetooth: Fix ACL MTU issue

ERTM and Streaming Modes was having problems when the ACL MTU is lower
than MPS. The 'minus 10' is to take in account the header and fcs
lenghts.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Fix expected_tx_seq calculation on L2CAP
Gustavo F. Padovan [Sat, 1 May 2010 19:15:36 +0000 (16:15 -0300)]
Bluetooth: Fix expected_tx_seq calculation on L2CAP

All operation related to the txWindow should be modulo 64.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Fix memory leak of S-frames into L2CAP
Gustavo F. Padovan [Sat, 1 May 2010 19:15:35 +0000 (16:15 -0300)]
Bluetooth: Fix memory leak of S-frames into L2CAP

l2cap_data_channel do not free the S-frame, so we free it here.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Move specific Basic Mode code to the right place
Gustavo F. Padovan [Sat, 1 May 2010 19:15:35 +0000 (16:15 -0300)]
Bluetooth: Move specific Basic Mode code to the right place

Inside "case L2CAP_MODE_BASIC:" we don't need to check for sk_type and
L2CAP mode. So only the length check is fine.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Trivial clean ups to SCO
Gustavo F. Padovan [Sat, 1 May 2010 19:15:35 +0000 (16:15 -0300)]
Bluetooth: Trivial clean ups to SCO

Remove extra braces and labels, break over column 80 lines, etc

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Make hci_send_sco() void
Gustavo F. Padovan [Sat, 1 May 2010 19:15:35 +0000 (16:15 -0300)]
Bluetooth: Make hci_send_sco() void

It also removes an unneeded check for the MTU. The check is done before
on sco_send_frame()

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Reviewed-by: João Paulo Rechi Vita <jprvita@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Fix wrong packet type count increment
Gustavo F. Padovan [Sat, 1 May 2010 19:15:34 +0000 (16:15 -0300)]
Bluetooth: Fix wrong packet type count increment

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Use the proper function cast to get hdr data
Gustavo F. Padovan [Sat, 1 May 2010 19:15:34 +0000 (16:15 -0300)]
Bluetooth: Use the proper function cast to get hdr data

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoBluetooth: Fix return value when bt_skb_alloc fails
Gustavo F. Padovan [Sat, 1 May 2010 19:15:34 +0000 (16:15 -0300)]
Bluetooth: Fix return value when bt_skb_alloc fails

Set the proper error(ENOMEM), instead of just return 0.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
13 years agoipv4: remove ip_rt_secret timer (v4)
Neil Horman [Sat, 8 May 2010 08:57:52 +0000 (01:57 -0700)]
ipv4: remove ip_rt_secret timer (v4)

A while back there was a discussion regarding the rt_secret_interval timer.
Given that we've had the ability to do emergency route cache rebuilds for awhile
now, based on a statistical analysis of the various hash chain lengths in the
cache, the use of the flush timer is somewhat redundant.  This patch removes the
rt_secret_interval sysctl, allowing us to rely solely on the statistical
analysis mechanism to determine the need for route cache flushes.

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 years agort2x00: rt2800: use correct txop value in tx descriptor
Helmut Schaa [Fri, 7 May 2010 09:03:08 +0000 (11:03 +0200)]
rt2x00: rt2800: use correct txop value in tx descriptor

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

initvals -w -f ar9003 > ar9003_initvals.h

The respective checksums are:

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

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

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

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

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

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

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

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

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

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

Signed-off-by: John W. Linville <linville@tuxdriver.com>