summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Bluetooth: Initial support for retransmission of packets with REJ framesGustavo F. Padovan2009-08-222-14/+44
| | | | | | | | | | | | When receiving an I-frame with unexpected txSeq, receiver side start the recovery procedure by sending a REJ S-frame to the transmitter side. So the transmitter can re-send the lost I-frame. This patch just adds a basic support for retransmission, it doesn't mean that ERTM now has full support for packet retransmission. Signed-off-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add support for Segmentation and Reassembly of SDUsGustavo F. Padovan2009-08-222-17/+162
| | | | | | | | | | | | | | ERTM should use Segmentation and Reassembly to break down a SDU in many PDUs on sending data to the other side. On sending packets we queue all 'segments' until end of segmentation and just the add them to the queue for sending. On receiving we create a new SKB with the SDU reassembled. Initially based on a patch from Nathan Holstein <nathan@lampreynetworks.com> Signed-off-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add initial support for ERTM packets transfersGustavo F. Padovan2009-08-223-51/+390
| | | | | | | | | | | | | | This patch adds support for ERTM transfers, without retransmission, with txWindow up to 63 and with acknowledgement of packets received. Now the packets are queued before call l2cap_do_send(), so packets couldn't be sent at the time we call l2cap_sock_sendmsg(). They will be sent in an asynchronous way on later calls of l2cap_ertm_send(). Besides if an error occurs on calling l2cap_do_send() we disconnect the channel. Initially based on a patch from Nathan Holstein <nathan@lampreynetworks.com> Signed-off-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Create separate l2cap_send_disconn_req() functionGustavo F. Padovan2009-08-221-30/+16
| | | | | | | | The code for sending a disconnect request was repeated several times within L2CAP source code. So move this into its own function. Signed-off-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add configuration support for ERTM and Streaming modeGustavo F. Padovan2009-08-222-35/+255
| | | | | | | | | | | Add support to config_req and config_rsp to configure ERTM and Streaming mode. If the remote device specifies ERTM or Streaming mode, then the same mode is proposed. Otherwise ERTM or Basic mode is used. And in case of a state 2 device, the remote device should propose the same mode. If not, then the channel gets disconnected. Signed-off-by: Gustavo F. Padovan <gustavo@las.ic.unicamp.br> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add L2CAP RFC option if ERTM is enabledMarcel Holtmann2009-08-221-3/+20
| | | | | | | When trying to establish a connection with Enhanced Retransmission mode enabled, the RFC option needs to be added to the configuration. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Allow setting of L2CAP ERTM via socket optionMarcel Holtmann2009-08-222-7/+38
| | | | | | | | | To enable Enhanced Retransmission mode it needs to be set via a socket option. A different mode can be set on a socket, but on listen() and connect() the mode is checked and ERTM is only allowed if it is enabled via the module parameter. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add module option to enable L2CAP ERTM supportMarcel Holtmann2009-08-221-2/+10
| | | | | | | | Since the Enhanced Retransmission mode for L2CAP is still under heavy development disable it by default and provide a module option to enable it manually for testing. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Coding style cleanup from previous rfcomm_init bug fixMarcel Holtmann2009-08-221-13/+15
| | | | | | | | The rfcomm_init bug fix went into the kernel premature before it got fully reviewed and acknowledged by the Bluetooth maintainer. So fix up the coding style now. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Convert hdev->req_lock to a mutexThomas Gleixner2009-08-222-4/+4
| | | | | | | hdev->req_lock is used as mutex so make it a mutex. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add missing kmalloc NULL tests to Marvell driverJulia Lawall2009-08-221-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check that the result of kmalloc is not NULL before dereferencing it. The patch also replaces kmalloc + memset by kzalloc. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression *x; identifier f; constant char *C; @@ x = \(kmalloc\|kcalloc\|kzalloc\)(...); ... when != x == NULL when != x != NULL when != (x || ...) ( kfree(x) | f(...,C,...,x,...) | *f(...,x,...) | *x->f ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Fix incorrect alignment in Marvell BT-over-SDIO driverBing Zhao2009-08-222-6/+9
| | | | | | | | | The driver uses "u32" for alignment check and calculation which works only on 32-bit system. It will crash the 64-bit system. Replace "u32" with "unsigned long" to fix this issue. Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Remove Enter/Leave debug statements from Marvell driverMarcel Holtmann2009-08-222-219/+23
| | | | | | | | | The Marvell Bluetooth driver is full of Enter/Leave debug statements and all of them are really pointless and only clutter the code. Seems to be some left-overs when they ported the driver from Windows. For the Linux driver lets remove these. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Fix last few compiler warning within Marvell core driverMarcel Holtmann2009-08-221-4/+4
| | | | | | | After fixing the driver to use skb_put properly for their HCI commands only a few compiler warnings are left. Add proper casting for them. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Fix Marvell driver to use skb_put and hci_opcode_packMarcel Holtmann2009-08-221-14/+8
| | | | | | | | The Marvell driver has some weird quirks on how to construct proper SKBs with Bluetooth HCI commands. Fix it to use skb_put properly and also use hci_opcode_pack instead of self-crafted macro. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Remove private device name of Marvell SDIO driverMarcel Holtmann2009-08-222-5/+0
| | | | | | | | For some reason the btmrvl_device struct has a name field that the SDIO fills in, but then never ever uses again. That is totally pointless and so just remove it. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Fix module description strings for Marvell driverMarcel Holtmann2009-08-222-2/+2
| | | | | | | Make the module description entries for the core and also the Marvell SDIO driver match common practive inside the Bluetooth subsystem. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Fix complicated assignment of firmware for Marvell devicesMarcel Holtmann2009-08-222-53/+38
| | | | | | | | | | | The Marvell Bluetooth SDIO driver has a really complicated concept on how firmware names are assigned to specific device ids. Fix that by doing a proper structure and assign it to the module device table. And while at it fix various coding style weirdness that is still present in this driver. Signed-off-by: Marcel Holtman <marcel@holtmann.org>
* Bluetooth: Some coding style cleanup for Marvell core driverMarcel Holtmann2009-08-221-52/+45
| | | | | | | | The Marvell core Bluetooth driver has various weird casting and unneeded braces in its code that makes it hard to read. Remove all of these to make the code a little bit simpler. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Remove pointless casts from Marvell debugfs supportMarcel Holtmann2009-08-221-143/+106
| | | | | | | | The Marvell Bluetooth driver has debugfs support and they are casting like there is no tomorrow. Remove all of them and magically the code becomes more readable. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Remove pointless ifdef protection for Marvell header filesMarcel Holtmann2009-08-222-10/+0
| | | | | | | | | Both header files of the Marvell Bluetooth driver are private anyway and if the driver happens to include them twice or they create a circular dependency then the driver needs fixing. So just remove both pointless ifdefs. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Fix compilation of Marvell driver without debugfsMarcel Holtmann2009-08-221-1/+3
| | | | | | | | | The Makefile entry for the Marvell driver is broken when it comes to handling the optional DEBUG_FS correctly. That must have been the reason why they were using select in Kconfig in the first place. Fix this and make it really optional. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Fix Kconfig for Marvell Bluetooth driverMarcel Holtmann2009-08-221-2/+1
| | | | | | | | | | The Marvell driver selects DEBUG_FS and FW_LOADER for its core driver and that is pointless. Don't select DEBUG_FS since it is either enabled or not and it is not for the driver to enable it. Also FW_LOADER is only used within the SDIO driver and so just have that one select the FW_LOADER option. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add documentation for Marvell Bluetooth driverBing Zhao2009-08-222-0/+121
| | | | | | | | | | | add btmrvl.txt to Documentation/ This patch incorporates a lot of comments given by Nicolas Pitre <nico@marvell.com>. Many thanks to Nicolas Pitre. Signed-off-by: Rahul Tank <rahult@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add debugfs support to btmrvl driverBing Zhao2009-08-225-1/+487
| | | | | | | | | | | | | | /debug/btmrvl/config/ /debug/btmrvl/status/ See Documentation/btmrvl.txt for details. This patch incorporates a lot of comments given by Nicolas Pitre <nico@marvell.com>. Many thanks to Nicolas Pitre. Signed-off-by: Rahul Tank <rahult@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add Marvell BT-over-SDIO driverBing Zhao2009-08-224-0/+1255
| | | | | | | | | | | | | | | This driver supports Marvell Bluetooth enabled devices with SDIO interface. Currently only SD8688 chip is supported. The helper/firmware images of SD8688 can be downloaded from this tree: git://git.infradead.org/users/dwmw2/linux-firmware.git This patch incorporates a lot of comments given by Nicolas Pitre <nico@marvell.com>. Many thanks to Nicolas Pitre. Signed-off-by: Rahul Tank <rahult@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add btmrvl driver for Marvell Bluetooth devicesBing Zhao2009-08-224-0/+867
| | | | | | | | | | | | | This driver provides basic definitions and library functions to support Marvell Bluetooth enabled devices, such as 88W8688 WLAN/BT combo chip. This patch incorporates a lot of comments given by Nicolas Pitre <nico@marvell.com>. Many thanks to Nicolas Pitre. Signed-off-by: Rahul Tank <rahult@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Let HIDP grab the device reference for connectionsMarcel Holtmann2009-08-222-21/+43
| | | | | | | | | | The core exports the hci_conn_hold_device() and hci_conn_put_device() functions for device reference of connections. Use this to ensure that the uevents from the parent are send after the child ones. Based on a report by Brian Rogers <brian@xyzw.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add extra device reference counting for connectionsMarcel Holtmann2009-08-223-1/+22
| | | | | | | | | | | | | | | | | | | | The device model itself has no real usable reference counting at the moment and this causes problems if parents are deleted before their children. The device model itself handles the memory details of this correctly, but the uevent order is not consistent. This causes various problems for systems like HAL or even X. So until device_put() does a proper cleanup, the device for Bluetooth connection will be protected with an extra reference counting to ensure the correct order of uevents when connections are terminated. This is not an automatic feature. Higher Bluetooth layers like HIDP or BNEP should grab this new reference to ensure that their uevents are send before the ones from the parent device. Based on a report by Brian Rogers <brian@xyzw.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Disconnect HIDRAW devices on disconnectMarcel Holtmann2009-08-221-0/+3
| | | | | | | | | | | Currently the HID subsystem will create HIDRAW devices for the transport driver, but it will not disconnect them. Until the HID subsytem gets fixed, ensure that HIDRAW and HIDDEV devices are disconnected when the Bluetooth HID device gets removed. Based on a patch from Brian Rogers <brian@xyzw.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Improve USB driver throughput by increasing the frame sizeVikram Kandukuri2009-08-221-3/+1
| | | | | | | | | | | | This patch increases the receive buffer size to HCI_MAX_FRAME_SIZE which improves the RX throughput considerably. Tested against BRM/Atheros/CSR USB Dongles with PAN profile using iperf and chariot. This gave significant (around 40%) increase in performance (increased from 0.8 to 1.5 Mb/s in Sheld room) Signed-off-by: Vikram Kandukuri <vikram.kandukuri@atheros.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Fix missing scheduling when VIRTUAL_CABLE_UNPLUG is receivedVikram Kandukuri2009-08-221-0/+1
| | | | | | | | | | | There is a test case in PTS tool; PTS will send the VIRTUAL_CABLE_UNPLUG command to IUT. Then IUT should disconnect the channel and kill the HID session when it receives the command. The VIRTUAL_CABLE_UNPLUG command is parsed by HID transport, but it is not scheduled to do so. Add a call to hidp_schedule() to kill the session. Signed-off-by: Jothikumar Mothilal <jothikumar.mothilal@atheros.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Add proper shutdown support to SCO socketsMarcel Holtmann2009-08-221-15/+34
| | | | | | | | | | | | | | | | The SCO sockets for Bluetooth audio setup and streaming are missing the shutdown implementation. This hasn't been a problem so far, but with a more deeper integration with PulseAudio it is important to shutdown SCO sockets properly. Also the Headset profile 1.2 has more detailed qualification tests that require that SCO and RFCOMM channels are terminated in the right order. A proper shutdown function is necessary for this. Based on a report by Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Tested-by: Johan Hedberg <johan.hedberg@nokia.com>
* Merge branch 'master' of ↵David S. Miller2009-08-2199-2170/+2790
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
| * MAINTAINERS: add information for mwl8k wireless driverLennert Buytenhek2009-08-201-0/+6
| | | | | | | | | | Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwl8k: update copyright and version numberLennert Buytenhek2009-08-201-2/+2
| | | | | | | | | | Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwl8k: remove mwl8k_queue_work()Lennert Buytenhek2009-08-201-64/+0
| | | | | | | | | | Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwl8k: get rid of mwl8k_configure_filter() workqueue useLennert Buytenhek2009-08-201-45/+20
| | | | | | | | | | Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwl8k: get rid of mwl8k_get_stats() workqueue useLennert Buytenhek2009-08-201-30/+2
| | | | | | | | | | Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwl8k: get rid of mwl8k_conf_tx() workqueue useLennert Buytenhek2009-08-201-43/+14
| | | | | | | | | | Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwl8k: get rid of mwl8k_set_rts_threshold() workqueue useLennert Buytenhek2009-08-201-39/+3
| | | | | | | | | | Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwl8k: get rid of mwl8k_bss_info_changed() workqueue useLennert Buytenhek2009-08-201-63/+38
| | | | | | | | | | Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwl8k: get rid of mwl8k_config() workqueue useLennert Buytenhek2009-08-201-52/+20
| | | | | | | | | | Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwl8k: get rid of mwl8k_stop() workqueue useLennert Buytenhek2009-08-201-25/+1
| | | | | | | | | | Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwl8k: get rid of mwl8k_start() workqueue useLennert Buytenhek2009-08-201-78/+27
| | | | | | | | | | Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwl8k: fix firmware command serialisationLennert Buytenhek2009-08-201-65/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current mwl8k_priv->fw_lock spinlock doesn't actually protect against multiple commands being submitted at once, as it is not kept held over the entire firmware command submission. And since waiting for command completion sleeps, we can't use a spinlock anyway. To fix mwl8k firmware command serialisation properly, we have the following requirements: - Some commands require that the packet transmit path is idle when the command is issued. (For simplicity, we'll just quiesce the transmit path for every command.) - There are certain sequences of commands that need to be issued to the hardware sequentially, with no other intervening commands. This leads to an implementation of a "firmware lock" as a mutex that can be taken recursively, and which is taken by both the low-level command submission function (mwl8k_post_cmd) as well as any users of that function that require issuing of an atomic sequence of commands, and quiesces the transmit path whenever it's taken. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwl8k: mwl8k_queue_work() cleanupLennert Buytenhek2009-08-201-171/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Delete most of the mwl8k_work_struct fields and options, since most of them are unused or never changed from their defaults: - We always use priv->config_wq, so delete the wqueue argument from mwl8k_queue_work(). - MWL8K_WQ_SPIN and MWL8K_WQ_POST_REQUEST are never used, as all callers sleep for request completion, so sleep unconditionally. - MWL8K_WQ_FREE_WORKSTRUCT is never used. - MWL8K_WQ_TX_WAIT_EMPTY is always set, so assume it unconditionally. - timeout_ms/txwait_attempts/tx_timeout_ms are never changed from their defaults, so just hardcode these in the workqueue worker. - step is never used. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwl8k: mwl8k_txq_xmit() reworkLennert Buytenhek2009-08-201-93/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various mwl8k_txq_xmit changes: - Extract the QoS field before adding the DMA header. - Only write to tx->status once, and only after all the other descriptor fields have been set. - Do all tx state manipulation under the tx spinlock. - Remove the priv->inconfig check, as all transmit queues will be frozen during config cycles, so we won't ever be asked to transmit if a config cycle is running. - Remove some more dead code. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwl8k: implement idle modeLennert Buytenhek2009-08-201-0/+6
| | | | | | | | | | Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mwl8k: no need to hold ->tx_lock while setting the hardware interrupt maskLennert Buytenhek2009-08-201-6/+0
| | | | | | | | | | Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
OpenPOWER on IntegriCloud