Commit Graph

304 Commits

Author SHA1 Message Date
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 2318f895df Fix some compile problems found during build testing. 2017-10-07 09:40:02 -06:00
Gregory Nutt 936df1bcb5 Adds new OS internal functions nxsig_sleep() and nxsig_usleep. These differ from the standard sleep() and usleep() in that (1) they don't cause cancellation points, and (2) don't set the errno variable (if applicable). All calls to sleep() and usleep() changed to calls to nxsig_sleep() and nxsig_usleep().
Squashed commit of the following:

    Change all calls to usleep() in the OS proper to calls to nxsig_usleep()

    sched/signal:  Add a new OS internal function nxsig_usleep() that is functionally equivalent to usleep() but does not cause a cancellaption point and does not modify the errno variable.

    sched/signal:  Add a new OS internal function nxsig_sleep() that is functionally equivalent to sleep() but does not cause a cancellaption point.
2017-10-06 10:15:01 -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 29b5b3667f sched/semaphore: sem_timedwait() is a cancellation point and, hence, cannot be called from within the OS. Created nxsem_timedwait() that is equivalent but does not modify the errno and does not cause cancellation. All calls to sem_timedwait() change to calls to nxsem_timedwait() in the OS. 2017-10-05 07:24:54 -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
Gregory Nutt 8394f9b60f Squashed commit of the following:
configs/z80sim and xtrs:  Serial driver lower halfs ioctl methods should return a negated errno value, not set the errno variable.

    drivers/wireless:  CC1101 driver not permitted to set errno.

    drivers/sensors:  LIS331DL driver not permitted to set errno.

    drivers/lcd: ILI9341 initialize method not permitted to set errno,

    drivers/serial: 16550 UART driver IOCTL method must not set errno; it must return a negated errno value.
2017-09-30 12:59:33 -06:00
Anthony Merlino 046a94e363 Merged in merlin17/nuttx (pull request #485)
drivers/xbee: Fixes a few warnings

* drivers/xbee: Fixes a few warnings

* configs/clicker2-stm32: Updates sections about i8sak usage in the README

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-15 19:41:24 +00:00
Anthony Merlino 22754053e8 Merged in merlin17/nuttx/xbee (pull request #484)
drivers/wireless:  Adds XBee S2C (802.15.4 firmware) support. XBee driver emulates mac802154 interface

* drivers/wireless/xbee: Adds xbee_netdev. Very similar to mac802154_netdev

* configs/same70-xplained: Starts adding support for XBee radio

* drivers/wireless/ieee802154/xbee: More structuring of XBee driver

* drivers/wireless/ieee802154/xbee: More Xbee work. Starts adding support on Clicker2

* drivers/wireless/ieee802154/xbee: More XBee MAC code

* configs/clicker2-stm32: More work to add XBee radio support

* drivers/wireless/ieee802154/xbee: Most of driver is now structured. No build errors

* configs/clicker2-stm32: Adjustments to XBee click module support

* drivers/xbee: Changes md_ prefix to xd_ prefix for xbeenet_driver_s fields

* drivers/xbee: XBee network device now passes MAC events via IOCTL

* drivers/xbee: Support querying device for parameters, setting parameters, and structures association/startpan logic

* configs/clicker2-stm32: Fixes Xbee lower half ATTN poll logic

* drivers/xbee: Removes dependce on CONFIG_IEEE802154_NETDEV

* drivers/xbee: Supports MAC RESET.request primitive

* drivers/xbee: Exposes generic AT query to the rest of driver

* drivers/xbee: Sets local values when writing setting change to Xbee device

* drivers/xbee: Finish association logic

* drivers/xbee: Adds xbee_get_mhrlen( ) allocating enough space for API frame header to frame

* drivers/xbee: Finishes transmit/receive logic

* drivers/xbee: Fixes xbee_netdev to match logic in mac802154_netdev.c

* drivers/xbee: Rearranges logic to prevent a loop condition where recursion could potentially occur to the point of deadlocking the system

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-09-15 14:37:55 +00: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 7fbceacb46 Mark an untested driver as EXPERIMENTAL in its Kconfig; Update some comments. 2017-09-11 09:35:39 -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 e7ce9c4a79 sem_open() should return SEM_FAILED on any failures. This is change change in the POSIX specification since the original sem_open() was written so many years ago. 2017-09-08 10:14:51 -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
Anthony Merlino fbf830aef2 drivers/wireless/spirit: Fixes a pre-processor directive 2017-08-22 21:15:22 -04: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
Gregory Nutt cff4ac6845 Squashed commit of the following:
commit 2a3ab1652a2c95bcfc8be8380fc7cbdcb6472938
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Sat Aug 19 08:44:31 2017 -0600

    PF_IEEE802154: Finish some missing bind() logic.  Add configs/sim configuration for testing.

commit 59be4b846a6e3bfe82087a888e3fdac9c3c414e5
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 19:30:04 2017 -0600

    PF_IEEE802154:  More renaming to decouple 6LoPAN from radios in general.

commit 69fabb1aea76e54381bdc13de28a3f1441fb42f4
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 19:21:11 2017 -0600

    PF_IEEE802154: Missed a few renamings.

commit ff0af1bb25567720934cc1c2a721ccd92cc35f89
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 17:46:58 2017 -0600

    PF_IEEE802154:  A few bugfixes

commit 01c7c84afd00cf907d280d30cfaf0fb2cf90e02e
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 17:01:31 2017 -0600

    PF_IEEE802154:  A few bugfixes

commit dcef4056d1c1488c93151135f3b7106977faa903
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 16:31:05 2017 -0600

    PF_IEEE802154: Bring in framework for sendto/recvfrom.  Currently just a crude port of functions from net/pkt and do not provide the implemenation needed.

commit 68c5b7b6dd3ab7eb2d0c19890abb38e6561b140e
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 15:18:31 2017 -0600

    Trivial fix to typo in comment

commit fd0af534c089569ccdbd59f13b85453de0a653ad
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 15:07:20 2017 -0600

    PF_IEEE802154: Add device lookup logic; Rename some things that used to be used only by 6LoWPAN but now must be shared with PF_IEEE802154 and need more generic naming.

commit 4fc80a1659f1c699b050775cefc7f6b631b46114
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 13:49:54 2017 -0600

    PF_IEEE802154: Add driver poll logic.

commit d83f71992df8764faa93f9425f1a7602a758f730
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 13:28:59 2017 -0600

    PF_IEEE802154:  Add frame input function.

commit 77561b8c4d5d7be1f8d8eb62cf1a07229afe2048
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 12:46:29 2017 -0600

    PF_IEEE802154: Socket type should be SOCK_DGRAM.  Hook in socket interface.

commit c0f90350282e9905d7f26a1b30f04cc6d6794648
Merge: 8b518abfd0 169c55e546
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 09:36:32 2017 -0600

    Merge remote-tracking branch 'origin/master' into pf_ieee802154

commit 8b518abfd07d492f5148f2c5fdf65604de9822da
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 09:35:39 2017 -0600

    PF_IEEE802154: Add initialization and connection management logic.

commit 98b62620b3cb420041d8ad14204f9410a8aace8c
Author: Gregory Nutt <gnutt@nuttx.org>
Date:   Fri Aug 18 07:52:51 2017 -0600

    PF_IEEE802154: Add basic build support and socket interface framework.
2017-08-19 08:48:52 -06:00
Gregory Nutt a703ed76af Clicker2: Configure EDBG SPI CS just to make that it is disabled 2017-08-15 18:21:10 -06:00
Gregory Nutt 8033f8ae5b SAMv71-XULT: Fix MRF24J40 interrupt GPIO number. 2017-08-15 11:43:31 -06:00
Gregory Nutt 4fa6106b57 Fix some compile problems found in build testing. 2017-08-12 14:28:27 -06:00
Gregory Nutt 6c4405561a Fix a few compile errors and warnings found in build testing 2017-08-12 10:27:55 -06:00
Gregory Nutt aeb59383cf Remove CONFIG_NET_MULTILINK. This increases code size by a little, but greatly reduces the complexity of the network code. 2017-08-08 15:26:09 -06:00
Gregory Nutt f3f522514e libm: Eliminate a warning from lgamma(); Update some comments; Add some logic to handle broadcast better -- Currently conditioned out because it does not work. 2017-08-08 12:08:43 -06:00
Gregory Nutt 09f31d1371 Spirit Radio: Add support for CSMA backoff count reached interrupt. 2017-08-08 10:34:51 -06:00
Gregory Nutt 79400ea960 B-L475-IOT01A: Enable UDP broadcast test in the spirit-starhub configuration. 2017-08-08 08:32:41 -06:00
Gregory Nutt 572cf51fa4 Networking: Rethink IPv6 all-nodes packet routing. 2017-08-08 07:48:07 -06:00
Gregory Nutt 6e3ced4111 Spirit: Make error handling for discarded packets match other RX failure interrupts. 2017-08-07 13:52:42 -06:00
Gregory Nutt 1ac4848686 Spirit bugfixes: Was hanging occasionally because there was not mechanism to restart the poll timer if poll was not performed because Spirit ws busy. Fixed by not checking if Spirit is busy. The TX poll can be performed asynchronouly while spirit is busy; any outgoing data will queued until Spirit is ready. Fixed handling of a timeout condition. Failure to transmition to the TX state would fail (timeout) if in a race condition Spirit already committed to the RX state. The driver needs to recover the state properly and avoid debug assertions in this event. 2017-08-07 09:22:16 -06:00
Gregory Nutt e57a5755cc TX timeout must also be cancelled on a TX error. TX timeout should check if we are waiting for a TXto complete. TX timeout was too short (short than the maximum number of retries). 2017-08-06 16:56:02 -06:00
Gregory Nutt bbf1ad4ea6 Spirit network driver: TX timeout was never being cancelled! Also reviewed and cleaned up all error handling logic 2017-08-06 15:40:37 -06:00
Gregory Nutt 48a507c0b7 6LoWPAN: When obtaining the radio MAC address from the IP address, handle the special case of broadcast and multicast address. 2017-08-06 13:50:48 -06:00
Gregory Nutt 84001f79a0 Spirit Network Driver: Add support for watermark interrupts on RX FIFO. Reduce max packet length to avoid an errata. 2017-08-06 10:10:55 -06:00
Gregory Nutt 3b1e2ac4fd Spirit network driver: Restructure threading to reduce locking. Still get a few RX FIFO errors. 2017-08-06 08:26:51 -06:00
Gregory Nutt 2947ca06c9 Avoid some harsh, inappropriate DEBUGASSERT's. 2017-08-05 12:32:31 -06:00
Gregory Nutt a29a168086 Spirit + 6LoWPAN: In STAR configuration, Spirit must use a configured well known hub address. 6LoWPAN cannot assume that the PAN coordinator is the STAR hub; it must ask the radio to provide it with the address of the star hub 2017-08-05 09:13:29 -06:00
Gregory Nutt c2fbef2062 b-l475e-iot01a: Add configurations to support a star topology. 2017-08-05 07:53:55 -06:00
Gregory Nutt 5d96385c52 Spirit: Increase number of retries if there is no acknowledgement; Add interrupt handling for the case where the max number of retries expires. Fix some badly implemented queue management code. With these changes the basic UDP and TCP tests work. 2017-08-04 15:20:10 -06:00
Gregory Nutt 8027d1bf18 Spirit: Enable AutoACK, TX retries, and RX timeouts in the network driver. 2017-08-04 13:16:07 -06:00
Gregory Nutt 0d551cd0ac Spirit: Convert network driver to use STack packets vs. Basic packets. We need to use the STack packets in order to provide the source address. 2017-08-04 12:19:59 -06:00
Gregory Nutt df51b69895 Spirit: Commit some trivial changes in preparation for a more substantial change. 2017-08-04 12:19:59 -06:00
Gregory Nutt 733d96cf81 Spirit: Correct setting of the length width field; Add multicast and broadcast addresses to radio properities. 2017-08-04 12:19:59 -06:00
Gregory Nutt f6ebcc2220 Spirit network driver: Need to enable sending of TX address. Moved some non-optional settings out of board.h to driver. 2017-08-04 12:19:58 -06:00
Gregory Nutt 36e7a18181 spirit: Modify reg needs to toggle CS to get the correct status. Remove some delbug left in last commit. make sprit_unlock an inline function. 2017-08-03 15:15:15 -06:00
Gregory Nutt d2b5078e01 Spirit: Mostly cosmetic fixes to names and comments. Tx timeout should run on the HP work queue. 2017-08-03 11:47:38 -06:00
Gregory Nutt 76c9ef4844 Spirit: Fix a few RX-related issues. 2017-08-03 11:08:33 -06:00
Gregory Nutt b3e788e11b Spirit: Fix typos in conditional compilation. Add debug output. Remove extra clear of pending interrupts, could cause missing interrupts. Add spirit_reg_modify() which is not currently used. 2017-08-03 09:55:30 -06:00
Gregory Nutt 8a785c4b66 Spirit Network Device: Fix a deadlock. Also several other design improvements to eliminate corner cases. 2017-08-03 08:37:05 -06:00
Gregory Nutt 1ae9748170 Networking: Add support for some packet radio IOCTL commands; Spirit: Fix a few bugs from testing. 2017-08-02 11:53:03 -06:00