l2cap_conless_channel always return 0 which is not used.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
l2cap_data_channel always return 0 which is not used anywhere,
make it void function.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
Make A2MP channel special channel which do not reference hci_conn.
This prevents from keeping ACL connection open when all L2CAP
channels got closed.
hci_conn_hold and hci_conn_put are not reference counts on the
hci_conn structure in the typical way. They are reference counts for
the ACL. When you do the last hci_conn_put, the ACL is disconnected
after a timeout.
Reported-by: Mat Martineau <[email protected]>
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
Functions will be always defined and in case not implemented as
dummy __no_func.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
Process A2MP responses, print cmd code and ident for now.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
Placeholder for A2MP Create Physlink Request.
Handles requests with invalid controler id as shown below:
...
> ACL data: handle 11 flags 0x02 dlen 50
A2MP: Create Physical Link req: local id 1 remote id 85
Assoc data:
<skipped>
< ACL data: handle 11 flags 0x00 dlen 15
A2MP: Create Physical Link rsp: local id 85 remote id 1 status 1
Invalid Controller ID
...
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
Process A2MP Get Info Request.
Example of trace log for invalid controller id is shown below:
...
> ACL data: handle 11 flags 0x02 dlen 13
A2MP: Get Info req: id 238
< ACL data: handle 11 flags 0x00 dlen 30
A2MP: Get Info rsp: id 238 status (1) Invalid Controller ID
...
Note that If the Status field is set to Invalid Controller ID all subsequent
fields in the AMP Get Info Response shall be ignored by the receiver.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
Helper function to build and send A2MP messages.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
Move this check to before the channel time creation simplifies the code
and avoid memory allocation if the channel already exist.
Signed-off-by: Gustavo Padovan <[email protected]>
Acked-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
These vars are kept in sync so we can use chan->state here.
Signed-off-by: Gustavo Padovan <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
This remove a bit more of socket code from l2cap core, this calls set the
SOCK_ZAPPED and do some clean up depending on the socket state.
Reported-by: Mat Martineau <[email protected]>
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
Use chan instead of void * makes more sense here.
Signed-off-by: Gustavo Padovan <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
This replace code in l2cap_le_conn_ready() by a similar code in
l2cap_chan_ready().
Signed-off-by: Gustavo Padovan <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
This is already performed inside l2cap_chan_ready(), so we don't need it
here again.
Signed-off-by: Gustavo Padovan <[email protected]>
Acked-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
Both FCS and Extended header might be or might not be present in a ERTM
channel.
Signed-off-by: Gustavo Padovan <[email protected]>
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
__constant_cpu_to_le16() is the right go here.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
Define assigned Protocol and Service Multiplexor (PSM) identifiers
and use them instead of magic numbers.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
Define Continuation flag which the only flag used from Flags field
in L2CAP Configuration Request and Response.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
After l2cap, sco and bluetooth modules merge some symbols doesn't need to
be exported anymore.
Signed-off-by: Gustavo Padovan <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
Most of the include were unnecessary or already included by some other
header.
Replace module.h by export.h where possible.
Signed-off-by: Gustavo Padovan <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
This is some leftover from the last patches that fixed style. It is mostly
line over 80 characters fixes reported by checkpatch.pl.
checkpatch.pl is clean for these files now.
Signed-off-by: Gustavo Padovan <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
Only obvious cases were left as inline, mostly oneline functions.
Signed-off-by: Gustavo Padovan <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
Previous callers of l2cap_build_conf_rsp in l2cap_config_req use
flags instead of continuation flag hardcoded value. It does not change
logic and preserve future possible flags.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
Remove magic number with defined link key size.
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
HCI_QUIRK_NO_RESET name is misleading - purpose of this quirk is to
reset device on close instead of init, not to not reset at all.
Rename it to HCI_QUIRK_RESET_ON_CLOSE to avoid confusion.
Signed-off-by: Szymon Janc <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
These functions were returning always 0, we just make then void.
Signed-off-by: Gustavo Padovan <[email protected]>
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
The same check is done just before call l2cap_streaming_send()
Signed-off-by: Gustavo Padovan <[email protected]>
Reviewed-by: Mat Martineau <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
Silence warnings below:
net/bluetooth/l2cap_core.c:1662:24: warning: Using plain integer
as NULL pointer
net/bluetooth/l2cap_core.c:1662:27: warning: Using plain integer
as NULL pointer
net/bluetooth/l2cap_core.c:1683:24: warning: Using plain integer
as NULL pointer
net/bluetooth/l2cap_core.c:1683:27: warning: Using plain integer
as NULL pointer
net/bluetooth/l2cap_core.c:2260:46: warning: Using plain integer
as NULL pointer
net/bluetooth/l2cap_core.c:2574:33: warning: Using plain integer
as NULL pointer
net/bluetooth/l2cap_core.c:2581:33: warning: Using plain integer
as NULL pointer
net/bluetooth/l2cap_core.c:4556:24: warning: Using plain integer
as NULL pointer
net/bluetooth/l2cap_core.c:4556:27: warning: Using plain integer
as NULL pointer
Signed-off-by: Andrei Emeltchenko <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>
chan->tx_q is only initialized if we use ERTM or Streaming mode.
Signed-off-by: Gustavo Padovan <[email protected]>
Signed-off-by: Marcel Holtmann <[email protected]>
This enables the new receive and transmit state machines.
Signed-off-by: Mat Martineau <[email protected]>
Signed-off-by: Gustavo Padovan <[email protected]>