Commit Graph

351 Commits

Author SHA1 Message Date
Gregory Nutt 22cd0d47fa This commit attempts remove some long standard confusion in naming and some actual problems that result from the naming confusion. The basic problem is the standard MTU does not include the size of the Ethernet header. For clarity, I changed the naming of most things called MTU to PKTSIZE. For example, CONFIG_NET_ETH_MTU is now CONFIG_NET_ETH_PKTSIZE.
This makes the user interface a little hostile.  People thing of an MTU of 1500 bytes, but the corresponding packet is really 1514 bytes (including the 14 byte Ethernet header).  A more friendly solution would configure the MTU (as before), but then derive the packet buffer size by adding the MAC header length.  Instead, we define the packet buffer size then derive the MTU.

The MTU is not common currency in networking.  On the wire, the only real issue is the MSS which is derived from MTU by subtracting the IP header and TCP header sizes (for the case of TCP).  Now it is derived for the PKTSIZE by subtracting the IP header, the TCP header, and the MAC header sizes.  So we should be all good and without the recurring 14 byte error in MTU's and MSS's.

Squashed commit of the following:

    Trivial update to fix some spacing issues.
    net/: Rename several macros containing _MTU to _PKTSIZE.
    net/: Rename CONFIG_NET_SLIP_MTU to CONFIG_NET_SLIP_PKTSIZE and similarly for CONFIG_NET_TUN_MTU.  These are not the MTU which does not include the size of the link layer header.  These are the full size of the packet buffer memory (minus any GUARD bytes).
    net/: Rename CONFIG_NET_6LOWPAN_MTU to CONFIG_NET_6LOWPAN_PKTSIZE and similarly for CONFIG_NET_TUN_MTU.  These are not the MTU which does not include the size of the link layer header.  These are the full size of the packet buffer memory (minus any GUARD bytes).
    net/: Rename CONFIG_NET_ETH_MTU to CONFIG_NET_ETH_PKTSIZE.  This is not the MTU which does not include the size of the link layer header.  This is the full size of the packet buffer memory (minus any GUARD bytes).
    net/: Rename the file d_mtu in the network driver structure to d_pktsize.  That value saved there is not the MTU.  The packetsize is the memory large enough to hold the maximum packet PLUS the size of the link layer header.  The MTU does not include the link layer header.
2018-07-04 14:10:40 -06:00
Gregory Nutt 8fdbb1e0a4 Elimate use of the non-standard type systime_t and replace it the equivalent, standard type clock_t
Squashed commit of the following:

    sched:  Rename all use of system_t to clock_t.
    syscall:  Rename all use of system_t to clock_t.
    net:  Rename all use of system_t to clock_t.
    libs:  Rename all use of system_t to clock_t.
    fs:  Rename all use of system_t to clock_t.
    drivers:  Rename all use of system_t to clock_t.
    arch:  Rename all use of system_t to clock_t.
    include:  Remove definition of systime_t; rename all use of system_t to clock_t.
2018-06-16 12:16:13 -06:00
Anthony Merlino 2f921fbe8e Merged in antmerlino/nuttx/xbee-timeout-fix (pull request #656)
drivers/xbee: Fixes issue with timeouts.  Timeouts were in ticks but should have been in ms.  This caused false triggers of timeout causing redundant packets, etc.

Approved-by: GregoryN <gnutt@nuttx.org>
2018-06-13 03:21:45 +00:00
Gregory Nutt fd844f8eac include/nuttx/wireless/bluetooth: Move Bluetooth header files from include/nuttx/wireless to include/nuttx/wireless/bluetooth for symmetry with other wireless technologies. 2018-04-29 12:43:09 -06:00
hhuysqt 144e335b85 drivers/wiresless/ieee80211: Correct some initialization problems with BCM43362 chip. Adds BCM43428 support. arch/arm/src: Add support for SDIO card to SDIO driver.
Squashed commit of the following:

Author: Gregory Nutt <gnutt@nuttx.org>
    include/nuttx/wireless/ieee80211:  Cosmetic, coding standard changes from review of last merge.
    drivers/wireless/ieee80211:  Cosmetic, coding standard changes from review of last merge.
    configs/photon:  Cosmetic, coding standard changes from review of last merge.
    arch/arm/src/stm32:  SDIO changes from last review:  Fix a few long lines and other coding standard issues; Make additions for SDIO card support dependent on a configuration option.

Author: hhuysqt <hyq9606@126.com>
    Return IEEE 802.11 MAC address just as ethernet does
    Modifyed bcmf_board_setup_oob_irq declaration
    Modified OOB ISR function types
    Add some logic according to WICED SDK
    Bug fixed: data_offset counts in 4-bytes
    Add BCM43438 logic for future developement
    Add tips on using telnet
    Use SDIO in-band interrupt instead of OOB interrupt, because Photon seems to unconnect the OOB interrupt line...
    add SDIO in-band interrupt logic
2018-04-26 08:10:23 -06:00
Gregory Nutt 9b83737821 drivers/wireless/bluetooth: Partition bt_uart.c adding bt_uart.h and bt_uart_generic.c. This will now permit adding HCI UART drivers that have custom initialization requirements.. such as parts the need to download a configuration file to the HCI UART before they are usable. 2018-04-19 17:48:04 -06:00
Anthony Merlino 7061d02f0f Merged in antmerlino/nuttx/xbee_timeout (pull request #629)
Xbee: Adds a timeout to send logic to handle case where XBee module fails to respond to a Transmit request with a Transmit Status

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2018-04-19 04:08:13 +00:00
Gregory Nutt 8ab2eb55d6 drivers/wireless: Add option to dump I/O buffers. Fix calculation of response length. 2018-04-18 12:46:47 -06:00
Gregory Nutt 1224db454b arch/arm/src/stm32 and drivers/wireless/bluetooth: Fix some buffer management errors in HCI UART upper and lower halves. 2018-04-18 08:17:15 -06:00
Gregory Nutt 27f624d881 drivers/wireless/bluetooth: Default BAUD must be 115200, Fix logic in Rx callback, Rx callback must execute on work queue. Now sends and receives one command and response. But hangs on the next. 2018-04-17 13:07:28 -06:00
Gregory Nutt 0271a6a5e9 drivers/wireless/bluetooth: Fix error in testing if interrupts enabled. 2018-04-17 07:13:03 -06:00
Gregory Nutt 5d2c226675 wireless/bluetooth and drivers/wireless/bluetooth: Simply the driver registration/initialization interface. 2018-04-14 11:33:29 -06:00
Gregory Nutt fa287e8863 Various fixes/changes from intial testing of the HCI UART on the STM32F4-Discovery board. Re-organized how the Blutetooth network driver is initialized. Added lots of new debug output. Add a new STM32 F4 Discovery configuration for testing the HCI UART. Various fixes to get through initialization (still does not). 2018-04-14 09:23:08 -06:00
Gregory Nutt d25549ac54 This commit adds a Bluetooth HCI UART lower half driver for the STM32
Squashed commit of the following:

    arch/arm/src/stm32:  Add Kconfig options needed by the HCI UART.  Various fixes to finally get a clean error free compile with no unexpected warnings.
    arch/arm/src/stm32:  In HCI UART, use spin_lock_irqsave() instead of enter_critical_section() whenever possible.
    arch/arm/src/stm32:  In HCI UART, fix up naming of configurations so that they are unique.  Still needs Kconfig settings.  Modify logic so that there can be multiple HCI UARTs, some supporting DMA and some not.
    arch/arm/src/stm32:  Integrate watermarks and software Rx flow control into the HCI UART driver.
    arch/arm/src/stm32:  Eliminate some HCI UART UART configuration options.  Per the HCI UART spec, the link will b 8 data bits, no parity, 1 stop bit... Always.
    arch/arm/src/stm32:  Trivial cleanup
    arch/arm/src/stm32:  Fixes most initial compilation issues STM32 HCI UART driver.  Still need to set up USART configuration parmeters for HCI UART
    arch/arm/src/stm32:  Completes first cut at STM32 HCI UART driver.
    arch/arm/src/stm32:  Completes most of read logic for HCI UART.  Still needs to be able to block if no read data is available.  Still missing write and flush logic.
    drivers/wireless:    Remove txenable from HCI UART methods.  arch/arm/src/stm32:  Reorganize some structures in HCI UART.
    arch/arm/src/stm32:  Still messaging the HCI uart driver.
    arch/arm/src/stm32:  Some trivial renaming.
    arch/arm/src/stm32:  A little more HCI-UART logic.
    arch/arm/src/stm32:  Initial setup to support HCI-UART.  Little more than the serial driver with some name changes and a few things removed.
2018-04-13 10:36:23 -06:00
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
Alan Carvalho de Assis b4c1ac0659 This commit removes all support and all references to the Spark board and to the CC3000 wireless part.
Squashed commit of the following:

Author: Gregory Nutt <gnutt@nuttx.org>
    Fix a few remaining refereces to cc3000.

Author: Alan Carvalho de Assis <acassis@gmail.com>
    drivers/wireless/cc3000: emove the driver to support CC3000 because it doesn't use the USRSOCKET

Author: Alan Carvalho de Assis <acassis@gmail.com>
    configs:  Remove board support to CC3000 from all relevant configurations.

Author: Gregory Nutt <gnutt@nuttx.org>
    configs/spark:  Removes Spark board configuration.  Still available in the Obsoleted repository.  This is preparation for removal of CC3000 support by Alan Carvalho de Assis.  If there is no CC3000 support, then there is no purpose in supporting the Spark either.
2018-04-04 09:34:23 -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 15d033e32b drivers/wireless/bluetooth: Add a NULL device to support some very low level testing on the Simulator. 2018-04-03 09:00:18 -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 380d558795 Adds re-architected Bluetooth UART driver from the Intel/Zephyr arduino101_firmware_source-v1.tar package.
Squashed commit of the following:

    drivers/bluetooth:  Re-architect Bluetooth UART driver to follow upper/lower half model.  Completely untested.
    drivers/bluetooth:  Grr..  Another band-aid commit to stay in sync with master.  Why is this so difficult
    drivers/bluetooth:  Band-aid commit to stay in sync with master.  Lost it somehow.
    drivers/wireless/bluetooth:  A few changes, mostly thought experiments.
    drivers/wireless/bluetooth:  UART-based Bluetooth driver ported from the Intel/Zephyr arduino101_firmware_source-v1.tar package.  This initial commit is the original files in the NuttX build environment with changes to conform with the coding standard.  It should not even build.
2018-03-29 18:36:03 -06:00
lihaichen 6538e4750f drivers/wireless: Fix some issues in the CC1101 driver; Update the CC1101 chip version number 2018-03-19 09:25:41 -06:00
Gregory Nutt b54ffe858a Standardization of some function headers. 2018-03-13 09:52:27 -06:00
Gregory Nutt d1b31d536a Eliminate a couple more uses of printf() within the OS. There are several more. 2018-03-03 12:59:48 -06:00
Gregory Nutt de0ef2486f Some days I can't do anything right. 2018-03-03 11:39:58 -06:00
Gregory Nutt 430204daea drivers/wireless/cc1101.c: Fix a few things that I bungled in my review of the driver mods. Fix the logic that was dumping register contents: printf() may not be used within the OS and the syslog and debug macros may add ornamentatino to the output. The only real option inside the OS is to buffer the data and outputing with a single syslog write (vs. many tiny writes). 2018-03-03 10:32:32 -06:00
Author: lihaichen afe5f706f6 Squashed commit of the following:
cc1101:  Changes from review of last PR.
    remove gpio
    remove  cc1101 frame len
    remove FLAGS_RXONLY flags
    add cc1101 function
    remove some waring
    add cc1101 poll function
    add cc1101 register
    add cc1101 isr read data
    add cc1101 spi deviceId
    add cc1101 init2
    add wait cc1101 chip ready
    raw init cc1101
2018-03-03 08:53:51 -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
Gregory Nutt 2683f713ab Make sure that labeling is used consistently in all function headers (part 3). 2018-02-01 12:17:03 -06:00
Gregory Nutt 1567b82429 Make sure that labeling is used consistently in all function headers (part 2). 2018-02-01 12:03:55 -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 da50646bcf sched/wdog: wd_start() is an internal OS function and should not set the errno value. Reviewed and updated every call to wd_start() to verify if return value is used and if so if the errno value is accessed. 2018-01-31 10:09:14 -06:00
Gregory Nutt 30f2927101 binfmt/, drivers/, graphics/: Fix several inappropriate accesses to get_errno() that were missed in previous changes (some going back to nuttx-.23). 2018-01-30 17:23:10 -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
Gregory Nutt f3286d83e7 Costmetic 2017-11-02 19:17:33 -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
Anthony Merlino 02721f9d95 net/icmpv6: Add some header file necessary for correct build.
drivers/wireless/ieee80211:  Fix typos and spelling errors as needed for Photon build.
2017-11-01 06:58:33 -06:00
Gregory Nutt 5b385f4d4d kthread_create(): Rename kernel_thread() to kthread_create() for better naming consistency with task_create() and kthread_delete(). 2017-10-16 11:38:00 -06:00
Gregory Nutt 181875f3ba fs/vfs: Add new internal OS interface nx_read(). nx_read() is functionally equivalent to read() except that it does not modify the errno variable and it is not a cancellation point. Changed all references to read() in the OS to nx_read(). 2017-10-11 12:13:41 -06:00
Gregory Nutt a00d8e16a1 Adds OS internal function nx_write() which is functionally equivalent to write() except that it does not set the errno variable and do not cause cancellation points. 2017-10-11 10:18:30 -06:00
Gregory Nutt af072d52bc Adds OS internal functions nx_send(), ns_recv(), and nx_recvfrom() which are functionally equivalent to send(), recv(), and recvfrom() except that they do not set the errno variable and do not cause cancellation points. 2017-10-11 09:25:43 -06:00
Gregory Nutt e11e3b2607 Squashed commit of the following:
Change all calls to mq_receive() and mq_timedreceive() in the OS to calls to nxmq_receive() and nxmq_timedreceive(), making appropriate changes for differences in return values.

    sched/mqueue:  Add nxmq_receive() and mxmq_timedreceive() which are functionally equivalent to the standard mq_receive and mq_timedreceive() except that (1) they do not create cancellation points, and (2) the do not modify the application's errno variable.
2017-10-10 09:57:40 -06:00
Gregory Nutt fca07be1df Squashed commit of the following:
Change all calls to mq_send() and mq_timedsend() in the OS to calls to nxmq_send() and nxmq_timedsend(), making appropriate changes for differences in return values.

    sched/mqueue:  Add internal function nxmq_send() and nxmq_timedsend() that are equivalent to mq_send() and mq_timedsend() except that they do not create cancellation points and do to not modify the errno variable.
2017-10-10 08:44:12 -06: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 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