Commit graph

41120 commits

Author SHA1 Message Date
Luiz Augusto von Dentz
62df15d598 nano_work: Don't assert if work is pending on submit
This makes nano_work_submit to allow resubmits when the work is pending
so the user code don't have to check the pending flag to avoid a possible
assert.

Change-Id: I6c9c7a2277aa8e590cedf1d043e55f72f3413451
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 17:29:59 +03:00
Luiz Augusto von Dentz
cd4501c453 nano_work: Add nano_work_pending
This adds nano_work_pending which can be use to check if a nano_work
is pending execution.

Change-Id: Iae0492a750de93fcd7e89e3a2e74509ffce4983b
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 17:29:59 +03:00
Johan Hedberg
a8de2de1f2 Bluetooth: Fix compiler warnings/errors related to string casts
Fix the following compiler warnings/errors that show up with llvm:

    tests/bluetooth/shell/src/main.c:594:2: error:
          initializing 'const uint8_t *' (aka 'const unsigned char *') with an
          expression of type 'char [11]' converts between pointers to integer types
          with different sign [-Werror,-Wpointer-sign]
            BT_DATA(BT_DATA_NAME_COMPLETE, DEVICE_NAME, DEVICE_NAME_LEN),
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    include/bluetooth/bluetooth.h:93:11: note: expanded
          from macro 'BT_DATA'
                    .data = (_data), \
                            ^~~~~~~
    1 error generated.
    net/bluetooth/hci_core.c:1759:22: error: passing
          'uint8_t [248]' to parameter of type 'const char *' converts between
          pointers to integer types with different sign [-Werror,-Wpointer-sign]
                            name_len = strlen(evt->name);
                                              ^~~~~~~~~
    lib/libc/minimal/include/string.h:32:34: note: passing
          argument to parameter 's' here
    extern size_t strlen(const char *s);
                                     ^
      CC      net/bluetooth/log.o
    net/bluetooth/hci_core.c:3136:10: error: passing
          'uint8_t [248]' to parameter of type 'char *' converts between pointers to
          integer types with different sign [-Werror,-Wpointer-sign]
            strncpy(name_cp->local_name, CONFIG_BLUETOOTH_BREDR_NAME,
                    ^~~~~~~~~~~~~~~~~~~
    lib/libc/minimal/include/string.h:30:39: note: passing
          argument to parameter 'd' here
    extern char  *strncpy(char *_Restrict d, const char *_Restrict s, size_t n);
    net/bluetooth/conn.c:301:10: error: passing
          'uint8_t [16]' to parameter of type 'char *' converts between pointers to
          integer types with different sign [-Werror,-Wpointer-sign]
            strncpy(cp->pin_code, pin, sizeof(cp->pin_code));
                    ^~~~~~~~~~~~
    lib/libc/minimal/include/string.h:30:39: note: passing
          argument to parameter 'd' here
    extern char  *strncpy(char *_Restrict d, const char *_Restrict s, size_t n);

Change-Id: I342131c6c2b25445382b2317d673561c4087096b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-04 12:44:24 +00:00
Vinicius Costa Gomes
da41fc87ed samples/zoap_server: Fix warning about pointer signedness
Change-Id: I78b2762d0713aa42d9800cb7736f4831195a6d3c
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-04 12:29:07 +00:00
Vinicius Costa Gomes
75d7147fa4 iot/zoap: Fix comparing pointers of different signedness
strncmp() expects pointers of type 'char *', we could cast option.value
to 'char *', but we can use memcmp() instead, which has the benefit of
being simpler.

Change-Id: I8c4ee4401712f3617c134d8e5b6d84e8f5cc4e1d
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-04 12:29:07 +00:00
Baohong Liu
e965119cd9 dma: qmsi_shim: add typecasting to avoid compilation error
Add typecasting in dma QMSI shim to avoid compilation error.

The DMA API and QMSI have their own definitions for the
dma configuration parameters, such as handshake_interface,
handshake_polarity, source/destination_transfer_width,
channel_direction, and source/destination_burst_length.
When a API is called, the shim driver will assign values
for the above-mentioned parameters to the configuration
variable(based on QMSI's definiton) from the values in the
variable provided by the caller based on API's definition.
Even though all these parameters have similiar definition
and values in both the generic API and QMSI, QMSI uses
its own names which are different from those definied in
the generic API. Without typecasting, the parameter value
assignment will cause compilation error(even though error
only happens for some compiler).

Jira: ZEP-1031

Change-Id: I147c690799514bd611cd9f88316f44346e095359
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-10-04 12:28:38 +00:00
Benjamin Walsh
bbe361ccaf nano: remove duplicated typedef
Obtained from device.h, which includes microkernel.h when building for a
microkernel system.

Caught by LLVM.

Change-Id: I98a00269b2b6cb38c851b176323de1228d65603d
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-10-04 12:28:27 +00:00
Ramesh Thomas
cda7bf3b2a samples: power_mgmt: Fix compile bugs flagged by llvm
Change-Id: Id062f1d6f1eef6b98d040dcd16eb34fa4bd8bb30
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-10-04 12:27:56 +00:00
Ramesh Thomas
773dcc34ae sample: fs: Fix a compile error flagged by llvm
printk format specifier used for size_t (%lu) was not compatible
with llvm because it sees size_t as unsigned int. Using %zu
makes it portable acroos compilers.

Change-Id: If0e732fbaada5f50a975ec912b8147d6b252a2de
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-10-04 12:27:39 +00:00
Itankar, Piyush T
76947d7fe6 Bluetooth: A2DP: Added Connect API
API Implemented Connect API. This can be used to establish A2DP connection.

Change-Id: I8cf714283a452c40b33fd46de442514a1341264c
Signed-off-by: Itankar, Piyush T <piyush.t.itankar@intel.com>
2016-10-04 10:55:04 +00:00
Johan Hedberg
a8df6cd14b Bluetooth: Adjust maximum connections & paired devices range
The maximum allowed values in Kconfig were quite conservative.

Change-Id: Icd2d09a2d52fbbaf03671147f08e08385c6776c7
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-04 10:46:30 +00:00
Ramesh Thomas
d31b3fe3f7 fs: Fixes some type incompatibilities flagged by llvm
Change-Id: I37df470ace779b9654f8b10e50ec83d9f629c965
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-10-04 00:19:22 -07:00
Mariusz Skamra
d363e384f3 Bluetooth: Enable privacy for nimble
This enables privacy feature for nimble configuration.

Change-Id: I3ffb1f6c54ac0825c73e3943c5634905b4908f16
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-10-04 09:12:25 +02:00
Johan Hedberg
9adfb4af17 Bluetooth: RFCOMM: Fix some remaining white-space issues
Change-Id: I56f3ffc9dc9dd18ff204224d1a3166f9dbdc4c3f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-04 08:12:14 +03:00
Arkadiusz Lichwa
dde0737f1a Bluetooth: L2CAP: Fix sending double connection request
HCI events 'encryption change' and 'encryption key refresh' can trigger
channel ops 'encrypt_change'. For BR/EDR outgoing channel connection setup,
when new security needs to be set over existing one, CoC channel connection
request to remote is on hold since security got precedence. Then when
security procedure ends controller emits these 2 HCI event one by one.
In such case channel ops 'encrypt_change' is called 2 times causing
indirectly resume held request that can in consequence sent two subsequent
connection requests for the same target channel.

> HCI Event: Simple Pairing Complete (0x36) plen 7	[hci1] 132.169432
        Status: Success (0x00)
        Address: 68:17:29:CF:5D:86 (Intel Corporate)
> HCI Event: Link Key Notification (0x18) plen 23	[hci1] 132.191364
        Address: 68:17:29:CF:5D:86 (Intel Corporate)
        Link key: 949749ea9f6e91cae22bbfdeada2f333
        Key type: Authenticated Combination key from P-192 (0x05)
> HCI Event: Encryption Key Refresh Complete (0x30) plen 3	[hci1] 132.222430
        Status: Success (0x00)
        Handle: 72
> HCI Event: Auth Complete (0x06) plen 3	[hci1] 132.224365
        Status: Success (0x00)
        Handle: 72
< ACL Data TX: Handle 72 flags 0x00 dlen 12	[hci1] 132.229865
      L2CAP: Connection Request (0x02) ident 7 len 4
        PSM: 5 (0x0005)
        Source CID: 65
< HCI Command: Set Connection Encryption (0x01|0x0013) plen 3	[hci1] 132.230340
        Handle: 72
        Encryption: Enabled (0x01)
> HCI Event: Number of Completed Packets (0x13) plen 5	[hci1] 132.232363
        Num handles: 1
        Handle: 72
        Count: 1
> HCI Event: Command Status (0x0f) plen 4	[hci1] 132.234361
      Set Connection Encryption (0x01|0x0013) ncmd 1
        Status: Success (0x00)
> HCI Event: Encryption Change (0x08) plen 4	[hci1] 132.235362
        Status: Success (0x00)
        Handle: 72
        Encryption: Enabled with E0 (0x01)
< ACL Data TX: Handle 72 flags 0x00 dlen 12	[hci1] 132.240960
      L2CAP: Connection Request (0x02) ident 8 len 4
        PSM: 5 (0x0005)
        Source CID: 65
> ACL Data RX: Handle 72 flags 0x02 dlen 16	[hci1] 132.245765
      L2CAP: Connection Response (0x03) ident 7 len 8
        Destination CID: 65
        Source CID: 65
        Result: Connection pending (0x0001)
        Status: Authentication pending (0x0001)
> HCI Event: Number of Completed Packets (0x13) plen 5	[hci1] 132.246360
        Num handles: 1
        Handle: 72
        Count: 1
> ACL Data RX: Handle 72 flags 0x02 dlen 16	[hci1] 132.246987
      L2CAP: Connection Response (0x03) ident 8 len 8
        Destination CID: 0
        Source CID: 65
        Result: Connection refused - no resources available (0x0004)
        Status: No further information available (0x0000)

Change-Id: Ib417b0e701d6ac09c988f3aff0276cd488ed9115
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-10-04 08:12:14 +03:00
Jaganath Kanakkassery
5f2d121cf1 Bluetooth: RFCOMM: Replace tabs with spaces
As per the coding guidelines spaces should be used for allignment
of macros.

Change-Id: I8947af32ec64ef3791a88bc3ff151f2fbb3c8480
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2016-10-04 08:12:14 +03:00
Johan Hedberg
ea5576145a Bluetooth: RFCOMM: Remove reference counting
The reference counting has been an internal trick to handle the TX
fiber, but it's not really needed since we can do the same thing with
the help of the state value.

Change-Id: I9cdaed9afb0b0c07e23d599637328cb863c123b3
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-04 08:12:14 +03:00
Jaganath Kanakkassery
7fb0894565 Bluetooth: RFCOMM: Introduce dlc destroy
dlc will be destroyed when ref count reaches 0.
This also moves calling user disconnected callback to destroy
since disocnneted callback will be called whenever dlc is
destroyed regardless of dlc previously been in connected state
or not.

Change-Id: I4a13f8118704c59a88923b74e538063c0db11d77
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2016-10-04 08:12:14 +03:00
Jaganath Kanakkassery
5743879d85 Bluetooth: RFCOMM: Introduce rfcomm_send_dm()
DM (Disconnect mode) response is to inform the peer that dlc
is in logically disconnected state. It can be used to reject
an incoming SABM or PN request as well.

For example if a PN request comes to a server channel which is
not registered, a DM response can be sent.

> ACL Data RX: Handle 256 flags 0x02 dlen 18
      Channel: 64 len 14 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
         Address: 0x03 cr 1 dlci 0x00
         Control: 0xef poll/final 0
         Length: 10
         FCS: 0x70
         MCC Message type: DLC Parameter Negotiation CMD (0x20)
           Length: 8
           dlci 2 frame_type 0 credit_flow 15 pri 7
           ack_timer 0 frame_size 195 max_retrans 0 credits 7

< ACL Data TX: Handle 256 flags 0x00 dlen 8
      Channel: 64 len 4 [PSM 3 mode 0] {chan 0}
      RFCOMM: Disconnect Mode (DM) (0x0f)
         Address: 0x0b cr 1 dlci 0x02
         Control: 0x1f poll/final 1
         Length: 0
         FCS: 0x73

Change-Id: I1f7576ad97590eed147505802f59faadacc790ea
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2016-10-04 08:12:14 +03:00
Arun Jagadish
2b583eac63 Bluetooth: AVDTP: Connect and Disconnect API
- Connect/Disconnect API
- L2CAP Connected/Disconnected Callback

Change-Id: I852b748adb9825541904dbb43bdb169e7125749f
Signed-off-by: Arun Jagadish <arun.jagadish@intel.com>
2016-10-04 08:12:14 +03:00
Luiz Augusto von Dentz
e889e2ae87 Bluetooth: Enable CONFIG_BLUETOOTH_DEBUG_AVDTP with prj_20.conf
This ensures ADVTP patches are build tested with debug enabled.

Change-Id: I5c09afea4a9df84b054d2383f0b53ff85fa5dcd5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 08:12:14 +03:00
Arkadiusz Lichwa
ab0b3a8303 Bluetooth: AVDTP: Fix getting inaccessible internal
conn->handle belongs to core stack space. Apps shouldn't get access to
it. This fixes build/compiler error when Kconfig's DEBUG_AVDTP is defined.

Change-Id: Id188b367e1e4b7d377a7ef59c0f672229ad98fd8
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-10-04 08:12:14 +03:00
Arkadiusz Lichwa
13ac9cc9c6 Bluetooth: AVDTP: Remove internal headers
The protocol for audio distribution shouldn't have references to internal
core stack space.

Change-Id: Ifce00856dfb8e48d406f815d54cf4b493a7a2770
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-10-04 08:12:14 +03:00
Arkadiusz Lichwa
fdfad74bca Bluetooth: A2DP: Remove internal stack headers
The profile code as sort of user application shouldn't use internal core
stack headers.

Change-Id: I3c6aabf0ee8e1bedac0bd99ebc8526d735219369
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-10-04 08:12:14 +03:00
Kaustav Dey Biswas
ab30160708 Bluetooth: SDP: Server: Initialize and accept incoming connections
Initialize SDP, register to L2CAP and accept incoming connections

Change-Id: I568db63910d9e6ff418581b9943d528d4260b859
Signed-off-by: Kaustav Dey Biswas <kaustav.d.biswas@intel.com>
2016-10-04 08:12:14 +03:00
Johan Hedberg
566780ca91 Bluetooth: tests: Fix name of Quark SE C1000 SS devboard
This board was recently renamed, but apparently this reference was
left out.

Change-Id: I9789fa45eab6a9b3118f0f0857ef2207311597f3
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-04 08:12:14 +03:00
Johan Hedberg
49d2bb13cd Bluetooth: L2CAP: Extend bt_l2cap_create_pdu() with 'reserve' parameter
This makes it possible for protocols to reserve headroom for their own
headers.

Change-Id: I64530febc4b86b45a379660197f0ff63671fab6e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-04 08:12:14 +03:00
Arkadiusz Lichwa
71163ac9dc Bluetooth: init: Add HFP to automated tests
Adds HFP HF stack code to automated tests during build coverage.

Change-Id: Ic7bf5f0077b38bbe0feed167935dee73c989a523
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-10-04 08:12:14 +03:00
Jaganath Kanakkassery
58d47f0b99 Bluetooth: RFCOMM: Handle session disconnection from peer
UA response will be sent and session will be cleaned up.
Session will also be cleaned up if l2cap channel is disconnected.

> ACL Data RX: Handle 256 flags 0x02 dlen 8
      Channel: 64 len 4 [PSM 3 mode 0] {chan 0}
      RFCOMM: Disconnect (DISC) (0x43)
         Address: 0x03 cr 1 dlci 0x00
         Control: 0x53 poll/final 1
         Length: 0
         FCS: 0xfd

< ACL Data TX: Handle 256 flags 0x00 dlen 8
      Channel: 64 len 4 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Ack (UA) (0x63)
         Address: 0x03 cr 1 dlci 0x00
         Control: 0x73 poll/final 1
         Length: 0
         FCS: 0xd7

Change-Id: I44997d7d13c90a2a0814520ea11e6f14bc60271f
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2016-10-04 08:12:14 +03:00
Arkadiusz Lichwa
ef1a5527e7 Bluetooth: HFP HF: Enforce Kconfig's HFP_HF relation to RFCOMM
Whenever turning on HFP HF support there's a need to toggle on 
automatically RFCOMM support.

Change-Id: I2fb75c09534d0b6e49a403a527e1caa7d6f9ffaf
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-10-04 08:12:14 +03:00
Vinayak Chettimada
8e25789052 Bluetooth: Controller: Remove custom irq implementation
As part of an effort to closely integrate with Zephyr OS,
removed the custom implementation of IRQ interfaces used
in controller code.

Jira: ZEP-841

Change-id: Ie427f45aeecad51053112371526cb7dc4817248f
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-10-04 08:12:14 +03:00
Vinayak Chettimada
54164b1350 Bluetooth: Controller: Fix SCHED_ADVANCED cond, compilation
Code under SCHED_ADVANCED macro in ctrl.c is used to
disable advanced radio time space scheduling calculations
used for placing non-overlapping observer and master roles;
to populate connection parameter request/response PDU
fields, and autonomous generation of slave initiated
connection parameter requests.

This macro shall always be enabled for optimal and correct
operation of the controller, It shall only be disabled to
debug failures in other part of the controller, to rule out
this code's influence, if any, on the failure being
debugged.

Change-id: I04e5f837ef0a5658361bd3668f583f1e13504570
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-10-04 08:12:14 +03:00
Arkadiusz Lichwa
97b32a0468 Bluetooth: HFP HF: Fix getting inaccessible internal
The profile (application layer) shouldn't use direct (de)references
to internal stack context members.

Change-Id: I772134a5016de6706c30f058545b3c64c0894202
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-10-04 08:12:14 +03:00
Carles Cufi
2fb8a11906 Bluetooth: Controller: Fix __packed placement
Place __packed at the end of the structure definition in line
with the rest of the Zephyr codebase.

Jira: ZEP-732

Change-Id: I25aa731cbd188a6e23ca2035eb22fa919295bb25
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-04 08:12:14 +03:00
Szymon Janc
7ea426a8f1 Bluetooth: L2CAP: Cleanup flags names for BR/EDR channels
This makes all flags used for BR/EDR L2CAP be stored in single place.
Connection oriented flags and signaling flags are now sharing same
atomic.

Change-Id: If01b29009f9c60ed529338122992b9b5e31f883a
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-04 08:12:14 +03:00
Carles Cufi
e9d32ed6e1 Bluetooth: Controller: Remove unused macro
Leftover from previous commits, this macro is not used anymore in
the HCI implementation.

Change-Id: I376c92a6b68432d2ff818ea25e68f087131e8479
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-04 08:12:14 +03:00
Jaganath Kanakkassery
5c1ce90926 Bluetooth: RFCOMM: Handle dlc disconnection from peer
Sends UA response for the DISC request from peer and clean up
dlc. Disconnected callback will be called to profile. Dummy
buf and credit will be used to wake up the tx fiber for exit
and cleanup.

> ACL Data RX: Handle 256 flags 0x02 dlen 8
      Channel: 64 len 4 [PSM 3 mode 0] {chan 0}
      RFCOMM: Disconnect (DISC) (0x43)
         Address: 0x0b cr 1 dlci 0x02
         Control: 0x53 poll/final 1
         Length: 0
         FCS: 0xb8

< ACL Data TX: Handle 256 flags 0x00 dlen 8
      Channel: 64 len 4 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Ack (UA) (0x63)
         Address: 0x0b cr 1 dlci 0x02
         Control: 0x73 poll/final 1
         Length: 0
         FCS: 0x92

Change-Id: I4ec19a93d13a95a9cf4fc5a9beaf48ba8c98689d
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2016-10-04 08:12:14 +03:00
Mariusz Skamra
c76da25cac Bluetooth: tester: Fix advertising data
This fixes data passed to the BTP Device Found event.

Change-Id: I1ab465b87ce24f3ea10b7217c254aafaee494c91
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-10-04 08:12:14 +03:00
Arkadiusz Lichwa
e3506ca120 Bluetooth: RFCOMM: Shuffle up Kconfig's RFCOMM_L2CAP_MTU
Moves RFCOMM frames max length settings directly under the main RFCOMM
selector for better relations readability. It uses 'depends on' clause
for RFCOMM dependency and proper indentation.

Change-Id: Ic4dc0ffddaf8b438ace1f455191b7a707c0e9ed6
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-10-04 08:12:14 +03:00
Carles Cufi
2f33724017 Bluetooth: Controller: Use net_buf for evt and ACL RX
Use the net_buf structure directly when populating incoming
ACL data or asynchronous events. This ensures that no additional
memcpy() operations are required and removes completely the
statically allocated buffers in hci.c.

Jira: ZEP-726

Change-Id: I6ac8bd0becb7037ce8ecfac109f44832d23fcfd2
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-04 08:12:14 +03:00
Szymon Janc
36b8e8cdc8 Bluetooth: Add debug keys support to HCI ECC emulation code
This was initialy done in SMP code but was lost when moved to HCI ECC
emulation. With this patch if CONFIG_BLUETOOTH_USE_DEBUG_KEYS is set
ECC emulation code uses debug public and private keys as specified
in Core Specifitation 4.2 Vol 3. Part H 2.3.5.6.1.

Change-Id: I626e7e1c6bde2baeae642d6f2c60c324fdd0369f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-04 08:12:14 +03:00
Szymon Janc
f4d75398ca Bluetooth: SMP: Fix unused static variable
gen_method_legacy is used only if SMP SC only mode is not enabled.
This fix compilation warning on some GCC version.

Change-Id: I183c5d0072c2f76da78bf0d2b1077c8d0620f688
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-04 08:12:14 +03:00
Szymon Janc
aa6a9b0066 Bluetooth: SMP: Remove unused static const
This is no longer used and can produce warning on some GCC versions.

Change-Id: Ib19903ea41d6446983a738ea99912dc5ba9b88f8
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-04 08:12:14 +03:00
Carles Cufi
0a720c4771 Bluetooth: Controller: Use net_buf for CC/CS TX
Preallocate a response event net_buf buffer before processing an
incoming command and provide it to hci.c so that it populates
the event directly, instead of using a temporary buffer than
must then be copied into the return net_buf.
This applies exclusively to Command Complete and Command
Status, since those are the only events that are sent in
direct respone to an incoming command.

Jira: ZEP-726

Change-Id: Ia3ea71ac497690af929c44308760f68491ea829e
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-04 08:12:14 +03:00
Luiz Augusto von Dentz
6877651a30 Bluetooth: GATT: Fix locking RX fiber
If an indication is received while there is an outstanding request the
code will attempt to get a buffer from req_pool to confirm which may
block causing the RX fiber to lock and probably crash as the request
won't release the buffer until it gets a response or timeout.

JIRA: ZEP-940

Change-Id: I3df30db473a0c6c6c3e63b1d0b410a50bdd3accf
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 08:12:14 +03:00
Carles Cufi
d12b6c87c9 Bluetooth: Controller: Use net_buf for HCI RX
Instead of copying the net_buf contents into a temporary
buffer byte-by-byte, the Controller HCI code now handles
incoming commands and ACL packets from the Host directly
in the net_buf containers, to avoid unnecessary memory
copying and to align with the rest of the Bluetooth stack.

Jira: ZEP-726

Change-Id: I9802607d84ee6206218b711e7e6e23dafb70581a
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-04 08:12:14 +03:00
Luiz Augusto von Dentz
85f82d7985 Bluetooth: init: Add CONFIG_BLUETOOTH_A2DP to prj_20.conf
This makes sure A2DP support is build tested on each patch.

Change-Id: I9dba5c20d44d8ac92910e80c1ad97ac8d2207652
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 08:12:14 +03:00
Itankar, Piyush T
acb8c75648 Bluetooth: A2DP: Initialization of A2DP
A2DP Initialization, registers callback functions with AVDTP.

Change-Id: I6b24ca5e7906c08774a173f35da28b1711f34577
Signed-off-by: Itankar, Piyush T <piyush.t.itankar@intel.com>
2016-10-04 08:12:14 +03:00
Luiz Augusto von Dentz
52efcf8acd Bluetooth: AVDTP: Add missing BLUETOOTH_DEBUG_AVDTP
Change-Id: Ib2243f85bb06df9d98d258bce11d4e7ac87f212d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 08:12:14 +03:00
Luiz Augusto von Dentz
4c44e66a5c Bluetooth: init: Add CONFIG_BLUETOOTH_AVDTP to prj_20.conf
This makes sure AVDTP support is build tested on each patch.

Change-Id: Ia7cf94ca84fa01bd676a99b0df58ac745bbfc8c7
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 08:12:14 +03:00