Variable len is related uIP stack. datalen is actual variable which
needs to be set zero in net_buf_get_reserve.
Change-Id: I75273ef760d3cd4f90808b496b75f56f19bd2e2b
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Tester application requires 3 UARTs and currently no x86 based
platform supports it. For convenience default to arch that allows
to run, not only build tester.
Change-Id: I086e72a580f56d94181a6d6eada7693ddd24dec1
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
It's invalid to try to send HCI events to the controller so we should
treat such buffer types as invalid in bt_uart_send().
Change-Id: I4108a158d5b91f364a9f3c56e3037f03755daa19
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Previously we didn't have the split to priority rx fiber vs "normal"
rx fiber. This meant that we didn't have full control of code that
would run from this fiber and therefore a deadlock check was useful.
The rx priority fiber (where the deadlock could happen) is very well
defined and controlled so the value of this extra check is now quite
minimal.
Change-Id: I8d09cc39ca6548230a973bc8b8231d999dc1dc67
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
To avoid unnecessary stack variables and to simplify code, add helper
macros to access the Bluetooth specific ACL and HCI user data that's
part of the buffers.
Change-Id: Idc337537721115c4091982c04f8a05bbbf0d5a19
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Now that all code is converted remove the temporary helpers for the
old bt_buf API.
Change-Id: I5183add527d204c51103549fda3378040d5f8f68
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Convert the code to use the net_buf API instead of the soon to be
removed bt_buf API.
Change-Id: I98a0720483d3f364b77fe6dc030c9169aa4ade67
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Convert the code to use the net_buf API instead of the soon to be
removed bt_buf API.
Change-Id: I4eb6cea592cce99dcc9e4c1b1219ebbf89eddd04
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Convert the code to use the net_buf API instead of the soon to be
removed bt_buf API.
Change-Id: I9437750aa6fffcde31e1879bf6e3a13143f45480
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Convert the code to use the net_buf API instead of the soon to be
removed bt_buf API.
Change-Id: I89e5ac5a178cf57c0a3f7fee38d1170c25e07c5b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Convert the code to use the net_buf API instead of the soon to be
removed bt_buf API.
Change-Id: I3c7f6c5ec2b447adc8855acf8d66205434ce08eb
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Convert the code to use the net_buf API instead of the soon to be
removed bt_buf API.
Change-Id: I5f376caeb861ac8b815a0a2e235bd188b9e8185b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Convert the code to use the net_buf API instead of the soon to be
removed bt_buf API.
Change-Id: I7f4577ba31f8e5646873f164ff308c71d23021e5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Convert the code to use the net_buf API instead of the soon to be
removed bt_buf API.
Change-Id: I226de212d4f8d4f5b613708ffe42570443bc2182
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Convert the code to use the net_buf API instead of the soon to be
removed bt_buf API.
Change-Id: I8df37d214e1f93ee472cde82c4198d667709ff5a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This patch performs the minimal necessary conversion to the net_buf
API. It uses a temporary "#define bt_buf net_buf" to make it possible
to convert the code in smaller increments. Most old bt_buf function
also serve as one-line wrappers to the matching net_buf APIs. Once
everything is converted these helpers will be removed.
Change-Id: Ie31433d33576022c9c193a35d2389267005545d6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We need to have a generic buffer API in order to efficiently transfer
data between different subsystems. The first such case will be the
Networking and Bluetooth subsystems where 6LoWPAN data will be passed
back and forth.
The needed API needs to provide enough flexibility for different
buffer sizes as well as custom protocol-specific context data.
The implementation offered in this patch follows the general design of
the existing Networking and Bluetooth buffer implementations by using
a backing array of buffer which is fed into a "free buffers" FIFO for
management. The main difference is that the API allows specifying
variable sized buffers for each created pool, as well as a minimum
amount of "user data" that's allocated as part of each buffer.
There's also an optional destroy callback that's e.g. useful for HCI
flow control in Bluetooth (for notifying the controller of available
buffers).
Change-Id: I00b7007135a0ff35219f38f48658f31728fbb7ca
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Currently it is only possible to build the tester for arm.
Change-Id: I7fd530ca09bfa41072420da774fba3b48a5d5a90
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This makes BT_GATT_CHARACTERISTIC declare a local bt_gatt_chrc so the
applications don't need to declare themselves.
Change-Id: Icf3fad7dffea5667c6f13aa022a5722900da51e8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The spec says it should always be the very first descriptor after the
characteristic:
"BLUETOOTH SPECIFICATION Version 4.2 [Vol 3, Part G] page 534:
3.3.2 Characteristic Value Declaration
The Characteristic Value declaration contains the value of the
characteristic. It is the first Attribute after the characteristic
declaration. All characteristic definitions shall have a
Characteristic Value declaration."
Change-Id: I6c38dea9cc4c1a05997edbd348e2759680472725
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
value_handle is not used for anything.
Change-Id: I3885d221b162eb3bd44956af64280baf61dc001b
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
bt_gatt_register will assign a handle if not initialized and removing
the handle makes it simpler to change the attributes since it is no
longer possible to have conflicting handles.
Change-Id: I787f7325cc990c360056b1aefd07bb7d7876b445
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This allow calling bt_gatt_register multiple times so different tasks
can add their own services separately.
Change-Id: I8143ddedfa1079087d608013d1a97b552a3007dc
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This patch adds a NET_INTF makefile configuration option to the
echo_server sample application to allow Ethernet support to be enabled
by specifying NET_INTF=ethernet. It currently includes specific
support for the Ethernet device in the Intel Galileo.
Change-Id: I6b605db32d2d8a4259fc003724b2daa11c9a26d9
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
Provide a preconfigured base address for MMIO and a preconfigured IRQ
pin identifier for the first PCI Ethernet MAC in the Intel Quark X1000
SoC.
Change-Id: I1b527df6c3b1b65da9f0233464e54157029f04f5
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
This patch adds a driver for a Synopsys DesignWare Ethernet MAC. The
driver uses interrupts to handle received frames, but it uses a
spinloop when transmitting to wait for the transmit descriptor to
become available. Transmission is coordinated by a fiber, so this
should not result in the system execution being blocked. Only a
single descriptor is allocated for each of the transmit and receive
directions to save memory and simplify the code. Another
simplification is that none of the offload capabilities of the
Ethernet device are used. The driver currently only supports a single
instance of the Ethernet MAC, which is consistent with the limitation
in the network stack that only a single network device is supported.
Change-Id: I013b3d439a76e8ff91a775516f7035841b040870
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
This patch adds support for Ethernet to the network stack, which
entails relying on the Ethernet device driver to set the MAC address,
invoking ARP routines at the appropriate points, configuring the
Contiki network stack to use the appropriate link-level header length,
etc.
Change-Id: I153a6f4c83c28ca7129ef5affa1e9a18b0f92913
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
This patch adds the pci_enable_bus_master function that enables bus
master access for a PCI device.
Change-Id: I317daac1a613ccfc5a3894332c1a7dbbff05991f
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
We can't use '=' in net/Makefile since then one statement would
override the value of the previous one when both CONFIG_NETWORKING and
CONFIG_BLUETOOTH were set to 'y'. Instead, use '+='.
Change-Id: Idba9916cc9fb2bd0e53975bdf0a86c0fd184533c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
We want to make the naming convention ref/unref rather than get/put.
So far the only reference counted objects are the buffers and the
connections. For the buffers the new generic buffer API will also use
ref/unref.
Change-Id: I9fe8b8a6a50a8baf06ba231e8f6717a5a47dd292
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
bt_uuid_to_str uuid param is const therefore bt_uuid_str should be const
as well.
Change-Id: I043d66d16c863ed92e60477dbbb9c37bcde92703
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The two last fields are 32 bits and 16 bits respectively not the other
way around.
Change-Id: I10d2ed9d69229f02b430f9812e95e4a8f3f060c7
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
If the attribute value is going to be changed by the upper tester,
(eg. to issue notification) for simplicity it can be stored in the
place of old one.
Change-Id: I03a6ebbda5d75e6ffa9c2fd6b3c0eab495623a11
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
There's no point in having a return value for uart_out() if it always
returns the same length that was passed to it. Just make it return
void and remove the error handling code from the caller (which would
never have been run).
Change-Id: I88dab7499a5f526ca65058640021f84e1b3486ca
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The reason why fifo_fill works in qemu but not on real hardware is
that qemu serializes all byte transmission 1 by 1. There is no
real hardware fifo emulated, and "fifo" depth is 1. On real
hardware, the controller owns an internal fifo, with a depth like
8 bytes on Quark x1000. And because of execution flow, how fast is
the controller etc etc... a fifo_fill call might fill in the
internal fifo of 8 bytes and then controller says "I am full"
(which means: "wait for the fifo to have space again"). That's
why poll_out() works: it does the same as fifo_fill and wait
that the internal fifo gets some space again before continuing.
And only when all bytes have been pushed in, it returns.
Change-Id: I452a6ebb2913c5e52ed01d999185e250aa3ed474
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This patch fixes a potential issue in which the signed return value
from the network driver send routine is returned from a caller that
has an unsigned return type. The meaning of a negative return value
from the network driver send routine is that an error occurred. A
return value of 1 means that the packet was sent successfully. A
return value of 0 means that the packet could not be sent. Thus, this
patch converts negative return values from the network driver send
routine to a return value of 0 from the caller.
Change-Id: If5cbecb18e514fd976200ecc45782d2a9e1f300f
Signed-off-by: Michael LeMay <michael.lemay@intel.com>
This make use of bt_uuid_to_str to when printing UUID values, to make it
simpler when it is just going to print so the patch introduces a new
function that does the conversion in place using a static variable.
Change-Id: Idfedf05a5ad201653fff2e01387f046cd5647c83
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This allow sending direct notification to a specific peer without
using CCC which is allowed by the spec:
BLUETOOTH SPECIFICATION Version 4.2 [Vol 3, Part F page 507
3.4.7.1 Handle Value Notification
A server can send a notification of an attribute’s value at any time.
Change-Id: Ieff29216cb9ba197c0da92d7b22b26e63101cfa8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This patch cleans up the code a bit. BT_ATT_MAX_LE_MTU defines
MTU that can be used over LE ATT.
Change-Id: Ie433f33f3bcba3275f51e1bea826bb0fd061c45f
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
If attribute requires authentication to be read or written,
we check if current security level (should be BT_SECURITY_HIGH
or higher) allows to perform such operations on this attribute.
Change-Id: Ibba542ac96af00722370eba77d6c929cda520fd8
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Always set MITM in AuthReq if local IO capabilities allow it.
This match Security Request behaviour with Pairing Request.
Change-Id: I1734df6661bada296b088cc762a871c443b9e5d1
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Set discoverable command is used to set the discoverable flags
in advertisement data.
Change-Id: If46a5e05379c5f589afb1658a7b275a82c52e4e1
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
For limited discoverable mode, we need to have a define
for this advertisement flag.
Change-Id: I774b68546983697844eca2644b0ca0a85b8026e8
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
This adds an option to enable L2CAP dynamic channel support, fixed
channels are not affected by it.
Change-Id: If36bece46b7b94142ea1ac976b878d1b5ae6a578
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
l2cap-register can be used to register a server:
btshell> l2cap-register 0x0080
bt: bt_l2cap_server_register (0x0011110c): PSM 0x0080
Change-Id: I2c2d9a4cba70b0cddaf352830659d206b609ee63
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This refactorer fixed channel data so that the channel itself carries
any extra context necessary.
Change-Id: Iea0f29fb7913a29dccdcbef72d92ec4cf4711bf3
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
From Core Spec Vol 3 Part H 2.3.5.1:
"If both devices have not set the MITM option in the Authentication
Requirements Flags, then the IO capabilities shall be ignored and the Just
Works association model shall be used."
Change-Id: I450f8ab5661382b787fe9742937d47df62fb6cfa
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This split L2CAP API so that server API is available to applications
while the rest of the API is keep internal to the stack.
Change-Id: I031926ff906ce100684fba0947b2e9eb2c8fcaeb
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>