summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Bluetooth: Test 'count' value before enter the loopGustavo F. Padovan2010-07-271-4/+4
| | | | | | | Testing first we avoid enter the loop when count = 0. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Fix permission of hci_ath.cGustavo F. Padovan2010-07-271-0/+0
| | | | | | | .c file shall not have the 'x' permission. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Bluetooth: Defer SCO setup if mode change is pendingMarcel Holtmann2010-07-273-20/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | Certain headsets such as the Motorola H350 will reject SCO and eSCO connection requests while the ACL is transitioning from sniff mode to active mode. Add synchronization so that SCO and eSCO connection requests will wait until the ACL has fully transitioned to active mode. < HCI Command: Exit Sniff Mode (0x02|0x0004) plen 2 handle 12 > HCI Event: Command Status (0x0f) plen 4 Exit Sniff Mode (0x02|0x0004) status 0x00 ncmd 1 < HCI Command: Setup Synchronous Connection (0x01|0x0028) plen 17 handle 12 voice setting 0x0040 > HCI Event: Command Status (0x0f) plen 4 Setup Synchronous Connection (0x01|0x0028) status 0x00 ncmd 1 > HCI Event: Number of Completed Packets (0x13) plen 5 handle 12 packets 1 > HCI Event: Mode Change (0x14) plen 6 status 0x00 handle 12 mode 0x00 interval 0 Mode: Active > HCI Event: Synchronous Connect Complete (0x2c) plen 17 status 0x10 handle 14 bdaddr 00:1A:0E:50:28:A4 type SCO Error: Connection Accept Timeout Exceeded Signed-off-by: Ron Shaffer <rshaffer@codeaurora.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
* Merge branch 'master' of ↵John W. Linville2010-07-274739-139657/+325184
|\ | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-next-2.6 Conflicts: drivers/net/wireless/iwlwifi/iwl-commands.h
| * Bluetooth: Support for Atheros AR300x serial chipSuraj Sumangala2010-07-215-1/+261
| | | | | | | | | | | | | | | | | | | | Implements Atheros AR300x serial HCI protocol. This protocol extends H4 serial protocol to implement enhanced power management features supported by Atheros AR300x serial Bluetooth chipsets. Signed-off-by: Suraj Sumangala <suraj@atheros.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Use __packed annotation for driversGustavo F. Padovan2010-07-214-5/+5
| | | | | | | | | | | | | | Use the __packed annotation instead of the __attribute__((packed)). Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Use __packed annotationGustavo F. Padovan2010-07-214-113/+113
| | | | | | | | | | | | | | | | | | To make net/ and include/net/ code consistent use __packed instead of __attribute__ ((packed)). Bluetooth subsystem was one of the last net subsys still using __attribute__ ((packed)). Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Enable L2CAP Extended features by defaultGustavo F. Padovan2010-07-211-9/+9
| | | | | | | | | | | | | | | | Change the enable_ertm param to disable_ertm and default value to 0. That means that L2CAP Extended features are enabled by default now. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Fix typo in hci_event.cGustavo F. Padovan2010-07-211-2/+2
| | | | | | | | | | | | | | memmory -> memory Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Move bit-field variable in USB driver to data->flagsGustavo F. Padovan2010-07-211-6/+4
| | | | | | | | | | | | | | | | did_iso_resume keeps only a bit-field value, so moving that to a proper flags place. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Add Google's copyright to L2CAPGustavo F. Padovan2010-07-212-0/+2
| | | | | | | | | | Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Implemented HCI frame reassembly for RX from streamSuraj Sumangala2010-07-212-0/+36
| | | | | | | | | | | | | | | | Implemented frame reassembly implementation for reassembling fragments received from stream. Signed-off-by: Suraj Sumangala <suraj@atheros.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Modified hci_recv_fragment() to use hci_reassembly helperSuraj Sumangala2010-07-211-74/+11
| | | | | | | | | | | | | | | | Modified packet based reassembly function hci_recv_fragment() to use hci_reassembly() Signed-off-by: Suraj Sumangala <suraj@atheros.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Implement hci_reassembly helper to reassemble RX packetsSuraj Sumangala2010-07-212-0/+110
| | | | | | | | | | | | | | Implements feature to reassemble received HCI frames from any input stream Signed-off-by: Suraj Sumangala <suraj@atheros.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Add one more buffer for HCI stream reassemblySuraj Sumangala2010-07-212-5/+5
| | | | | | | | | | | | | | Additional reassembly buffer to keep track of stream reasembly Signed-off-by: Suraj Sumangala <suraj@atheros.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Added support for controller shipped with iMac i5Cyril Lacoux2010-07-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Device class is ff(vend.) instead of e0(wlcon). Output from command `usb-devices`: T: Bus=01 Lev=03 Prnt=03 Port=00 Cnt=01 Dev#= 6 Spd=12 MxCh= 0 D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=05ac ProdID=8215 Rev=01.82 S: Manufacturer=Apple Inc. S: Product=Bluetooth USB Host Controller S: SerialNumber=7C6D62936607 C: #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) I: If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=00 Driver=(none) Signed-off-by: Cyril Lacoux <clacoux@ifeelgood.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Update L2CAP version informationGustavo F. Padovan2010-07-211-1/+1
| | | | | | | | | | | | | | | | We did some changes on the L2CAP configuration process and its behaviour is bit different now. That justifies a updated on the L2CAP version. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Add Copyright notice to L2CAPGustavo F. Padovan2010-07-212-0/+2
| | | | | | | | | | | | | | | | Copyright for the time I worked on L2CAP during the Google Summer of Code program. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Remove unnecessary casts of private_data in driversJoe Perches2010-07-211-1/+1
| | | | | | | | | | Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Add HCIUARTSETFLAGS and HCIUARTGETFLAGS ioctlsJohan Hedberg2010-07-213-1/+20
| | | | | | | | | | | | | | | | | | | | | | This patch introduces two new ioctls: HCIUARTSETFLAGS and HCIUARTGETFLAGS. The only flag available for now is HCI_UART_RAW_DEVICE which allows to initialize a UART device into RAW mode from userspace. This is particularly useful for experimenting with Bluetooth controllers that don't yet have proper support in BlueZ. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Keep code under column 80Gustavo F. Padovan2010-07-211-21/+25
| | | | | | | | | | | | | | Purely a cosmetic change, it doesn't change the code flow. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Fix bug in kzalloc allocation sizeGustavo F. Padovan2010-07-211-1/+1
| | | | | | | | | | | | | | Probably a typo error. We were using the wrong struct to get size. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Add missing HCIUARTGETDEVICE ioctl to compat_ioctl.cJohan Hedberg2010-07-211-2/+3
| | | | | | | | | | Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Send ConfigReq after send a ConnectionRspGustavo F. Padovan2010-07-211-3/+41
| | | | | | | | | | | | | | | | | | The extended L2CAP features requires that one should initiate a ConfigReq after send the ConnectionRsp. This patch changes the behaviour of the configuration process of our stack. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Fix error return on L2CAP-HCI interface.João Paulo Rechi Vita2010-07-211-3/+3
| | | | | | | | | | | | | | | | L2CAP only deals with ACL links. EINVAL should be returned otherwise. 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 error value for wrong FCS.João Paulo Rechi Vita2010-07-211-1/+1
| | | | | | | | | | | | 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 error return for l2cap_connect_rsp().João Paulo Rechi Vita2010-07-211-2/+2
| | | | | | | | | | | | 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 error return value on sendmsg.João Paulo Rechi Vita2010-07-211-1/+1
| | | | | | | | | | | | | | | | When the socket is in a bad state EBADFD is more appropriate then EINVAL. 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 error return value on sendmsg.João Paulo Rechi Vita2010-07-211-1/+1
| | | | | | | | | | | | | | | | | | When we try to send a message bigger than the outgoing MTU value EMSGSIZE (message too long) should be returned. 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: Make l2cap_streaming_send() void.João Paulo Rechi Vita2010-07-211-3/+2
| | | | | | | | | | | | | | | | | | It doesn't make sense to have a return value since we always set it to 0. 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 l2cap_sock_connect error return.João Paulo Rechi Vita2010-07-211-0/+1
| | | | | | | | | | | | | | | | Return a proper error value if socket is already connected. 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: Improve ERTM local busy handlingGustavo F. Padovan2010-07-211-36/+47
| | | | | | | | | | | | | | | | | | Now we also check if can push skb userspace just after receive a new skb instead of only wait the l2cap_busy_work wake up from time to time to check the local busy condition. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Add backlog queue to ERTM codeGustavo F. Padovan2010-07-211-53/+79
| | | | | | | | | | | | | | | | | | backlog queue is the canonical mechanism to avoid race conditions due interrupts in bottom half context. After the socket lock is released the net core take care of push all skb in its backlog queue. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Remove the send_lock spinlock from ERTMGustavo F. Padovan2010-07-212-28/+1
| | | | | | | | | | | | | | | | | | Using a lock to deal with the ERTM race condition - interruption with new data from the hci layer - is wrong. We should use the native skb backlog queue. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Don't accept ConfigReq if we aren't in the BT_CONFIG stateGustavo F. Padovan2010-07-211-1/+7
| | | | | | | | | | | | | | | | If such event happens we shall reply with a Command Reject, because we are not expecting any configure request. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Disconnect early if mode is not supportedGustavo F. Padovan2010-07-212-16/+45
| | | | | | | | | | | | | | | | When mode is mandatory we shall not send connect request and report this to the userspace as well. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Remove check for supported modeGustavo F. Padovan2010-07-211-7/+2
| | | | | | | | | | | | | | | | Since now we have checks for the supported mode before on l2cap_info_rsp we can remove the check for it here. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Refuse ConfigRsp with different modeGustavo F. Padovan2010-07-211-1/+5
| | | | | | | | | | | | | | | | If our mode is Basic Mode we have to refuse any ConfigRsp that proposes a different mode. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Actively send request for Basic ModeGustavo F. Padovan2010-07-211-6/+11
| | | | | | | | | | | | | | | | The Profile Tuning Suite requires that we send a RFC containing the Basic Mode configuration when requesting Basic Mode. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Prefer Basic Mode on receipt of ConfigReqGustavo F. Padovan2010-07-211-3/+0
| | | | | | | | | | | | | | | | If we choose to use Basic Mode then we have to refuse the received mode and propose Basic Mode again. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Disconnect the channel if we don't want the proposed modeGustavo F. Padovan2010-07-211-1/+2
| | | | | | | | | | | | | | | | If the device is a STATE 2 then it should disconnect the channel if the remote device propose a mode different from its mandatory mode. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Change the way we set ERTM mode as mandatoryGustavo F. Padovan2010-07-211-4/+18
| | | | | | | | | | | | | | | | | | | | | | If the socket type is SOCK_STREAM we set Enhanced Retransmisson Mode or Streaming Mode as mandatory. That means that we will close the channel if the other side doesn't support or request the the mandatory mode. Basic mode can't be set as mandatory. 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: Tweaks to l2cap_send_i_or_rr_or_rnr() flowGustavo F. Padovan2010-07-211-2/+1
| | | | | | | | | | | | | | | | | | l2cap_send_sframe() already set the F-bit if we set L2CAP_CONN_SEND_FBIT and unset L2CAP_CONN_SEND_FBIT after send the 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>
| * Bluetooth: Add debug output to ERTM codeGustavo F. Padovan2010-07-211-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the dynamic debug to output info about ERTM protocol stuff. The following script can be used to enable debug for ERTM: DEBUGFS="/sys/kernel/debug/dynamic_debug/control" echo -n 'func l2cap_send_disconn_req +p' > $DEBUGFS echo -n 'func l2cap_monitor_timeout +p' > $DEBUGFS echo -n 'func l2cap_retrans_timeout +p' > $DEBUGFS echo -n 'func l2cap_busy_work +p' > $DEBUGFS echo -n 'func l2cap_push_rx_skb +p' > $DEBUGFS echo -n 'func l2cap_data_channel_iframe +p' > $DEBUGFS echo -n 'func l2cap_data_channel_rrframe +p' > $DEBUGFS echo -n 'func l2cap_data_channel_rejframe +p' > $DEBUGFS echo -n 'func l2cap_data_channel_srejframe +p' > $DEBUGFS echo -n 'func l2cap_data_channel_rnrframe +p' > $DEBUGFS 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 ERTM error reporting to the userspaceGustavo F. Padovan2010-07-211-17/+22
| | | | | | | | | | | | | | | | | | If any error occurs during transfers we have to tell userspace that something wrong happened. 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 missing retransmission action with RR(P=1)Gustavo F. Padovan2010-07-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The Bluetooth SIG Profile Tuning Suite Software uses the CSA1 spec to run the L2CAP tests. The new 3.0 spec has a missing Retransmit-I-Frames action when the Remote side is Busy. We still start the retransmission timer if Remote is Busy and unacked frames > 0. We do everything we did before this change plus the Retransmission of I-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>
| * Bluetooth: Check packet FCS earlierGustavo F. Padovan2010-07-211-11/+11
| | | | | | | | | | | | | | | | This way, if FCS is enabled and the packet is corrupted, we just drop it without read it len, which could be corrupted. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
| * Bluetooth: Check the tx_window size on setsockoptGustavo F. Padovan2010-07-211-0/+5
| | | | | | | | | | | | | | | | | | We have to check if the proposed tx_window value is not greater that maximum value supported. 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 handle of received P-bitGustavo F. Padovan2010-07-211-2/+12
| | | | | | | | | | | | | | | | | | | | | | ERTM spec mandates that after receive a P-bit we shall send an F-bit in response. This patch fixes this for retransmitted packets, on retransmitting we were missing to check for a pending F-bit to be sent. Also we were missing some annotation to send a 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>
| * Bluetooth: Update buffer_seq before retransmit framesGustavo F. Padovan2010-07-211-4/+4
| | | | | | | | | | | | | | | | Updating buffer_seq first make us able to ack the last I-frame received. This is also a requirement of the Profile Tuning Suite software. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
OpenPOWER on IntegriCloud