Commit graph

18396 commits

Author SHA1 Message Date
Flavio Santes
76e479974a net/mqtt: Allow an MQTT publisher app to receive msgs
Changes applied by this patch:

- Add the mqtt_publisher_parser routine
- Add the MQTT_PACKET_TYPE macro to get the MQTT msg packet type
  (required by mqtt_publisher_parser)
- Add the mqtt_linearize_buffer (required by mqtt_publisher_parser)
- Add the mqtt_recv callback for reception
- Modify the mqtt_init routine to install the reception callback

The mqtt_publisher_parser routine is a callback used internally
to execute the appropriate mqtt_rx routine. Only the following
messages are handled by this routine:

MQTT_CONNACK, MQTT_PUBACK, MQTT_PUBREC, MQTT_PUBCOMP and MQTT_PINGRESP.

On error, it executes the ctx->malformed cb, if defined.

This commit also introduces the mqtt_linearize_buffer routine that
will be used to linearize an IP stack fragmented buffer. This patch
makes use of the net_nbuf_linear_copy routine to linearize the
incoming buffer. mqtt_rx_xxxx routines are also updated to handle
linear buffers (no fragmentation).

Currently, all the network protocol routines assume that the input
buffer is not fragmented. Future versions will remove that assumption
and the mqtt_linearize_buffer routine will be removed as well.

Public MQTT API is not affected by this patch.

Change-Id: I02fece67052ffbc7cb393d5ca545c503da463c4b
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-06 09:11:45 +01:00
Flavio Santes
bf88fe5118 net/mqtt: Add the reception callback
The reception cb: internal use only cb that will be set according to
the application profile: PUBLISHER, SUBSCRIBER, PUBLISHER & SUBSCRIBER
or SERVER.

Change-Id: Ib36b0686deb9220e507f9e468aae1b1191c35d31
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-06 09:11:45 +01:00
Flavio Santes
8619d9d625 net/mqtt: Improve error handling in mqtt_rx_connack routine
Avoid undesired behaviors by exiting once an error is detected.

Change-Id: Id8e6accd6cd096274fe1c40a615d290967f1d4b9
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-06 09:11:45 +01:00
Flavio Santes
e4e74be208 net/mqtt: Improve buffer error handling in mqtt_tx routines
This commit improves the buffer error handling in the mqtt_tx
routines.

Change-Id: Ic8e5761d927fe881b2376b6ac948a412e3b1168a
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-06 09:11:45 +01:00
Flavio Santes
d490ff27ad net/mqtt: Add the mqtt_rx_publish routine
The mqtt_rx_publish is used to process incoming MQTT PUBLISH
messages. This routine performes the following steps:

- take ownership of the rx buffer containing the MQTT PUBLISH msg,
- call the MQTT parser routine, and
- determine, based on the incoming message's MQTT QoS,
  the next action.

Change-Id: I3cc011cf0c280205161d0484f12a2cfa79fdf44a
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-06 09:11:45 +01:00
Flavio Santes
ab042f2997 net/mqtt: Add missing function prototypes
Some public function prototypes are missing, so this commit adds
them to the mqtt.h header.

Change-Id: I57a50ce346f086f55e499bfc8c815fd161a52f7b
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-06 09:11:45 +01:00
Flavio Santes
edfaeba73d net/mqtt: Use the right data type
Use the appropriate data type for some variables:

- const input arguments
- int32_t instead of uint32_t for timeout
- uint8_t instead of int for variables that take just a few
  possitive values.

Change-Id: Id7d762b400fa17e6751829ac401cd7c13aabb7b2
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-06 09:11:44 +01:00
Flavio Santes
4cfd7f7fe2 net/mqtt: Improve indentation
Replace tabs by spaces to improve code alignment in mqtt_pkt.c.

Change-Id: If586b91ba67b8075ddc7e0203dc538420e96b49a
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-06 09:11:44 +01:00
Flavio Santes
51a48d2d07 net/mqtt: Make input arguments const
This commit changes some function signatures found at the private
MQTT Packet Lib. Input arguments representing arrays can be considered
'const', avoiding compiler warnings when passing "const arrays" in
MQTT applications.

Change-Id: I3ebaa9c7ff5fba74324bf79c55027cdd82669eaa
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-06 09:11:44 +01:00
Flavio Santes
c015c0e2c8 net/nbuf: Introduce the net_nbuf_linear_copy routine
This commit adds one routine previously found at the DNS resolver
library. The net_nbuf_linear_copy routine allows to "linearize"
an IP stack network buffer. This routine is required by functions
that must jump between big chunks of data that in this case may
lie between many fragments. Tracking fragments may be a tedious
task, so getting a linear copy of the buffer will reduce code
complexity altough it increases memory consumption.

The DNS client library is updated to reflect these changes.

Change-Id: Iae321f99fa9b05fae7e722b6d41baac427d82d7e
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-06 09:11:44 +01:00
Flavio Santes
a46548ec31 net/protocols: Remove unnecessary assignement in Makefiles
Change-Id: Ifea85ebdaf5f1ac6b17abddc0311306c31c36b37
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-06 09:11:44 +01:00
Tomasz Bursztyka
db1ee31c04 samples: ieee802154: Let's proceed with an active scan
It's currently hard to find a Beacon enabled network. So let's switch to
active scan for now.

Change-Id: I192e7c3128f9488fb680ea7f23221b2b4aa52188
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 09:11:44 +01:00
Tomasz Bursztyka
5d0503fa30 net: ieee802154: Handle disassocation notification from PAN coordinator
PAN coordinator can decide to eject a client device from the PAN by
disassocating it.

Change-Id: Ia868554d40a7aceb4c75a0b426db45f56003fbb7
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 09:11:44 +01:00
Tomasz Bursztyka
820713239a net: ieee802154: Add PAN disassociation request
If associated, this will request to disassociate from the PAN. That's
only client side, PAN coordinator can also disassociate a client, which
case is not handled here.

Change-Id: If308f51b62c5006b4a2db53d0c891e8192f3c198
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 09:11:44 +01:00
Tomasz Bursztyka
d8b874b0c7 net: ieee80215: Add Active Scan request
Active scan differs from passive scan by sending a Beacon request (thus
the "active" part) and wait for beacons in reply to it.

Taking the opportunity to add debugging output to scanning logic.

Change-Id: I85001b1ea17f4ec4cd315dc39524c4d8f053cee2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 09:11:43 +01:00
Tomasz Bursztyka
df4fa6557e net: ieee802154: Integrate MAC Command frames handling
Now we can handle incoming MAC command frames.
Association result ONLY for now.

Change-Id: Ib54b1757185ed079fe6914fa7939347020e006d9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 09:11:43 +01:00
Tomasz Bursztyka
b53e48de1b net: ieee802154: Add PAN association request
Such management request will enable association the 15.4 device to an
existing PAN.

Change-Id: I61ffd5e4d8192716e067c5225b3327f08944063b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 09:11:43 +01:00
Tomasz Bursztyka
792c29a376 samples: net: ieee802154: Once cc2520 is up, let's initiate a scan
It will print-out the results, if any.

Change-Id: If988a6dc3c4504a8d4aa947d3d3f949870b638c8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 09:11:43 +01:00
Tomasz Bursztyka
8a2bc07af8 net: ieee802154: Integrate beacon frame handling
This is used only for scanning at this point. But will be needed to get
slots information and else in the future.

Change-Id: Ib917469134c6ba5a54485847c612d3755f62ed35
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 09:11:43 +01:00
Tomasz Bursztyka
88d4f1f543 net: ieee802154: Add grounds for passive scan
Currently, as only CC2520 device is supported: it will loop over the 16
channels present in 2.4Ghz spectrum. However, this will need refinement
as soon as other spectrums will be in use: L2 layer could request
capabilites from the device in order to know which range to use.

Scan result is done one at a time for now. It's unlikely going to fit
all production use case, so it's going to change in the future.

Change-Id: I2fafec49eb5cbfca1a4f04107ba3b6511d7d956d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 09:11:43 +01:00
Tomasz Bursztyka
ef041c10b6 net: event: Notify on interface being put down or up
It can be thus used to track the status of network interfaces in order
to act accordingly (no need to try sending things on network if the
interface is down for instance).

Change-Id: Ie160ef0dfdad6679d531d05a7abada96ad1de7db
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 09:11:43 +01:00
Tomasz Bursztyka
81bbfa1995 net: event: Fix misplaced comment
Change-Id: I6ab966461b98351d5207ec53054c62eebd6b44dc
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 09:11:43 +01:00
Maureen Helm
87bc9eb010 net: samples: Fix stale yaip references
Fixes two references to yaip that were were left behind after net/yaip
was renamed to subsys/net/ip. The zperf sample needs net_private.h, so
the include path is updated. The dhcpv4_client sample doesn't need it,
so the path is removed.

Change-Id: I189f1b58191524330254a5b7b31a9a4974956728
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-06 09:11:43 +01:00
Luiz Augusto von Dentz
8a16c6681a net: l2: Add enable callback
This adds enable callback which can be used to notify the L2 driver about
changes of interface state, the L2 driver can then check if the new state
is allowed and reject otherwise.

Change-Id: I4bb6b1e32be2633f24694c0246585f803f8c645d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-06 09:11:42 +01:00
Luiz Augusto von Dentz
bf4fb51f44 net: if: Add NET_IF_UP flag
This adds NET_IF_UP flag support indicating the interface is up,
currently this shall only be used internally by the driver, later on it
shall be possible to make it public by using dedicated functions.

Change-Id: I38090da4030395b2341733b846004789416d61c1
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-06 09:11:42 +01:00
Anas Nashif
c0f0dd9734 samples: env sensing: restrurcture and cleanup docs
- move documentation to rst
- add a top level Makefile
- remove obsolete configurations

Change-Id: I8674b67e0383497cbbb0b6e861b78d8c7f7378a5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-05 19:56:37 -05:00
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