Moves up and consolidate the BREDR specific code to skip certain forward
declaration and to prepare for possibility to initiate authentication
using start_security() routine.
Change-Id: Ic32d7d1376173d47b0eb0481eff37c6e56f995d4
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
This reverts commit 3d08d16780.
The Read Response only contains a Characteristic Value that is less than or
equal to (ATT_MTU – 1) octets in length so, condition
(length < bt_att_get_mtu(conn)) is always true, and the full Characteristic
Value will not be read.
Change-Id: I63280e65b4ff5b830295aa9aadebe2758b626912
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Refines pairing method holder name to be more generic in connection object
representing applied method during authentication process.
Change-Id: Ia6f51788912974fbbda26b760d187c0f7e24bb0b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Now that the incoming ACL & HCI event pools can be defined externally
to hci_core.c there should be convenience macros to know what's the
minimum required buffer size for these pools.
Change-Id: I6f2a7322a3d77e1304e9d925767a1fd3471c76c7
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
So far the assumption has been that the host stack manages all
incoming and outgoing buffers. For the incoming buffers (from the
controller) this has required hci_core.c to manage its own pools and
do the host flow control. This setup makes perfect sense for an
architecture where the controller resides remotely on a different CPU
& address space (i.e. the "traditional" HCI transport case).
When the stack runs on a system where the controller resides in the
same address space this setup doesn't work that well. In such a
scenario the incoming buffers are ideally created as low down in the
stack as possible (i.e. below HCI), which means that the current
hci_core.c cannot be responsible for managing their pools.
To allow for both types of architectures this patch introduces a new
BLUETOOTH_HOST_BUFFERS Kconfig option that can be selected to say that
host-side management is desired, or deselected to say that the
controller (residing in the same address space) takes care of managing
the incoming buffers.
So far the incoming buffer types were identified by hci_core.c by
looking at their "free pool" pointers, however as soon as the pools
are allowed to be somewhere else this doesn't work. To solve this we
now require a minimum user data size for all Bluetooth buffers and use
that to store the buffer type.
Change-Id: I14bc32007e3e3f17c654f71f79b520650028d7ce
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This reverts commit 5680396aaa.
The network timers do not trigger with this patch so this needs
to be reverted for time being.
Change-Id: If653e3ecaae1ebddabe26227af876ff6b592675b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This information will be used to construct the fixed channel mask in
the L2CAP information response.
Change-Id: I66244ca2d5e40b3d204f5115c4bddad578f3ea64
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The same l2cap_recv function is now used for BR/EDR as well so remove
LE references from the logs.
Change-Id: I841ceea2eee72ee099be922eb00c1f6a3a16a787
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Makes room for L2CAP signal channel transport and start listening
on signalling CID.
Change-Id: I152973a9a9e672f0b4f66b06055e305561123f34
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Applies L2CAP CID valid values based on link type and proper limitations
according to BT Core L2CAP spec principles.
Change-Id: Ifa0719cf593d1d22977da59fb8a6c0ed9c3a176b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Makes possible to initiate L2CAP signalling handling on set connection
based on connection transport type.
Change-Id: I114dc3e4408f428301628520a569a2b087c325b8
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Makes available to register fixed L2CAP signalling channel on
dedicated channels list.
Change-Id: I9a90a64dac40b34799353ff261ba570541347084
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Renames routine to be clear to be used to register LE L2CAP fixed
channel only. The routine operates on le_channels list object that also
was renamed to reflect the connection type. Updates all calls to
the procedure in the stack.
Change-Id: I01348b8186a0f537532f6a7b9dc59586827b204b
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Print info about packet serialization if debugging is turned on.
Change-Id: I578ecb4e85ab34c74a960cbce9aa4f9bf5b9473d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
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>
User can select various coap debugging options from Kconfig.
Change-Id: I97cc82278c230b9678f506063fed5683dc271c8a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
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>
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>
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>
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>
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>
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>
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>
This will be needed to implement local privacy support.
Change-Id: I6222a7d396d47929d6f8946793bbf3f49eaae179
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
There will be other uses, so rename this to bt_addr_le_is_bonded and
export it through hci_core.h.
Change-Id: Ia033a215255f2ec2e513c785dd1b9862faaf5ac8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
If the local controller doesn't have a public address we need to
generate a static random address and use that as our Identity Address.
Change-Id: I3db261b630c670d285c6bfacbe090184cccb5e8c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add initial skeleton for the persistent storage API.
Change-Id: I7a6cc283aa88e7d861af18a6f0db2ed8c71e44a0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Store the Identity Address and Random Address in their own variables.
If the controller doesn't have a public address a static random
address is set as the Identity Address. Also keep properly track of
which address was used for advertising and initiating connections so
that the connection object contains the right information.
Change-Id: I3e9dc2036b330c19c2725b180fd061da2df8a0fa
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The shorter form "param" is used elsewhere and this helps avoid overly
long lines.
Change-Id: Ie76497b5bf30e72099d13a26db9cacb8cd2c9c79
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
From now on user/app has possibility to dismiss Passkey Notify authentication
on acceptor side even with DisplayOnly interface. The action on 'Cancel' API
in this case is disconnection.
Change-Id: I4be198482c23c0ccaeb0112b72ff269037e03583
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Some devices may actually lose track of CCC setting so this is required
to work around the problem, in case the device does work track CCC
properly the extra write shall not cause anything more than one extra
round trip thus it is probably work doing it anyway.
Change-Id: I9e5ed3fa459e4617c6fae094d0ce0f80cb2682e4
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Deal with controllers that don't support controller to host control.
This may potentially lead to dropped packets so make a clear warning
log of the issue.
Change-Id: Ie8fdaed826a072fd157343721222f618328d59a3
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Reading supported commands isn't an LE-specific feature, so the
command should be in common_init() rather than le_init().
Change-Id: I613bbe8d39b4c2b6dadc45a710bc59568ec9b488
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
There are two major issues with the kconfig:
() Some of the config options have incorrect dependencies inside help
under menuconfig. For example, CONFIG_GPIO depends on BOARD_GALILEO.
() Since the SoC and board specific kconfig files are parsed first,
the help screen would say, for example, CONFIG_SPI is defined at
arch/arm/soc/fsl_frdm_k64f/Kconfig. This is incorrect because
the actual config is defined in drivers/spi/Kconfig.
These cause great confusion to users of menuconfig/xconfig.
To fix these, the SoC and board defaults are now to be parsed last.
Note that the position swapping of defaults in this patch is due to
the fact the the default parsed last will be used.
And, spi_test is broken due to the fact that it requires
CONFIG_SPI_INTEL_PORT_1, but never enables it anywhere. This is
bypassed for now.
Origin: refactored and edited from existing files
Change-Id: I2a4b1ae5be4d27e68c960aa47d91ef350f2d500f
Signed-off-by: Daniel Leung <daniel.leung@intel.com>