Commit Graph

275 Commits

Author SHA1 Message Date
Gregory Nutt
4fd814982d drivers/bluetooth: Extend device simulation. Now makes it all the way through initialization without error. wireless/bluetooth: Add support for IOCTL commangs to get BR/EDR and LE features. 2018-04-06 16:22:49 -06:00
Gregory Nutt
ea84215059 drivers/bluetooth: Extend NULL driver to support a little more testing. 2018-04-06 14:07:03 -06:00
Gregory Nutt
5009c22f85 wireless/bluetooth: Implementat SIOCGBTINFO IOCTL command. Eliminated some redundancy. 2018-04-06 10:39:12 -06:00
Gregory Nutt
cab7ba8b8f Bluetooth: Better integrate NuttX Bluetooth IOCTL commands and NetBSD IOCTL commands. Stanardize naming. 2018-04-06 09:42:41 -06:00
Gregory Nutt
39e393fa5f net/bluetooth: Since the max header is always reported, the max frame size for purposes of allocation is the max header lenght plus the max payload, even though the frames with the max payload never have the max header length. 2018-04-05 16:40:59 -06:00
Juha Niskanen
797d9b1822 This commit adds a 1wire subsystem.
Squashed commit of the following:

Author: Gregory Nutt <gnutt@nuttx.org>
    Some cosmetic changes from coding style review.
Author: Juha Niskanen <juha.niskanen@haltian.com>
    drivers/1wire: add 1-wire subsystem and ds28e17 driver
2018-04-04 10:57:36 -06:00
Gregory Nutt
04b0ace6b0 wireless/bluetooth: With change the test with the simulated bluetooth driver can get all the way up the point where it determines that the attached controller is not LE capable. I am not sure how much first to take the simulation. The time would probably be better invested in bringing up real hardware. 2018-04-03 17:57:06 -06:00
Gregory Nutt
48dd0f3825 wireless/bluetooth: Fix some confusion in initialization of message queues. 2018-04-03 17:23:54 -06:00
Gregory Nutt
265b5d7dc6 wireless/bluetooth: A few trivial fixes from initial testing with the simulator. The simulated Bluetooth device is probably going to be in adequate for any level of testing. 2018-04-03 16:28:22 -06:00
Gregory Nutt
0142a5ad13 arch/sim/src: Variable fixes to get a Bluetooth simulation build. 2018-04-03 10:00:56 -06:00
Gregory Nutt
49644be9a5 include/nuttx/wireless and wireless/bluetooth: Add support for an IOCTL command to enable Bluetooth security. 2018-04-02 17:34:41 -06:00
Gregory Nutt
bf23588a41 include/nuttx/wireless: Another correction to a Bluetooth IOCTL command structure. 2018-04-02 14:20:01 -06:00
Gregory Nutt
15c7886fad include/nuttx/wireless: All Bluetooth IOCTL command data must begin with the interface name string. 2018-04-02 13:03:46 -06:00
Gregory Nutt
4ee0917789 wireless/bluetooth: Completes basic Rx/Tx data paths. Still missing: device address discovery and pairing logic. 2018-04-02 06:38:31 -06:00
Gregory Nutt
3a0f3d4be8 wireless/bluetooth: Buffer allocation was always allocationg a new buffer, even if one was provided.. causing data loss. Correct initialization of lengths: IOB lenth includes data offset. Bluetooth buffer length does not. 2018-04-01 15:46:11 -06:00
Gregory Nutt
aae0d92598 wireless/bluetooth and net/bluetooth: Clean up some garbage left in Kconfig file that broke 'make menuconfig'. Clean up some craziness with Bluetooth frame length definitions. 2018-04-01 15:21:58 -06:00
Gregory Nutt
7e05d5e9c7 wireless/bluetooth: Adds most of the logic to get the Tx path working. Still missing the logic to recover the Bluetooth connection structure given the destination address in the socket address. 2018-04-01 14:00:40 -06:00
Gregory Nutt
29a4a80f8c Squashed commit of the following:
wireless/bluetooth:  This completes the basic logic path that gets frames from the Bluetooth stack and into the network layer.
    wireless/bluetooth:  Fleshes out some of the network packet receive logic.
    wireless/bluetooth:  Replace buffer allocated with primitive allocator from ieee 802.15.4.
    wireless/ieee802154:  Fix a few typos.
    wireless/bluetooth:  More renaming in preparation for some real work.
    wireless/bluetooth:  Some trivial renaming; update comments
2018-04-01 12:25:30 -06:00
Gregory Nutt
0c007be4bd This comment adds (1) basic support for AF_BLUETOOTH sockets. The logic compiles but is still incomplete. Support for Bluetooth is general is still dependent on CONFIG_EXPERMIMENTAL because it is not yet ready for used.
Squashed commit of the following:

    wireless/bluetooth:  Some small changes that gets to a clean compile by just eliminating some incorrect implementations (still with a lot of warnings.  The logic is still incomplete but now not so lethal.
    wireless/bluetooth:  Restructuring:  Connection interfaces should internal to wireless/bluetooth.  include/nuttx/wireless/bt_conn.h removed and merged with wireless/bluetooth/bt_conn.h.  Several fix to get closer to bt_netdev.c compiling.  Need to design some not interfaces and use some existing interfaces to send and receiv packets.
    wireless/bluetooth: Some organization with some network device compile errors fixed.  Still not even close to compiling.
    net/bluetooth:  Fix numerous compile issues; Still open design issues with regard to the interface with the Bluetooth stack.
    wireless/bluetooth:  Create bt_netdev.c with a crude copy of mac802154_netdev.c.  Does not not even compile yet.
    include/nuttx/net:  Add bluetooth.h.  Content is not yet correct.
    net/netpackets:  Add bluetooth.h.  Update net/bluetooth to use new socket address definition.
    net/bluetooth:  Some fixes for initial build.
    net/bluetooth:  Add initial support for Bluetooth sockets.  The initial cut is just the a clone of the IEEE 802.15.4 socket support with name changes.
    net/ieee802154:  Fix some typos noted when cloning to create net/bluetooth.
2018-03-31 14:55:03 -06:00
Gregory Nutt
fd068f17ca wireless/ieee802154: Some trivial typos fixed while working with Bluetooth port 2018-03-31 10:38:07 -06:00
Gregory Nutt
de7000ee3e wireless/ieee802154: Fix a few typos 2018-03-30 17:44:25 -06:00
Gregory Nutt
d62649757c wireless/bluetooth and include/nutt/net: Add support for Bluetooth IOCTL commands. 2018-03-30 10:50:44 -06:00
Gregory Nutt
aaf5fee1e6 wireless/bluetooth: Add driver object in all driver methods so that the driver has a way of maintaingin context. 2018-03-29 15:12:00 -06:00
Gregory Nutt
accef0ca9e This commit brings in the Bluetooth stack from the Intel/Zephyr arduino101_firmware_source-v1.tar package.
NOTE: This selection is marked EXPERIMENTAL.  It is incomplete and, hence, untested.  It still lacks any low-level Bluetooth drivers and is missing the network interface driver.

Squashed commit of the following:

    wireless/bluetooth:  Fixe last of compile issues.  Now compiles without errors or warnings.
    wireless/blutooth:  Add macros BT_GETUINT16() and BT_PUTUINT16().  Fix more compile errors.  Only one file now generates compile errors.
    wireless/bluetooth:  Add macros BT_LE162HOST() and BT_HOST2LE16().
    wireless/bluetooth:  Add bt_queue.c; begin fixing comple errors.  Many more compile problems yet to resolve.
    Kconfig edited online with Bitbucket
    wireless/bluetooth:  Struggling to remove nano_fifo logic:  Replace buffer management with IOB allocate... this changes some logic and might have some side effects.  Use messages queues instead of nano-fifos to inter-task communications.  nano-fifos still used in 'frag' logic... whatever that is.
    wireless/bluetooth:  Fix numerous typos introduced by an ill conceived search-and-replace.
    wireless/bluetooth:  Add message queue support to manage interthread buffer transfers.
    wireless/bluetooth:  Replace fibers with kernel threads.
    wireless/bluetooth:  Fix a few initial compile errors.  Just the tip of the iceberg.
    wireless/bluetooth:  Complete leveage of the bluetooth stack including public header files.
    wireless/bluetooth:  Complete leverage of all Bluetooth source files.  Still missing header files that defines the driver interface.  Also missing the network driver implementation.
    wireless/bluetooth:  Fix some naming of static global variables.
    wireless/bluetooth:  Adds three more files ported from the Intel/Zephyr arduino101_firmware_source-v1.tar package (plus two original files).
    wireless/bluetooth:  Adds five more files ported from the Intel/Zephyr arduino101_firmware_source-v1.tar package.
    wireless/bluetooth:  Adds three more files ported from the Intel/Zephyr arduino101_firmware_source-v1.tar package.
    wireless/bluetooth:  First few files ported from the Intel/Zephyr arduino101_firmware_source-v1.tar package.
2018-03-29 12:39:22 -06:00
Anthony Merlino
5e1f54ddc3 Merged in antmerlino/nuttx/mac802154_primitivebug (pull request #620)
mac802154: Fixes bug where primitive was freed when it shouldn't have been, causing double free call

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-03-28 15:50:41 +00:00
Anthony Merlino
ec4bb7b990 Merged in antmerlino/nuttx/mac802154_ackhandling (pull request #619)
mac802154: Adds ackreq flag to TX descriptor for use by radio driver.

The radio layer is responsible for a full "transaction". Because of
differences in radio capabilites, the radio must be responsible for
the handling of acks and retransmissions. This commit simply passes
the ackreq meta-data flag along to the radio.

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-03-28 15:50:11 +00:00
Anthony Merlino
62e89e0f8d Merged in antmerlino/nuttx/mac802154_rxenable (pull request #618)
mac802154: Adds basic support for RX-ENABLE.request primitive

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-03-28 15:49:34 +00:00
Gregory Nutt
b54ffe858a Standardization of some function headers. 2018-03-13 09:52:27 -06:00
Dmitriy Linikov
a8c58607e9 Merged in hardlulz/modem-3.0-nuttx/fix-sem-EINTR (pull request #603)
Added ECANCELED condition to DEBUGASSERT-s checking sem_wait result

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-02-20 18:24:53 +00:00
Alan Carvalho de Assis
fb50c44d08 Fix various issues noted by Coverity 2018-02-06 09:13:16 -06:00
Gregory Nutt
7cf88d7dbd Make sure that labeling is used consistently in all function headers. 2018-02-01 10:00:02 -06:00
Gregory Nutt
a8b6be4aaf The existence of the network driver ioctl() method should depend on CONFIG_NETDEV_IOCTL rather than CONFIG_NETDEV_PHY_IOCTL. The former enables the method, the later enables a subset of possible driver IOCTLs. This change should be basically a no-operation. The affected ioctl methods only support those subset of driver IOCTLs selected by CONFIG_NETDEV_PHY_IOCTL and the network logic will tolerate a nul ioctl method. 2018-01-22 08:17:45 -06:00
Anthony Merlino
cb62580216 Merged in antmerlino/nuttx/mac802154dev-header-offset (pull request #538)
Pass header-payload offset to application for use when the MAC layer is in promiscuous mode

* mac802154_device: When in promiscuous mode, the char driver sends the entire frame, including the MAC header.  This change adds an offset field indicating the header-payload boundary. It is set to 0 when not in promiscuous mode as the header is not passed to the application

* mac802154: Adds support for getting promiscuous mode state

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-11-22 18:22:35 +00:00
Anthony Merlino
6853569633 Merged in antmerlino/nuttx/mac802154 (pull request #527)
mac802154: Fixes a warning for unused variable and returns -1 from macnet_notify() if event is not used.

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-11-03 16:08:17 +00:00
Gregory Nutt
c1de4380e9 Last fix to eliminate a warning also perpetrated a logic error in semaphore handling. 2017-11-03 09:24:16 -06:00
Gregory Nutt
ac40630452 wireless/ieee802154: Fix a warning found in build testing. Mouse input: Cosmetic changes while reviewing logic. 2017-11-03 09:21:19 -06:00
Gregory Nutt
f562bf0fbe Another fix from recent PR: mac802154_primitive_free() does not exist. Perhaps ieee802154_primitive_free() is what was intended? 2017-11-03 08:42:21 -06:00
Anthony Merlino
14fb37c995 Merged in antmerlino/nuttx/sixlowpan-mac802154 (pull request #526)
ieee802154: Simplifies notify() and rxframe() calls to a single notify() call. dataind's and all other "notifs" are now "primitives" which aligns with standard terminology

* mac802154: Adds missing breaks from case statement

* sixlowpan: Fixes bad logic where ACK is not requested if address is not a broadcast

* ieee802154: Simplification of "notifs" and "datainds" to generic primitives passed via a single notify call to the layer above the MAC

* Directories.mk should reference CONFIG_WIRELESS instead of CONFIG_DRIVERS_WIRELESS

* xbee_netdev: Network must be locked when calling sixlowpan_input

* sixlowpan: Reassembly buffer can't be freed if provided by radio driver

* sixlowpan: Don't free IOB if there is an error processing it as the MAC will try to pass it along to another receiver

* ieee802154: Adds basic logging to ieee802154_primitive.c

* Minor fixes after rebase

* xbee: Adds AT query timeout to retry if XBee doesn't respond to request

* same70-xplained: Adds Xbee support. Makes mikroBus slot Kconfig 'choice'

* mac802154: Removes unused function declaration

* drivers/mrf24j40: Fixes compilation error using . operator rather than -> operator

* mac802154_device: Changes a few mac802154_primtive_free's to ieee802154_primitive_free() and changes notif to primitive in a couple places.

* mac802154: Adds promiscous mode logic to bypass parsing of incoming frames. MAC char device also checks for promiscous mode and passes whole frames including header and FCS to the application if promiscous mode is enabled.

* sixlowpan: Fixes logic to correctly check if packet is large enough to include header.  This would cause packets to be considered too small when they are sufficiently sized.

* sixlowpan: Fixes forwarding logic to use forwarding device rather than received device to look up destination link layer address

* net/ipforward: Fixes typo that caused build error when IP forwarding was enabled with CONFIG_NET_ICMPv6_NEIGHBOR enabled as well.

* configs/same70-xplained: Simple spelling fix

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-11-01 20:15:21 +00:00
Gregory Nutt
4810499d3a Squashed commit of the following:
Replace all calls to sigqueue() in the OS proper with calls to nxsig_queue() to avoid accessing the errno variable.

    sched/signal:  Add nxsig_queue() which is functionally equivalent to sigqueue() except that it does not modify the errno variable.
2017-10-07 10:57:09 -06:00
Gregory Nutt
7cc63f90d9 sched/semaphore: sem_trywait() modifies the errno value and, hence, should not be used within the OS. Use nxsem_trywait() instead. 2017-10-05 07:59:06 -06:00
Gregory Nutt
9568600ab1 Squashed commit of the following:
This commit backs out most of commit b4747286b1.  That change was added because sem_wait() would sometimes cause cancellation points inappropriated.  But with these recent changes, nxsem_wait() is used instead and it is not a cancellation point.

    In the OS, all calls to sem_wait() changed to nxsem_wait().  nxsem_wait() does not return errors via errno so each place where nxsem_wait() is now called must not examine the errno variable.

    In all OS functions (not libraries), change sem_wait() to nxsem_wait().  This will prevent the OS from creating bogus cancellation points and from modifying the per-task errno variable.

    sched/semaphore:  Add the function nxsem_wait().  This is a new internal OS interface.  It is functionally equivalent to sem_wait() except that (1) it is not a cancellation point, and (2) it does not set the per-thread errno value on return.
2017-10-04 15:22:27 -06:00
Gregory Nutt
42a0796615 Squashed commit of the following:
sched/semaphore:  Add nxsem_post() which is identical to sem_post() except that it never modifies the errno variable.  Changed all references to sem_post in the OS to nxsem_post().

    sched/semaphore:  Add nxsem_destroy() which is identical to sem_destroy() except that it never modifies the errno variable.  Changed all references to sem_destroy() in the OS to nxsem_destroy().

    libc/semaphore and sched/semaphore:  Add nxsem_getprotocol() and nxsem_setprotocola which are identical to sem_getprotocol() and set_setprotocol() except that they never modifies the errno variable.  Changed all references to sem_setprotocol in the OS to nxsem_setprotocol().  sem_getprotocol() was not used in the OS
2017-10-03 15:35:24 -06:00
Gregory Nutt
83cdb0c552 Squashed commit of the following:
libc/semaphore:  Add nxsem_getvalue() which is identical to sem_getvalue() except that it never modifies the errno variable.  Changed all references to sem_getvalue in the OS to nxsem_getvalue().

    sched/semaphore:  Rename all internal private functions from sem_xyz to nxsem_xyz.  The sem_ prefix is (will be) reserved only for the application semaphore interfaces.

    libc/semaphore:  Add nxsem_init() which is identical to sem_init() except that it never modifies the errno variable.  Changed all references to sem_init in the OS to nxsem_init().

    sched/semaphore:  Rename sem_tickwait() to nxsem_tickwait() so that it is clear this is an internal OS function.

    sched/semaphoate:  Rename sem_reset() to nxsem_reset() so that it is clear this is an internal OS function.
2017-10-03 12:52:31 -06:00
Anthony Merlino
9af6b7cdae Squashed commit of the following:
Merged in merlin17/nuttx/mac802154-sock (pull request #479)

    wireless/ieee802154: Adds support for receiving MAC events via IOCTL through socket interface. Other small fixes and cleanup

    * ioctl: Cleans up MAC802154IOC values
    * wireless/ieee802154: Cleans up MAC802154IOC_NOTIFY_REGISTER logic in character driver
    * wireless/ieee802154/mac802154_netdev:  Adds support for MAC event notification via IOCTL
    * wireless/ieee802154/mac802154: Changes reset logic. No longer reset extended address.
    * wireless/ieee802154: Cleans up MAC802154IOC logic

        Moves MAC802154IOC from ieee802154_ioctl.h and renames ieee802154_ioctl.h to ieee802154_device.h since it only contains types relevant to the MAC char device now.

    * wireless/ieee802154/mac802154_device: Cleans up IOCTL logic for recent changes.
    * drivers/wireless/ieee802154/mrf24j40: Adds missing break in case statement
    * wireless/ieee802154/mac802154_netdev: Starts adding support for passing MAC events via IOCTL
    * wireless/ieee802154/mac802154: Fixes issue with receiver enable logic
    * wireless/ieee802154/mac802154: Fixes issue where extended address is cleared and not rewritten after radio reset
    * configs/clicker2-stm32/mrf24j40-mac: Enables RAMLOG and wireless driver logging
    * wireless/ieee802154/mac802154: Fixes poll logic meant to automatically choose address mode based on short address range.

    Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-15 08:04:38 -06:00
Gregory Nutt
6a6bf1b62f :Remove CONFIG_NET_6LOWPAN_FRAMELEN. In this case where multiple radios are support3d, this may not be a constant. 6LoWPAN now always queries the driver to get the maximum frame length. 2017-09-10 11:40:54 -06:00
Gregory Nutt
334d1734dc 6LoWPAN/Radio: Rename radio property sp_pktlen to sp_framelen. Add 6LoWPAN utility to get the max frame length (not yet hooked in) 2017-09-10 10:13:33 -06:00
Gregory Nutt
88a87f8e3f 6LoWPAN: The original, Contiki-based design used only a single buffer for reassemblying larger packets. This could be a problem issue for hub configurations which really need the capability concurrently reassemble multiple incoming streams concurrently. These was also a design issue in that the reassembly buffer could be corrupted by outgoing packets. The design was extended to support multiple reassembly buffers, each associated with the reassembly tag and source address. This assures that there can be be no corruption of the reassembly once it has started. 2017-08-26 10:00:47 -06:00
Gregory Nutt
70911c3f52 PktRadio loopback driver: Fix compile problem by removing inappropriate const storage class. 2017-08-20 13:19:29 -06:00
Gregory Nutt
0438783afa Squashed commit of the following:
commit 5b7b6e6e616c475c782e9883ada9f4a3b7cb4e2c
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sun Aug 20 11:13:17 2017 -0600

    IEEE 802.15.4 network device:  Make same changes as per loopback device so that it will build with PF_IEEE802154 but without 6LoWPAN.

commit d656a98cf8eab2f20e884224b52cd47ec35df4cc
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sun Aug 20 10:31:28 2017 -0600

    PF_IEEE802154: More fixes to device registration and to IEEE 802.15.4 loopback driver for PF_IEEE802154 without 6LoWPAN.

commit 866bb9cbb0c5af79734bbd434c07fa2560b6608f
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sun Aug 20 09:58:13 2017 -0600

    Network: Reorganize some Kconfig selections.

commit 230b4cb48008cba5fccdafa22340df1d43584829
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sun Aug 20 09:19:53 2017 -0600

    Changes to conditional compilation so that PF_IEEE802154 can build without 6LoWPAN

commit d96cbd6520d40590a740f695c4cd72208ce872da
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sun Aug 20 09:17:02 2017 -0600

    configs/sim/pf_ieee802154: Disable 6LoWPAN, IPv6, TCP, and UDP.  Now things do not build
2017-08-20 11:14:43 -06:00
Gregory Nutt
6919fb85e4 6LoWPAN/PF_IEEE802154: Created radiodev.h and renamed various structures to provide a better separation between 6LoWPAN and PF_IEEE802154. 2017-08-20 07:10:48 -06:00