Commit graph

18576 commits

Author SHA1 Message Date
Tomasz Bursztyka
6090d779d7 spi: intel: Move back private structures to the right locations
Since the driver is the only one needing those, no need to expose them
anywhere.

Change-Id: Iac4eaa65a9dbdaa8e72c70ea0de35cd2b3d836d1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:27 -05:00
Tomasz Bursztyka
f18275a5be spi: intel: Switch CS before unmasking and after masking interrupts
At this points the slave is ready to deal with the master.

Change-Id: I815d3c577bd0b73100cbf585cc8ca78f180ec713
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:27 -05:00
Tomasz Bursztyka
15058e21ef spi: intel: Fixing how speed is set
This was failing, the documentationg provides numbers only telling at
one places these are hexadecimal values. So switching to hexadecimal.
Then DDS rate retrieving macro was bogus, so fixing it.
And adding debug output about the DDS rate and the clock ratio.

Change-Id: I9cc414796fbd7f7123f1f406c6bce7ffacf641e8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:27 -05:00
Tomasz Bursztyka
93f38d26c2 spi: galileo: Fix SPI port 1 settings names
*_PORT_1_* not *_PORT_0_* obviously.

Change-Id: Idefad40c25b4ad54d9558355daab224bc634c2e7
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:27 -05:00
Tomasz Bursztyka
77d6c32fc2 spi: galileo: Set the right default interrupt type
Galileo SPI interrupt is of type level low, thus setting it to this
value in Galileo's defconfig and removing useless entry in Kconfig.

Change-Id: I90bcc74be1a957bf59912d6f8c2234cfa4fe2329
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:27 -05:00
Tomasz Bursztyka
e6fc1c2049 adc: Add drivers infrastructure
Only Kconfig file for now.

Change-Id: I633ac209583b2fe6cbed3c75036ac245f0058df6
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:27 -05:00
Dan Kalowsky
24aa678401 adc: adding API include file
Change-Id: Ia9c003261d3f07bf9ecbe406b09c6136712e923b
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-02-05 20:24:27 -05:00
Daniel Leung
1c96cdeb52 i2c: simplify API and driver_api with generic transfer function
With the introduction of generic transfer function, it is no longer
needed to specify read or write functions explicitly in drivers.
All read/write functions can now thus call the generic transfer
function to achieve the same result.

With this change, the transfer function becomes mandatory, and
should always be available.

Change-Id: Ia6fb98e58b84330a56a5d44ed3df9db42c3a5e88
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:27 -05:00
Daniel Leung
827f6d018b gpio: pcal9535a: use i2c_poll_transfer() for register read
The newly introduced i2c_poll_transfer() is now used for register
read for PCAL9535A GPIO driver. The old write then read does not
work because every read or write ends with STOP. However,
the chip requires RESTART after writing the register address.
So the new generic transfer function is perfect for this.

Change-Id: I56d7ebe08f68cb04731c72138d60645ef124f65e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:27 -05:00
Daniel Leung
01796ecf5c i2c: dw: implement generic transfer functions
() For interrupt driven transfer, the driver already has
   a generic transfer function, so this simply exposes it
   for public consumption.
() The polling write is extended to support generic
   transfer.

Change-Id: I657db8a6376282c723728b7a875813d389cf7d27
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:27 -05:00
Daniel Leung
ac0beb7034 i2c: add API for generic transfer
Add an API to I2C for generic transfer. This is for those data
transactions which are more complex than simple read or write.

One example use of this is to read register data from a slave
device. The master has to write the address of the register
to slave, then start reading from slave for register data.
In this situation, simple read or write is no longer
sufficient, as for some slave devices, they require RESTART
when data transfer direction changes. Doing a simple write via
i2c_write() results in STOP at end of transfer, which results
in the slave not responding to read request as it is not
expected to send anything back.

Change-Id: I22f9c5ba2f7a7c48a33b9cb1aaf559e596a85d39
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:27 -05:00
Daniel Leung
76bfe7b3a1 i2c: dw: re-organize transfer related code
() Re-organize the steps involved in data transfer, according to
   the datasheet's flowchart.
() Extract the common code for transfer initialization and put
   it into its own function.
() i2c_write() and i2c_polling_write() are now using the common
   data sending function.

Change-Id: Ieb90253ee10ddceb3b5d05b258e7fc6253d18729
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:27 -05:00
Daniel Leung
7551562a14 uart: make poll_in and poll_out mandatory
Polling in/out are basic UART functions that are supposed to
work on every UART controllers. Therefore, both poll_in and
poll_out are now mandatory. The API no longer checks if
they are defined before calling. This is to avoid the if
statements so to speed up things a bit.

Change-Id: I3bd1e7a2dfa5405699ebaec3eb34cfc0434b0073
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:27 -05:00
Daniel Leung
c615ae56cb serial: nsim: add dummy poll_in function
Both poll_in and poll_out are supposed to be implemented
in each driver, as these are basic function.

Change-Id: If1b6b11834f57934fe7e776bfcf818e088abdd0a
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:24:27 -05:00
Dan Kalowsky
94d60babaa tinycrypt: use tabs not spaces
Passing checkpatch check to use tabs instead of spaces for everything.

Change-Id: Ieffa0b0cc4b24598e7cbce7edf9ed640c8fb27dd
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:27 -05:00
Dan Kalowsky
31ff5ad01f tinycrypt: moving includes
Moving the includes to include/tinycrypt. This will help make it
clear when looking at source files where each header originated from.

Change-Id: Ic79978da286f9c288868074a69262d89488925b8
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:27 -05:00
Andrew Boie
9882dcd3d2 sanitycheck: look for misaligned XIP VMA/LMA addresses
XIP is currently implemented in Zephyr by copying only the RW
sections from flash into RAM. For these sections, if the VMA spacing
is different than the LMA spacing the sections in RAM will not be
at the right addresses. Warn about this situation.

Change-Id: I59a55fc27703103e37a7f0bbc34f236047621e0e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:27 -05:00
Andrew Boie
73b4ee69b7 sanitycheck: binary size calculation improvements
- Several recently added binary sections were not being taken
  into consideration, unknown sections now trigger test case
  failure
- Use same VMA/LMA terminology that objdump uses and show both
  addresses

Change-Id: I641eef64aaed6612f62e5aa092f66baaa2797c70
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:27 -05:00
Andrew Boie
c2a9a37e1c test_task: fix startup race
Bad things happen if an SW IRQ is asserted before it is initialized.

Change-Id: I4ad48480c4d7bb5fc14d778d2566d73086300fa1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:27 -05:00
Anas Nashif
93f06fad7d Revert "tinycrypt: moving includes"
This commit breaks the sanitychecks

This reverts commit 93fa1053b21efe3d030ea060a31b80d6008d5bfd.

Change-Id: Ia52092e845c33234817a1cb27cd1f17064c65e7e

Signed-off-by: Anas Nashif <nashif@linux.intel.com>
2016-02-05 20:24:27 -05:00
Anas Nashif
cd6e315167 Revert "tinycrypt: use tabs not spaces"
breaks sanitychecks

This reverts commit 6712ac6c73dcfd6a8e5dc04f6e05ab33b8dbf51c.

Change-Id: I69c3938da0d215b63361cf4d741f2c978ad80661

Signed-off-by: Anas Nashif <nashif@linux.intel.com>
2016-02-05 20:24:27 -05:00
L.S. Cook
86f851c55a doc: adding :dfn: syntax where needed
Updated as per Allan's comments to correct use of Zephyr
kernel in lieu of codename variable

Change-Id: Iaf5f8531c5452b6d8fb13318f00050aa63d99200
Signed-off-by: L.S. Cook <leonax.cook@intel.com>
2016-02-05 20:24:27 -05:00
L.S. Cook
cb9749f443 doc: directive indentation fixes on language.rst
Editing language.rst file to clarify a few items
Also correcting a few things I missed earlier
Also fix title case without hyphen to be consistent

Change-Id: I463d1cdb436957a14af6ea40933f892a51b161aa
Signed-off-by: L.S. Cook <leonax.cook@intel.com>
2016-02-05 20:24:27 -05:00
Dan Kalowsky
3b650c5c44 tinycrypt: use tabs not spaces
Passing checkpatch check to use tabs instead of spaces for everything.

Change-Id: I2fdd507d48db83fda8d183043c5a4ab1b97148dc
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:27 -05:00
Dan Kalowsky
9d506d0a26 tinycrypt: moving includes
Moving the includes to include/tinycrypt. This will help make it
clear when looking at source files where each header originated from.

Change-Id: I062cb3c6ecc5bc2ed2d28228d5926646b6b5f912
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:27 -05:00
Dan Kalowsky
53dbe1f1ec crypto: comply with checkpatch file length
Fixes the tinycrypt library to use Zephyr checkpath acceptable line
lengths.

Change-Id: Ia7bef46a39fa029cda826ec5b2d7d42036d9bdfe
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:26 -05:00
Andrew Boie
579a490ea3 test_sema: fix initialization race
If the other tasks try to trigger a SW IRQ before MONITORTASK
has initilized it, the CPU generates an exception.

Change-Id: Id2745d728a7cf15132096585c073f85f8306cb38
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:26 -05:00
Jukka Rissanen
966401307e x86: Allow use of simple_uart driver with ia32 target
Needed to get simple uart driver working in qemu with
SLIP networking or qemu<->qemu network testing. Because
this is only needed in qemu the patch only touches ia32
platform.

This can conflict with Bluetooth in x86 and qemu so caveat emptor.

Change-Id: Iba20543f968c8fd37ee36747d9aa1ad3f782057d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:26 -05:00
L.S. Cook
1f901bd491 doc: change bash to console refs
Also: fixed trailing whitespaces.
Also: integrated comment change suggestions from GA

Change-Id: I41f7052d9895e0c61ad0e76be989ea6161f9ed83
Signed-off-by: L.S. Cook <leonax.cook@intel.com>
2016-02-05 20:24:26 -05:00
Leona
c98560f783 doc: edit of gerrit tutorial
Change-Id: I3f5831d5e41968c5ce43cc1042565f7677025caa
Signed-off-by: L.S. Cook <leonax.cook@intel.com>
Signed-off-by: Leona <lsc@hackeress.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:26 -05:00
Szymon Janc
0fe883ccb1 Bluetooth: Fix not reseting required security in case of error
If bt_conn_security failed required security level should be set
back to current security. Otherwise it might not be possible to
try later on with lower security.

Change-Id: I3ad7151f2cdff15147b9948bbdab516b8cc16ce2
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:26 -05:00
Mariusz Skamra
ab665fbe27 Bluetooth: Clear pairing flag if all keys have been distributed
This fixes the bug that affected pairing as peripheral.
With this patch pairing flag is cleared and timeout timer stops
if all keys has been distributed.

Change-Id: If7575197d5a42a0ca5bb158ea5607934e92abb81
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:26 -05:00
Szymon Janc
7aae2849c3 Bluetooth: Rename connection state notify functions
Rename bt_conn_connected to notify_connected. This will avoid
confusion with BT_CONN_CONNECTED state name. Same goes with
bt_conn_disconnected.

Change-Id: I6e9d50016036b30345068ef2a6bb556c45d7dd06
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:26 -05:00
Szymon Janc
89f8453ebe Bluetooth: Don't delay bt_conn connected callback
Delaying only connected callback resulted in races where security
or pairing callback could be called before bt_conn connected.

Currently only procedure that relies on read features is connection
parameters update and that should not conflict with other traffic.

Change-Id: I835535abbff21ea8d86b728f5681f90ef9fd337c
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:26 -05:00
Jukka Rissanen
6dba9310d4 net: Keep track of number of free L2 buffers
Print current number of free MAC buf count when allocating
or freeing mbufs.

Change-Id: I3c434671b28ac4b4d8c8d968899e891391d849d9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:26 -05:00
Jukka Rissanen
3e5a38d348 net: contiki: Do not try to free null mbuf
If mbuf could not be allocated, then do not try to free it.

Change-Id: Idf48f9f2eda260b8560a5388c920a9d9a3ef8f16
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:26 -05:00
Jukka Rissanen
44df1a12a2 net: Print local MAC address when setting local addresses
Useful for debugging.

Change-Id: I812ec770e1cdf24f6470c4a0d066c74107ce35df
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:26 -05:00
Jukka Rissanen
dbed256cb0 net: Print stack usage more often for 802.15.4 fibers
The stack usage was not printed often enough when receiving
and sending 802.15.4 packets.

Change-Id: I61a4b6acdc10cb1681e2aeb63cb6af7a35834dff
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:26 -05:00
Jukka Rissanen
c41ad174fc net: Print stack usage and statistics for every transmitted msg
The TX stack usage data and statistics were only printed
if there was an error. This happened very seldom which was
not very helpful.

Change-Id: I059cf9ee3449e5b39d872ef6026df968d86d0209
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:26 -05:00
Jukka Rissanen
b14fdb8b5d net: contiki: Print detailed info if packet len is wrong
If IPv6 packet length is incorrect, then print the actual
length values for debugging aid.

Change-Id: I20d4d73efd1e0103f670e8e53ba6417a4795ab80
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:26 -05:00
Jukka Rissanen
f857815455 net: Print warning if 6lowpan is not used with 802.15.4
If one has 802.15.4 network and tries to compile without
6lowpan, then print warning as that combination is not a
usable network setup. It can be used for testing but not
for real live setup.

Change-Id: I3b540686c8556ed0306723834ca38633aff63165
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:26 -05:00
Jukka Rissanen
a3c8bf6ce3 net: contiki: Typo in 802.15.4 reassembly debug message
Change-Id: Ib363ff582fe5e3e019055c2f3bf062deb5ba8eba
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:26 -05:00
Jukka Rissanen
b7d790b4b2 net: contiki: Do not discard non-fragmented packets
If the fragmentation header is missing, then do not discard
the message but pass it to upper layers as is. The fragmentation
header might be missing if the packet fits into 128 bytes.

Change-Id: I39d29e7ad80be5531262a0ac413d8137da0c64f5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:26 -05:00
Jukka Rissanen
ea0d712ee1 net: Compile 6lowmac layer only if 6lowpan is enabled
No need to compile sicslowmac.c if we do not have 6lowpan.

Change-Id: I8624089f4b360fb12ef1c4a6d7104f0b190f048c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:26 -05:00
Jukka Rissanen
d0731d5d81 net: Pretty print statistics
Align statistics columns better.

Change-Id: I9e83fbbb744d910cae3512bdddab8a5d0e217ba5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:26 -05:00
Jukka Rissanen
a8c54384c0 net: Gather statistics about amount of received L2 bytes
This collects received statistics from layer 2 (MAC).

Change-Id: Ie869c1209bd06f0a5ccad5094b0cafe5fe74d787
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:26 -05:00
Jukka Rissanen
f84e0c1b9b net: Gather statistics about amount of sent L2 bytes
This collects byte counts from layer 2 (MAC).

Change-Id: I16c25f7ae8b9aa485e3c5f1573154cd2270cff93
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:26 -05:00
Jukka Rissanen
f10641f072 net: contiki: Initialize statistics structure
The statistics counts were not initialized so the numbers were
mostly bogus.

Change-Id: If4c33701fbdc4d4603d708c69950a8a18f8eaeaf
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:24:26 -05:00
Szymon Janc
66f6cfc86f Bluetooth: Cover whole key API under CONFIG_BLUETOOTH_SMP
There is no need to define keys types if SMP is disabled.

Change-Id: If6b653906df4623f440b258afd574722498109d0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:26 -05:00
Szymon Janc
4372347319 Bluetooth: SMP: Move code to reduce number of ifdefs
Gather central and peripheral related code togerther so it can be
placed under single blocks of ifdefs.

Change-Id: Ia5fe45b86173b0e647b582bf2cd96fc7c9cb7feb
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:26 -05:00