BT_DEV_ENABLE flag value must be preserved after HCI reset is complete
to not allow calling bt_enable more then once.
Change-Id: I77bf6111d4fc2a209e0c5a56717decba156068a6
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
With this API it's possible for the caller to force specific behavior
when it comes to waiting (or not waiting) on the FIFO.
Change-Id: Ib66e2f767c26c82abf1ba3b80bd15aec2383542e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The Bluetooth logs use format specifiers available with printf but not
with printk. Selecting STDOUT_CONSOLE enables printf support, which
makes the logs readable again.
Change-Id: I3e86f0bcf31688148a340eba6cdf33e81c64393d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This replaces use of delayed fiber with nano_delayed_work which uses the
system workqueue fiber and stack.
Change-Id: Ie127fc5eb6f38b38df072154a702d4efc34ed9f4
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This add CONFIG_BLUETOOTH_DEBUG_LOG which depends on SYS_LOG since the
later can actually use either CONFIG_PRINTK or CONFIG_STDOUT_CONSOLE.
Change-Id: Ib2974d1331f6c91d119a218ec95e8bf01069377b
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Currently enable procedure can be called only once regardles if it
failed or succeeded.
Change-Id: I3869e97442720860baba7bb1b7610738ca95561a
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
There is no need for struct bt_storage being modified by stack.
Change-Id: I732cf94983a29de40d692e802d6a71b8986708df
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
When doing LE SC pairing with Passkey Confirmation slave must wait
for remote DHCheck before doing comparison. This fix issue with
pairing as slave when passkey was first confirmed locally.
Change-Id: Iba780836341a944997adde24285b2e650b31afa1
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
bt_recv should be used to send event back to stack.
Change-Id: I092e2480b3f0e5c40c0751c30be46d0310012bae
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
DHCP client support provided for IPv4 over ethernet.
Change-Id: Ia89bc4123842cf109813b80a90b70cf50cc52e0a
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Earlier default was 8, new default is 4.
Change-Id: I99c9d2aae465fd0feb968efa7417cd28bafd73b8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Earlier default was 10, new default is 2.
Change-Id: I307a4abaad34223254fd32e1fd4357892a04a2d0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Earlier default was 10, new default is 2.
Change-Id: I938449d840a244a13e9b9b954648577b76db00bc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The network context is similar concept as network socket.
Depending on application use, the number of contexts can be
now tweaked. Default value is now 2, it was 5 earlier. Using
the lower number saves 241 bytes of memory.
Change-Id: I6e2a9f053c8c63163af6d6175783233f67553ae9
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This saves little over 4kb of memory.
Change-Id: I4dc3812b11de2736e2bdc17042e47fcdf5cf5491
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
User cannot select CSMA mac driver any more in order to save some
memory.
Change-Id: I7805a1c2028f60bc8a428bd5b8f891d540a14b6d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The ethernet driver calls net_set_mac before net_init is
called (ie before the uip stack has been fully initialized).
Unfortunately net_set_mac calls the function uip_ds6_set_lladdr.
Therefore this function is called before uip_ds6_init: this is an
issue as uip_ds6_set_lladdr is setting some static data which are
going to be erased by uip_ds6_init. In some case it could even lead
to a system hang due to a timer set twice.
To fix this issue net_set_mac should check whether net_init has been
already called. If not net_set_mac should simply copies the mac
address into uip_lladdr. Indeed uip_ds6_init automatically calls
uip_ds6_set_lladdr for the address stored into uip_lladdr.
Change-Id: Ifbcb07e7cd493b6284a85d70f2439d434cebbb00
Signed-off-by: Sebastien Griffoul <sebastien.griffoul@intel.com>
The line below is wrong and useless:
lladdr->state = ADDR_AUTOCONF;
Indeed the three possible values for the state attribute are:
ADDR_TENTATIVE, ADDR_PREFERRED or ADDR_DEPRECATED. ADDR_AUTOCONF
is one possible value for the type attribute.
Moreover uip_ds6_set_lladdr already set the type attribute to
ADDR_AUTOCONF (this done through the call to the function
uip_ds6_addr_add).
Therefore this issue has been simply fixed by removing the line.
Change-Id: I432b7bb6a6a858264bb634f2e4d253f55acbbd5b
Signed-off-by: Sebastien Griffoul <sebastien.griffoul@intel.com>
Convert leading whitespace into tabs in Kconfig files. Also replaced
double spaces between config and <prompt>.
Change-Id: I341c718ecf4143529b477c239bbde88e18f37062
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Task can be preempted and bt_recv is expected to be atomic. Since
on microkernel with TinyCrypt ECC enabled this can be called from
task context we need to make it run in critical section.
Change-Id: I24414e8d98b0dfe8affc18058eb164ba0cba7b17
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
If TinyCrypt ECC is used for LE SC calculations need to be done
in task to avoid hogging CPU from non-preemptible fiber. To keep
upper layers of stack independent of crypto used (TinyCrypt or
controller) this patch adds HCI ECC emulation.
If ECC emulation is enabled it is always used regardless of ECC
support being present in controller.
Change-Id: I7c5ca873a18c10237e1c0b2f09e6da2a75fb334e
Origin: Original
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This fixes "No matching connection found" error when a packet
is received.
Change-Id: I9f9bba73f9858a9a3a45de26abd378d7c48aa9a7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
TCP client only sent one SYN and if that was lost, the connection
was not initiated correctly.
Change-Id: Iebb0b719a3d01d2e4f56ed911b3ed94643e53941
Jira: ZEP-385
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
IP packet passing through 6lowpan compression and 802.15.4
fragmentation has an issue. (RFC 6282 and 4944) RFC4944, 5.3
says "fragment header's datagram_size and datagram_offset
values as the size and offset of the IPv6 datagram before
compression".
At the moment datagram size and offset values are after
compression. Due to multiple bearer (15.4 and bluetooth) support
and multiple incoming buffers support functionality is divided
to compression and fragmentation parts. And datagram size and
offset values for BT are after compression. Small packet (which
doesn't need fragmentation) doesn't go through this. So cacheing
compressed and uncompressed header lengths and with hdr difference
preparing fragments as per original buffer (total buf size and offset).
Change-Id: I9d3b0433e64964c68519d7c007cc06ec6035b573
Jira: ZEP-208
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Add additional check which verifies that MAC address is given
and return -EINVAL if it is not set.
Change-Id: I90d415670c4b35d092ba057329f998df3a72018e
Jira: ZEP-213
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The application can initiate TCP connection when using IPv4.
Change-Id: I264270d013f567dd0c429783c47506d9c38f0509
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The application can initiate TCP connection when using IPv6.
Change-Id: I632fa2559d5deb40d71288762bd13fbc2aac9cc7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we are initiating a TCP connection, then make sure that
we try to re-send initial SYN packet (max 8 times) if it is lost.
Change-Id: I9fbc39bdaef3a535c480eb5433eb7ef3ad60d604
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This will be used in following commit.
Change-Id: Ie4fccd72471c285b68a6df6970babe562e5e6258
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If application calls net_send(), set the retry count to some
low number (currently 5) so that we do not wait forever but
eventually we try to send the data properly.
Change-Id: I8103246ac9227a0cf70b56aecab6ed8307877e19
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
These changes are needed so that Zephyr host can initiate
a TCP connection to another host.
Change-Id: I46b92bf978e2dd04993951f2215d179a5cf1bd55
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
These are internal functions needed when initiating a TCP
connection.
Change-Id: Ide5d59ac9854ec8bdea3baa97b3cde3ffa6a5e0f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Application can by default do a connection request. If this is
not needed (app is only working in server role i.e., only
listening connection attempts), then some memory can be saved
by disabling client role support.
Change-Id: I33ed95ad0cf099a70563465beff555ec4adab958
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Simplify l2cap_chan_get() in l2cap.c file by removing
CONFIG_BLUETOOTH_BREDR preproprocessor check. Now function serves
only getting channel on LE transport.
Change-Id: I20b72f352ad9d5998cc812b28cb3d6951f91f212
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Adds support getting L2CAP information about remote features. To get
the response local stack gets call information request about 'extended
features supported mask' after ACL link is established. Then in
response if 'fixed channels' bits are enabled, next information
request is sent to get details about 'fixed channels'.
Change-Id: I4980c61b12e83fef914e97dea296b0a848d59034
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
The function gets 32bit-wide data from net buffer and converts the
value from little endian to host order.
Change-Id: I2d2454951b3ac39686a25454678ce92d8a1a0f3d
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Adds support to handle incoming L2CAP information request from
remote to get local information about 'extended features' and 'fixed
channels'. For now local stack ensures support for L2CAP BR/EDR
signalling channel.
Change-Id: If8c9c9dd041b45a79db5e560394dcd2778176f55
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
The function gets 32bits wide data, converts host order to little
endian and then puts the data on protocol stack to be send.
Change-Id: I29e4040b302a16b551a0922133c327ff694fec5d
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Use appropriate scope for 'random' and remove unnecessary empty lines.
Change-Id: Idb8d527fa0a88ca738e91887b56a123a5a8831ce
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Separates LE and BR/EDR L2CAP signal channel context and starts accept
incoming PDU traffic on BR/EDR signal channel. For now all valid L2CAP
commands are send back as rejected on BR/EDR signal channel.
Change-Id: If4392b2d3ccbe157cb7eeafcaa0804e90f44e2be
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
It is valid to call set_ad with NULL data as long as length is 0.
Improve code comment for unusual condition check explaning why it
is correct.
Change-Id: I29440fb04747f6df06dc4df466eb43e160ff3be4
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Adds implementation of the BR/EDR connection L2CAP notifier. It makes,
for each registered BR/EDR fixed channel, basic validation and channel
initialization using two local helper functions.
Change-Id: I6393a43b25ff0d9f23deaf93562add08861ea1d2
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Moves, specific for BR/EDR transport, register fixed channel handler
to l2cap_br.c file and make it local. Then using it register BR/EDR
signal channel (CID 1) context during channel layer initialization
in 'bt_l2cap_br_init'.
Change-Id: I5e23fc5d43ae3d7838ecb44ad4fa631eccc8cb4c
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Adds dedicated function informing L2CAP layer about established BR/EDR
connection. Existing 'bt_l2cap_connected()' connection notifier is
refactored to use new API 'bt_l2cap_br_connected()' which is implemented
in l2cap_br.c file.
Currently the new handler is just stub since proper internals of
BR/EDR L2CAP signal channel management are not yet implemented
in l2cap_br.c file.
Change-Id: Idef9be63338c6bb4b3315ec0452d84f2431fbaa2
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>