Commit graph

19237 commits

Author SHA1 Message Date
Inaky Perez-Gonzalez
324f8d7a41 tests/legacy/kernel/test_libs: use memcpy() vs strncpy()
Coverity complained about the use of strncpy() to fill up a buffer of
size N with a string of the same size didn't leave room for the final
\0.

This is a valid concern; however, the usage is valid too, as the
writer intended to create a pattern that later can be tested--addind a
\0 would break the pattern.

So instead, use memcpy() for the same function.

Change-Id: If52d02ce41731348f4a2d750c79f9e1c51f3afcf
Coverity-ID: 151947
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-18 23:04:43 +00:00
Inaky Perez-Gonzalez
ababbf7815 scrips/kconfig: use snprintf() vs sprintf()
Coverity reported 150819 issue, which steams off Flex generated code
from zconf.l in which sprintf() was use. Because of that, the
conf_read_simple() @name parameter could be used to overrun
zconf_open() @fullname by crafting SRCTREE and KCONFIG_ALLCONFIG
environment variables.

Change-Id: I2cff817dccafe0e06b35636bbb7be95e062410af
Coverity-ID: 150819
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-18 23:04:32 +00:00
Inaky Perez-Gonzalez
c9aabcf282 test_fp_saring/nanokernel: fix uninitialized variable
Coverity complains about using an uninitialized variable; there is no
reason to do so; thus fixed to avoid maintaining a whitelist.

Change-Id: I657f9e7d46b1b9b091e36638c1951b93903fbec3
Coverity-ID: 152048
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-18 23:03:58 +00:00
Inaky Perez-Gonzalez
2612e7518e test_map: initialize memory block
This is not a strictly necessary initialization, as the data is not
used, but will keep Coverity happy. It being a testcase, there are no
size or speed penalties to the overall kernel and avoids having to
manage a whitelist for an issue in scanning tools.

Change-Id: I0ddcf43ca1114356d58f93de57232864246ffe07
Coverity-ID: 152052
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-18 23:03:33 +00:00
Inaky Perez-Gonzalez
dd87d9b595 test_map: fix uninitialized area
Coverity complained about the code using an uninitialized chunk of
memory; harmless, but fixed to avoid having to whitelist.

Change-Id: I5c890ff78fab2799b882b8e4a25c15476702d132
Coverity-ID: 152049
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-18 23:03:09 +00:00
Inaky Perez-Gonzalez
c7e7089c36 test_static_idt: fix uninitialized variable
Coverity complains about an easy-to-fix uninitialized variable.

Change-Id: I04bf670c7137df25165d4e37f2f7df2d4004c478
Coverity-ID: 152050
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-18 23:03:08 +00:00
Inaky Perez-Gonzalez
03940d4c6a test_fp_sharing: fix uninitialized variable
Coverity complains about this (harmless) issue, so simple fix.

Change-Id: Ibac952157cb0541dbd150d681515280091409864
Coverity-ID: 152051
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-18 20:58:13 +00:00
Inaky Perez-Gonzalez
ee387f0b6e samples/kernel_event_logger: initialize variable
Fix usage of an uninitialized variable detected by Coverity.

In theory GCC should pick up this situation, but it does not. I've
experimented with adding -Wextra and -Wuninitialized but I cannot get
GCC to complain. I might be missing something else, but in the
meantime, this is a simple fix to remove this issue.

Change-Id: I6fec37719719dfaf7077ce1f464605c93efa8ea2
Coverity-ID: 152054
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-18 19:44:11 +00:00
Anas Nashif
61f4b2419c kernel: remove v2 usage and rename KERNEL_V2_DEBUG
Change-Id: I6b3f07714322ad79aeec2342621a4cddfe84cb2c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-18 19:00:34 +00:00
Vincenzo Frascino
9468f8183d aio: Cleanup AIO comparator driver
This patch addresses the following issues:
* Aligns the Kconfig code style with Zephyr projects requirements.
* Removes redundant "depends on" from Kconfig.
* Adds static to the containing file scope declarations.

Change-Id: I03326a800392cffda00b47949981b7e6d119b90f
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-18 19:00:23 +00:00
Paul Sokolovsky
6b2a1af1cd pinmux: Make default init priority be between GPIO's prio and device prio.
Pinmux driver almost certainly should be initialized before the
rest of hardware devices (which may need specific pins already
configured for them), and usually after generic GPIO drivers.
Thus, its priority should be between KERNEL_INIT_PRIORITY_DEFAULT
(default 40) and KERNEL_INIT_PRIORITY_DEVICE (default 50). Thus,
we set PINMUX_INIT_PRIORITY to 45.

There are exceptions to the rule above for particular boards. For
example, BOARD=galileo has GPIO and pinmuxer on I2C bus and thus
overrides PINMUX_INIT_PRIORITY to be much higher. Note that while
PINMUX_INIT_PRIORITY was defined previously (at 60), it was used
only for galileo, which overrides it anyway.

This fix was prompted by investigation why eth_ksdk driver was
non-functional after kernel priorities re-hashing: both eth_ksdk
and pinmux used the same priority, and eth_ksdk happened to run
before pinmux. While bumping eth_ksdk priority would help in the
particular case, the same would likely reoccur with other drivers
like I2C, SPI, etc.

Change-Id: Ie5ca3135c1ee2fe8d9cf48d5c12e62eac63487f7
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2016-11-18 16:43:45 +00:00
Anas Nashif
ab664b1db1 boards: nucleo_f103rb: define user LED
Make the blinky application work with this board.

Change-Id: Ibe8d310229e2ff79a2164b7c8f16e7ba3ee0b8c2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-18 09:28:54 -05:00
Johan Hedberg
fc96508453 Merge bluetooth branch into master
Most of these changes are already in the release branch, so this is
mostly to make sure master keeps up. Main changes:

 - Coverity fixes
 - Controller fixes
 - Add more RFCOMM initiator support
 - Add Data Length Extension HCI command support to controller

----------------------------------------------------------------
Carles Cufi (1):
      Bluetooth: Controller: Implement missing DLE commands

Jaganath Kanakkassery (2):
      Bluetooth: RFCOMM: Refactor rfcomm_handle_pn()
      Bluetooth: RFCOMM: Initiate DLC

Johan Hedberg (2):
      Bluetooth: Use convenience macros for timeout durations
      Bluetooth: doc: Fix reference to documentation location

Luiz Augusto von Dentz (3):
      Bluetooth: GATT: Fix using att_ prefix
      Bluetooth: GATT: Fix using out of scope variable
      Bluetooth: L2CAP: Fix regression with move to k_sem API

Mariusz Skmara (1):
      Bluetooth: Fix not sending L2CAP Connection Parameters Update Request

Szymon Janc (6):
      Bluetooth: Fix use of deprecated PRIMARY init level
      Bluetooth: Kconfig: Fix BR/EDR dependencies
      Bluetooth: Fix address type use for passive scanning
      Bluetooth: Kconfig: Remove deprecated dependency for ECC support
      Bluetooth: tests: Fix Makefiles comments
      Bluetooth: Kconfig: Remove deprecated dependency on NANO_TIMEOUT

Vinayak Chettimada (6):
      Bluetooth: Controller: Fix HCI Reset Command implementation
      Bluetooth: Controller: Fix observer filter_policy field size
      Bluetooth: Controller: Fix incorrect auto variable init
      Bluetooth: Controller: Remove unused util functions
      Bluetooth: Controller: Fix incorrect irq priority check
      Bluetooth: Controller: Fix suspicious use of sizeof

 doc/subsystems/bluetooth/bluetooth.rst         |   2 +-
 drivers/bluetooth/hci/h5.c                     |   4 +-
 drivers/bluetooth/nble/conn.c                  |   2 +-
 include/bluetooth/gatt.h                       |   3 +-
 include/bluetooth/hci.h                        |  20 ++-
 samples/bluetooth/eddystone/src/main.c         |   2 +-
 subsys/bluetooth/Kconfig                       |   1 -
 subsys/bluetooth/controller/hci/hci.c          |  47 +++++-
 subsys/bluetooth/controller/hci/hci_driver.c   |   9 +-
 subsys/bluetooth/controller/ll/ctrl.c          | 244 ++++++++++++++++++++++---------
 subsys/bluetooth/controller/ll/ctrl.h          |  19 ++-
 subsys/bluetooth/controller/ll/ctrl_internal.h |  17 ++-
 subsys/bluetooth/controller/ll/ticker.c        |   2 -
 subsys/bluetooth/controller/util/mem.c         |   2 +-
 subsys/bluetooth/controller/util/util.c        |  97 ------------
 subsys/bluetooth/controller/util/util.h        |   3 -
 subsys/bluetooth/controller/util/work.c        |   2 +-
 subsys/bluetooth/host/Kconfig                  |   5 +-
 subsys/bluetooth/host/att.c                    |   2 +-
 subsys/bluetooth/host/conn.c                   |   8 +-
 subsys/bluetooth/host/gatt.c                   | 111 +++++++-------
 subsys/bluetooth/host/hci_core.c               |  28 ++--
 subsys/bluetooth/host/l2cap.c                  |   6 +-
 subsys/bluetooth/host/l2cap_br.c               |   8 +-
 subsys/bluetooth/host/monitor.c                |   2 +-
 subsys/bluetooth/host/rfcomm.c                 |  90 ++++++++++--
 subsys/bluetooth/host/rfcomm_internal.h        |   3 +
 subsys/bluetooth/host/smp.c                    |   2 +-
 tests/bluetooth/shell/Makefile                 |   2 +-
 tests/bluetooth/tester/Makefile                |   2 +-
 30 files changed, 453 insertions(+), 292 deletions(-)

Change-Id: I9ab10264bfbef250221b7a7ef6f8bcec00215670
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-18 14:35:28 +02:00
Jaganath Kanakkassery
8166de77db Bluetooth: RFCOMM: Initiate DLC
This patch initiate a DLC when user calls connect. It first does
Parameter negotiation and then establish connection to the
dlci derived from channel given by user.

< ACL Data TX: Handle 256 flags 0x00 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 3 frame_type 0 credit_flow 15 pri 0
           ack_timer 0 frame_size 30 max_retrans 0 credits 4

> 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: 0x01 cr 0 dlci 0x00
         Control: 0xef poll/final 0
         Length: 10
         FCS: 0xaa
         MCC Message type: DLC Parameter Negotiation RSP (0x20)
           Length: 8
           dlci 3 frame_type 0 credit_flow 14 pri 0
           ack_timer 0 frame_size 30 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: Set Async Balance Mode (SABM) (0x2f)
         Address: 0x0b cr 1 dlci 0x02
         Control: 0x3f poll/final 1
         Length: 0
         FCS: 0x59

> ACL Data RX: Handle 256 flags 0x02 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: I62a19f624fc4bb89eb9a109a5352fa763c1241d2
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2016-11-18 17:27:01 +05:30
Jaganath Kanakkassery
d9eb0fb2a0 Bluetooth: RFCOMM: Refactor rfcomm_handle_pn()
Handle the scenarios like ignoring a response in non existing dlc,
correctly handle if received a command with invalid mtu etc.

Change-Id: Ib0bce9134bac3a0dead03798f859af54873a70c1
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2016-11-18 17:27:01 +05:30
Luiz Augusto von Dentz
1bbb31e201 Bluetooth: L2CAP: Fix regression with move to k_sem API
k_sem_take return differ from nano_sem_take since it return 0 for
successful case instead of 1.

Change-Id: Ia39cd624d56dbc1c8e7f3558244bebf765da191d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-11-18 07:47:50 +02:00
Szymon Janc
8217bb1ef6 Bluetooth: Kconfig: Remove deprecated dependency on NANO_TIMEOUT
This is no longer needed after switch to unified kernel.

Change-Id: Ie1f8dadb3f2e43ae6ccfbfaf1f754196f3237471
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-18 07:47:50 +02:00
Szymon Janc
cb67b35c5a Bluetooth: tests: Fix Makefiles comments
Those tests are now build with unified kernel.

Change-Id: Idbc42bb77060cea0130d62cccdf2e40aeee89128
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-18 07:47:50 +02:00
Szymon Janc
6cda540a4e Bluetooth: Kconfig: Remove deprecated dependency for ECC support
After switch to unified kernel this is no longer needed.

Change-Id: If9877d3fa038dd873011fb780c7e767e150647ae
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-18 07:47:50 +02:00
Luiz Augusto von Dentz
58a2b3df7c Bluetooth: GATT: Fix using out of scope variable
This fixes defect found by coverity: 152027 Pointer to local outside
scope.

Change-Id: I50f196a04363ffa6e6654b71a9a1d89034580413
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-11-18 07:47:50 +02:00
Johan Hedberg
7d3a6a1ae5 Bluetooth: doc: Fix reference to documentation location
The Bluetooth documentation is found in doc/subsystems/bluetooth and
not in doc/bluetooth.

Change-Id: I7e7010b5ae4a26ea552d75f1a095baec18d02630
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-18 07:47:50 +02:00
Carles Cufi
c969e757bc Bluetooth: Controller: Implement missing DLE commands
Implement the 3 missing HCI commands required to support
Data Length Extensions:

- LE Read Suggested Default Data Length
- LE Write Suggested Default Data Length
- LE Read Maximum Data Length

Note: Only octets are actually used at this time, not time.

Jira: ZEP-1246

Change-Id: Id76d8fedb5ecaf0001c8429cf22f9a3e2c910a44
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-11-18 07:47:50 +02:00
Vinayak Chettimada
e9b818e763 Bluetooth: Controller: Fix suspicious use of sizeof
Fix Coverity, sizeof not portable, defect; by explicitly
using sizeof(void *).

suspicious_sizeof:
Passing argument mem_head of type void ** and argument 4U
/* sizeof (mem_head) */ to function memcpy is suspicious.
In this case, sizeof (void **) is equal to sizeof
(void *), but this is not a portable assumption.

Change-id: I4b4776466e16020876500feba0141985b8581017
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-11-18 07:47:50 +02:00
Vinayak Chettimada
26f6b71a8e Bluetooth: Controller: Fix incorrect irq priority check
External interrupts are indexed from value 16, wherein
0 to 15 are ARM cortex M exceptions. Fixed code in
_irq_is_priority_equal to fetch correct external
interrupt line ISR priority.

Change-id: I9cfd411480e78dfc9635e72d14df9d667a9d8400
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-11-18 07:47:50 +02:00
Vinayak Chettimada
27b1a24993 Bluetooth: Controller: Remove unused util functions
Change-id: I7b691d082d080239c35b63221e3c6c7aa93ed58e
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-11-18 07:47:50 +02:00
Vinayak Chettimada
94a425429c Bluetooth: Controller: Fix incorrect auto variable init
Coverity analysis discovered NULL pointer being
dereferenced when passing a auto variable. The variable is
now correctly assigned with address of a valid default
value variable. As per design, the dereferencing will not
happen as the master role does not use the passed parameter
only slave role uses it to prepare the connection parameter
request PDU.

Change-id: I3f8519b23a83cb8c50c7fba81810eff7737ff74a
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-11-18 07:47:50 +02:00
Vinayak Chettimada
7b1c042b02 Bluetooth: Controller: Fix observer filter_policy field size
Coverity analysis discovered that observer filter policy
field was 1 bit, whereas valid range for extended scanner
filter policy feature implemented in controller is 0 to 3.
Increase the bit field size from 1 to 2.

Change-Id: Id4b2e354961dfb3b45f72fa4e0ab18de7425bbb5
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-11-18 07:47:50 +02:00
Szymon Janc
a2ee111aa0 Bluetooth: Fix address type use for passive scanning
This fix using incorrect address type for passive scanning with
privacy enabled. Controller was not reporting directed advertising
to RPA address due to public type being used for passive scan.

This was affecting TC_CONN_GCEP_BV_01_C, TC_CONN_ACEP_BV_01_C and
TC_CONN_DCEP_BV_01_C qualification test cases.

Jira: ZEP-1200

Change-Id: Icc316441fcac1a72d75f9ade27a99030efc846b9
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-18 07:47:50 +02:00
Luiz Augusto von Dentz
c0edc551b5 Bluetooth: GATT: Fix using att_ prefix
This might create confusions when debugging as usually the prefix is
associated with the file or layer.

Change-Id: Ibf45578c1f54a4bec896acd6042589c815216e1f
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-11-18 07:47:50 +02:00
Szymon Janc
243668dbc4 Bluetooth: Kconfig: Fix BR/EDR dependencies
BR/EDR code should have minimal impact on LE code so to keep it simple
just require peripheral and central to be enabled when selecting BR/EDR
support.

Fix following Kconfig warning:

warning: (NETWORKING_WITH_BT && BLUETOOTH_BREDR) selects
    BLUETOOTH_L2CAP_DYNAMIC_CHANNEL which has unmet direct dependencies
    (BLUETOOTH && BLUETOOTH_HCI && BLUETOOTH_HCI_HOST && BLUETOOTH_CONN
    && BLUETOOTH_SMP)

Change-Id: I7f7cb8794def0df6daaa4abfe4596df460f1a2b2
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-18 07:47:50 +02:00
Szymon Janc
9dde3e02fd Bluetooth: Fix use of deprecated PRIMARY init level
Fix following warning:

  CC      subsys/bluetooth/host/monitor.o
In file included from zephyr/include/drivers/loapic.h:58:0,
                 from zephyr/include/drivers/ioapic.h:22,
                 from zephyr/include/drivers/sysapic.h:20,
                 from zephyr/include/arch/x86/irq_controller.h:33,
                 from zephyr/include/arch/x86/arch.h:28,
                 from zephyr/include/arch/cpu.h:23,
                 from zephyr/include/kernel.h:2458,
                 from zephyr/include/zephyr.h:20,
                 from zephyr/subsys/bluetooth/host/monitor.c:24:
zephyr/subsys/bluetooth/host/monitor.c: In function
    '_deprecation_check_sys_init_bt_monitor_init0':
zephyr/include/device.h:130:16: warning: '_INIT_LEVEL_PRIMARY' is
    deprecated [-Wdeprecated-declarations]
  static struct device_config _CONCAT(__config_, dev_name) __used \
                ^
zephyr/include/device.h:245:2: note: in expansion of macro
    'DEVICE_AND_API_INIT'
  DEVICE_AND_API_INIT(dev_name, drv_name, init_fn, data, cfg_info, \
  ^
zephyr/include/init.h:69:2: note: in expansion of macro 'DEVICE_INIT'
  DEVICE_INIT(_SYS_NAME(init_fn), "", init_fn, NULL, NULL, level, prio)
  ^
zephyr/subsys/bluetooth/host/monitor.c:193:1: note: in expansion of
    macro 'SYS_INIT'
 SYS_INIT(bt_monitor_init, PRIMARY, MONITOR_INIT_PRIORITY);
 ^
zephyr/include/device.h:48:31: note: declared here
 static __deprecated const int _INIT_LEVEL_PRIMARY = 1;

Change-Id: Ie903e3a075f6614b26018be5769be3651f0963be
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-18 07:47:50 +02:00
Vinayak Chettimada
11770b8bf4 Bluetooth: Controller: Fix HCI Reset Command implementation
Added implementation for HCI Reset Command. Implementation
gracefully disables any running advertiser, observer, and/
or connection roles, and it resets controller context members.
The HCI Reset Command is implemented in such a way that
driver instances shared with other sub-systems and
application is not disturbed and instance/references used
by Bluetooth Controller are gracefully returned back.

Jira: ZEP-1282

Change-id: Ifb9ae6807736b5ec2d9f346cf2a590322056bcee
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-11-18 07:47:50 +02:00
Mariusz Skmara
2305196461 Bluetooth: Fix not sending L2CAP Connection Parameters Update Request
This fixes issue that L2CAP Connection Parameters Update Request was
not sent. There was check that used LE features of host controller
to determine if L2CAP procedure or LL shall be used. It was failing
with 4.2 controller. The check shall test if remote supports
LL Connection Parameters Request Procedure. If it's not supported,
then L2CAP Connection Parameters Update Procedure will be used.

Closes ZEP-1220

1/4   L2CAP   TC_LE_CPU_BV_01_C      PASS
2/4   GAP     TC_CONN_CPUP_BV_01_C   PASS
3/4   GAP     TC_CONN_CPUP_BV_02_C   PASS
4/4   GAP     TC_CONN_CPUP_BV_03_C   PASS

Change-Id: I61ad544d9568ca6306a845e05c1a2e28d1693ab4
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-11-18 07:47:50 +02:00
Johan Hedberg
2469bd6f87 Bluetooth: Use convenience macros for timeout durations
Using the K_* macros makes it easier to read what exactly the various
timeouts are.

Change-Id: Ia405d3760b8e600af7e33a7221ef6ec717708973
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-18 07:47:50 +02:00
Allan Stephens
82d4c3a68b doc: Minor cosmetic tweaks for kernel API descriptions
Change-Id: Ie989b45b19e5e70958301dd8d903cf2876709f5a
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-18 02:31:35 +00:00
Allan Stephens
c2f15a4525 doc: Add descriptions for clock-related helper macros
Also fixes up Kernel Primer examples to use these macros.

Change-Id: Ib1bc9e3f85ab75f81986bc3930fb287266a886b5
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-18 02:31:35 +00:00
Allan Stephens
56daa20345 doc: Revise timer example to use workqueue instead of alert
Rewrites the example of a timer's expiry routine offloading
processing that can't be done at interrupt level. The example
now submits work to the system workqueue directly, rather than
using an alert. This saves footprint by eliminating the need
for alert-related API support that isn't needed. (This is a
true savings, since the alert code just called the same
workqueue APIs the example now calls directly.)

Change-Id: I378e40aef33014f2c75c4f57531f75247d50e479
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-18 02:31:34 +00:00
Allan Stephens
2ba967f925 doc: Fix up API descriptions for ring buffers
Change-Id: I82453c1fb5365d7dfe35cb1bc9eba50c71a47b17
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-18 02:31:34 +00:00
Allan Stephens
fb513eb1c8 doc: Fix up API description for IRQ_CONNECT()
Change-Id: I5ea1bd28f355d78c724948568c160ef1b32b5eb5
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-18 02:31:33 +00:00
Allan Stephens
9ef50f4f0c doc: Fix up return value descriptions for kernel APIs
Return value descriptions using the "@retval" tag now reflect
the fact that they appear on a separate line from the value
they are describing.

Change-Id: I3e3e347d133ad998e7db50a99369d41cbfb9efcc
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-18 02:31:33 +00:00
Allan Stephens
6bba9b052f doc: Improve descriptions of workqueue APIs
The API guide now does a better job of explaining how to use
a workqueue. Also hides information about workqueue internals
and fixes several errors and omissions.

Change-Id: I6492c1c6105c258ce98365ca33059d8f32c1be41
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-18 02:31:32 +00:00
Allan Stephens
5eceb8514c doc: Improve descriptions for some user-supplied functions
The API guide now does a better job of explaining how to correctly
write these functions.

Change-Id: Ib1df55eb28fa408f3f786f122353e37505002f07
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-18 02:31:32 +00:00
Allan Stephens
3acb1c97a3 doc: Enable Kernel Primer links to macro-type APIs
Also adds a link to function-type API that was missing.

Change-Id: Ie671ad2f239cdca3ac1a2eb33248dfecfa251c79
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-18 02:31:31 +00:00
Baohong Liu
5e892b7e1e samples: grove_lcd: stop the app if device binding fails
Proceed to LCD programming only if device binding succeeds.
Otherwise, dereferencing a NULL pointer will happen. This
was caught by Coverity.

Coverity-CID: 151986

Change-Id: Ibdb658f530203428aa3e53f358e0788fc1502b06
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-18 02:07:14 +00:00
Javier B Perez
0ad8f517f7 test: power states: fix dead code issue
Coverity detected some constant value in the vars, due to the
exclusive config select in the code.

Change-Id: Id27b658f3cd70dce626fef054457a9c726b3b957
CID: 151974, 151972 and 151971
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-11-18 02:05:00 +00:00
Sergio Rodriguez
6b04e0669a drivers: gpio_dw: Remove contradictory if statement evaluation
This fixes an always false evaluation of the gpio I/O direction

This issue was reported by Coverity

Coverity-CID: 151978

Change-Id: I93ec3319a3f18d564c961a5cbd9dcc9c60efbeb7
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-18 02:04:36 +00:00
Sergio Rodriguez
cd63c74bbd drivers: gpio_atmel: Fix erronous if statement
The GPIO_INT_ACTIVE_LOW value is  zero so the mask assignement is
never executed. Using the bit complement GPIO_INT_ACTIVE_HIGH the
proper mask is assigned

This issue was reported by Coverity

Coverity-CID: 151966

Change-Id: Ibc7d2e4c3ebee249b5ab9719f8177cc14c0d1d33
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-18 02:04:20 +00:00
Sergio Rodriguez
bad9665198 soc: stm32f1: gpio: Fix unnecessary else statement
The bitfield determining the I/O direction already defines the pin
as either input or output, cannot be none or both at the same time

This issue was reported by Coverity

Coverity-CID: 151970

Change-Id: I18d5387139d6834004ba3269c5b54176bdc97ea7
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-18 02:03:53 +00:00
Baohong Liu
2ca689da91 samples: button: stop the app if device binding fails
Stop the app from running if device binding fails. Otherwise,
dereferencing NULL pointer will happen. This was caught by
Coverity.

Coverity-CID: 151988

Change-Id: I8245d938498a51123249fbd069935900ad660314
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-18 02:01:22 +00:00
Flavio Santes
8d2a511557 tests/tinycrypt: Solve style issues in test_ccm_mode
This commit fixes some style issues detected by checkpatch:

- Lines over 80 characters
- Comment block

Furthermore test legends are homogenized.

Change-Id: If92bbbdcf915164da945a60c8bcdbb7452ad0da0
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-18 01:05:33 +00:00