Commit graph

41120 commits

Author SHA1 Message Date
Anas Nashif
6131ed2a01 doc: grove lcd: move to rst syntax
Change-Id: I3b8b1a8f0fc7732c88536ad2667257721dc743fd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-05 19:56:37 -05:00
Anas Nashif
f562349231 doc: philosophers: move to rst syntax
Change-Id: Idc808f062853bc201c22e4c30f0e3687f055265d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-05 19:56:37 -05:00
Anas Nashif
2e293c5172 doc: synchronization: move to rst syntax
Change-Id: I3f3868e213704f2d34ff06bd94d4d62d20881e4b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-05 19:56:37 -05:00
Anas Nashif
49bbc4d13d doc: hello world: move to rst and expand docuemntation
Change-Id: Id623dd8d2f97836c0f970424d06d9d549065f7c5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-05 19:56:37 -05:00
Anas Nashif
369d5c95df MAINTAINERS: add tests/kernel to kernel section
Change-Id: I26ada48d322b9d92621d8d0fdb9cb776aa9b0d71
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-06 00:00:51 +00:00
Qiu Peiyang
a6aa60f502 tests/gpio: fix typo
Change-Id: Ic93d1e5dcb46455abd3ea2d7fe8790b2163c1c67
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2017-01-05 23:54:18 +00:00
Anas Nashif
89e64ee446 Merge "Merge bluetooth branch into master" 2017-01-05 21:55:54 +00:00
Juro Bystricky
af6d817428 Makefile (arc/soc/quark_se): New compiler options
GCC 6.x for ARC does not recognize the options
    -mARCv2EM and -mav2em anymore.

Both options replaced in Makefile by -mcpu=quarkse_em.

Change-Id: I9dec26dd64b4738976704a39455fe4241406db9e
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-01-05 11:26:21 -08:00
Juro Bystricky
51859d27e9 Makefile (arc/soc/em*): New compiler options
GCC 6.x for ARC does not recognize the options
-mARCv2EM and -mav2em anymore.

Both options replaced in Makefile by -mcpu=arcem.

Change-Id: Ic86bf51cd5fb1a67ba2cd75998cd907e26996347
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2017-01-05 11:26:21 -08:00
Sergio Rodriguez
47b7b6bd31 ext: lib: mbedtls : Upgrading mbedTLS library
Upgrading mbedTLS to version 2.4 from 2.3

Origin: https://tls.mbed.org/download/start/mbedtls-2.4.0-apache.tgz

Jira: ZEP-1292
Jira: ZEP-734

Change-Id: I32d81304f5d568810e271b8e9fc2135def1dda0a
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-05 17:58:06 +00:00
Jean-Paul Etienne
1a3de7b4b6 samples: button: set EDGE to SW0_GPIO_INT_CONF if defined
SW0_GPIO_INT_CONF shall allow boards to define the
interrupt configuration for SW0 without having to modify
the button sample app.

If SW0_GPIO_INT_CONF is defined set EDGE to it, otherwise
used default EDGE value.

Change-Id: Ia697e06debc341463ed9cdee1db564f3727d27e3
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-01-05 16:35:47 +00:00
Marcus Shawcroft
98f3f3b1a5 sensor/bmc150: Fix layout.
Change-Id: Ibbf5f74b6e3298586f40e35c3cb9a2414655db41
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-05 16:19:29 +00:00
Marcus Shawcroft
8386d2f3fa sensor/bmc150: Drop unncessary external definition.
Change-Id: Ic1e85685ca50a7f2568f327a0bf211c1ef4740e3
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-05 16:19:28 +00:00
Marcus Shawcroft
cc7f0e05b4 sensor/nrf5_temp: Drop unncessary attribute set callback.
The sensor_attr_set() wrapper deals with drivers that do not support
the attribute set API, there is no need to provide a per driver
implementation that only return -ENOTSUP.

Change-Id: I1568ab018988fc560bd89ab96f2f2256ddd5b7e1
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-05 16:19:28 +00:00
Jean-Paul Etienne
cfa43f5bda serial: enable 64-bytes FIFO for UART 16750 in uart_ns16550 driver
UART 16750 is basically a UART 16550 with a 64-bytes FIFO.
The 64-bytes FIFO can be enabled via register FCR.

Account for it in the uart_ns16550 driver whenever the
CONFIG_UART_NS16750 variable is set.

Change-Id: I2342b28a41d03c96410bbfbe57e4b5a4e335731d
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-01-05 16:05:20 +00:00
Johan Hedberg
aa129feec2 Merge bluetooth branch into master
- Redesigned controller-host interface with less buffers & threads
 - Lower latency work & interrupt handling in the controller
 - Improved SDP client support
 - Improved RFCOMM support
 - Improved AT parser (for HFP)
 - IPSP sample app ported to native IP stack

----------------------------------------------------------------
Arkadiusz Lichwa (11):
      Bluetooth: SDP: Implement ServiceSearchAttribute request PDU
      Bluetooth: SDP: Validate Transaction ID of PDU
      Bluetooth: SDP: Introduce ContinuationState of PDU
      Bluetooth: SDP: Handle SSA PDU response
      Bluetooth: SDP: Enable resolve all user delivered UUIDs
      Bluetooth: SDP: Validate SSA response PDU
      Bluetooth: SDP: Allocate user delivered memory for resolved data
      Bluetooth: SDP: Check room needed against user allocated
      Bluetooth: SDP: Send resolved UUID data to user
      Bluetooth: SDP: Add UUID reference to user callback
      Bluetooth: SDP: Update 'no records found' code comment

Arun Jagadish (1):
      Bluetooth: AVDTP:Add Accept Incoming connection cb

Carles Cufi (5):
      Bluetooth: Rename SEND_STACK to TX_STACK_SIZE
      Bluetooth: hci_uart: Disable HCI ECC commands temporarily
      bluetooth: Tune stack sizes after measuring with hci_uart
      bluetooth: controller: Split events into normal and priority
      bluetooth: hci_uart: Allocate 65 bytes for L2CAP packets

Jaganath Kanakkassery (7):
      Bluetooth: RFCOMM: Respond to Test command
      Bluetooth: RFCOMM: Handle non supported message types
      Bluetooth: Fix reserve param of bt_l2cap_create_pdu()
      Bluetooth: RFCOMM: Increase dlc stack size to 256
      Bluetooth: RFCOMM: Rearrange fns to avoid forward declaration
      Bluetooth: RFCOMM: Implement timer in dlc
      Bluetooth: RFCOMM: Implement timer in session

Johan Hedberg (24):
      Bluetooth: Take advantage of new net_buf_add_mem() API
      Bluetooth: Fix incorrect call to memcpy()
      Bluetooth: Fix another incorrect memcpy call
      Bluetooth: hci_ecc: Fix incorrect private_key size
      Bluetooth: Kconfig Remove HOST_BUFFERS option
      Bluetooth: Kconfig: Introduce BLUETOOTH_COMBINED_RX_BUF option
      Bluetooth: Refactor bt_recv() logic
      Bluetooth: Introduce support for HCI driver-side RX thread
      Bluetooth: Remove support for host flow control
      Bluetooth: Add bt_buf_get_rx() helper API
      Bluetooth: Kconfig: Fine tune options for RECV_IS_RX_THREAD
      Bluetooth: Convert H:4 HCI driver to RECV_IS_RX_THREAD
      Bluetooth: Use bt_buf_get_rx in hci_ecc.c
      Bluetooth: hci_ecc: Delay event buffer allocation
      Bluetooth: drivers: Use bt_buf_get_rx() in h5.c
      Bluetooth: Controller: Use bt_buf_get_rx for buffer allocation
      Bluetooth: Remove unused prio pool and buffer helpers
      Bluetooth: Controller: Switch to controller-side RX thread
      Bluetooth: Controller: Deprioritize adv report buffer allocation
      Bluetooth: h4: Use k_fifo instead of k_sem
      Bluetooth: Reduce the minimum RX buf count to 2
      Bluetooth: h4: Convert TX path to be interrupt based
      Bluetooth: Create separate bt_recv_prio() API
      Bluetooth: Fix potential race condition in bt_pub_key_gen()

Louis Caron (1):
      Bluetooth: fix write cmd handling

Luiz Augusto von Dentz (2):
      Bluetooth: ipsp: Port sample to native stack
      Bluetooth: ATT: Fix using k_fifo API with net_buf

Piyush Itankar (1):
      Bluetooth: A2DP: Removes confirmation callback registration

Sathish Narasimman (8):
      Bluetooth: AT: Rename API's which uses term 'stream'
      Bluetooth: HFP HF: SLC Connection send/parse CIND
      Bluetooth: AT: Change API name skip_whitespace to skip_space
      Bluetooth: HFP HF: SLC query indicators present value
      Bluetooth: samples: handsfree application indicator callback
      Bluetooth: HFP HF: SLC Enable indicator status report
      Bluetooth: AT: Reset AT and CMD state
      Bluetooth: HFP HF: Rename cind_status_handle_values

Szymon Janc (1):
      Bluetooth: hci_ecc: Verify LE Generate DHKey command parameters

Vinayak Chettimada (18):
      Bluetooth: Controller: internally handle unknown rsp for LE Ping
      Bluetooth: Controller: use BT_WARN to display unknown rsp
      Bluetooth: Controller: add radio ISR profiling event
      Bluetooth: Controller: BT_INFO the ISR profiling event
      Bluetooth: Controller: Kconfig radio ISR profiling
      Bluetooth: Controller: refactor ISR to reduce critical path code
      Bluetooth: Controller: add init test for BT 4.0 only controller
      Bluetooth: Controller: Kconfig LE Ping feature
      Bluetooth: Controller: fix LE Ping conditional compilations
      Bluetooth: Controller: Kconfig Data Length Update feature
      Bluetooth: Controller: Kconfig connection RSSI measurement
      Bluetooth: Controller: Kconfig Tx buffer size
      Bluetooth: Controller: Kconfig fast encryption setup feature
      Bluetooth: Controller: add memq_peek interface
      Bluetooth: Controller: replace work with mayfly
      Bluetooth: Controller: fix DLE conditional compilations
      Bluetooth: Controller: Remove advertiser struct use in observer
      Bluetooth: Controller: revert to event callback inside radio ISR

 drivers/bluetooth/hci/Kconfig                      |  14 +-
 drivers/bluetooth/hci/h4.c                         | 398 ++++++---
 drivers/bluetooth/hci/h5.c                         |   9 +-
 drivers/bluetooth/nble/gatt.c                      |   2 +-
 drivers/bluetooth/nble/rpc_serialize.c             |   6 +-
 include/bluetooth/buf.h                            |  38 +-
 include/bluetooth/hci.h                            |   1 +
 include/bluetooth/hfp_hf.h                         |  73 +-
 include/bluetooth/rfcomm.h                         |   5 +-
 include/bluetooth/sdp.h                            |   6 +-
 include/drivers/bluetooth/hci_driver.h             |  34 +-
 samples/bluetooth/handsfree/src/main.c             |  42 +
 samples/bluetooth/hci_uart/nrf5.conf               |   4 +-
 samples/bluetooth/hci_uart/src/main.c              |   8 +-
 samples/bluetooth/hci_usb/src/main.c               |   6 +-
 samples/bluetooth/ipsp/prj.conf                    |  34 +-
 samples/bluetooth/ipsp/src/main.c                  | 384 +++++++--
 subsys/bluetooth/Kconfig                           |   2 +-
 subsys/bluetooth/controller/Kconfig                |  81 +-
 subsys/bluetooth/controller/Makefile               |  13 +-
 subsys/bluetooth/controller/hal/ccm.h              |   2 -
 .../bluetooth/controller/hal/{hal_rtc.h => cntr.h} |  16 +-
 subsys/bluetooth/controller/hal/cpu.h              |   2 -
 subsys/bluetooth/controller/hal/debug.h            |   2 -
 subsys/bluetooth/controller/hal/ecb.h              |   2 +-
 subsys/bluetooth/controller/hal/hal_work.h         |  33 -
 .../controller/hal/{rtc.c => nrf5/cntr.c}          |  35 +-
 subsys/bluetooth/controller/hal/{ => nrf5}/ecb.c   |   6 +-
 subsys/bluetooth/controller/hal/{ => nrf5}/radio.c |  19 +-
 subsys/bluetooth/controller/hal/{ => nrf5}/rand.c  |  46 +-
 subsys/bluetooth/controller/hal/radio.h            |   2 +-
 subsys/bluetooth/controller/hal/rand.h             |   2 +-
 subsys/bluetooth/controller/hci/hci.c              |  64 +-
 subsys/bluetooth/controller/hci/hci_driver.c       | 257 ++++--
 subsys/bluetooth/controller/hci/hci_internal.h     |   1 +
 subsys/bluetooth/controller/ll/ctrl.c              | 869 ++++++++++++++------
 subsys/bluetooth/controller/ll/ctrl.h              |  72 +-
 subsys/bluetooth/controller/ll/ctrl_internal.h     |  32 +-
 subsys/bluetooth/controller/ll/ll.c                |  12 +-
 subsys/bluetooth/controller/ll/pdu.h               |  19 +-
 .../bluetooth/controller/{ll => ticker}/ticker.c   | 459 ++++++++---
 .../bluetooth/controller/{ll => ticker}/ticker.h   |   2 +-
 subsys/bluetooth/controller/util/config.h          |  40 +
 subsys/bluetooth/controller/util/defines.h         |  34 -
 subsys/bluetooth/controller/util/mayfly.c          | 163 ++++
 .../bluetooth/controller/util/{work.h => mayfly.h} |  35 +-
 subsys/bluetooth/controller/util/mem.c             |  45 +-
 subsys/bluetooth/controller/util/mem.h             |   8 +
 subsys/bluetooth/controller/util/memq.c            |  18 +-
 subsys/bluetooth/controller/util/memq.h            |   1 +
 subsys/bluetooth/controller/util/util.h            |   8 +
 subsys/bluetooth/controller/util/work.c            | 165 ----
 subsys/bluetooth/host/Kconfig                      |  94 +--
 subsys/bluetooth/host/a2dp.c                       |   6 -
 subsys/bluetooth/host/at.c                         |  38 +-
 subsys/bluetooth/host/at.h                         |  10 +-
 subsys/bluetooth/host/att.c                        |  27 +-
 subsys/bluetooth/host/avdtp.c                      |  37 +-
 subsys/bluetooth/host/avdtp_internal.h             |  40 +-
 subsys/bluetooth/host/conn.c                       |   4 +-
 subsys/bluetooth/host/conn_internal.h              |   2 +-
 subsys/bluetooth/host/gatt.c                       |   3 +-
 subsys/bluetooth/host/hci_core.c                   | 271 ++----
 subsys/bluetooth/host/hci_core.h                   |   4 +
 subsys/bluetooth/host/hci_ecc.c                    |  95 ++-
 subsys/bluetooth/host/hci_raw.c                    |  23 +-
 subsys/bluetooth/host/hfp_hf.c                     | 268 +++++-
 subsys/bluetooth/host/hfp_internal.h               |  16 +-
 subsys/bluetooth/host/l2cap.c                      |  10 +-
 subsys/bluetooth/host/l2cap_br.c                   |   4 +-
 subsys/bluetooth/host/rfcomm.c                     | 195 ++++-
 subsys/bluetooth/host/rfcomm_internal.h            |   5 +
 subsys/bluetooth/host/sdp.c                        | 383 ++++++++-
 subsys/bluetooth/host/sdp_internal.h               |  12 +
 subsys/bluetooth/host/smp.c                        |   2 +-
 subsys/bluetooth/host/smp_null.c                   |   2 +-
 tests/bluetooth/init/prj_controller_4_0.conf       |  14 +
 tests/bluetooth/init/prj_controller_dbg.conf       |   2 +
 tests/bluetooth/init/testcase.ini                  |  11 +-
 tests/bluetooth/shell/src/main.c                   |   4 +-
 tests/bluetooth/tester/src/l2cap.c                 |   2 +-
 81 files changed, 3622 insertions(+), 1593 deletions(-)
 rename subsys/bluetooth/controller/hal/{hal_rtc.h => cntr.h} (75%)
 delete mode 100644 subsys/bluetooth/controller/hal/hal_work.h
 rename subsys/bluetooth/controller/hal/{rtc.c => nrf5/cntr.c} (63%)
 rename subsys/bluetooth/controller/hal/{ => nrf5}/ecb.c (98%)
 rename subsys/bluetooth/controller/hal/{ => nrf5}/radio.c (97%)
 rename subsys/bluetooth/controller/hal/{ => nrf5}/rand.c (72%)
 rename subsys/bluetooth/controller/{ll => ticker}/ticker.c (81%)
 rename subsys/bluetooth/controller/{ll => ticker}/ticker.h (98%)
 create mode 100644 subsys/bluetooth/controller/util/config.h
 delete mode 100644 subsys/bluetooth/controller/util/defines.h
 create mode 100644 subsys/bluetooth/controller/util/mayfly.c
 rename subsys/bluetooth/controller/util/{work.h => mayfly.h} (52%)
 delete mode 100644 subsys/bluetooth/controller/util/work.c
 create mode 100644 tests/bluetooth/init/prj_controller_4_0.conf

Change-Id: I1ea0adab8e50f643fb2ffdf487da1a9c30183225
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 17:26:00 +02:00
Johan Hedberg
696b89da0f Bluetooth: Fix potential race condition in bt_pub_key_gen()
It's possible for the Public Key to be available by the time that the
bt_hci_cmd_send_sync() returns, so we need to make sure the flags have
the right values no matter what.

Change-Id: I053093b6611af360f52b14ddca50d409388f9475
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 14:48:01 +02:00
Carles Cufi
0e650d4eaf drivers: rtt: Lock interrupts around RTT Write
Since RTTWriteNoLock is not thread-safe or preemptable, it is necessary
to lock interrupts around the calls to it.

Change-id: I38b7e37a0f46e77bf82c1e07d549414393e84a51
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-01-05 13:32:11 +01:00
Anas Nashif
457ae38dd0 doc: support official website theme
Jira: ZEP-1512
Change-Id: I795b1cdec3eb6096c97e2b97013184914102dccf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-05 12:26:49 +00:00
Anas Nashif
b7b2318148 doc: add JIRA macro
In the documentation you can now reference issues in JIRA using the
following macro:

 :jira:`ZEP-308`

This will link to the JIRA in the macro.

Change-Id: I3785d4abd243f5c5b75e9e3b58a449e2a3225415
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-05 12:26:48 +00:00
Arun Jagadish
231050a966 Bluetooth: AVDTP:Add Accept Incoming connection cb
Added Accept Incoming connection callbacks for the A2DP layer

Change-Id: I8aee32a97916ed9fc9c4050151e7395e288c404c
Signed-off-by: Arun Jagadish <arun.jagadish@intel.com>
2017-01-05 11:33:24 +00:00
Carles Cufi
c2a2841212 bluetooth: hci_uart: Allocate 65 bytes for L2CAP packets
With LE Secure Connections the longest packet we require is 65 bytes
long: 64 bytes of Public Key data + 1 byte SMP opcode.
Extend the size of the L2CAP pool blocks so that they can fit such
packets and therefore one can use 70-byte
CONFIG_BLUETOOTH_CONTROLLER_TX_BUFFER_SIZE to achieve LE Secure
Connections pairing without HCI fragmentation.

Change-id: I2f11b4277ec5a24ceba79bccc7d84c64065b6e84
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05 11:05:49 +00:00
Jaganath Kanakkassery
c37b59b3bb Bluetooth: RFCOMM: Implement timer in session
As per the spec, the station which disconnects the last dlc
should disconnect session also. In case if remote does not
do it we need to disconnect otherwise rfcomm will be connected
without any dlc. So this starts an idle timer to handle the
above scenario.

This also starts a disconnect timer to handle in case remote
does not respond to session disconnect request.

Change-Id: I3b45aa5bf4c35fd81dc10974f2b0b6d4cfe4ea7d
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2017-01-05 09:36:08 +00:00
Sathish Narasimman
b5891d1ddf Bluetooth: HFP HF: Rename cind_status_handle_values
Rename cind_status_handle_values to ag_inidcator_handle_values.
Because the same function will be reused internally for +CIEV
Callbacks.

Change-Id: I875064de17700d72ea89dbbe0f5cb6554c813a5e
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2017-01-05 12:35:21 +05:30
Sathish Narasimman
4b323cd72e Bluetooth: AT: Reset AT and CMD state
Reset AT and COMMAND state to process unsolicited response received
after processing result recieved for AT command sent to AG.

Change-Id: Id2a5827ce5b098336291696157027699479478cf
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2017-01-05 12:35:21 +05:30
Sathish Narasimman
166a8f762a Bluetooth: HFP HF: SLC Enable indicator status report
End of service level connection(call waiting or 3-way calling bit
and HF Indicators bit not set at present). AT+CMER is sent to
enable indicators status reporting in the AG side.

< ACL Data TX: Handle 256 flags 0x00 dlen 24                  [hci0] 102.898017
      Channel: 68 len 20 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
         Address: 0x09 cr 0 dlci 0x02
         Control: 0xef poll/final 0
         Length: 16
         FCS: 0x40
        41 54 2b 43 4d 45 52 3d 33 2c 30 2c 30 2c 31 0d  AT+CMER=3,0,0,1.
        40                                               @
> ACL Data RX: Handle 256 flags 0x02 dlen 15                  [hci0] 102.942198
      Channel: 64 len 11 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
         Address: 0x0b cr 1 dlci 0x02
         Control: 0xff poll/final 1
         Length: 6
         FCS: 0x86
         Credits: 1
        0d 0a 4f 4b 0d 0a 86                             ..OK...

Change-Id: I1630bf40f0f84e6e037b405854eb0c1c4ea691c4
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2017-01-05 12:35:21 +05:30
Sathish Narasimman
55190c90a1 Bluetooth: samples: handsfree application indicator callback
Displays the present value of the indicators in the Handsfree
application.

Change-Id: I666ff2b15e70de8c1a26b902077d79c5c1a9d5fe
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2017-01-05 12:35:21 +05:30
Szymon Janc
46a7989a5d Bluetooth: hci_ecc: Verify LE Generate DHKey command parameters
Reply with Invalid Parameters Command Status if incomplete command
was received.

 HCI Command: LE Generate DHKey (0x08|0x0026) plen 60
        invalid packet size
        f6 0f 79 a0 3c 4f 3e 90 40 66 6b 1d 93 64 af ed  ..y.<O>.@fk..d..
        03 ec b4 5f 29 cf 6d 26 42 02 61 b9 29 9a bf 0b  ..._).m&B.a.)...
        5e da 86 8b 3a ef aa e8 13 3d 87 de a7 dc 36 57  ^...:....=....6W
        25 89 56 43 e8 2a 73 56 62 60 fa 81              %.VC.*sVb`..
> HCI Event: Command Status (0x0f) plen 4
      LE Generate DHKey (0x08|0x0026) ncmd 1
        Status: Invalid HCI Command Parameters (0x12)

Change-Id: I9c4e798096023f0807e8d353ac3318e3d13dc6f7
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-01-05 08:49:17 +02:00
Piyush Itankar
4b5e19d21c Bluetooth: A2DP: Removes confirmation callback registration
Confirmation callbacks needed not be registered with AVDTP
during A2DP initialization

Change-Id: I2cdf8c5a283775e49fa6e7e9404024e26d05a767
Signed-off-by: Piyush Itankar <piyush.t.itankar@intel.com>
2017-01-05 08:49:17 +02:00
Jaganath Kanakkassery
665937a19f Bluetooth: RFCOMM: Implement timer in dlc
This basically implements timer for connection and disconnection.

Conn timer will be started when dlc is initialized and stopped
when it is connected. Authentication if any, will be also included
in this timer.

Disc timer will be started during disconnect initiation.

Change-Id: Ia4b74e478fefa42db21aef528e623a24c72ddf7f
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2017-01-05 08:49:17 +02:00
Jaganath Kanakkassery
3b397076ab Bluetooth: RFCOMM: Rearrange fns to avoid forward declaration
Moves rfcomm_send_disc() and rfcomm_session_disconnect() to call it
while doing timer implementation.

Change-Id: I5805d31fb45181193385f055716c8518d68cc4a1
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2017-01-05 08:49:17 +02:00
Arkadiusz Lichwa
b11f30a246 Bluetooth: SDP: Update 'no records found' code comment
Adds more descriptive comment to the code responsible for handling no
resolved UUID case.

Jira: ZEP-1112

Change-Id: I1af07949e19246d51bab9df05504a90f5fb22bb2
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2017-01-05 08:49:17 +02:00
Arkadiusz Lichwa
7ec0c37ec3 Bluetooth: SDP: Add UUID reference to user callback
User may want to know when getting called user UUID callback handler
on what UUID the result data was retrieved from server.

Jira: ZEP-1112

Change-Id: Iabb2dbdf0f3cfdb24244e052f094c7549164b199
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2017-01-05 08:49:17 +02:00
Vinayak Chettimada
2d064eef89 Bluetooth: Controller: revert to event callback inside radio ISR
In order that host can continue a connection event by
enqueuing packets, the number of completed packets event
needs to be generated as soon it arrives on air. Hence, the
Controller now calls the radio_event_callback on every radio
Rx complete ISR.

The callback executes at the Radio ISR priority, take care
to only do as little as necessary in the callback, say, just
a semaphore give to wake up the hci_driver's thread.

Change-id: If48afd0f1390d450bc1e7ec66f1c9fd45208d9a4
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05 08:49:17 +02:00
Carles Cufi
e979d656cc bluetooth: controller: Split events into normal and priority
For the host to be able to block on the recv_thread while waiting for a
number of completed packets HCI event, those are pulled from the radio
in a new, higher priority thread that also schedules the execution of
the lower priority event/ACL data recv_thread.

Change-id: I9d356bd297d0504cb16a032fb5fe5530693546e2
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05 08:49:17 +02:00
Luiz Augusto von Dentz
ae6d92a4ef Bluetooth: ATT: Fix using k_fifo API with net_buf
net_buf shall not be used with k_fifo since net_buf_unref will assume
unused bytes in the beginning are actually fragments causing it to
unref them as well.

Jira: ZEP-1489

Change-Id: I5ce420de73b245dc20eb15ea4d8d0b6ba346e513
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-05 08:49:17 +02:00
Johan Hedberg
d64f47d956 Bluetooth: Create separate bt_recv_prio() API
Since callers of bt_recv() have so far anyway been required to know in
which context to call it (based on e.g. bt_hci_evt_is_prio) it's
cleaner to have two separate APIs: bt_recv and bt_recv_prio.

Change-Id: Icd0d9aed9c51ffd2def31432c4ffcc16a9f13ccd
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:17 +02:00
Johan Hedberg
3341d7d2b5 Bluetooth: h4: Convert TX path to be interrupt based
Use interrupt based transmission instead of polling.

Change-Id: Iebfd67372044d3e6de9bdbdd6f0c9c6d01d46cb9
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:17 +02:00
Johan Hedberg
1094f00253 Bluetooth: Reduce the minimum RX buf count to 2
The recent redesign of the H:4 HCI driver means that the smallest
safest RX buffer count goes down to 2. Default is left at 3 however to
get a bit better performance.

Change-Id: I879c7bd3a769f973dfb9bd179d196ab91f9d2abe
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:17 +02:00
Johan Hedberg
37aa1a1f8b Bluetooth: h4: Use k_fifo instead of k_sem
So far the use of k_sem meant that there was no major benefit of
having more than 2 or 3 RX buffers since there was no queuing
mechanism. Instead of using k_sem, introduce a k_fifo and use that to
queue up incoming buffers. This way the RX buffer count can be
increased with measurable effects on throughput.

Change-Id: I8122b233aeee7c8e145de3fff5f10bcfe348efaa
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:17 +02:00
Johan Hedberg
2f191012c2 Bluetooth: Controller: Deprioritize adv report buffer allocation
Advertising reports are the only HCI events which we can drop if we
are low on buffers. Allocate them therefore with K_NO_WAIT rather than
K_FOREVER.

Change-Id: I0b7c92647f9be54b8746da837037725f8161a452
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:17 +02:00
Johan Hedberg
88b620550c Bluetooth: Controller: Switch to controller-side RX thread
Since the controller already uses a thread for receiving data it makes
sense to enable the BLUETOOTH_RECV_IS_RX_THREAD option.

Change-Id: I927b20c1a0afaea8d000df28cc220a69ae817d59
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:17 +02:00
Johan Hedberg
533d544d95 Bluetooth: Remove unused prio pool and buffer helpers
These are no longer used by anything.

Change-Id: Ic01467b4fbaae0af29ff5dc537f2e19744170a41
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:17 +02:00
Johan Hedberg
d79bdd74e9 Bluetooth: Controller: Use bt_buf_get_rx for buffer allocation
The controller uses K_FOREVER for the allocations so there's no
benefit in trying to use specialized pools (which exist to try to
guarantee availability of buffers for critical data).

Change-Id: I130f2c44a2f28af1284290e6a0b17dcba438862f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:17 +02:00
Johan Hedberg
3fb654ecd1 Bluetooth: drivers: Use bt_buf_get_rx() in h5.c
The H:5 HCI driver doesn't need the type-specific bt_buf allocation
helpers.

Change-Id: Iccb9803f32f3143f1cdf972d9229124816a99aa6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:17 +02:00
Johan Hedberg
38eef90d01 Bluetooth: hci_ecc: Delay event buffer allocation
Allocate the event buffers after the ECDH operations rather than
before them. This way we don't hold on to the buffer for potentially
multiple seconds while the buffer could be used for other things.

Change-Id: I0fcc34ec4bea2265b7df3c1de3587c2a850c974e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:17 +02:00
Johan Hedberg
8f766efc2f Bluetooth: Use bt_buf_get_rx in hci_ecc.c
There's no need to use the type-specific helpers since those anyway
map to the same pool.

Change-Id: I74750f545c989bb921abca58166fe591ed325856
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:17 +02:00
Johan Hedberg
95049fb99b Bluetooth: Convert H:4 HCI driver to RECV_IS_RX_THREAD
Completely redesign the H:4 driver to utilize its own thread and
select the new RECV_IS_RX_THREAD Kconfig option.

Jira: ZEP-1483

Change-Id: I0ca0661b66d564e5edc1b8505706d6bb76632e79
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:17 +02:00
Johan Hedberg
53b1503ac8 Bluetooth: Kconfig: Fine tune options for RECV_IS_RX_THREAD
Give more sensible values when RECV_IS_RX_THREAD is configured.

Change-Id: I40b5bd88213d224cc29f63fccef6cecee5868f77
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:17 +02:00
Johan Hedberg
0174200cd0 Bluetooth: Add bt_buf_get_rx() helper API
The separate ACL & event pools will soon be removed, and it's already
now convenient to have a generic API when the exact type of the
incoming packet is not yet known.

Change-Id: I84cb65d17ea69ebeaeb21532fbf76689e4fb59a0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:17 +02:00