Commit graph

41120 commits

Author SHA1 Message Date
James Fagan
7cea08d5f1 aio: Configuration issue in aio driver
The reference and polarity fields of the config struct which is passed
to qm_set_config are never cleared, meaning the wrong configuration
may be written if aio_set_config is called for different sets of pins
in the same program.

This patch clears these fields in aio_cmp_disable to prevent such an
issue.

Change-Id: I8feabae1f3d9fa4c7260d94c1ec919ef2fb84bfb
Signed-off-by: James Fagan <james.p.fagan@intel.com>
2016-11-23 00:16:22 +00:00
Flavio Santes
be1dd33053 build: Add __ZEPHYR__ to Makefile
This commit adds the __ZEPHYR__ define to the main Makefile.
This new define may help to drive conditional compilation when
writing multi-platform applications.

Change-Id: I81a37f9c86fa7f85bbac7cd0c0cd4150cbff1911
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-22 17:10:49 +00:00
Marcus Shawcroft
22f438b5ef gpio: Add doxygen markup for internal only definitions.
Change-Id: Ibc01d35199c643e186b58282af971975c0999e8b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-11-22 17:01:27 +00:00
Marcus Shawcroft
1b3a933164 gpio: Document public API return codes.
Change-Id: Ief1cd5c231b9b87ac7a0a80c2c005560fd29652b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-11-22 17:01:27 +00:00
Tomasz Bursztyka
dc7193373b clock_control: NRF5 Kconfig option should be available only on NRF5
Change-Id: If6ba2f5a03967ca2ddca8d4bc211bc0c55ae0312
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-11-22 17:00:46 +00:00
Tomasz Bursztyka
6d6c559001 arch: stm32f1: Fixing a typo
PA10 should use *_PA10_UART1_RX

Change-Id: Ifba4d301d049db1d62ea3a63d4d66f75c88a71a6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-11-22 17:00:45 +00:00
Tomasz Bursztyka
b7d0784552 pinmux: nucleo_f103: Fix an 80 chars limit issue
Change-Id: Ib59f818ff9687ca4487ad8023c9f9a4e0f5ca6be
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-11-22 17:00:45 +00:00
Tomasz Bursztyka
28537c887b arch: stm32f1: Fix 80 char limit issue
Change-Id: I1d83c53d509eecf037efb0cafd7f5b5aefdf855d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-11-22 17:00:44 +00:00
Mahavir Jain
02036c85fb doc: fix ring_buffer code snippet
Change-Id: I5c1b08aea675ae9a9f636a1e8f0de5684dc403de
Signed-off-by: Mahavir Jain <mjain@marvell.com>
2016-11-22 21:09:13 +05:30
Flavio Santes
c9e10f8dfe tinycrypt/sha256: Array compared to NULL has no effect
This commit fixes the issue reported by Coverity: an array compared
against NULL is always false.

Coverity-CID: 143715
Coverity-CID: 143730

Change-Id: Ie3c87f892c2b2a337981125e2a92c37c579d4b38
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-22 01:59:10 +00:00
Flavio Santes
ad2fccb871 tinycrypt/hmac: Array compared to NULL has no effect
This commit fixes the issue reported by Coverity: an array compared
against NULL is always false.

Coverity-CID: 143687
Coverity-CID: 143737
Coverity-CID: 143740

Change-Id: Id94a144c47b3377876695e86da8c0c33a989ec99
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-22 01:59:10 +00:00
Vincenzo Frascino
86add71a86 clock_control: Cleanup stm32f10x 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: Idaaa0d705a31bc69cdf7e576e303f581d3d0bd5f
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-19 01:58:55 +00:00
Vincenzo Frascino
b6b35f6113 clock_control: Cleanup stm32f4x 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: I14651826724c014cc71d62ab6cab03c668c578c0
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-19 01:58:54 +00:00
Vincenzo Frascino
9c1bb2b2b9 clock_control: Cleanup quark_se 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: I6d48d2eaf6ffd5fa28b37e1d3ca2d467705110f3
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-19 01:58:54 +00:00
Vincenzo Frascino
dc1ddf9c1a clock_control: Cleanup nrf5 clock_control driver
This patch removes redundant "depends on" from Kconfig.

Change-Id: I13d7556faa4751d2da149d458340bcdf29afa2ca
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-19 01:58:53 +00:00
Vincenzo Frascino
d6964951df clock_control: Cleanup main Kconfig
This patch addresses the following issues:
* Aligns the Kconfig code style with Zephyr projects requirements.
* Removes redundant "depends on" from Kconfig.

Change-Id: Ic9e2fd935417fa40127bddeba4660109332087ff
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-11-19 01:58:53 +00:00
Anas Nashif
9f884155ab Merge "Merge bluetooth branch into master" 2016-11-19 01:52:15 +00:00
Andrew Boie
2ffa516d89 x86: set accessed bit in ROM-based GDT
Previous configuration was backwards. From the Intel manual:

"If the segment descriptors in the GDT or an LDT are placed in ROM,
the processor can enter an indefinite loop if software or the
processor attempts to update (write to) the ROM-based segment
descriptors. To prevent this problem, set the accessed bits
for all segment descriptors placed in a ROM. Also, remove
operating-system or executive code that attempts to modify
segment descriptors located in ROM."

Only by some miracle has this not been causing problems.

Change-Id: I0bb915962a1069876d2486473760112102feae7b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-19 00:57:04 +00:00
Benjamin Walsh
dd2f554239 samples: configure philosophers with more than 32 priorities
To have one project use more than 32 priorities. The preempt priorities
are also aligned so that they straddle two priority bitmaps.

Change-Id: I0f0862110d876e40fde45a0d105b769e8603d644
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-18 23:45:35 +00:00
Benjamin Walsh
358a53cb2f kernel: support for more than 32 total priorities
In addition to more priorities taking more memory to host them, finding
the next thread to run when it is not cached is slower since each extra
set of 32 priorities maps to a loop iteration. That loop is remove
entirely when the number of priorities is less than 32 (31 + the idle
thread).

Fixes ZEP-1303.

Change-Id: I3205df90d379a0f4456ff1d7f1aaa67ad2cddf15
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-18 23:45:34 +00:00
Juan Manuel Cruz
7f1c76f2bf win-build: Fixes a kconfig incompatibility for Windows
In windows systems the rename() function fails if the new name
of the original file corresponds to a file that already exists.

The fix removes the new file before renaming the original one.

Jira: ZEP-980

Change-Id: Ib3a43db86c0dd3fabb592f53ea7619eb5738bb65
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-11-18 23:22:21 +00:00
Juan Manuel Cruz
3e1d001f9b enc28j60: Fixes an issue reading/writing long frames from SPI
Jira: ZEP-1302
Change-Id: Ia58d51aee14281aaeb2f8e85fbbf8c250eae8e06
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-11-18 23:19:21 +00:00
Allan Stephens
66a07bbd48 kernel: Minor optimization to kernel event logger timestamping
Rewrites the timestamping logic to always generate timestamps
via a function pointer that is initialized to sys_cycle_get_32(),
but can be changed to point to a user-supplied function. This
eliminates the need for an if/then/else construct in every place
that a timestamp is generated.

Change-Id: Id11f8c41b193a93cece16565978a525056010f0e
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-18 23:17:51 +00:00
Allan Stephens
d7b355b865 doc: Revise kernel event logger documentation
Makes the purpose and capabilities of the kernel event logger
clearer, and leaves much of the low-level detail relating to
use of the configuration options and APIs to the configuration
option guide and API guide, respectively. Also corrects some
bugs in the example code for retrieving event information.

Also updates the API guide to make a clear distinction between
the general purpose event logger framework and the kernel event
logger (which is a specific instance of this framework).

Change-Id: I924f65092b2b0e5050af13376b5da85a6cdc1a65
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-18 23:17:51 +00:00
Allan Stephens
72efec3d2b doc: Fix up API descriptions for kernel event logger
Prepares the kernel event logger APIs for inclusion in the
API guide. Also corrects a couple of other issues:

* Gets rid of obsolete thread monitor code.
* Renames "timer_func" global variable to "_sys_k_timer_func"
  to align it with kernel naming conventions.

Change-Id: I93d403f83ae44ff45dda489c2ead7bfec6ce1fa3
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-18 23:17:50 +00:00
Allan Stephens
671f0ae17e kernel: Ensure event logger APIs convert timeouts to millseconds
Event logger APIs still express timeout delays in ticks;
need to convert to milliseconds when using unified kernel APIs.

Change-Id: I5fab66be660621cd2029417eaff3758e3ef4ba2c
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-18 23:17:49 +00:00
Juan Manuel Cruz
ec27d03ed4 sensor: fixes program hangs in the apds9960 sample
If an i2c transaction fails the sample will hang the program into
an infinite circle.

This commit will remove the infinite circle and report back the
error code from the i2c transaction.

Change-Id: I38d350a805af6bec43f2fa8d4af6ce4e3cc27662
Coverity-CID: 151991
Coverity-CID: 151992
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-11-18 23:17:30 +00:00
Juan Manuel Cruz
2936f0e00e sensor: fixes dead code in the apds9960 sample
If the gpio or spi devices are not found there is no
need to keep the device busy in a loop for this particular
sample.

Since it is not possible to continue execution it is better
to simply end the application.

Change-Id: Ie25ea970a479db2a2f339ca2b37f88541a45ef97
Coverity-CID: 151973
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-11-18 23:17:29 +00:00
Vinicius Costa Gomes
777d57dbfb iot/zoap: Fix decoding of 16-bit delta
When an option code or length representation is encoded in a 16-bit
value, the access was wrong.

Coverity-CID: 151963

Change-Id: Ie7741998cbde348ccf490a6686e68a1ace99920e
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-11-18 23:13:08 +00:00
Anas Nashif
8f0057a05f tests: test CONFIG_KERNEL_DEBUG and CONFIG_ASSERT
Enable this option to test any usage of structs and variables inside
macros.

Change-Id: I6ec64fb865e87fc0771ae10f0c4eb63f6144c88a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-18 23:08:48 +00:00
Benjamin Walsh
a4e033fdba kernel: fix obsolete access to fields in K_DEBUG() calls
When moving arch-specific thread structure to arch-agnostic, some field
accesses were missed when used in K_DEBUG statements, which are turned
off by default.

Change-Id: Ife0f49b8185a0db468deab73555f7034f20ca3e8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-18 23:08:47 +00:00
Benjamin Walsh
669360d5ec kernel: fix thread prio and stack size types in some APIs
Prio should be an int, since values are small integers, not a fixed-size
int32_t. It aligns with the prio parameters of the other APIs.

Stack size should be size_t.

Change-Id: Id29751b86c4ad7a7c2a7ffe446c2a96ae83c77bf
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-18 23:08:46 +00:00
Inaky Perez-Gonzalez
db0e9aea51 test_static_idt: fix unininitialized variable
The divide-by-zero test was using an uninitialized variable that
Coverity was unhappy about. Simple fix to just initialize to any non
zero value.

Change-Id: I9e5865a99e7a8eb3ee52421cc3dcb6717dca1ad1
Coverity-ID: 152053
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-18 23:04:50 +00:00
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