aboutsummaryrefslogtreecommitdiff
path: root/net/bluetooth
AgeCommit message (Collapse)AuthorFilesLines
2012-11-01Bluetooth: AMP: Use l2cap_physical_cfm in phylink complete evtAndrei Emeltchenko2-13/+26
When receiving HCI Phylink Complete event run amp_physical_cfm which initialize BR/EDR L2CAP channel associated with High Speed link and run l2cap_physical_cfm which shall send L2CAP Create Chan Request. Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: AMP: Check for hs_hcon instead of ctrl_idAndrei Emeltchenko1-2/+2
When deciding whether to send EFS configuration response with success, check rather for existence of High Speed physical link hs_hcon then ctrl_id. There might be cases when there is ctrl_id but high speed link is not established yet. Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: Disconnect logical link when deleting chanAndrei Emeltchenko2-0/+21
Disconnect logical link for high speed channel hs_hchan associated with L2CAP channel chan. Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: AMP: Remove hci_conn receiving error command statusAndrei Emeltchenko1-4/+13
When receiving HCI Event: Command Status for Create Physical Link with Error code remove AMP hcon. Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: AMP: Process Disc Physical Link Complete evtAndrei Emeltchenko1-0/+26
Add processing for HCI Disconnection Physical Link Complete Event. Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: AMP: Process Disc Logical LinkAndrei Emeltchenko2-0/+35
Add processing for HCI Disconnection Logical Link Complete Event. Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: AMP: Add Logical Link Create functionAndrei Emeltchenko3-5/+72
After physical link is created logical link needs to be created. The process starts after L2CAP channel is created and L2CAP Configuration Response with result PENDING is received. Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: Derive remote and local amp id from chan structAndrei Emeltchenko1-2/+4
l2cap_chan already keeps information about *_amp_id. Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: Return correct L2CAP response typeAndrei Emeltchenko1-1/+10
Return L2CAP_CREATE_CHAN_RSP for Create Channel Request and L2CAP_CONN_RSP for Create Connection Request. Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: Save hs_hchan instead of hs_hcon in loglink completeAndrei Emeltchenko1-1/+1
When logical link creation is completed we need to save hs_hchan which represents logical link instead of hs_hcon representing physical link. hs_hcon shall be saved when receiving physical link complete event. Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: trivial: Fix braces style and remove empty lineAndrei Emeltchenko1-2/+2
Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: mgmt: Use __constant when dealing with constantsSyam Sidhardhan1-5/+5
__constant_cpu_to_le*() is the right go here. Signed-off-by: Syam Sidhardhan <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: Remove unnecessary include export.hSyam Sidhardhan2-2/+0
For files only using THIS_MODULE and/or EXPORT_SYMBOL, map them onto including export.h -- or if the file isn't even using those, then just delete the include. Signed-off-by: Syam Sidhardhan <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: Add put(hcon) when deleting hchanAndrei Emeltchenko1-0/+2
When refcnt reaches zero disconnect timeout will run and hci_conn will be disconnected. Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: AMP: Process Logical Link complete evtAndrei Emeltchenko2-2/+44
After receiving HCI Logical Link Complete event finish EFS configuration by sending L2CAP Conf Response with success code. Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: AMP: Process Physical Link Complete evtAndrei Emeltchenko1-0/+55
Add processing for HCI Physical Link Complete event. Upon successful status received start L2CAP create channel process. Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: Use helper function sending EFS conf rspAndrei Emeltchenko1-6/+1
There is helper function used to send EFS Configuration Response. Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: trivial: Remove unneeded assignmentAndrei Emeltchenko1-1/+1
Assignment is not needed here since err is always gets value. Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: Fix sending unnecessary HCI_LE_Host_EnableJohan Hedberg1-2/+8
This patch fixes sending an unnecessary HCI_LE_Host_Enable command if the command has already been sent as part of the default HCI init sequence. Signed-off-by: Johan Hedberg <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: Fix unnecessary EIR update during powering onJohan Hedberg1-1/+6
When powered on the EIR data gets updated as the last step by mgmt. Therefore avoid an update when getting a local name update as that's part of the normal HCI init sequence. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: Fix sending unnecessary HCI_Write_SSP_Mode commandJohan Hedberg1-1/+2
This patch fixes sending an unnecessary HCI_Write_SSP_Mode command if the command has already been sent as part of the default HCI init sequence. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: Fix setting host feature bits for SSPJohan Hedberg1-3/+10
When we get a successful command complete for HCI_Write_SSP_Mode we need to update the host feature bits for the hdev struct accordingly. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: Disallow LE scanning and connecting in peripheral roleJohan Hedberg2-0/+6
When an adapter is in the LE peripheral role scanning for other devices or initiating connections to them is not allowed. This patch makes sure that such attempts will result in appropriate error returns. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: Make use feature test macrosJohan Hedberg2-18/+18
For better code readability and avoiding simple bugs of checking the wrong byte of the features make use of feature test macros whenever possible. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: Fix updating host feature bits for LEJohan Hedberg1-0/+5
When LE has been enabled with the simultaneous BR/EDR & LE parameter set to true we should also update the host features stored in struct hci_dev accordingly. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: mgmt: Restrict BR/EDR settings to BR/EDR-only adaptersJohan Hedberg1-3/+19
This patch makes sure that settings which are specific for BR/EDR capable adapters are not allowed for non-BR/EDR (e.g. LE-only) adapters. Instead, a "not supported" error is returned of such a setting is attempted to be set for a non-BR/EDR adapter. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-11-01Bluetooth: Fix HCI command sending when powering on LE-only adaptersJohan Hedberg1-13/+21
This patch makes sure that we don't send BR/EDR-only commands for LE-only adapters when they get powered on. Doing this would just cause command errors. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Replace *_init() for *_setup()Gustavo Padovan1-4/+4
le_init() and bredr_init() are now called le_setup() and bredr_setup() to avoid duplicates names over the tree even if they are all static. Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Read adversiting channel TX power during init sequenceJohan Hedberg1-0/+20
This patch adds the reading of the LE advertising channel TX power to the HCI init sequence of LE-capable controllers. This data will be used e.g. for inclusion in the advertising data packets when advertising is enabled. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Add setting of the LE event maskJohan Hedberg1-0/+20
This patch adds setting of the LE event mask to the HCI init procedure for LE-capable controllers. Right now we only set the default mask which is good enough for the events available in the 4.0 core specification. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Fix LE MTU reporting for HCIGETDEVINFOJohan Hedberg1-4/+11
This patch fixes the use of le_mtu and le_pkts values in the HCIGETDEVINFO ioctl for LE-only controllers. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Add initial support for LE-only controllersJohan Hedberg2-52/+53
This patch splits off most the HCI init sequence commands from a fixed set into a conditional one that is sent once the HCI_Read_Local_Features and HCI_Read_Local_Version_Information commands complete. This is necessary since many of the current fixed commands are not allowed for LE-only controllers. Signed-off-by: Johan Hedberg <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Replace include linux/module.h with linux/export.hSyam Sidhardhan2-2/+2
include <linux/export.h> is the right to go here. Signed-off-by: Syam Sidhardhan <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: trivial: Remove newline before EOFSyam Sidhardhan1-1/+0
Trivial fix. Signed-off-by: Syam Sidhardhan <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Start channel move when socket option is changedMat Martineau2-0/+24
Channel moves are triggered by changes to the BT_CHANNEL_POLICY sockopt when an ERTM or streaming-mode channel is connected. Moves are only started if enable_hs is true. Signed-off-by: Mat Martineau <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Do not retransmit data during a channel moveMat Martineau1-2/+2
Do not retransmit previously-sent data when a "receiver ready" s-frame with the "final" flag is received during a move. The ERTM state machines will resynchronize at the end of a channel move, and the state machine needs to avoid state changes during a move. Signed-off-by: Mat Martineau <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Acked-by: Andrei Emeltchenko <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Ignore BR/EDR packet size constraints when fragmenting for AMPMat Martineau1-1/+3
When operating over BR/EDR, ERTM accounts for the maximum over-the-air packet size when setting the PDU size. AMP controllers do not use the same over-the-air packets, so the PDU size should only be based on the HCI MTU of the AMP controller. Signed-off-by: Mat Martineau <[email protected]> Signed-off-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Configure appropriate timeouts for AMP controllersMat Martineau1-6/+41
The L2CAP spec recommends specific retransmit and monitor timeouts for ERTM channels that are on AMP controllers. These timeouts are calculated from the AMP controller's best effort flush timeout. BR/EDR controllers use the default retransmit and monitor timeouts. Signed-off-by: Mat Martineau <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Do not send data during channel moveMat Martineau1-0/+12
Outgoing ERTM data is queued during a channel move. The ERTM state machine is partially reset at the start of a move, and must be resynchronized with the remote state machine at the end of the move. Data is not sent so that there are no state transitions between the partial reset and the resync. Streaming mode frames are dropped during a move. Signed-off-by: Mat Martineau <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Acked-by: Andrei Emeltchenko <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Flag ACL frames as complete for AMP controllersMat Martineau1-0/+9
AMP controllers expect to transmit only "complete" ACL frames. These frames have both the "start" and "cont" bits set. AMP does not allow fragmented ACLs. Signed-off-by: Mat Martineau <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Acked-by: Andrei Emeltchenko <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Handle physical link completionMat Martineau1-0/+164
Several different actions may be taken when an AMP physical link becomes available. A channel being created on an AMP controller must continue the connection process. A channel being moved needs to either send a move request or a move response. A failed physical link will revert to using a BR/EDR controller if possible. Signed-off-by: Mat Martineau <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Acked-by: Andrei Emeltchenko <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Add move confirm response handlingMat Martineau1-0/+18
The move confirm response concludes the channel move command sequence. Receipt of this command indicates that data may begin to flow again. Signed-off-by: Mat Martineau <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Acked-by: Andrei Emeltchenko <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Add logical link confirmMat Martineau1-11/+123
The logical link confirm callback is executed when the AMP controller completes its logical link setup. During a channel move, a newly formed logical link allows a move responder to send a move channel response. A move initiator will send a move channel confirm. A failed logical link will end the channel move and send an appropriate response or confirm command indicating a failure. If the channel is being created on an AMP controller, L2CAP configuration is completed after the logical link is set up. Signed-off-by: Mat Martineau <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Move channel responseMat Martineau1-15/+168
The move response command includes a result code indicating "pending", "success", or "failure" status. A pending result is received when the remote address is still setting up a physical link, and will be followed by success or failure. On success, logical link setup will proceed. On failure, the move is stopped. The receiver of a move channel response must always follow up by sending a move channel confirm command. Signed-off-by: Mat Martineau <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Add state to hci_chanMat Martineau1-0/+1
On an AMP controller, hci_chan maps to a logical link. When a channel is being moved, the logical link may or may not be connected already. The hci_chan->state is used to determine the existance of a useable logical link so the link can be either used or requested. Signed-off-by: Mat Martineau <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Acked-by: Andrei Emeltchenko <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Add move channel confirm handlingMat Martineau1-3/+55
After sending a move channel response, a move responder waits for a move channel confirm command. If the received command has a "confirmed" result the move is proceeding, and "unconfirmed" means the move has failed and the channel will not change controllers. Signed-off-by: Mat Martineau <[email protected]> Acked-by: Andrei Emeltchenko <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Add new ERTM receive states for channel moveMat Martineau1-0/+102
Two new states are required to implement channel moves with the ERTM receive state machine. The "WAIT_P" state is used by a move responder to wait for a "poll" flag after a move is completed (success or failure). "WAIT_F" is similarly used by a move initiator to wait for a "final" flag when the move is completing. In either state, the reqseq value in the poll/final frame tells the state machine exactly which frame should be expected next. Signed-off-by: Mat Martineau <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Acked-by: Andrei Emeltchenko <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Channel move request handlingMat Martineau1-1/+112
On receipt of a channel move request, the request must be validated based on the L2CAP mode, connection state, and controller capabilities. ERTM channels must have their state machines cleared and transmission paused while the channel move takes place. If the channel is being moved to an AMP controller then an AMP physical link must be prepared. Moving the channel back to BR/EDR proceeds immediately. Signed-off-by: Mat Martineau <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Acked-by: Andrei Emeltchenko <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-24Bluetooth: Lookup channel structure based on DCIDMat Martineau1-0/+17
Processing a move channel request involves getting the channel structure using the destination channel ID. Previous code could only look up using the source channel ID. Signed-off-by: Mat Martineau <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Acked-by: Andrei Emeltchenko <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>
2012-10-23Bluetooth: Remove unnecessary intermediate functionMat Martineau1-11/+2
Resolves a conflict resolution issue in "Bluetooth: Fix L2CAP coding style". The remaining connect and create channel response handler is renamed to better reflect its use for both response types. Signed-off-by: Mat Martineau <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Acked-by: Andrei Emeltchenko <[email protected]> Signed-off-by: Gustavo Padovan <[email protected]>