Commit graph

42249 commits

Author SHA1 Message Date
Tomasz Bursztyka
257379d0ff net: Add header file for generic link address
It only describes the structure for now, but will then provide helpers.

Change-Id: I7ac7717a3289086dac50d90e25b2a1ce7d7abc91
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-07-12 07:20:40 +00:00
Jukka Rissanen
ca2f26999a net: yaip: Compile new stack if enabled
Change-Id: Ifb9c1b49e253af0428187898c6c3e6aa7f4851cd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:20:31 +00:00
Jukka Rissanen
d53c56fff4 net: yaip: Use same prefix in new IP stack Kconfig
Use CONFIG_NET_... prefix for Kconfig options.

Change-Id: I3e882845e7c09ba910f108179208fcaf33360f21
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:20:19 +00:00
Jukka Rissanen
8e7007c26f net: yaip: Add ntohl() and related macros
Change-Id: Ia329a63644eab8ca1ce6debb8f7e7b97b8de711d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:19:51 +00:00
Jukka Rissanen
7db376cfec net: yaip: Add defines for various IP protocol header lengths
Change-Id: I05dcb7a26f50cd0c8d544c5d829e1154ed3f8119
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:18:45 +00:00
Jukka Rissanen
75ae39518c net: yaip: Initial commit for new IP stack
This is a placeholder that just compiles but does nothing else.

Change-Id: I9689fa26eb13bc23d29940938f7b3c11f32b2ff1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-12 07:18:06 +00:00
Arkadiusz Lichwa
ca57a7816d Bluetooth: L2CAP: Start servicing configuration request from remote
To make channel operational in basic mode a process of BR/EDR CoC
channel configuration needs to be performed in both directions. Remote
peer is mandated as well to inform local about its segmentation
requirements. Here is added such request handler focused on grabbing
remote MTU which is mandatory in channel setup.

> ACL Data RX: Handle 12 flags 0x02 dlen 12  [hci1] 12.133539
      L2CAP: Connection Request (0x02) ident 3 len 4
        PSM: 1 (0x0001)
        Source CID: 64
< HCI Command: Host Number of Completed Packets (0x03|0x0035) plen 5  [hci1] 12.133631
        Num handles: 1
        Handle: 12
        Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5  [hci1] 12.133792
        Num handles: 1
        Handle: 12
        Count: 2
< ACL Data TX: Handle 12 flags 0x00 dlen 16  [hci1] 12.141644
      L2CAP: Connection Response (0x03) ident 3 len 8
        Destination CID: 64
        Source CID: 64
        Result: Connection successful (0x0000)
        Status: No further information available (0x0000)
< HCI Command: Host Number of Completed Packets (0x03|0x0035) plen 5  [hci1] 12.142054
        Num handles: 1
        Handle: 12
        Count: 1
< ACL Data TX: Handle 12 flags 0x00 dlen 16  [hci1] 12.143276
      L2CAP: Configure Request (0x04) ident 6 len 8
        Destination CID: 64
        Flags: 0x0000
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 48
> HCI Event: Number of Completed Packets (0x13) plen 5  [hci1] 12.150945
        Num handles: 1
        Handle: 12
        Count: 2
> ACL Data RX: Handle 12 flags 0x02 dlen 16  [hci1] 12.150959
      L2CAP: Configure Request (0x04) ident 4 len 8
        Destination CID: 64
        Flags: 0x0000
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 128
> ACL Data RX: Handle 12 flags 0x02 dlen 18  [hci1] 12.152160
      L2CAP: Configure Response (0x05) ident 6 len 10
        Source CID: 64
        Flags: 0x0000
        Result: Success (0x0000)
        Option: Maximum Transmission Unit (0x01) [mandatory]
          MTU: 48
< HCI Command: Host Number of Completed Packets (0x03|0x0035) plen 5  [hci1] 12.158806
        Num handles: 1
        Handle: 12
        Count: 1
< ACL Data TX: Handle 12 flags 0x00 dlen 14  [hci1] 12.161822
      L2CAP: Configure Response (0x05) ident 4 len 6
        Source CID: 64
        Flags: 0x0000
        Result: Success (0x0000)
< HCI Command: Host Number of Completed Packets (0x03|0x0035) plen 5  [hci1] 12.163197
        Num handles: 1
        Handle: 12
        Count: 1

Change-Id: I7919fe180cf1d761023bb1478d8e1fb2d21a94d9
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-07-11 19:34:17 +00:00
Jukka Rissanen
83707d5675 net: buf: Calculate amount of bytes in fragments
Utility function net_buf_frags_len() calculates amount of data
stored in the fragments.

Change-Id: I89ebc8dac4f216ff9e77b5c44002082398957f7b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-11 18:06:24 +00:00
Jukka Rissanen
95f5cd2b9a net: buf: Add tests for net_buf fragmentation
More realistic IPv6 packet creation tests created.
One test creates one big IPv6 packet and manipulates that.
Second test creates a list of IPv6 header + data fragments
and sets some user data in those fragment buffers.

Change-Id: Ic8309ff115e1d735e98c30b3c8292b0d6ffc5f42
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-11 18:06:11 +00:00
Jukka Rissanen
7d6197cf94 net: buf: Add fragmentation API tests
Add tests for checking that the net_buf fragmentation works ok.

Change-Id: I778f79bae971314b6f19c1bf00ed42e1c2128e99
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-11 18:05:41 +00:00
Andrew Boie
8a80ce5c6f Revert "REVERTME: test_pool disable due to memory corruption bug"
Allan fixed the underlying issue, re-enable.

This reverts commit 19fa82ab91.

Change-Id: I6e517f76a6650a3e9ba5a09118187e6c965a147a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-11 17:53:45 +00:00
Luiz Augusto von Dentz
d98068be94 Bluetooth: L2CAP: Fix not canceling RTX work
If the channel is being destroyed the RTX work should be cancelled as
it may cause destroy to be called again.

Change-Id: I49c10d64a2108719d28e456fb5b4bfb50ef8a140
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-07-11 15:40:39 +00:00
Luiz Augusto von Dentz
a6a78bfbca Bluetooth: L2CAP: Unify code for adding and deleting channels
The code for adding and removing channels is very similar for LE and
BR/EDR so it can be unified and just leave the CID allocation up for the
bearer implementation.

Change-Id: Icf4c66262c4e973039381ebd1861fad4d46e1535
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-07-11 15:39:59 +00:00
Luiz Augusto von Dentz
2329d82432 Bluetooth: L2CAP: Make l2cap_chan_add initialize the destroy callback
This is cleaner and safer as destroy is garanteed to be initialized once
it is added to the list of channels.

Change-Id: Iae674f6e25527d71c03c5903337b0bd18c3dd0be
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-07-11 15:38:30 +00:00
Jukka Rissanen
4605a3771c net: buf: Add fragmentation API support
User can add fragments to the network packet if the data cannot
be placed in one buffer.

Change-Id: I060ef533cc4fdda0f38405fb7dc72015f5cac7fc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-07-11 15:37:45 +00:00
Johan Hedberg
4efe39ff04 Bluetooth: SMP: Take advantage of new bt_hex helper
The h() helper isn't needed anymore.

Change-Id: Ica1b4beb086237c1c792d5376e8ee71bc64394fe
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-11 09:44:13 +00:00
Johan Hedberg
6e701275af Bluetooth: Add hexadecimal conversion logging helper
This has so far been used in SMP code as the h() function. Now it has
a more generic name and is accessible by all parts of the Bluetooth
subsystem.

Change-Id: Iae4607da9c8b3e6779d9c97f84a4e486d5258ef0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-11 09:38:53 +00:00
Johan Hedberg
f7d802b1e3 Bluetooth: Fix enabling ECDH HCI events when SMP is not selected
Now that there's an API always exposed for this the events should
always be enabled whenever the controller supports this feature.

Change-Id: I4965c9463ae7b3f6424784dab2c03403fdf3f179
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-11 09:38:42 +00:00
Johan Hedberg
abc142bdc3 net: buf: Add net_buf_push_u8() helper API
This is similar to the other net_buf_*_u8() helpers that already
exist.

Change-Id: I63fc963877c1946964e675067dd98f748be7cbbc
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-09 15:43:31 +03:00
Johan Hedberg
30cb395bbf net: buf: Add big-endian helpers
Add helpers for big-endian 16-bit values, similar to the ones that
already exist for little-endian values.

Change-Id: I63bf4dd7df802669ea6657cd95d6da48e6176487
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-09 15:43:31 +03:00
Johan Hedberg
727a2459b1 net: buf: Add net_buf_reserve() API
This API allows initializing the buffer with a given headroom. This
prepares the way for eventually removing the 'reserve_head' parameter
from the net_buf_get APIs, but can already now be useful in some
scenarios where the headroom is desired to be different than some
higher level API sets it to be.

Change-Id: Iffbe5761fdf3d2ad8cb4b8437b1074cf42ea9c6c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-09 15:43:31 +03:00
Johan Hedberg
e03151ee3e net: buf: Use precise buffer size given to NET_BUF_POOL
Until now, NET_BUF_POOL() would be opportunistic and allocate a few
more bytes extra for the buffer content if the given size wasn't a
multiple of 4. This is an issue however if the API user really wants
to have a precise size for the buffer so that e.g. net_buf_tailroom
gives meaningful and deterministic results.

This patch removes the opportunistic rounding up, basically leaving it
up to the application to decide if it wants to have unused padding in
the data structure or not.

The crucial thing here is to ensure that locating the user data
section (which is aligned to a 4-byte boundary) doesn't break, since
buf->size is used for that. However, the net_buf_user_data()
implementation already uses ROUND_UP() so the result will still be
the same even if buf->size is not a multiple of 4.

Change-Id: I4bc17139cda19a680180c2d326d417a41ad0d4cd
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-07-09 15:43:31 +03:00
Szymon Janc
bccc1bf0e1 Bluetooth: SMP: Send pairing failed on unexpected PDU
If unexpected PDU is recevied it is better to reply with Pairing
Failed and abort pairing then just silently ingore such PDU as
pairing will most likely fail anyway.

Change-Id: I3c67a6997a5e8d33b1e97cb955981a52baf38d02
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-07-09 12:40:48 +00:00
Allan Stephens
c002401295 sysgen: Cosmetic cleanup of memory pool generation code
Does renaming of variables and comments to conform to the
"block set" and "quad-block" terminology now used by the kernel's
memory pool code. (Note: This renaming also includes names of
some variables generated by sysgen.)

Change-Id: I8e04cb1ee9ca83daddb487b477da7dd2e1004fd8
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 23:04:41 +00:00
Allan Stephens
7bbf48bf5b kernel: Cosmetic cleanups to memory pool code
Improves a handful of comments, and removes some unneeded blank lines.

Change-Id: Ia2b951d23131b0080104c18c06324342de3359ef
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 23:04:40 +00:00
Allan Stephens
ff48e07f70 kernel: Rename fields of private memory pool type
Revises two fields of the memory pool structure to better reflect
that block sets are involved.

Change-Id: I44a751e7457270391fbe99705010345448df2ff4
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 23:04:40 +00:00
Allan Stephens
dc9556c4f7 kernel: Rename field of private memory pool type
Revises the memory pool block set field that points to its array
of quad-blocks to better reflect that quad-blocks are involved.

Change-Id: I159805ce8eee9091221cb1f494a4ab082e3736e5
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 23:04:39 +00:00
Allan Stephens
c0fd08e82d kernel: Rename private memory pool types
Revises the names of 2 types to make them better reflect the
data structures they represent, namely:

- block set: a collection of memory pool blocks of a given size
- quad-block: four contiguous memory pool blocks of a given size

Change-Id: I3e424586e97157eea185fba6836e2e89d10d9cd6
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 23:04:39 +00:00
Allan Stephens
569d08a940 kernel: Eliminate unused memory pool structure field
Eliminates the memory pool field indicating the size of the
pool's memory buffer, since it isn't used anywhere.
(Anyway, it could be computed by multiplying the maximum
block size by the number of maximum-sized blocks.)

Change-Id: Ia11554bdc2b246a1ba0ea33f05c5e6ce6a32ca13
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 23:04:39 +00:00
Allan Stephens
28c427d6c0 kernel: Invert polarity of memory pool's quad-block memory status field
Alters the use of the field so that a 1 bit indicates that the
associated block is available (i.e. can be allocated from the pool),
and a 0 bit indicates the block is unavailable (i.e. it is already
allocated or does not exist).

The revised definition of this field is more intuitive, since it follows
the conventional "1 = thing is present, 0 = this is not present" model.

Change-Id: Id133d1940aca0dd1c3c1672f989d0c0bb083ebc5
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 23:04:38 +00:00
Allan Stephens
8b925dc5de kernel: Optimize memory pool initialization routine
No longer initializes the quad-block descriptors for block sets,
except for the one containing the largest size blocks. The descriptors
for the other block sets don't need initialization since sysgen already
ensures the block pointer field is NULL, and the block status field can
be anything (since it is ignored if the pointer is NULL).

Change-Id: I72cdf772329ef3e6d1babd9da11706d11611e61a
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 23:04:38 +00:00
Allan Stephens
6f3f29a0f3 kernel: Enhance memory pool defragmentation routine
Adds missing check to prevent defragmentation algorithm from
going past the end of a block set's array of quad-blocks.
Optimizes quad-block deletion algorithm so that it simply moves
the final array entry into the slot for the deleted entry,
rather than shifting all of the entries in between them.

Also enhances comments to make it easier to understand
what is going on.

Change-Id: Ic281c6f3c6dd5df9ec532a302b4103f3d929665b
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 23:04:38 +00:00
Javier B Perez
d3d1034172 MAINTAINER: move known issues component and clean blank line
Moved Known issues component to in alphabetical order.

Change-Id: Ia9e495fd35056490f9cb0355bf3418dc46804b68
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-07-08 21:21:37 +00:00
Andrew Boie
251317c1bf nios2f-zephyr: commit additional source files
These are necessary to edit the CPU design in QSYS.
These originate from the F core archive supplied by Altera.

Change-Id: Ic03bd8738ae58dc154b5eaef91154fadaa61c491
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-08 21:20:26 +00:00
Andrew Boie
76be6c89a7 nios2f-zephyr: update CPU build
This build has support for hardware break/watch points.

Change-Id: Icf8a0d4abc82640eedd8c43322ebecf0ef069974
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-08 21:20:22 +00:00
Juan Manuel Cruz
2db8e207bb doc: application build update.
Updates the application build steps needed to rebuild your system.
Adds team recommendations on the current friendly manner to build
an application.

Change-Id: I7aff1788dc15c7159a319c926f14bc621924ce67
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
JIRA: ZEP-180
2016-07-08 20:34:31 +00:00
Juan Manuel Cruz
655a2c89f8 tracing: test includes ipc console fiber if enabled
The test test_thread_monitor fails when a platform enables
the IPC console.
This commit fixes the test to count the IPC console fiber
if it is enabled in the project or the platform.

Change-Id: I9faf9d120b35d9211e558be8f5788885f30c3081
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-07-08 20:34:30 +00:00
Allan Stephens
c3218e486f doc: Remove reference to deprecated task IRQ object type
This line was missed when the task IRQ APIs were deprecated
by commit a83f895dd5.

Change-Id: I0135eebb2f7bd0991364fdaab8a0a1fd6981d50d
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 20:32:42 +00:00
Allan Stephens
70e4a80360 doc: Purge inappropriate fundamentals info from Kernel Primer
Incorporates the brief discussion of device driver support into
the Device Drivers document, so that the driver material is all
in one place. (Also converts a few unprintable characters in the
latter document to spaces, since they appear to have been used
by accident.)

Removes the empty discussion of networking support, to avoid
duplicating stuff already covered in the Networking document.

Change-Id: Ia5b8a92ade72a0634ee142afb45928016442d7dd
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 20:32:25 +00:00
Allan Stephens
a8b0301087 kernel: Standardize memory pool block set computation
Now use a standard routine for identifying which block set to use,
rather than duplicating the identification code in multiple places.

Change-Id: I2f6577879c23183f3f91e4418d1ea0b2f6eec184
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 20:31:35 +00:00
Allan Stephens
032041e644 kernel: Enhance memory pool block deallocation routine
Revises algorithm to call an existing routine to free an allocated
block, rather than duplicating the logic to do the freeing.

Also enhances comments to make it easier to understand what is
going on.

Change-Id: Ie7a83a8a2e978e8a685c27e07acb5b70aea37afa
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 20:31:35 +00:00
Allan Stephens
4b67b115d3 kernel: Enhance memory pool block deallocation routine
Revises algorithm for deallocating an existing block to make it
more compact (and efficient). Address calculation is simplified
and unnecessary error checking is removed (& replaced by asserts).

Also enhances routine name and comments to make it easier to
understand what is going on.

Change-Id: If1803ee09c8f4f73693c0cff9e433a7938f14398
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 20:31:35 +00:00
Allan Stephens
f2abf7425a kernel: Enhance memory pool defragmentation routine
Enhances comments to make it easier to understand what is going on.
(Doesn't change actual defragmentation algorithm.)

Change-Id: I294f55b8f233d88c01ce30ba9ccff88000dc7936
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 20:31:34 +00:00
Allan Stephens
5a8c054544 kernel: Enhance memory pool block allocation routine
Enhances routine name and comments to make it easier to understand
what is going on. (Doesn't change actual allocation algorithm.)

Change-Id: I7d982ed8eeda3a2edd4602c5a10003aa8532457d
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 20:31:34 +00:00
Allan Stephens
18f4557513 kernel: Enhance memory pool block allocation routine
Revises algorithm for allocating an existing free block to make it
more compact (and efficient) by using the same logic to handle the
allocation of any block within a quad-block.

Also enhances routine name and comments to make it easier to
understand what is going on.

Change-Id: I55ca513e6f85df2b548502262e4dbe6bb272596b
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 20:31:33 +00:00
Allan Stephens
ea5a523c43 kernel: Enhance memory pool block allocation routine
Converts check for a request for an impossibly large block
from a run-time check to an assertion. (The run-time check logic
was faulty anyway, since an excessive request would result
in a negative value for "offset", which would then get used
as an array index!)

Also enhances comments to make it easier to understand what is
going on.

Change-Id: I3faa86be177dcbc76912e23fabc2d24724fcba18
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 20:31:33 +00:00
Allan Stephens
e6112a0cb8 kernel: Enhance memory pool initialization routine
Makes a couple of minor optimizations to initialization algorithm:

- Now initializes block status array for largest size blocks once,
  rather than twice.
- Doesn't initialize "count" field of block size descriptors to zero,
  since sysgen ensures that this happens automatically.

Also enhances comments for initialization routine to make it easier
to understand what is going on.

Change-Id: I00d907c0f2a86f5b6ea8a63475b40074fe89357c
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 20:31:33 +00:00
Allan Stephens
f31b9a377d sysgen: Enhance comments describing generation of memory pools
Change-Id: Ie4a52e110075854dfac2a9e2c32fc8ae8b9e287e
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 20:31:32 +00:00
Allan Stephens
06dc3090d5 kernel: Eliminate unused memory pool structure field
Eliminates memory pool field associated with a capability that was
never implemented. (This field was initialized, but never subsequently
referenced.)

Change-Id: I58cf8c4bb846a66b4c8754654ffc3ff55abcff7f
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-07-08 20:31:32 +00:00
Andrew Boie
3275d8a24a doc: don't install 32-bit libraries
No longer necessary since the host tools compile natively now.

Change-Id: Ibe6f66fa79498678bddc25f69f799555d181ea7f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-07-08 20:31:03 +00:00