Commit graph

42249 commits

Author SHA1 Message Date
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
Daniel Leung
ba4099430b ethernet/dw: remove kconfigs that are SoC specific
Remove those kconfig options that are SoC specific, and
should not be configurable via kconfig.

Change-Id: Ib483419be5199b52cf281b4b106cd8a3be95b7be
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-07 00:58:57 +00:00
Daniel Leung
1bdc6f8b22 sanitycheck: fix initlevel section being mentioned twice
The "initlevel" section is being metioned twice. It does not affect
the final size calculation, but just remove it just for reader's
sanity.

Change-Id: I0e7d6e82c730631d2c83ca09dde0f675805840f3
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-04-07 00:56:41 +00:00
Sergio Rodriguez
1b41169828 rtc/qmsi: Fix the IRQ priority setting according to the SoC specific option
The configuration option CONFIG_RTC_IRQ_PRI does not longer exist, and have
to use the specific QMSI driver IRQ priority

Change-Id: I8074c6d8e095596d03e51a94f26a73c3a9ff91b7
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-04-06 12:05:23 -07:00
Grzegorz Kolodziejczyk
bae91cf980 Bluetooth: tester: Use bt enable cb to indicate cmd rsp success
This is needed especially for nble. If bluetooth is not enabled we
cannot send another commands to tester.

Change-Id: I17e639301bba6efd127f2c743b8942c1b493f9da
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-04-06 17:25:11 +00:00
Grzegorz Kolodziejczyk
355ded1863 drivers/nble: Add support to bt_gatt_attr_next
This function is needed to get next attribute of  passed to function
attribute.

Change-Id: Iefe2015f2d6bcb650012b1f9d5b1ea98e8fa8f48
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-04-06 12:35:49 +00:00
Andrei Emeltchenko
bd5f745e25 Bluetooth: Enable Nordic BLE chip using PM helpers
When Nordic BLE chip is flashed with HCI firmware use H:4 UART driver
and enable chip the same way we enable for NBLE.

Change-Id: Ie14734266803088feadb0d0eb20c49c3615f0267
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-06 12:10:21 +00:00
Johan Hedberg
f72063e214 Bluetooth: drivers/nble: Require callback for bt_enable()
The nble nRF51 firmware cannot handle situations where it receives
data before it is ready. The RPC calls otoh cannot be blocking.
Combine this with the fact that bt_enable(NULL) is supposed to be
blocking means we cannot support this mode of operation with nble.

Change-Id: Ib9c2c322b44b04bc48be243c2ba1c1bc4becb8ea
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-06 11:51:27 +00:00
Andrei Emeltchenko
f7da2220d7 quark_se_devboard: Remove UART default name from soc config
Remove UART default configuration to make it default UART_0. This
makes default working fine with Nordic BLE chip using H:4 driver.

Change-Id: Icb6d9f068b586bbf04694bc77ed968211de94c8a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-06 14:00:56 +03:00
Andrei Emeltchenko
3252f6cf1a drivers/nble: Refactor PM code to make it reusable
Refactoring Power Management related code to special file nrf51_pm
making it possible to reuse the functions for H:4 UART driver when
Nordic BLE is flashed with HCI firmware.

Change-Id: If389c1f4af13fa786e5866129624527cec0928e0
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-06 14:00:56 +03:00
Andrei Emeltchenko
8e4440674e Bluetooth: Add option for PM with Nordic BLE chip
The config option handles enabling, disabling and power management
operations with Nordic nRF51 BLE chip.

Change-Id: I816062a7fb17c9e57c234113a2cecdebceb407b6
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-06 14:00:55 +03:00
Andrei Emeltchenko
ecc35267da drivers/nble: Move Nordic Bluetooth LE driver inside drivers/bluetooth
Move NBLE code to the place where other Bluetooth drivers code resides.

Change-Id: Ibcf9ffb016e9b842bed66a61dff5c101b1573aaa
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 14:04:44 +03:00
Johan Hedberg
bc706e2a88 Bluetooth: Add stub for bt_storage_clear()
Change-Id: I7ab9ee4ca1d9702e7aef23aadfa627554907d145
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-05 12:29:14 +03:00
Johan Hedberg
d0e4e0183e Bluetooth: Rename bt_register_storage to bt_storage_register
Keep a single bt_storage_* name space for current and future storage
APIs.

Change-Id: If158eb7408cce7c06cd8f98d78a061b9f9585265
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-05 12:29:14 +03:00
Johan Hedberg
e70771d3c8 Bluetooth: Export bt_storage inside the stack
It's likely that other files besides hci_core.c will be needing to
read/write the storage. Export it therefore through hci_core.h (same
time adding a missing 'const' to the declaration).

Change-Id: I7c08bc0d69c752bef68f9da9e4aee1acfa00de72
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-05 12:29:14 +03:00
Johan Hedberg
499b44201b Bluetooth: Don't update random address unnecessarily
If the wanted address is already programmed to the controller there's
no need to send a HCI command to change it.

Change-Id: Ib73d09cc5b20cd6820e603f0828f000f8310a89e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-05 12:29:14 +03:00
Johan Hedberg
5ccb20c591 Bluetooth: Use bt_addr_t inside bt_addr_le_t
In many cases when we want to access the 'val' member of bt_addr_le_t
it's in situations where the type needed is actually bt_addr_t. To
avoid unnecessary typecasts in these places simply embed bt_addr_t
inside bt_addr_le_t.

Change-Id: I7eecf129bee1dcf085abc83ec2f32e1a10b0b5aa
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-05 12:29:14 +03:00
Johan Hedberg
13be3947ab Bluetooth: Add Privacy Feature support
Add initial support for the Privacy Feature, including the ability to
manage a local IRK and to use Resolvable Random Addresses.

Change-Id: I1c70aea67078dd2a5d07f3b797c37746ebe9ab61
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-04-05 12:29:14 +03:00
Andrei Emeltchenko
24732e8fb9 drivers/nble: Fix typo in compatible_firmware name
Change-Id: I81a211892e61bc11db5e5e8c1715f7971d64ace1
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 11:18:53 +03:00
Andrei Emeltchenko
8f5e21154b drivers/nble: Update RPC to Nordic firmware 0404 version
Update RPC headers and change compatible_firmware version 0404.

Change-Id: Ie9920d302f3787c07181bc6aa519a96556463a79
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 11:18:53 +03:00
Andrei Emeltchenko
f0f91d4a7b drivers/nble: Refactor Nordic BLE chip enable functions
Move NBLE pin handling to the driver from gap.c.

Change-Id: I4b7fd408c623971d19da12784c656c5c605852a5
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 11:18:53 +03:00
Andrei Emeltchenko
36748b9f33 ia32: Allow to connect Nordic chip to qemu
Allow to connect Nordic Devkit or dongle to qemu. Simple
configuration for the current NBLE firmware is following:

Connect Nordic board to PC, ttyACMX gets created.
$ socat -x /dev/ttyACMX,raw,b1000000 unix-listen:/tmp/bt-server-bredr
Build app with prj_nble.conf and run with make qemu

Change-Id: I354644b465ad09ab0ca62fbd97f15d9bb3c87d6a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-04-05 11:18:53 +03:00