Commit graph

42249 commits

Author SHA1 Message Date
Ricardo Salveti
d25d62a0e9 gpio/nrf5: set and clear just the specific gpio pin
Don't use the previous reg value when setting up just one specific pin,
as it can have a side effect on other gpio pins.

Change-Id: I60e69950a72446a6fa7087b13dbcecf6ae4b15e4
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2016-10-06 15:50:10 +00:00
Ricardo Salveti
81e7749cd5 kernel: event logger needs ring buffer
Change-Id: Ia5bb7e0c7cf7f94b03aad9826d5798af7813d0b5
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2016-10-06 12:56:19 +00:00
Anas Nashif
f320338066 sensors: do not use choice for I2C address
Set the value for the I2C address directly and use only
one per sensor.

Change-Id: I24d06a964e8e372eddf262b70fe5d9854a04563c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-06 04:17:52 +00:00
Anas Nashif
efd6b94929 sensors: HDC1000: check for manufacturer and device IDs
Make sure we are connected to the right device.

Change-Id: I09e696563191392d23a316ad065bb7e320df76bb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-06 04:17:44 +00:00
Ricardo Salveti
bc1affbfa2 drivers/gpio: nrf5: Use generic GPIO base naming
NRF_GPIO_BASE can be used by both the nrf51 and nrf52 families, as it
gets defined by the nrf5x.h header files.

Change-Id: I8e6b265d9ce94551389ca170f105a53c88d58c68
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2016-10-06 04:09:29 +00:00
Anas Nashif
6a534710c0 sensors: use one init priority config for all sensors
Sensors are end-devices and usually nothing depends on them,
so set a global priority for all sensors and use it instead of
individual values per sensor.

Change-Id: I5847411e783ef8a8517f0ab1d8234810513707b4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-05 23:01:23 +00:00
Anas Nashif
1ccad63744 samples: remove useless printf/printk wrappers
Change-Id: I4518171c85914785df1fc02ac679279b49a1be31
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-05 23:01:22 +00:00
Fabien Parent
f52baa15fb stm32: make SRAM/FLASH base address generic to soc
Move SRAM_BASE_ADDRESS and FLASH_BASE_ADDRESS to Kconfig.soc since
it will most likely be the same values for all STM32 socs.

Change-Id: I682dc441e34155a19a4f90757707008ef299e9d4
Signed-off-by: Fabien Parent <fparent@baylibre.com>
2016-10-05 18:33:21 +02:00
Benjamin Walsh
e135a273ec unified/doc: Kernel primer for unified kernel
Work by: Allan Stephens

Change-Id: I1f936cd6e7d592969f65330a6d204729ab0f32db
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-10-05 14:54:47 +00:00
Marcus Shawcroft
352ef5f033 eth: Rework LOG_ETHERNET_LEVEL config description.
Generalize the LOG_ETHERNET_LEVEL configuration parameter for use with
multiple ethernet drivers.

Change-Id: I26bc2189c8cf79db19f59e8082caec03b0d9c7b8
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-05 11:29:37 +00:00
Dmitriy Korovkin
19f2884738 unified: Fix build broblem caused by concurrent make processes in single dir
Make sure that kernel/unified, that is included in libs-y does not
built recursively through building kernel/ directory.
Make sure that any lib.a library is not included into libzephyr.a
and thus object modules from those lib.a files are linked only if a
function from that object module is referenced from the application.

Jira: ZEP-1025

Change-Id: Id3a3e96ca0b8abc9aedde0ffb9baa0164e380464
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-10-05 10:29:31 +00:00
Javier B Perez
d846dd1fcd drivers: shared irq: clean nested #if condition and align
Removed duplicated nest #if condition and aligned #if lines.

Change-Id: I54b8d9bfa166c41f133f8b1f5011c68ad68281a4
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-10-05 10:09:21 +00:00
David B. Kinder
449df16e60 doc: FIFO API uses first 32 bits of data items
API documenation for Nanokernel FIFO make no mention that the data items
added to the FIFO must include and reserve the first 32 bits for use as
a pointer to the next item in the FIFO.  This adds that note, as described
in the overview FIFO documentation.

Change-Id: I8cf0072d97dbb373a73d534f39b72831c726f4ef
Jira: ZEP-747
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2016-10-05 10:07:59 +00:00
Qiu Peiyang
76549c1b79 I2C: remove obsolete i2c_quark_se_ss driver
i2c_quark_se_ss driver is deprecated and replaced
by i2c_qmsi_ss. So remove i2c_quark_se_ss definition.

Change-Id: Idcc6a7f01ffae626ae7d5f9966eac67be78599af
Signed-off-by: Qiu Peiyang <peiyangx.qiu@intel.com>
2016-10-05 10:07:30 +00:00
Ramesh Thomas
c4c0ed414b power_mgmt: Reduce complexity in handling of power hooks
Simplified some documentation, removing inconsistencies and making
it easier to understand by separating PM infrastructure areas and
soc specific components that implement the hooks.

Removed the DEVICE_SUSPEND_ONLY policy as it is redundant and
causes high complexity in the flow. It is also not practical
to use it because it was meant to be used without doing CPU or SOC
low power state operations. This means it would do device PM
operations in the ISR of the system timer used by the scheduler.
This can disrupt the scheduler time.

Added a check of a flag around the notification sent from the ISR
of the wake event and created APIs to set/clear it. This will
allow disabling the notification when not needed from
_sys_soc_suspend().

Jira: ZEP-972
Change-Id: Id7aa7d2683384eabed518d4efac446ecc84c3498
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-10-05 10:05:42 +00:00
Iván Briano
aba245daad drivers qmsi: Fix power management with reentrancy disabled
The new device control API added a 'device_power_state' variable to the
driver's data structure to keep track of the current power state set
for a device. This member variable is conditionally built into the
runtime data structure of each driver, but in some cases the whole data
structure is conditional on its respective API_REENTRANCY config
variable.

In those cases where the runtime data was previously used only for
reentrancy protection, the runtime data pointer used for device
initialization is NULL, and when power management is enabled, this
invalid pointer ends up dereferenced to get the device_power_state
member.

Make the declaration of the runtime data dependent on any of its
conditional members, and NULL only when all of those settings are
disabled.

Change-Id: I4f41e00ad8551a096db639e31d33f43752b6672f
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-10-05 09:51:09 +00:00
Andy Ross
8d801a5e27 sanitycheck: Remove linker VMA/LMA offset checking
This misfeature can crop up at development time as the linker scripts
are modified, not just as a regression in known tests (c.f. ZEP-955).
So it makes more sense to put it in a check_link_map script inovked
for every build.  Remove it from sanitycheck.

Change-Id: I9c2f47a26a3bc03170b895545476350341e91170
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-10-05 09:48:54 +00:00
Andy Ross
4cc228baf6 check_link_map: rewrite in python
Oops, turns out that we don't require perl in all our build
environments.  Rewrite this script (it's tiny) in Python.  Exactly the
same logic.

Change-Id: Icbf4b36ef0b18fca94d54fc7fe5e47343c55c669
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-10-05 09:48:54 +00:00
Anas Nashif
b88f2e9e6a Merge "Merge bluetooth branch into master" 2016-10-05 09:26:37 +00:00
Iván Briano
9c7b5eacea unified: Fix building of the unified kernel
Change-Id: I6824cdb9123a574a56af10efdebdc1c8b82427f8
Signed-off-by: Iván Briano <ivan.briano@intel.com>
2016-10-04 18:11:05 -03:00
Peter Mitsis
340d00ab51 unified: Simplify k_msgq_purge()
Simplifies k_msgq_purge() at the expense of making the case of an
already empty message queue a little slower.

Change-Id: I8fafd6d49233efbf23b95d171f81bf795e828454
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-04 20:04:46 +00:00
Peter Mitsis
223b962e0b unified: Enable tickless idle test
Change-Id: I4cd1603266686f907dbc4398b6bc3dfea1e4502c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-04 20:02:50 +00:00
Peter Mitsis
96cb05ca50 unified: Add tickless idle support for x86 and ARM
Change-Id: I42d20355321f431900727768a0836ee18e96b667
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-04 20:02:50 +00:00
Peter Mitsis
a04c0d70e1 unified: Rename k_thread_static_init structure
Renames the k_thread_static_init structure to better follow
Zephyr naming conventions.

Change-Id: I479add2aefa3421ebc0b879e0d04c0c7ffd7f107
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-04 19:57:58 +00:00
Johan Hedberg
41d60dc3ed Merge bluetooth branch into master
Main changes:

 - Initial A2DP support
 - Initial SDP support
 - Controller code cleanups
 - Improved RFCOMM support
 - Minor fixes & cleanups here and there

----------------------------------------------------------------
Arkadiusz Lichwa (9):
      Bluetooth: RFCOMM: Shuffle up Kconfig's RFCOMM_L2CAP_MTU
      Bluetooth: HFP HF: Fix getting inaccessible internal
      Bluetooth: HFP HF: Enforce Kconfig's HFP_HF relation to RFCOMM
      Bluetooth: init: Add HFP to automated tests
      Bluetooth: A2DP: Remove internal stack headers
      Bluetooth: AVDTP: Remove internal headers
      Bluetooth: AVDTP: Fix getting inaccessible internal
      Bluetooth: L2CAP: Fix sending double connection request
      Bluetooth: Refactor distribution of security procedure status

Arun Jagadish (2):
      Bluetooth: AVDTP: Module Initialization
      Bluetooth: AVDTP: Connect and Disconnect API

Carles Cufi (6):
      Bluetooth: Controller: Clean up naming in the HCI driver
      Bluetooth: Controller: Use net_buf for HCI RX
      Bluetooth: Controller: Use net_buf for CC/CS TX
      Bluetooth: Controller: Use net_buf for evt and ACL RX
      Bluetooth: Controller: Remove unused macro
      Bluetooth: Controller: Fix __packed placement

Itankar, Piyush T (2):
      Bluetooth: A2DP: Initialization of A2DP
      Bluetooth: A2DP: Added Connect API

Jaganath Kanakkassery (5):
      Bluetooth: RFCOMM: Handle dlc disconnection from peer
      Bluetooth: RFCOMM: Handle session disconnection from peer
      Bluetooth: RFCOMM: Introduce rfcomm_send_dm()
      Bluetooth: RFCOMM: Introduce dlc destroy
      Bluetooth: RFCOMM: Replace tabs with spaces

Johan Hedberg (6):
      Bluetooth: L2CAP: Extend bt_l2cap_create_pdu() with 'reserve' parameter
      Bluetooth: tests: Fix name of Quark SE C1000 SS devboard
      Bluetooth: RFCOMM: Remove reference counting
      Bluetooth: RFCOMM: Fix some remaining white-space issues
      Bluetooth: Adjust maximum connections & paired devices range
      Bluetooth: Fix compiler warnings/errors related to string casts

Kaustav Dey Biswas (1):
      Bluetooth: SDP: Server: Initialize and accept incoming connections

Luiz Augusto von Dentz (7):
      Bluetooth: eddystone: Add missing characteristics
      Bluetooth: init: Add CONFIG_BLUETOOTH_RFCOMM to prj_20.conf
      Bluetooth: init: Add CONFIG_BLUETOOTH_AVDTP to prj_20.conf
      Bluetooth: AVDTP: Add missing BLUETOOTH_DEBUG_AVDTP
      Bluetooth: init: Add CONFIG_BLUETOOTH_A2DP to prj_20.conf
      Bluetooth: GATT: Fix locking RX fiber
      Bluetooth: Enable CONFIG_BLUETOOTH_DEBUG_AVDTP with prj_20.conf

Mariusz Skamra (2):
      Bluetooth: tester: Fix advertising data
      Bluetooth: Enable privacy for nimble

Szymon Janc (5):
      Bluetooth: SMP: Remove unused static const
      Bluetooth: SMP: Fix unused static variable
      Bluetooth: Add debug keys support to HCI ECC emulation code
      Bluetooth: L2CAP: Cleanup flags names for BR/EDR channels
      Bluetooth: L2CAP: Rename br_channels to br_fixed_channels

Vinayak Chettimada (2):
      Bluetooth: Controller: Fix SCHED_ADVANCED cond, compilation
      Bluetooth: Controller: Remove custom irq implementation

 drivers/bluetooth/controller/Makefile             |   1 -
 drivers/bluetooth/controller/hal/ccm.h            |   4 +-
 drivers/bluetooth/controller/hal/clock.c          |  18 +-
 drivers/bluetooth/controller/hal/ecb.c            |  17 +-
 drivers/bluetooth/controller/hal/irq.c            |  53 --
 drivers/bluetooth/controller/hal/radio.c          |  14 +-
 drivers/bluetooth/controller/hal/rand.c           |   7 +-
 drivers/bluetooth/controller/hci/hci.c            | 903 ++++++++-----------
 drivers/bluetooth/controller/hci/hci_driver.c     | 290 +++---
 drivers/bluetooth/controller/hci/hci_internal.h   |   9 +-
 drivers/bluetooth/controller/ll/ctrl.c            |  32 +-
 drivers/bluetooth/controller/ll/ctrl.h            |   8 +-
 drivers/bluetooth/controller/ll/pdu.h             | 110 +--
 drivers/bluetooth/controller/util/work.c          |  69 +-
 drivers/bluetooth/controller/util/work.h          |   2 +-
 include/bluetooth/a2dp.h                          |  47 +
 include/bluetooth/bluetooth.h                     |   2 +-
 include/bluetooth/l2cap.h                         |  15 +-
 include/bluetooth/rfcomm.h                        |  29 +-
 .../hal/hal_irq.h => include/bluetooth/sdp.h      |  35 +-
 net/bluetooth/Kconfig                             |  58 +-
 net/bluetooth/Makefile                            |   6 +-
 net/bluetooth/a2dp.c                              | 126 +++
 net/bluetooth/a2dp_internal.h                     |  36 +
 net/bluetooth/att.c                               |  40 +-
 net/bluetooth/avdtp.c                             | 180 ++++
 net/bluetooth/avdtp_internal.h                    | 158 ++++
 net/bluetooth/conn.c                              |   2 +-
 net/bluetooth/hci_core.c                          |  25 +-
 net/bluetooth/hci_ecc.c                           |  71 +-
 net/bluetooth/hfp_hf.c                            |   2 +-
 net/bluetooth/l2cap.c                             |  28 +-
 net/bluetooth/l2cap_br.c                          | 115 +--
 net/bluetooth/l2cap_internal.h                    |  16 +-
 net/bluetooth/rfcomm.c                            | 173 +++-
 net/bluetooth/rfcomm_internal.h                   |  82 +-
 net/bluetooth/sdp.c                               | 294 ++++++
 net/bluetooth/sdp_internal.h                      |  56 ++
 net/bluetooth/smp.c                               |  21 +-
 net/bluetooth/smp_null.c                          |   2 +-
 samples/bluetooth/eddystone/src/main.c            |  79 ++
 tests/bluetooth/init/prj_20.conf                  |   6 +
 tests/bluetooth/init/testcase.ini                 |   2 +-
 tests/bluetooth/tester/prj_nimble.conf            |   1 +
 tests/bluetooth/tester/src/gap.c                  |   2 +-
 45 files changed, 2116 insertions(+), 1130 deletions(-)
 delete mode 100644 drivers/bluetooth/controller/hal/irq.c
 create mode 100644 include/bluetooth/a2dp.h
 rename drivers/bluetooth/controller/hal/hal_irq.h => include/bluetooth/sdp.h (59%)
 create mode 100644 net/bluetooth/a2dp.c
 create mode 100644 net/bluetooth/a2dp_internal.h
 create mode 100644 net/bluetooth/avdtp.c
 create mode 100644 net/bluetooth/avdtp_internal.h
 create mode 100644 net/bluetooth/sdp.c
 create mode 100644 net/bluetooth/sdp_internal.h

Change-Id: I22864805bbb931fe9150ccd84d389b3e30794f7e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-04 18:48:00 +03:00
Szymon Janc
6526e66b62 Bluetooth: L2CAP: Rename br_channels to br_fixed_channels
This clarify what this list holds making code more readable.

Change-Id: Ia212cf611cbf2c2deab139324120b993bf14d06f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-04 15:44:45 +00:00
Arkadiusz Lichwa
f30b3debc6 Bluetooth: Refactor distribution of security procedure status
Layers (modules) above HCI like L2CAP need to know status of applied
security procedure when it's triggered on existing connection. It gives
them possibility to make action in layer specific context on
post-security-procedure conditions.

Change-Id: Ia10078469847b29bb7eb3b1fb376ac305dd0b0fc
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-10-04 15:15:40 +00:00
Luiz Augusto von Dentz
4ab9d32bd3 unified: Don't assert if work is pending on submit
This makes k_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: Ic39f3dc5936837ce84ad028cf3d426d0558c2925
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 17:30:42 +03:00
Luiz Augusto von Dentz
ee1e99b3b7 unified: Add k_work_pending
This adds k_work_pending which can be use to check if a k_work is
pending execution.

Change-Id: Ifd56e8d65d555c7e9722c547fe83e13e886d63cd
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 17:30:42 +03:00
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