Commit graph

42249 commits

Author SHA1 Message Date
Arkadiusz Lichwa
0e782884a0 Bluetooth: ATT: Add helper for LE ATT channel conversion
Change-Id: I4dec2690924764c29445b788a097828cd8c63ca3
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-06-27 10:52:35 +00:00
Mariusz Skamra
acc28a9631 Bluetooth: Fix invalid pointer to local variable
attr pointer is local here, so it may be overwritten anytime, because
this attribute user_data will be used out of scobe of this function.

Change-Id: I85b390299980dac213d8ce1939078fe8b242c887
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-06-27 10:49:09 +00:00
Johan Hedberg
502f4a1581 Bluetooth: Add convenience enum value for no advertising options
This makes the code be a bit clearer by letting it specify a more
descriptive value than '0'.

Change-Id: I2e6b46f0924581d0d13f13479aa15170cc9e0e70
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-27 11:09:51 +03:00
Johan Hedberg
fbb2fe8acf Bluetooth: Make random number generation API public
Applications or higher level profiles that are not part of the core
Bluetooth stack may need an easy way to generate random numbers. Since
we already have an internal helper for this export it for others to
use as well.

Change-Id: I29af7cab30ad8f60d481bc847984e781eaecd6bf
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-06-27 11:09:51 +03:00
Javier B Perez
908926ce36 gen_offset_header: resources leak in pTable
Fixed resources leak in pTable when the lseek command
fails.

Change-Id: I414276399b0d0ca3dee0c18d307ccc2035d66198
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-06-24 20:46:13 +00:00
David B. Kinder
2a4d461773 doc: add another issue to doxy troubleshooting.rst
Change-Id: I61f72906ddc790a71fccf39c2a7695106c44f13e
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2016-06-24 20:42:22 +00:00
Arkadiusz Lichwa
2178fc5ab3 Bluetooth: L2CAP: Add configuration response handler
Adds L2CAP configuration response protocol definitions to be able handle
response from remote in reaction to issued local request to exchange
MTU. Current optimistic path of configuration initiated from local
assumes to set MTU contract in one iteration.

Change-Id: If86d96b37e9cd888ad10a624a79c864a137e027d
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-06-24 10:07:24 +02:00
Arkadiusz Lichwa
69882759b8 Bluetooth: L2CAP: Initiate MTU configuration request
Triggers conditionally outgoing configuration request to start exchange
MTU just after incoming PSM connection request was aknowledged by local
host. If local MTU differs from default (672) add MTU option in request,
otherwise send empty configuration meaning default is wanted.

Change-Id: I4eb382cc496345c051967640422e926f595ce854
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-06-23 19:59:16 +00:00
Arkadiusz Lichwa
5192c44e72 Bluetooth: shell: Suplement BR/EDR L2CAP channel handlers
Adds to BR/EDR L2CAP client channel object required handlers and allocate
room for channel data traffic to make it operational when fully
setup and to be interactive with internal stack.

Change-Id: Id1e90d7ea318ed8a875383995e4d175e124939eb
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-06-23 19:58:57 +00:00
Mariusz Skamra
db250496b9 drivers/nble: Fix missing return status assignment
Status shall be stored to be returned in the response to the
on_nble_gatts_write_exec_evt.

Change-Id: I03172e4b8833f83bd9b60f10d3cb52a067cc9f34
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-06-23 11:03:35 +02:00
Mariusz Skamra
ab8ec1592d drivers/nble: Fix missing FIFO initialization
FIFO object has to be initialized before being used.

Change-Id: I3bd774f60e2585d09cfba657cb2aa50c95e0c2f5
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-06-23 11:03:34 +02:00
Andrew Boie
a1c71b2043 nios2: include required macros for byte addressing
These are no-ops since this is not an arch that isn't byte-
addressable.

Change-Id: I09b0fd8b8d85f67bcca2dcb6ebc35843c19afa45
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-23 05:37:32 +00:00
Andrew Boie
5a92526a7d nios2: add start_task_arch.h
Required by microkernel, currently does nothing.

Change-Id: I256886e3a52817d9216599bbf5691bc27c1d0ad8
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-23 05:37:32 +00:00
Bogdan Davidoaia
58ff059fc6 MAINTAINERS: add SENSOR DRIVERS section
Change-Id: I4dbfce59d5f28ead7192cfe0b074ac8c85f7f5d5
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-06-23 04:38:23 +00:00
Andrew Boie
84f06303d1 nios2f-zephyr: check in CPU and configuration
Per Altera these files for the /F core are freely distributable.
README included with instructions and links to necessary software.

Origin: Altera
Change-Id: I58c0dbcb5a2b11f0845d4e390e6aa0020d8b3ed5
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-23 00:15:53 +00:00
Andrew Boie
a6d546ba33 qemu_nios2_defconfig: use JTAG UART
Change-Id: Ifde07b8229a8013b7dabfa973f8d2eed4c3ea757
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 23:15:39 +00:00
Javier B Perez
6f67bfcd61 doc: fix warnings about undefined ref and group without end.
Fixed group end and undefined refs.

Change-Id: Iad0ab7b0dd858955d95f298a772d8d84bb4ee1c9
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-06-22 16:44:20 -05:00
Andrew Boie
133dab4a63 altera_avalon_timer: new timer driver for Nios II
Tickless idle is not yet supported. We program the timer period
to the desired system clock tick rate (sys_clock_hw_cycles_per_tick).

This was renamed to the same name used in the Altera Embedded IP
Peripherals Guide; used by other CPUs than Nios II.

Change-Id: Ic4fca8c16b923295b77b63f98f45cd3483c5f560
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 19:00:35 +00:00
Inaky Perez-Gonzalez
9b3b36bd7a gdb-server: update call to uart_register_input()
uart_register_input()'s signature changed with the addition of a
callback. gdb_server.c was never updated so now the compilation fails
when enabling the GDB server.

Fix by setting a NULL completion (as seems the code would not use it
anyway).

Change-Id: I4c0df65a31bd906db704f7f4a564e7d6f065aae7
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-06-22 17:40:01 +00:00
Inaky Perez-Gonzalez
b4bbc71369 gdb_server: fix semicolon that depends on #define
supported_features_cmd is a string which part of is added based on a

However, the semicolon to do so was being only included if the #define
was there; if not it was generating a syntax error. Place it out of
the #ifdef block.

Change-Id: Idd7e80519719b5ad432971e758a05546df8a89e2
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-06-22 17:39:43 +00:00
Andrei Emeltchenko
fbffa2a12f drivers/nble: Fix not unref not connected conn
If conn is not in BT_CONN_CONNECTED state we get extra reference.

Change-Id: Id78db628e776576ea120bda08e3f906c221015c7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-06-22 17:27:56 +00:00
Baohong Liu
029d3beb57 uart: qmsi: Add driver API reentrancy support to UART shim driver
Global data and device setting can be messed up by concurrent
API calls. This change is to serialize the access.

Jira: ZEP-454
Change-Id: I520722aecab7db443d053fd45498a22e165889de
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-06-22 16:47:52 +00:00
Vlad Dogaru
661c5eb676 gpio: add device config helpers
Change-Id: I8af573484934a02893a395bb0d19551b5c9d0291
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-06-22 16:47:16 +00:00
Vlad Dogaru
8fed55f640 i2c: add device config helpers
Add some macros that drivers and applications can use in describing I2C
clients.

Change-Id: Ic7af97804e88ed3b9d4f68f9ac358a425f4cc17c
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-06-22 16:47:16 +00:00
Vlad Dogaru
2982f0e730 sensor: add device config helpers
Define some configuration structures and macros that can be used in
device configuration.  These usage scenarios are as follows:

 * device drivers will use SENSOR_DECLARE_* macros in their device
   configuration structures and SENSOR_GET_* macros in the init
   functions;

 * application code will use SENSOR_TRIG_* to fill in the device
   configuration structures.

Change-Id: I3a897999175b14a4cd1111da4c26434741294e52
Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
2016-06-22 16:47:15 +00:00
Baohong Liu
e4c765f40f drivers: dma: Add QMSI 1.1-based DMA shim driver
Add DMA shim driver based on QMSI 1.1

In order to enable this driver, the following options must
be set.

CONFIG_DMA
CONFIG_DMA_QMSI

Jira: ZEP-354

Origin: Original

Change-Id: I604cbf34e90f7653b956a6e4d428424beee3ef87
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-06-22 16:46:50 +00:00
Baohong Liu
fe468c93ec drivers: dma: DMA driver interface
Add header file for DMA driver.

Jira: ZEP-234

Origin: Original

Change-Id: I2b36022bdad20dc4aa9d256bb13143b4e0945453
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-06-22 16:46:49 +00:00
Tomasz Bursztyka
0e0509b67f net: Let's use inline function for type checking for net_buf
Using macros does not let the compiler verifying about the type we are
providing, which usually give an error easier to understand.
Also, this will let the compiler deciding how to actually optimize
(inline or not) the code.

Change-Id: I17fb1f5a1c1854461fad101bbb40c9be33844c8b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-06-22 16:43:29 +00:00
Andrew Boie
b8d7b0dfe7 nios2: properly set SYS_CLOCK_HW_CYCLES_PER_SEC
This is a workaround until we can modify the kernel to pull this
value out of system.h instead of Kconfig.

Change-Id: Iaafa9003d2bbcb5b38a050c371466a206f716ae7
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:21 +00:00
Andrew Boie
4ae4d2f4d1 nios2: include .sbss in BSS section
Change-Id: I1165d65ae8505ec79166acc8ebde86611ac50e08
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:21 +00:00
Andrew Boie
738dec483e nios2: add static interrupt handling code
Supports Internal Interrupt Controller only for now; EIC
supoort tracked in ZEP-258.

Change-Id: I2d9c5180e61c06b377fce4bda8a59042b68d58f2
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:21 +00:00
Andrew Boie
e2ff2fdd91 nios2: add base exception handling code
Change-Id: I56b0ec1a3576a77ca7bd6f2c0217de8053406927
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:20 +00:00
Andrew Boie
b6d9c5ca80 bluetooth: init: disble for CONFIG_UART_ALTERA_JTAG
Interrupt-driving UART not implemented yet for this driver.

Change-Id: Ida60d7e09e9eca2d7e6452a84f6d95529d0af9b6
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:20 +00:00
Andrew Boie
533e88718b altera_max10: use JTAG UART for console
Attached PCs can read these messages with the 'nios2-terminal'
application.

Change-Id: I44942c8feaf3901adb410269460787cf2a8b6a4a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:19 +00:00
Andrew Boie
25052517c1 uart_altera_jtag: add JTAG UART driver for Nios II
This currently only supports outgoing messages without interrupts.

Change-Id: I635562f47106eb6cdc7104a8160e431bebea25dc
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:19 +00:00
Andrew Boie
7bd697b0d5 nios2: add _nios2_reg_write/read functions
The technical manuals and example HAL code frequently refer to
register bank numbers from some base address. Add these helper
functions to read and write registers correctly using this
notation.

Change-Id: Ia082f5cc89081fcea2cb6ad8204c1b9b2650d3fd
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:19 +00:00
Andrew Boie
280340162d altera_max10: enable some debug configs
Useful at this stage of the bring-up. Stack memory will be initialized
with 0xaa and we build with -O0.

Change-Id: Icd0e9ac49c0158f7b18e4e286a07ca281d20e7e6
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:18 +00:00
Andrew Boie
1487c6d66e nios2: implement _Swap() and _new_thread()
With this code we can successfully boot and context switch into
the main thread. Nanokernel hello_world has the expected
"Hello World!" string in the RAM console.

Change-Id: I56335d992f5a7cbb12d9e4c02d1cc23ea28ae6ef
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:18 +00:00
Mariusz Skamra
cc1559ce56 drivers/nble: Add timeout before Conn Param Update as Peripheral
According to Core 4.2 Vol 3, Part C, 9.3.12.2,
The Peripheral device should not perform a Connection Parameter
Update procedure within T_GAP (conn_pause_peripheral) after
establishing a connection.

T_GAP (conn_pause_peripheral) is 5 seconds.
Fixes TC_LE_REJ_BI_01_C.

1/3   L2CAP   TC_LE_REJ_BI_01_C   PASS
2/3   L2CAP   TC_LE_CPU_BI_02_C   PASS
3/3   L2CAP   TC_LE_CPU_BV_01_C   PASS

1/3   GAP   TC_CONN_CPUP_BV_01_C   PASS
2/3   GAP   TC_CONN_CPUP_BV_02_C   PASS
3/3   GAP   TC_CONN_CPUP_BV_03_C   PASS

Change-Id: I66bf57a2b8323b748c15f61b2daecfaa435dbb69
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-06-22 16:01:48 +02:00
Tomasz Bursztyka
06717d3196 net: Fix documentation of buf.h
Make sure all is documented, and the comments properly formated.

Change-Id: I7431535b0f3a409e63ac4b12c421be662098eed1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-06-22 13:34:46 +00:00
Andrei Emeltchenko
a0204e22aa drivers/nble: Implement on_nble_gatts_notify_tx_evt()
Print debug statement allowing to track bugs with firmware, this also
removing Not Implemented warnings.

Change-Id: I15b77cd6efb5d9bc75910ef444f746c860ac3c6c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-06-22 13:12:37 +00:00
Luiz Augusto von Dentz
105d342a63 Bluetooth: GATT: Fix attribute .write documentation
Change-Id: I765de61cc98927affd2547de765d61bb3f8e7efb
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-06-22 12:03:23 +00:00
Mariusz Skamra
ad02f94c29 drivers/nble: Fix return type
This function can return negative value.

Change-Id: If466897821a0d1b718ad210df208ce8a004b3da9
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-06-22 11:25:37 +02:00
Mariusz Skamra
b2ba8fbd0c drivers/nble: Split writing part of on_nble_gatts_write_evt
To be reused by on_nble_gatts_write_exec_evt.

Change-Id: I2cb7f3b8e2c33cbede9af3f211e876c4038bef36
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-06-22 11:25:32 +02:00
Mariusz Skamra
cad52d1a66 drivers/nble: Fix execute write condition
This fixes the condition that has to be checked while writting attribute
value. According to the GATT API, write() callback returns the "number
of bytes written, or in case of an error BT_GATT_ERR() with a specific
ATT error code".

Change-Id: I4268e1d0585f5ce816ad64ca62232b6d739b780a
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-06-22 10:44:18 +02:00
Fabrice Olivero
b551a447b0 samples/task_profiler: fix crash when starting profiler
When profiler is started from shell, platform information is
transmitted over uart by calling uart_poll_out(uart_dev)
directly in the shell fiber context which is executed when
the command is entered ('prof start')

Problem is that 'uart_dev' global variable is set to the UART
console device when prof_flush() first call is done.

Depending on when this call happens (application dependent,
especially in nano-apps which have to call prof_flush in
their main loop), 'prof start' may happen before 'uart_dev'
variable is actually set, which drives to shell fiber crash.

This patches moves sending platform information from shell
fiber to prof_flush function to avoid using non initialized
'uart_dev' variable.

Change-Id: Ie64f4418a745affa3fbd731db6bf9bb998b7c2f9
Signed-off-by: Fabrice Olivero <fabrice.olivero@intel.com>
2016-06-22 05:30:26 +00:00
Kumar Gala
86cbc320f0 build: quote SOURCE_DIR to allow it to be a list
If SOURCE_DIR happens to be multiple directories we need to quote it so
it gets passed correctly as a list.

Change-Id: I7795ddecd016fad2048f957accd1557bb2215632
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-22 05:02:28 +00:00
Kumar Gala
5ccf5298b5 build: make zephyrmake exposed with V=1
Remove extra @ which would always silence output from zephyrmake.  Every
instance of zephyrmake is prefixed with a $(Q) so V=1 will expose them

Change-Id: I8e622cc2175f645897ac78d607486d37c0af1618
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-06-22 05:02:28 +00:00
Inaky Perez-Gonzalez
b6b39f63d9 doc: add a troubleshooting guide
In preparation for more strict guidelines on documentation, provide a
trouble shooting guide with the most common and obscure issues found.

The CI system will point to this guide to help committers upon doc
failures.

Change-Id: I386baea75dad0c82b58b23926e0bd32de8a0b249
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-06-22 04:49:28 +00:00
Tomasz Bursztyka
bf40601c2a cc2520: Fix how FREGs and SREGs are accessed
- SREGs should use MEMRG/MEMWR instructions, FREGs use REGRD/REGWR
- REGRD/REGWR get the register address in the first byte along the
  instruction.

Reported-by: Igor Modino <igor@emutex.com>

Change-Id: I0da9de5ecd4cab914c8711bd4276e7a2bc6147a5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-06-22 04:47:43 +00:00