Commit graph

41120 commits

Author SHA1 Message Date
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
Dmitriy Korovkin
4fc7d0242c kernel: Make idle task sleep
Device drivers may use task_sleep() routine during the initialization.
As device driver initialization is carried by idle task, it can not
be sheduled out as any other task. Idle task goes into a wait loop
instead.

In order to invoke task_sleep() device drivers must enable
CONFIG_NANO_TIMEOUTS option.

Change-Id: Ib73a2ad1f3c0bda44c24f2417e102bfaa3a13a15
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-04-08 15:08:33 +00:00
Tomasz Bursztyka
1c827b9721 tests: test_early_sleep: Let's test at all initialization level
Not only SECONDARY, but also the following ones:
- NANOKERNEL
- MICROKERNEL
- APPLICATION

Change-Id: Id41fa572c830727166101fa3c6254398857b31c7
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-08 15:08:33 +00:00
Daniel Leung
6b17007b56 sanitycheck: parallelize binary size calculations
Instead of running nm/objdump and parsing the results one testcase
at a time, do these in parallel to speed up sanity check a bit.

The sanitycheck now requires at least Python 3.2 to run because of
the usage of concurrent.futures.

This reduces build time (--all -b) from 4:30 to 3:08 on 24C/48T
Xeon-E5.

Change-Id: I8e7c1efb2f473c7f2b65658f8ed9a101ed091eea
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-08 14:50:20 +00:00
Ravi kumar Veeramally
79bf4a0e5a net: coap: Create buffer while generating observe notification
CoAP observe notifications are originated from server, those
are not replies. So create a new buffer and copy remote address
and port number from obs list. Set udp_conn to null as this is
new buffer. Reason for setting the udp_conn to null is that there
is a chance that buffer might already have udp_conn set due to
reusing same buffers.

Change-Id: I3c7eada987cf539d77ea162b6f5901791cfa6ee0
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-04-08 13:38:07 +00:00
Ravi kumar Veeramally
db247d0fa1 net: coap: Use correct network buffer in serialization
Need to use the network buffer when sending CoAP serial message
because the message was constructed to net_buf

Change-Id: I74c54178707edf2d8451ce5ac719d63f99661332
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-04-08 13:38:07 +00:00
Ravi kumar Veeramally
ee858020dc net: Fix ip_buf_len after removing extra header
After removing extra header from IP packet, only uip_len is
updated not ip_buf_len. uip_len parameter is set to zero
at some point after handover to net_core. From net_core
only ip_buf_len holds the actual length. So update ip_buf_len
after removing extra header.

Change-Id: I2cc03ed1125df5216a0fa6e94eebfeee0a343481
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-04-08 13:38:07 +00:00
Ravi kumar Veeramally
e37dd00f6b net: Add Kconfig debug option for coap observe and well-known
User can activate debugging in coap observe and well-known by
setting CONFIG_NETWORK_IP_STACK_DEBUG_COAP_OBSERVE and
CONFIG_NETWORK_IP_STACK_DEBUG_COAP_WELL_KNOWN option in config file.

Change-Id: Id63824c88df1a84586518eaec8a8a929ae04b717
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-04-08 13:38:07 +00:00
Ravi kumar Veeramally
f27af5afb7 net: Add Kconfig debug option for simple udp and udp packet
User can activate debugging in simple UDP and UDP packet by
setting CONFIG_NETWORK_IP_STACK_DEBUG_SIMPLE_UDP and
CONFIG_NETWORK_IP_STACK_DEBUG_UDP_PACKET option in config file.

Change-Id: I581d4b33204f26119c5b194cb367adad8c6505c2
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-04-08 13:38:06 +00:00
Johan Hedberg
9d90ef45ec Bluetooth: drivers/nble: Add Kconfig option for conn.c
Without this conn.c will cause logs whenever BLUETOOTH_DEBUG is
enabled.

Change-Id: I03f7d6b5b37e05ca23cba20536b24dbdb850304d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-08 13:27:33 +00:00
Johan Hedberg
8e4582f80d Bluetooth: Kconfig: don't hardcode "UART_0"
Change-Id: Ic1da719450d3ba516d61c67a3256b38e04f7585c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-08 13:27:20 +00:00
Johan Hedberg
e5df34041f Bluetooth: Refactor nRF51 API
The previous enable/disable API implementations weren't actually what
their names implied, but simply gave the right result for the
initialization scenario when called after each other. Split these into
proper init/enable/disable APIs which do the exact thing that the
names imply.

Change-Id: I09a930d3607f4919ecd889ec3ee4ba8d7b12ee36
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-08 13:27:02 +00:00
Andrei Emeltchenko
a9652d0afd arduino_101: Add default Bluetooth UART configurations
When choosing Bluetooth UART driver on arduino_101 select also
BLUETOOTH_NRF51_PM which enables the Nordic chip.

Change-Id: I22dcb60a676bb0e4cdfe995590803dbfbf87f23a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-08 13:23:08 +00:00
Johan Hedberg
a36a4920ec boards/arduino_101: defconfig: Enable nRF51 PM if NBLE is selected
To avoid explicitly having to state this in every application's config
file simply set the defaults to the sanest values.

Change-Id: I2c2bbd2424a12ec9a36bbd6d0c9cd9a1d259e5e5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-08 12:52:27 +00:00
Jukka Rissanen
01771500ee net: contiki: Fix the timer expiration check
We need to check the timer expiration properly. The nano_timer_test()
will return user data to caller if the timer is expired.

The issue that is fixed by this commit started to appear after
the commit 9b2452047d which combined
nano_timers and nano_timeouts.

Change-Id: I9cf10e605f1c4767caa1aad9dcf29a159af55e28
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:19 +00:00
Jukka Rissanen
0be1fa53b4 net: Add Kconfig debug option for REST API
User can activate debugging in REST by setting
CONFIG_NETWORK_IP_STACK_DEBUG_REST_ENGINE option in config file.

Change-Id: I1c1c62803c0fcc5fb3a37d3d76de94754b33506a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:19 +00:00
Jukka Rissanen
6c703542d5 net: coap: Make sure that local endpoint IP address is set
When initializing the CoAP engine, make sure that we
initialize the local IP address properly.

Change-Id: I8ddc670371c3a58095cd5db6b435c5b1793c268b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:19 +00:00
Jukka Rissanen
21161a39fe net: coap: Delete network context when CoAP context is deleted
Network context must be cleared when CoAP context using that
is removed.

Change-Id: Id8deb798919fccf025af67c18f3a246cfa46598f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:18 +00:00
Jukka Rissanen
70ffc56a95 net: coap: Add debugging support for CoAP internals
Print info about packet serialization if debugging is turned on.

Change-Id: I578ecb4e85ab34c74a960cbce9aa4f9bf5b9473d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:18 +00:00
Jukka Rissanen
24911b81bd net: contiki: Enhance the IPv6 prefix calculation routine
The routine does not check prefixes properly which are not
multiple of 8.

Change-Id: I421456720541894eb4d9a2839361095a50587513
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:18 +00:00
Jukka Rissanen
7eb15eeb56 net: coap: Add debug activation support to Kconfig
User can select various coap debugging options from Kconfig.

Change-Id: I97cc82278c230b9678f506063fed5683dc271c8a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-04-08 11:33:18 +00:00
Luiz Augusto von Dentz
5680396aaa net: Use TICKS_UNLIMITED if there are no timers
This makes the fiber_sleep sleep indefinitely until fiber_wakeup is
called.

Change-Id: Id674c1f689376784599fc79c86d1c406474bb48f
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-04-08 13:09:52 +03:00
Tomasz Bursztyka
a1adbcb125 ieee802154: Replace the CC2520 driver with a new implementation
This is a complete new cc2520 driver for zephyr. Intention is to fit
better within Zephyr device driver model.

- It's (almost*) ready to be instanciated as many times as necessary
- It's fully interrupt based on SFD and FIFOP (no pin polling)
- It's nicer to other sub-systems (it sleeps, no busy-wait loop)
- It still loosely complies to old legacy radio device driver model

*: GPIO API needs to be fixed in order to accept multiple callbacks, as
well as enabling callbacks to retrieve private data.

Notes:
- Hardware filtering does not work yet as the net stack, above, needs to
  provide the relevant information for it (src/dst ieee802154 extended
  addresses, short addresses...)
- A embryo of generic functions (txpower, channel, addresses...)
  have been implemented but don't belong yet to any radio device driver
  model. Such new driver model will come afterwards (soon?)
- SPI API would need to be improved to avoid as much as possible memcpy
  as well as spi_slave_select() call.

Change-Id: I1fd6dfff28fba3984f6006d394ea12f1e763ac18
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-07 17:25:02 +00:00
Tomasz Bursztyka
f7d5d2c8f5 drivers: Renaming directory "802.15.4" into "ieee802154"
ieee802154 is a more relevant name. Applying the change in
include/drivers as well.

Change-Id: I7f7188ed0421045d7667303c375eeb8af1298b97
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-07 17:24:55 +00:00
Murtaza Alexandru
fbd45861f3 sensor: lsm9ds0-gyro: fix FULL_SCALE attribute
SENSOR_ATTR_FULL_SCALE attribute now expects the value as radians per
second.

Change-Id: I8082a1f112f1ed8efb511de39e3a8e5ae3d3ed0c
Signed-off-by: Murtaza Alexandru <alexandru.murtaza@intel.com>
2016-04-07 17:00:09 +00:00
Bogdan Davidoaia
9773fdaade samples: add environmental sensing sample for Arduino 101
The ARC application collects temperature, humidity and pressure data from
a set of sensors connected to the Arduino 101 and sends it to the x86 core
through IPM. The collected data is also displayed on a Grove LCD.

The x86 application exposes the received sensor data as a simple Bluetooth
Environmental Sensing Service.

This version of the sample does not offer notifications when the sensor data
values change.

Change-Id: Iee456d5d2455c7ccb7c5923ef3c94ecb20b5cecb
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-07 16:55:38 +00:00
Tomasz Bursztyka
814f5d0b5e sys_clock: Add a helper to compute micro seconds
As for SECONDS() and MSEC, now sys_clock.h provides a USEC() macro.

Change-Id: I43e8b132d2deeb862d8cfda1f785115f339d6ddb
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-04-07 16:51:07 +00:00
Arkadiusz Lichwa
9385a47e53 Bluetooth: Fix not using endianess helper in LE L2CAP conn req
Corrects response 'result' protocol field to right endianess when
responding to LE L2CAP connection request on error case.

Change-Id: I066bad2f0f3173739676e918f42d425581084dbe
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-04-07 09:20:17 +00:00
Johan Hedberg
7f07d28f37 Bluetooth: Fix BLUETOOTH_NRF51_PM Kconfig definition
Clarify the name of the option and add a dependency to Arduino 101
which is the only known board that is currently known to need it.

Change-Id: Ibfb96cba202f34464b45b922da599da70c038d12
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-07 10:50:52 +03:00
Bogdan Davidoaia
3bdf498716 sensors: fix coding style regarding max line length
Fix coding style so line length does not exceed 80 chars.

Change-Id: Iddebdf55593736cfa288a03a750cc927665f9065
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-04-07 01:03:40 +00:00