aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* wimax/i2400m: reserve additional space in the TX queue's buffer while ↵Prasanna S. Panchamukhi2010-05-112-1/+16
| | | | | | | | | | allocating space for a new message header Increase the possibilities of including at least one payload by reserving some additional space in the TX queue while allocating TX queue's space for new message header. Please refer the documentation in the code for details. Signed-off-by: Prasanna S. Panchamukhi <prasannax.s.panchamukhi@intel.com>
* wimax/i2400m: fix incorrect handling of type 2 and 3 RX messagesPrasanna S. Panchamukhi2010-05-111-25/+26
| | | | | | | | | According to Intel Wimax i3200, i5x50 and i6x60 device specification documents, the host driver must not reset the device if the normalized sequence numbers are greater than 1023 for type 2 and type 3 RX messages. This patch removes the code that incorrectly used to reset the device. Signed-off-by: Prasanna S. Panchamukhi <prasannax.s.panchamukhi@intel.com>
* wimax i2400m: fix race condition while accessing rx_roq by using kref countPrasanna S. Panchamukhi2010-05-112-8/+48
| | | | | | | | | | | | | | | | | | | | | | This patch fixes the race condition when one thread tries to destroy the memory allocated for rx_roq, while another thread still happen to access rx_roq. Such a race condition occurs when i2400m-sdio kernel module gets unloaded, destroying the memory allocated for rx_roq while rx_roq is accessed by i2400m_rx_edata(), as explained below: $thread1 $thread2 $ void i2400m_rx_edata() $ $Access rx_roq[] $ $roq = &i2400m->rx_roq[ro_cin] $ $ i2400m_roq_[reset/queue/update_ws] $ $ $ void i2400m_rx_release(); $ $kfree(rx->roq); $ $rx->roq = NULL; $Oops! rx_roq is NULL This patch fixes the race condition using refcount approach. Signed-off-by: Prasanna S. Panchamukhi <prasannax.s.panchamukhi@intel.com>
* wimax/i2400m: increase tx queue length from 5 to 20 [v1]Prasanna S. Panchamukhi2010-05-111-1/+5
| | | | | | | This patch increases the tx_queue_len to 20 so as to minimize the jitter in the throughput. Signed-off-by: Prasanna S. Panchamukhi <prasannax.s.panchamukhi@intel.com>
* wimax/i2400m: fix system freeze caused by an infinite loop [v1]Prasanna S. Panchamukhi2010-05-111-5/+60
| | | | | | | | This patch fixes an infinite loop caused by i2400m_tx_fifo_push() due to a corner case where there is no tail space in the TX FIFO. Please refer the documentation in the code for details. Signed-off-by: Prasanna S. Panchamukhi <prasannax.s.panchamukhi@intel.com>
* wimax/i2400m: modify i2400m_tx_fifo_push() to check for head room space in ↵Prasanna S. Panchamukhi2010-05-111-2/+14
| | | | | | | | | | | the TX FIFO [v1] This fixes i2400m_tx_fifo_push(); the check for having enough space in the TX FIFO's tail was obscure and broken in certain corner cases. The new check works in all cases and is way clearer. Please refer the documentation in the code for details. Signed-off-by: Prasanna S. Panchamukhi <prasannax.s.panchamukhi@intel.com>
* wimax/i2400m: fix BUILD_BUG_ON() to use the maximum message size constant [v1]Prasanna S. Panchamukhi2010-05-111-15/+5
| | | | | | | | | | The older method of computing the maximum PDU size relied on a method that doesn't work when we prop the maximum number of payloads up to the physical limit, and thus we kill the whole computation and just verify that the constants are congruent. Signed-off-by: Prasanna S. Panchamukhi <prasannax.s.panchamukhi@intel.com>
* wimax/i2400m: limit the message size upto 16KiB [v1]Prasanna S. Panchamukhi2010-05-111-1/+12
| | | | | | | | | | According to Intel Wimax i3200, i5x50 and i6x50 specification documents, the maximum size of each TX message can be upto 16KiB. This patch modifies the i2400m_tx() routine to check that the message size does not exceed the 16KiB limit. Please refer the documentation in the code for details. Signed-off-by: Prasanna S. Panchamukhi <prasannax.s.panchamukhi@intel.com>
* wimax/i2400m: increase the maximum number of payloads per message to 60 [v1]Prasanna S. Panchamukhi2010-05-111-1/+7
| | | | | | | | | | | According to Intel Wimax i3200, i5x50 and i6x50 device specification documents, the maximum number of payloads per message can be up to 60. Increasing the number of payloads to 60 per message helps to accommodate smaller payloads in a single transaction. This patch increases the maximum number of payloads from 12 to 60 per message. Signed-off-by: Prasanna S. Panchamukhi <prasannax.s.panchamukhi@intel.com>
* wimax/i2400m: Reset the TX FIFO indices when allocating the TX FIFO in ↵Cindy H Kao2010-05-111-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | tx_setup() This patch makes sure whenever tx_setup() is invoked during driver initialization or device reset where TX FIFO is released and re-allocated, the indices tx_in, tx_out, tx_msg_size, tx_sequence, tx_msg are properly initialized. When a device reset happens and the TX FIFO is released/re-allocated, a new block of memory may be allocated for the TX FIFO, therefore tx_msg should be cleared so that no any TX threads (tx_worker, tx) would access to the out-of-date addresses. Also, the TX threads use tx_in and tx_out to decide where to put the new host-to-device messages and from where to copy them to the device HW FIFO, these indices have to be cleared so after the TX FIFO is re-allocated during the reset, the indices both refer to the head of the FIFO, ie. a new start. The same rational applies to tx_msg_size and tx_sequence. To protect the indices from being accessed by multiple threads simultaneously, the lock tx_lock has to be obtained before the initializations and released afterwards. Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
* wimax/i2400m: Correct the error path handlers order in i2400m_post_reset()Cindy H Kao2010-05-111-1/+1
| | | | | | | | | | When bus_setup fails in i2400m_post_reset(), it falls to the error path handler "error_bus_setup:" which includes unlock the mutext. However, we didn't ever try to the obtain the lock when running bus_setup. The patch is to fix the misplaced error path handler "error_bus_setup:". Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
* wimax/i2400m: add the error recovery mechanism on TX pathCindy H Kao2010-05-113-0/+92
| | | | | | | | | | | | | | | | | | | This patch adds an error recovery mechanism on TX path. The intention is to bring back the device to some known state whenever TX sees -110 (-ETIMEOUT) on copying the data to the HW FIFO. The TX failure could mean a device bus stuck or function stuck, so the current error recovery implementation is to trigger a bus reset and expect this can bring back the device. Since the TX work is done in a thread context, there may be a queue of TX works already that all hit the -ETIMEOUT error condition because the device has somewhat stuck already. We don't want any consecutive bus resets simply because multiple TX works in the queue all hit the same device erratum, the flag "error_recovery" is introduced to denote if we are ready for taking any error recovery. See @error_recovery doc in i2400m.h. Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
* wimax/i2400m: fix for missed reset events if triggered by dev_reset_handle()Cindy H Kao2010-05-112-16/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is only seen on SDIO interface since on USB, a bus reset would really re-probe the driver, but on SDIO interface, a bus reset will not re-enumerate the SDIO bus, so no driver re-probe is happening. Therefore, on SDIO interface, the reset event should be still detected and handled by dev_reset_handle(). Problem description: Whenever a reboot barker is received during operational mode (i2400m->boot_mode == 0), dev_reset_handle() is invoked to handle that function reset event. dev_reset_handle() then sets the flag i2400m->boot_mode to 1 indicating the device is back to bootmode before proceeding to dev_stop() and dev_start(). If dev_start() returns failure, a bus reset is triggered by dev_reset_handle(). The flag i2400m->boot_mode then remains 1 when the second reboot barker arrives. However the interrupt service routine i2400ms_rx() instead of invoking dev_reset_handle() to handle that reset event, it filters out that boot event to bootmode because it sees the flag i2400m->boot_mode equal to 1. The fix: Maintain the flag i2400m->boot_mode within dev_reset_handle() and set the flag i2400m->boot_mode to 1 when entering dev_reset_handle(). It remains 1 until the dev_reset_handle() issues a bus reset. ie: the bus reset is taking place just like it happens for the first time during operational mode. To denote the actual device state and the state we expect, a flag i2400m->alive is introduced in addition to the existing flag i2400m->updown. It's maintained with the same way for i2400m->updown but instead of reflecting the actual state like i2400m->updown does, i2400m->alive maintains the state we expect. i2400m->alive is set 1 just like whenever i2400m->updown is set 1. Yet i2400m->alive remains 1 since we expect the device to be up all the time until the driver is removed. See the doc for @alive in i2400m.h. An enumeration I2400M_BUS_RESET_RETRIES is added to define the maximum number of bus resets that a device reboot can retry. A counter i2400m->bus_reset_retries is added to track how many bus resets have been retried in one device reboot. If I2400M_BUS_RESET_RETRIES bus resets were retried in this boot, we give up any further retrying so the device would enter low power state. The counter i2400m->bus_reset_retries is incremented whenever dev_reset_handle() is issuing a bus reset and is cleared to 0 when dev_start() is successfully done, ie: a successful reboot. Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
* wimax/i2400m: correct the error path handlers in dev_start()Cindy H Kao2010-05-111-1/+1
| | | | | | | | This fix is to correct order of the handlers in the error path of dev_start(). When i2400m_firmware_check fails, all the works done before it should be released or cleared. Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
* wimax/i2400m: fix the race condition for accessing TX queueCindy H Kao2010-05-112-8/+28
| | | | | | | | | | | | The race condition happens when the TX queue is accessed by the TX work while the same TX queue is being destroyed because a bus reset is triggered either by debugfs entry or simply by failing waking up the device from WiMAX IDLE mode. This fix is to prevent the TX queue from being accessed by multiple threads Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
* wimax/i2400m: fix insufficient size of Tx buffer for 12 payload of 1400 MTU.Prasanna S. Panchamukhi2010-05-111-1/+18
| | | | | | | | | | | | | | | | | | | | | | This patch increases the Tx buffer size so as to accommodate 12 payloads of 1408 (1400 MTU 16 bytes aligned). Currently Tx buffer is 32 KiB which is insufficient to accommodate 12 payloads of 1408 size. This patch - increases I2400M_TX_BUF_SIZE from 32KiB to 64KiB - Adds a BUILD_BUG_ON if the calculated buffer size based on the given MTU exceeds the I2400M_TX_BUF_SIZE. Below is how we calculate the size of the Tx buffer. Payload + 4 bytes prefix for each payload (1400 MTU 16 bytes boundary aligned) = (1408 + sizeof(struct i2400m_pl_data_hdr)) * I2400M_TX_PLD_MAX Adding 16 byte message header = + sizeof(struct i2400m_msg_hdr) Aligning to 256 byte boundary Total Tx buffer = (((((1408 + sizeof(struct i2400m_pl_data_hdr)) * I2400M_TX_PLD_MAX )+ sizeof(struct i2400m_msg_hdr)) / 256) + 1) * 256 * 2 Signed-off-by: Prasanna S. Panchamukhi <prasannax.s.panchamukhi@intel.com> Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
* wimax/i2400m: move I2400M_MAX_MTU enum from netdev.c to i2400m.hPrasanna S. Panchamukhi2010-05-112-6/+10
| | | | | | | | | This patch moves I2400M_MAX_MTU enum defined in netdev.c to i2400m.h. Follow up changes will make use of this value in other location, thus requiring it to be moved to a global header file i2400m.h. Signed-off-by: Prasanna S. Panchamukhi <prasannax.s.panchamukhi@intel.com> Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
* wimax/i2400m: fix incorrect return -ESHUTDOWN when there is no Tx buffer ↵Prasanna S.Panchamukhi2010-05-111-2/+4
| | | | | | | | | | | | | available i2400m_tx() routine was returning -ESHUTDOWN even when there was no Tx buffer available. This patch fixes the i2400m_tx() to return -ESHUTDOWN only when the device is down(i2400m->tx_buf is NULL) and also to return -ENOSPC when there is no Tx buffer. Error seen in the kernel log. kernel: i2400m_sdio mmc0:0001:1: can't send message 0x5606: -108 kernel: i2400m_sdio mmc0:0001:1: Failed to issue 'Enter power save'command: -108 Signed-off-by: Prasanna S.Panchamukhi <prasannax.s.panchamukhi@intel.com>
* Bluetooth: Fix issues where sk_sleep() helper is needed nowMarcel Holtmann2010-05-101-4/+4
| | | | | | | 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>
* Bluetooth: Use strict_strtoul instead of simple_strtoulTomas Winkler2010-05-101-12/+6
| | | | | | | | 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>
* Bluetooth: Set hdev->dev_type based on Marvell device typeBing Zhao2010-05-102-0/+11
| | | | | | | 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>
* Bluetooth: Separate btmrvl_register_hdev() from btmrvl_add_card()Bing Zhao2010-05-103-33/+50
| | | | | | | | 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>
* Bluetooth: Decode btmrvl MODULE_BRINGUP_REG response correctlyBing Zhao2010-05-102-3/+8
| | | | | | | | 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>
* Bluetooth: Fix storing negative values as unsigned charDan Carpenter2010-05-101-1/+1
| | | | | | | | | 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>
* Bluetooth: Create per controller workqueueMarcel Holtmann2010-05-103-13/+19
| | | | | | | 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>
* Bluetooth: Fix spec error in the RemoteBusy LogicGustavo F. Padovan2010-05-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Bluetooth: Prevents buffer overflow on l2cap_ertm_reassembly_sdu()Gustavo F. Padovan2010-05-101-4/+4
| | | | | | | | | 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>
* Bluetooth: Fix race condition on l2cap_ertm_send()Gustavo F. Padovan2010-05-102-33/+67
| | | | | | | | | | | | | | | | | | | | | | 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>
* Bluetooth: Add wait_queue to wait ack of all sent packetsGustavo F. Padovan2010-05-101-0/+34
| | | | | | | | | 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>
* Bluetooth: Implement Local Busy Condition handlingGustavo F. Padovan2010-05-102-21/+172
| | | | | | | | | | | | | 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>
* Bluetooth: Completes the I-frame tx_seq check logic on RECVJoão Paulo Rechi Vita2010-05-101-4/+36
| | | | | | | | 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>
* Bluetooth: Implement missing parts of the Invalid Frame DetectionGustavo F. Padovan2010-05-101-7/+112
| | | | | | | | | | | 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>
* Bluetooth: Refactor l2cap_retransmit_frame()Gustavo F. Padovan2010-05-101-26/+27
| | | | | | | | | 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>
* Bluetooth: Make hci_send_acl() voidGustavo F. Padovan2010-05-103-49/+30
| | | | | | | | | | | 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>
* Bluetooth: Fix lockdep annotation on ERTMGustavo F. Padovan2010-05-101-1/+1
| | | | | | | | 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>
* Bluetooth: Check if we really are in WAIT_F when F bit comesGustavo F. Padovan2010-05-101-2/+4
| | | | | | | | 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>
* Bluetooth: Remove unneeded control varsGustavo F. Padovan2010-05-101-10/+4
| | | | | | | | 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>
* Bluetooth: Remove set of SrejSaveReqSeq under receipt of REJ frameGustavo F. Padovan2010-05-101-3/+1
| | | | | | | | 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>
* Bluetooth: Fix errors reported by checkpatch.plGustavo F. Padovan2010-05-101-6/+5
| | | | | | 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>
* Bluetooth: Don't set control bits to zero firstGustavo F. Padovan2010-05-101-4/+2
| | | | | | | | 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>
* Bluetooth: Close L2CAP channel on invalid ReqSeqJoão Paulo Rechi Vita2010-05-101-1/+17
| | | | | | 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>
* Bluetooth: Fix SDU reassembly under SREJGustavo F. Padovan2010-05-101-2/+2
| | | | | | | | 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>
* Bluetooth: Check if mode is supported on getsockoptJoão Paulo Rechi Vita2010-05-101-1/+14
| | | | | | | | | 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>
* Bluetooth: Add SOCK_STREAM support to L2CAPGustavo F. Padovan2010-05-101-14/+26
| | | | | | | | | 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>
* Bluetooth: Add Kconfig option for L2CAP Extended FeaturesGustavo F. Padovan2010-05-102-0/+17
| | | | | | | | | | | | 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>
* Bluetooth: Optimize SREJ_QUEUE appendGustavo F. Padovan2010-05-101-1/+3
| | | | | | | | | | 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>
* Bluetooth: Fix drop of acked packets on ERTMGustavo F. Padovan2010-05-101-1/+2
| | | | | | | | | 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>
* Bluetooth: Fix crash when monitor timeout expiresGustavo F. Padovan2010-05-101-0/+3
| | | | | | | | | 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>
* Bluetooth: Fix bug when retransmitting I-framesGustavo F. Padovan2010-05-101-4/+8
| | | | | | | | | 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>
* Bluetooth: Enable option to configure Max Transmission value via sockoptGustavo F. Padovan2010-05-102-1/+8
| | | | | | | | 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>