Commit graph

42249 commits

Author SHA1 Message Date
Anas Nashif
9daa1076cb docs: remove notes from bluetooth document
Integrate the notes into the actual steps, notes are usually understood
as optional and disturb the actual flow.

Change-Id: If3168581ca130bd506bc44c353acc082dfa003fd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-12 22:52:43 +00:00
Anas Nashif
4dd845db13 doc: Fixed structure in collab guide
Merge documents and improve structure. Avoid too many jumps to get
to the information and avoid single paragraph pages.

Change-Id: Ifed4fa90d1105022bfe87e6d078845938e13bd3a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-12 22:52:43 +00:00
Anas Nashif
530a422a98 doc: create subsystem section
Add sensors and networking into the new section and seperate
those from the kernel documentation.

Change-Id: I585845c3ba09173ced7caa0b7fbc1f1a81a26f96
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-12 22:52:43 +00:00
Anas Nashif
73fcb9f503 doc: move device driver to a new section
Put all device drivers and device model documentation into one
section.

Change-Id: Iba6a50796b02b7f9234c23dca706be62fd7b4259
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-12 22:52:42 +00:00
Jukka Rissanen
12485eb8c9 cc2520: Make the generated MAC address to look more random
Because the random number generator is very dumb at the moment,
the generated MAC address has always last byte set to 0.
The MAC address is used when generating IPv6 address.
In order to avoid IPv6 address collision, swap the last four
bytes of the MAC address so that the most random data is
at the end of the MAC.

Change-Id: I96c03654359e32f407bab3b29be0e3b08ee91bd7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-12 16:27:21 +03:00
Jeremie Garcia
5e6da236cb net: fix uip_udp_conn leak
On each net_receive() call with different destination and/or port,
µIP stack consumes a uip_udp_conns[UIP_UDP_CONNS] entry.
As net_context_put() doesn't free it up, Zephyr applications can very
quickly reach the point where it can no more create new UDP connection
(default UIP_UDP_CONNS value is 10).

This patch is both IPv4 and IPv6 compliant.
It modifies net_context_put() so that it frees up such entries if
a UDP connection is registered for the context provided as argument.

Change-Id: I9abe686c81368231d4443fc53da9038761a1787d
Signed-off-by: Jeremie GARCIA <jeremie.garcia@intel.com>
2016-04-12 12:40:41 +00:00
Daniel Leung
00525c2acf sanitycheck: align output for easier visual comparison
() The test names are getting longer so adds more padding.
() Aligns the numerical size numbers for easier visual
   comparison when scrolling in shell.

Change-Id: Id218a641e9d5dffb77bf813ffbd828c48d14020f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-12 12:00:47 +00:00
Anas Nashif
11ee55a6cc openocd: make openocd variables overridable from env
Some boards require a newer version of openocd, this will
allow overriding the default version that comes with the SDK.

Change-Id: I70113182c3a2c8610e3b36542c6057ff3f0df547
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-12 12:00:05 +00:00
cacu
124feb27c5 build: Add a toolchain file for the GCC ARM Embedded toolchain
Change-Id: Iea501d30297123955fd699eb7d53e642949b6af7
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-04-12 11:59:38 +00:00
Daniel Leung
3257193c6d serial/uart.h: no need to check driver_api being NULL
The device_get_binding() no longer returns pointers
to device struct when driver_api is NULL. Therefore,
there is no need to check for driver_api being NULL
in the serial driver wrapper functions.

Change-Id: I018a409324d7c1ae83c699a3ebf30f2f2abfb3b3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-12 19:30:35 +08:00
Daniel Leung
dd5e90ec6c device_get_binding() returns NULL if driver_api is not set
This changes the behavior of device_get_binding() so that
it returns NULL if driver_api is not set. This provides
a way for driver to state that it has not been initialized
properly, and prevents app from using it since no reference
to the device struct will be returned.

This implements the idea specified in [1]. The idea is to
reuse an existing resource by piggy-backing onto driver_api,
thus avoiding an extra "device state" variable in the device
struct. This differs from the code specified in the mailing
list by checking driver_api for NULL first. This avoids
the unnecessary strcmp() if driver_api is NULL.

[1] https://lists.zephyrproject.org/archives/list/devel@lists.zephyrproject.org/message/MZB5PYBSRHV3NIEHJYXYQVLTPFIIHPB3/

Change-Id: I978b1a6683cd56c8a72532d6368c47e67515c82d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-12 19:30:35 +08:00
Daniel Leung
90e93dce05 spi/intel: move driver_api assignment later
This moves the assignment of driver_api to just before
the init function returns. This is in preparation to
make device_get_binding() return NULL if driver
initialization fails.

Change-Id: I69590c463b84877d250c63d4460b7e254b79c8b3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-12 19:30:35 +08:00
Daniel Leung
1870f95364 uart/nsim: fixed missing driver_api assignment
Change-Id: Icbda7600b808fa0338e4d672ccca1b969b6f5867
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-12 19:30:35 +08:00
Daniel Leung
b8e887a112 gpio/pcal_9535a: move driver_api assignment later
This moves the assignment of driver_api to just before
the init function returns. This is in preparation to
make device_get_binding() return NULL if driver
initialization fails.

Change-Id: Ibf08cb107885da7c1037c6e7d207530e1a4708f8
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-12 19:30:35 +08:00
Daniel Leung
aa98192cad pwm/pca_9685: move driver_api assignment later
This moves the assignment of driver_api to just before
the init function returns. This is in preparation to
make device_get_binding() return NULL if driver
initialization fails.

Change-Id: Ia0c7a0014eb28624cbf363f994d6149f1aa5aadd
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-12 11:25:03 +00:00
Baohong Liu
5ba89ffdea samples: A test app for spi flash
Demonstrate the use of SPI flash driver API on Arduino 101 board.

This is a re-submit of a previous merged patch which was reverted
because merge sequence was incorrect (the test app got merged
before the driver).

Origin: Original

Change-Id: I3fce61488ed7d48f400c12448f1c7a01c555661c
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-04-12 09:59:33 +00:00
Vlad Dogaru
b2419abfbc gpio: dw: Activate by default on D2000
Change-Id: I4b5a72ee086fae7c3d29311cd138af28d329f635
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-04-12 09:58:00 +00:00
Johan Hedberg
bacdf02061 Bluetooth: drivers/nble: Fix minor coding style issue
Change-Id: I71caf45702f053033fde5c5c0bc4dea22dbe95d1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-12 12:33:24 +03:00
Andrei Emeltchenko
e12cf24e6d drivers/nble: Implement multiple read in bt_gatt_read
Implement read multiple characteristics in bt_gatt_read().

Change-Id: I18c11275e4352bfc571b06558116bcbb9b4a32d3
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-12 12:09:08 +03:00
Andrei Emeltchenko
424cf4f9d2 drivers/nble: Update RPC to Nordic BLE Module
Add read multiple attributes request and response. Update RPC version
to niko-0412.

Change-Id: I5dfd99a1b8af866b69eae230ad24304eafccab4d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-12 10:32:41 +03:00
Peter Mitsis
5aaf7ab930 nano_fifo: Fix problem with nano_fifo and timeouts
Fixes a problem where the nanokernel FIFO state information could get
out of sync due to a timeout.

The nanokernel FIFO structure nano_fifo now maintains two separate
queues: one for waiting fibers and the other for posted data. This
permits the safe and independent querying of the queues as needed
when getting and/or putting data from/on the nanokernel FIFO.

Change-Id: Ifbcb5004558b06fc55cad2a955f5be20e716b392
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-04-12 01:22:42 +00:00
Arkadiusz Lichwa
af2deb8dea Bluetooth: BR/EDR: Move up code in conn.c
Moves up and consolidate the BREDR specific code to skip certain forward
declaration and to prepare for possibility to initiate authentication
using start_security() routine.

Change-Id: Ic32d7d1376173d47b0eb0481eff37c6e56f995d4
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-11 19:15:24 +00:00
Mariusz Skamra
550d031107 Revert "Bluetooth: Fix compare logic in ATT read rsp"
This reverts commit 3d08d16780.

The Read Response only contains a Characteristic Value that is less than or
equal to (ATT_MTU – 1) octets in length so, condition
(length < bt_att_get_mtu(conn)) is always true, and the full Characteristic
Value will not be read.

Change-Id: I63280e65b4ff5b830295aa9aadebe2758b626912
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-04-11 15:24:33 +00:00
Andrei Emeltchenko
37ef89511d drivers/nble: Correct auth configuration for No Input / Output
Change-Id: I5d1a9508ca8deca97149db2faa2f3406517e3b05
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-11 15:24:24 +00:00
Szymon Janc
01f80c48ff Bluetooth: shell: Use same config for arm and x86 build
There is no need to have separate configs as init sample is now
used for different build configuration tests.

Change-Id: I917692f8a8e96345afc561dd04bdcf08cdfa5de7
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-04-11 11:54:07 +00:00
Arkadiusz Lichwa
435ccd3e81 Bluetooth: BR/EDR: Refactor internals of 'Cancel' authentication API
For better code readability use 'switch-case' statement selecting valid
authentication cancel method. Adds also legacy pairing (pre-SSP) as first
item in valid paring method set.

Change-Id: I4d9c5178526cd5210b844878360d12b58b99a24f
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-11 11:53:31 +00:00
Arkadiusz Lichwa
8f844fac29 Bluetooth: BR/EDR: Rename pair method field
Refines pairing method holder name to be more generic in connection object
representing applied method during authentication process.

Change-Id: Ia6f51788912974fbbda26b760d187c0f7e24bb0b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-11 11:53:10 +00:00
Johan Hedberg
54425117d0 Bluetooth: Export helpers for defining buffer pools
Now that the incoming ACL & HCI event pools can be defined externally
to hci_core.c there should be convenience macros to know what's the
minimum required buffer size for these pools.

Change-Id: I6f2a7322a3d77e1304e9d925767a1fd3471c76c7
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-11 11:52:38 +00:00
Johan Hedberg
30601c09bb Bluetooth: Refactor buffer handling for non-host managed buffers
So far the assumption has been that the host stack manages all
incoming and outgoing buffers. For the incoming buffers (from the
controller) this has required hci_core.c to manage its own pools and
do the host flow control. This setup makes perfect sense for an
architecture where the controller resides remotely on a different CPU
& address space (i.e. the "traditional" HCI transport case).

When the stack runs on a system where the controller resides in the
same address space this setup doesn't work that well. In such a
scenario the incoming buffers are ideally created as low down in the
stack as possible (i.e. below HCI), which means that the current
hci_core.c cannot be responsible for managing their pools.

To allow for both types of architectures this patch introduces a new
BLUETOOTH_HOST_BUFFERS Kconfig option that can be selected to say that
host-side management is desired, or deselected to say that the
controller (residing in the same address space) takes care of managing
the incoming buffers.

So far the incoming buffer types were identified by hci_core.c by
looking at their "free pool" pointers, however as soon as the pools
are allowed to be somewhere else this doesn't work. To solve this we
now require a minimum user data size for all Bluetooth buffers and use
that to store the buffer type.

Change-Id: I14bc32007e3e3f17c654f71f79b520650028d7ce
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-11 11:52:29 +00:00
Jukka Rissanen
14cc0401b4 Revert "net: Use TICKS_UNLIMITED if there are no timers"
This reverts commit 5680396aaa.

The network timers do not trigger with this patch so this needs
to be reverted for time being.

Change-Id: If653e3ecaae1ebddabe26227af876ff6b592675b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-11 07:33:17 +00:00
Johan Hedberg
30fcb2fdca Bluetooth: L2CAP: Store BR/EDR fixed channel mask per channel
This information will be used to construct the fixed channel mask in
the L2CAP information response.

Change-Id: I66244ca2d5e40b3d204f5115c4bddad578f3ea64
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-09 20:03:25 +03:00
Johan Hedberg
8a2c7915e3 Bluetooth: L2CAP: Fix logs to account for BR/EDR signaling channel
The same l2cap_recv function is now used for BR/EDR as well so remove
LE references from the logs.

Change-Id: I841ceea2eee72ee099be922eb00c1f6a3a16a787
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-09 20:03:25 +03:00
Johan Hedberg
52401300f3 Bluetooth: L2CAP: Fix missing line termination
Change-Id: I28f18c1afbb168ed021bd15962b2087066eed341
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-09 20:03:24 +03:00
Arkadiusz Lichwa
a5d264774e Bluetooth: BR/EDR: Make available L2CAP signal channel
Makes room for L2CAP signal channel transport and start listening
on signalling CID.

Change-Id: I152973a9a9e672f0b4f66b06055e305561123f34
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-09 16:24:01 +00:00
Arkadiusz Lichwa
83674b1d52 Bluetooth: BR/EDR: Get proper L2CAP CID limits
Applies L2CAP CID valid values based on link type and proper limitations
according to BT Core L2CAP spec principles.

Change-Id: Ifa0719cf593d1d22977da59fb8a6c0ed9c3a176b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-09 16:20:58 +00:00
Arkadiusz Lichwa
f6cdc3f3ab Bluetooth: BR/EDR: Refactor bt_l2cap_connected handler
Makes possible to initiate L2CAP signalling handling on set connection
based on connection transport type.

Change-Id: I114dc3e4408f428301628520a569a2b087c325b8
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-09 16:19:23 +00:00
Arkadiusz Lichwa
d719c362f1 Bluetooth: BR/EDR: Add register routine for L2CAP fixed channel
Makes available to register fixed L2CAP signalling channel on
dedicated channels list.

Change-Id: I9a90a64dac40b34799353ff261ba570541347084
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-09 16:18:54 +00:00
Arkadiusz Lichwa
740bd96abc Bluetooth: Rename bt_l2cap_fixed_chan_register()
Renames routine to be clear to be used to register LE L2CAP fixed
channel only. The routine operates on le_channels list object that also
was renamed to reflect the connection type. Updates all calls to
the procedure in the stack.

Change-Id: I01348b8186a0f537532f6a7b9dc59586827b204b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-09 16:18:26 +00:00
Juro Bystricky
d57a503a55 Makefile: Fix linking order of libraries
Link with libm.a before libc.a, as libc.a can contain
references used by libm.a.

Change-Id: I5cde8f2e323f59ecae452a8a868a5d54942e9f39
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2016-04-09 14:31:19 +00:00
Khem Raj
a8aa603242 benchmark: Remove trailing whitespaces.
Change-Id: I852fbf40899e3d4f0715377c955870e5b3990af1
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2016-04-09 10:32:09 +00:00
Andrew Boie
27025e1988 x86.ini: increase arduino_101 priority
The ordering of the list of platforms is in priority order,
as the sanitycheck --platform-limit option chooses the first
N platforms in this list when doing a run. Move arduino_101 to
second position. qemu_x86_iamcu is still top priority as it
can execute code as part of the tests.

Change-Id: I989d91c66a0a741ce8eebe6279ee4512c33eb5e9
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-08 21:37:59 +00:00
Andrew Boie
14ac902633 sanitycheck: fix test names to be same as before
Add the last path information in the testcase root to the
test name, so that there is much less of chance of name
collisions and the reports come out with the same names
as before.

Change-Id: I75ed6ee96251058dd2547e57be31db3c2517a497
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-08 13:31:53 -07:00
Vlad Dogaru
146b76d839 doc: Add sensor section to kernel primer
Create a new top-level section in the primer that includes sensor
drivers and the synchronous call API.

Change-Id: I0c1b734ec56abc20724ff682caba618ab0965230
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-04-08 20:10:45 +00:00
Andrew Boie
3d348715d8 sanitycheck: be smarter about scanning for test cases
A recent tree change moved testcases to both the tests/ and
samples/ directory. The default testcase root was just made
the root of the Zephyr tree, which could lead to potentially
long scan times as every single directory in-tree was checked.
For example, it could be very time-consuming to scan everything
under the sanity-out/ dir if -n is used and --all was used in
a previous run.

Now we allow multiple testcase roots to be supplied on the
command line, and by default only scan under tests/ and
samples/.

Change-Id: I8dac747835b87801474e08c236913e04db64f87b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-08 20:09:18 +00:00
Daniel Leung
7f8501090c sanitycheck: add ability to use arbitrary report for comparison
This adds the ability for sanitycheck to use arbitrary report file
for size comparison. This is useful when optimizing binary size.
For example, a report can be generated with master head, and used
as base for comparison.

Change-Id: Id8c61146c498ba62c4cc77a9ef7d390c0fb11487
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-08 20:09:11 +00:00
Vlad Dogaru
81dbc7e8f9 doc: Add sensor section in API documentation
Change-Id: Ie35bf6a8630db25d25604cd0a1667699ba261577
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-04-08 19:59:02 +00:00
Vlad Dogaru
9e563c8769 gpio: dw: add support for D2000 board
The D2000 CRB is similar to the Arduino 101 (at least as GPIO is
concerned).  Add support for using the GPIO controller without QMSI
libraries.

Change-Id: I001da05c9a9d5771b2ec678a9d4a91c44db05289
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-04-08 17:55:44 +00:00
Johan Hedberg
722a36a03a arduino_101: defconfig: Limit UART defaults for Bluetooth H:4 driver
Currently there's no support for the H:5 driver on Arduino 101, so the
defaults set in defconfig should only be limited to the H:4 UART
driver.

Change-Id: I805d81c33701d179ffe26f4aed3fe2fb70d60d7b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-08 17:39:14 +00:00
Vlad Dogaru
fd094f8cfc samples: revert to default CFLAGS
SDK version 0.7.5 has fixed ZEP-62.  It is no longer necessary to use
-O0 in order to get correct readings from sensors.

Change-Id: Ia8ac2f55453b7dfdda71fe2f41863cbd0b366739
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-04-08 17:24:38 +00:00
Dmitriy Korovkin
977ba05d53 galileo: Enable PCI enumeration
If an external PCIe card inserted into Galileo board, the
devices I/O addresses may differ from the preconfigured ones.
For this reason PCI enumeration needs to be enabled.

Change-Id: I54b5ef9149f9eda0a390909a433b0e13a3dd7ecd
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-04-08 16:02:44 +00:00