The space that the HCI driver needs to reserve for its own use is not
necessarily symmetrical. E.g. even with the current H4 driver we only
need to reserve space for sending data but not for receiving it.
Keeping track of these values independently enables more efficient use
of the buffers.
Change-Id: I64917b545c5cd77356ed038d09afe76422334661
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add sanity test related changes to test_15_4 application in both
micro and nano kernel. config_whitelist in testcase.ini is not
accepting other than PLATFORM configs. So creating test folder
for sanity tests. src directory is still common for all.
Change-Id: Iffa4c588500367fa475aef8e0772f1c08946c5a4
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Add support for CONFIG_NET_15_4_LOOPBACK_NUM in test_15_4 application.
Change-Id: I57246f9db587f492cddc0d0be607b1ae4a78fbf7
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
The report_completed_packet() function overwrites the original buf
pointer so we have to use a local variable to store the handle value.
Change-Id: I9caada0dd83270f2de998f57940aaf4995a247da
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Outgoing ACL buffers don't need any user data.
Change-Id: If7e6a27b88d3aa64c51672190bdecc705429aa7b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Since the type can be determined either from the context or from e.g.
the pool that it belongs to (the 'free' pointer) we no-longer need to
store the type as part of the user data struct.
Change-Id: I090636aaa0a0b1be798b6dadfab072151fc3ab14
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Now that we have the buffer type enum as part of the HCI driver API we
can take advantage of it to pass the buffer type information and not
have to have two separate callbacks.
Change-Id: Ib2ee5b1540e532c9b27903e97660a276c1293fbc
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Since the buffer type is essentially a HCI driver - HCI core
communication detail the appropriate place for it is driver.h. At the
same time remove the unnecessary and slightly confusing BT_DUMMY type.
Change-Id: Ic813ad24d8f0530d3779006063ea21b010d29cf6
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The only user of this is l2cap.c so move the buffer pool there to
avoid unnecessary calls between c-files.
Change-Id: Ia9335b21c34546e2252fa40d9eec2e09156b0d67
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
There's no need to maintain a separate module for this anymore.
Subsequent patches will have further simplifications thanks to this
being now handled in a single c-file.
Change-Id: I4510c9f72b121e1e5fd19eeb8b5d5ddf2f4bfffe
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This way we avoid dealing with the specific buffer type value and to
make it clear that these are for drivers onle.
Change-Id: I8aef7ec6a767b2fa68cbe374eb371e2a6192f675
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This is a necessary step in preparation for removing the buffer type
information from the buffers.
Change-Id: I29d8fae32aa660416a1c12e87840499c711e659f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This allows to build sanity for both ARM and x86 archs.
Only supported platforms are enabled.
Change-Id: I499dbdee7b9df265affb2bba98b5bb100339fe18
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
NET_15_4_LOOPBACK_NUM is Kconfig option for number of times
loopback runs. In a controllable way loopback runs. This will
be helpful in sanity tests.
Change-Id: I48392d7e0d0b793ddc1b2b0c1b8c1f22e1bb318a
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
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>