forked from nuttx/nuttx-update
Run nxstyle against files modified in previous commit.
This commit is contained in:
parent
ca2b0a3657
commit
759d8c1bfa
10 changed files with 212 additions and 183 deletions
|
@ -390,7 +390,9 @@ static int rwb_rhreload(FAR struct rwbuffer_s *rwb, off_t startblock)
|
||||||
rwb->rhnblocks = nblocks;
|
rwb->rhnblocks = nblocks;
|
||||||
rwb->rhblockstart = startblock;
|
rwb->rhblockstart = startblock;
|
||||||
|
|
||||||
/* The return value is not the number of blocks we asked to be loaded. */
|
/* The return value is not the number of blocks we asked to be
|
||||||
|
* loaded.
|
||||||
|
*/
|
||||||
|
|
||||||
return nblocks;
|
return nblocks;
|
||||||
}
|
}
|
||||||
|
@ -1003,7 +1005,9 @@ ssize_t rwb_write(FAR struct rwbuffer_s *rwb, off_t startblock,
|
||||||
{
|
{
|
||||||
finfo("startblock=%d wrbuffer=%p\n", startblock, wrbuffer);
|
finfo("startblock=%d wrbuffer=%p\n", startblock, wrbuffer);
|
||||||
|
|
||||||
/* Use the block cache unless the buffer size is bigger than block cache */
|
/* Use the block cache unless the buffer size is bigger than block
|
||||||
|
* cache.
|
||||||
|
*/
|
||||||
|
|
||||||
if (nblocks > rwb->wrmaxblocks)
|
if (nblocks > rwb->wrmaxblocks)
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#define __INCLUDE_NUTTX_NET_BLUETOOTH_H
|
#define __INCLUDE_NUTTX_NET_BLUETOOTH_H
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Function Prototypes
|
* Included Files
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
@ -31,10 +31,6 @@
|
||||||
|
|
||||||
#ifdef CONFIG_NET_BLUETOOTH
|
#ifdef CONFIG_NET_BLUETOOTH
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Public Function Prototypes
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/****************************************************************************
|
/*****************************************************************************
|
||||||
* include/nuttx/wireless/ieee802154/ieee802154_mac.h
|
* include/nuttx/wireless/ieee802154/ieee802154_mac.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016 Sebastien Lorquet. All rights reserved.
|
* Copyright (C) 2016 Sebastien Lorquet. All rights reserved.
|
||||||
|
@ -37,14 +37,14 @@
|
||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#ifndef __INCLUDE_NUTTX_WIRELESS_IEEE802154_IEEE802154_MAC_H
|
#ifndef __INCLUDE_NUTTX_WIRELESS_IEEE802154_IEEE802154_MAC_H
|
||||||
#define __INCLUDE_NUTTX_WIRELESS_IEEE802154_IEEE802154_MAC_H
|
#define __INCLUDE_NUTTX_WIRELESS_IEEE802154_IEEE802154_MAC_H
|
||||||
|
|
||||||
/****************************************************************************
|
/*****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
@ -59,11 +59,11 @@
|
||||||
|
|
||||||
#include <nuttx/fs/ioctl.h>
|
#include <nuttx/fs/ioctl.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/*****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/* Configuration ************************************************************/
|
/* Configuration *************************************************************/
|
||||||
|
|
||||||
#if !defined(CONFIG_MAC802154_NPANDESC) || CONFIG_MAC802154_NPANDESC <= 0
|
#if !defined(CONFIG_MAC802154_NPANDESC) || CONFIG_MAC802154_NPANDESC <= 0
|
||||||
# undef CONFIG_MAC802154_NPANDESC
|
# undef CONFIG_MAC802154_NPANDESC
|
||||||
|
@ -104,13 +104,12 @@
|
||||||
|
|
||||||
/* Some addresses */
|
/* Some addresses */
|
||||||
|
|
||||||
#define IEEE802154_PANID_UNSPEC ((uint8_t[]){0xFF,0xFF})
|
#define IEEE802154_PANID_UNSPEC ((uint8_t[]){0xff,0xff})
|
||||||
#define IEEE802154_SADDR_UNSPEC ((uint8_t[]){0xFF,0xFF})
|
#define IEEE802154_SADDR_UNSPEC ((uint8_t[]){0xff,0xff})
|
||||||
#define IEEE802154_SADDR_BCAST ((uint8_t[]){0xFE,0xFF})
|
#define IEEE802154_SADDR_BCAST ((uint8_t[]){0xfe,0xff})
|
||||||
#define IEEE802154_EADDR_UNSPEC ((uint8_t[]){0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF})
|
#define IEEE802154_EADDR_UNSPEC ((uint8_t[]){0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff})
|
||||||
|
|
||||||
|
/* IEEE 802.15.4 MAC Character Driver IOCTL Commands *************************/
|
||||||
/* IEEE 802.15.4 MAC Character Driver IOCTL Commands ************************/
|
|
||||||
|
|
||||||
/* The IEEE 802.15.4 standard specifies a MLME Service Access Point (SAP)
|
/* The IEEE 802.15.4 standard specifies a MLME Service Access Point (SAP)
|
||||||
* including a series of primitives that are used as an interface between
|
* including a series of primitives that are used as an interface between
|
||||||
|
@ -139,20 +138,20 @@
|
||||||
#define MAC802154IOC_MLME_RXENABLE_REQUEST _MAC802154IOC(0x0007)
|
#define MAC802154IOC_MLME_RXENABLE_REQUEST _MAC802154IOC(0x0007)
|
||||||
#define MAC802154IOC_MLME_SCAN_REQUEST _MAC802154IOC(0x0008)
|
#define MAC802154IOC_MLME_SCAN_REQUEST _MAC802154IOC(0x0008)
|
||||||
#define MAC802154IOC_MLME_SET_REQUEST _MAC802154IOC(0x0009)
|
#define MAC802154IOC_MLME_SET_REQUEST _MAC802154IOC(0x0009)
|
||||||
#define MAC802154IOC_MLME_START_REQUEST _MAC802154IOC(0x000A)
|
#define MAC802154IOC_MLME_START_REQUEST _MAC802154IOC(0x000a)
|
||||||
#define MAC802154IOC_MLME_SYNC_REQUEST _MAC802154IOC(0x000B)
|
#define MAC802154IOC_MLME_SYNC_REQUEST _MAC802154IOC(0x000b)
|
||||||
#define MAC802154IOC_MLME_POLL_REQUEST _MAC802154IOC(0x000C)
|
#define MAC802154IOC_MLME_POLL_REQUEST _MAC802154IOC(0x000c)
|
||||||
#define MAC802154IOC_MLME_DPS_REQUEST _MAC802154IOC(0x000D)
|
#define MAC802154IOC_MLME_DPS_REQUEST _MAC802154IOC(0x000d)
|
||||||
#define MAC802154IOC_MLME_SOUNDING_REQUEST _MAC802154IOC(0x000E)
|
#define MAC802154IOC_MLME_SOUNDING_REQUEST _MAC802154IOC(0x000e)
|
||||||
#define MAC802154IOC_MLME_CALIBRATE_REQUEST _MAC802154IOC(0x000F)
|
#define MAC802154IOC_MLME_CALIBRATE_REQUEST _MAC802154IOC(0x000f)
|
||||||
|
|
||||||
/* Non-standard MAC ioctl calls */
|
/* Non-standard MAC ioctl calls */
|
||||||
|
|
||||||
#define MAC802154IOC_NOTIFY_REGISTER _MAC802154IOC(0x00FD)
|
#define MAC802154IOC_NOTIFY_REGISTER _MAC802154IOC(0x00fd)
|
||||||
#define MAC802154IOC_GET_EVENT _MAC802154IOC(0x00FE)
|
#define MAC802154IOC_GET_EVENT _MAC802154IOC(0x00fe)
|
||||||
#define MAC802154IOC_ENABLE_EVENTS _MAC802154IOC(0x00FF)
|
#define MAC802154IOC_ENABLE_EVENTS _MAC802154IOC(0x00ff)
|
||||||
|
|
||||||
/* IEEE 802.15.4 MAC Interface **********************************************/
|
/* IEEE 802.15.4 MAC Interface ***********************************************/
|
||||||
|
|
||||||
/* Frame control field masks, 2 bytes
|
/* Frame control field masks, 2 bytes
|
||||||
* Seee IEEE 802.15.4/2011 5.2.1.1 page 57
|
* Seee IEEE 802.15.4/2011 5.2.1.1 page 57
|
||||||
|
@ -163,9 +162,9 @@
|
||||||
#define IEEE802154_FRAMECTRL_PEND 0x0010 /* Frame pending, bit 4 */
|
#define IEEE802154_FRAMECTRL_PEND 0x0010 /* Frame pending, bit 4 */
|
||||||
#define IEEE802154_FRAMECTRL_ACKREQ 0x0020 /* Acknowledge request, bit 5 */
|
#define IEEE802154_FRAMECTRL_ACKREQ 0x0020 /* Acknowledge request, bit 5 */
|
||||||
#define IEEE802154_FRAMECTRL_PANIDCOMP 0x0040 /* PAN ID Compression, bit 6 */
|
#define IEEE802154_FRAMECTRL_PANIDCOMP 0x0040 /* PAN ID Compression, bit 6 */
|
||||||
#define IEEE802154_FRAMECTRL_DADDR 0x0C00 /* Dest addressing mode, bits 10-11 */
|
#define IEEE802154_FRAMECTRL_DADDR 0x0c00 /* Dest addressing mode, bits 10-11 */
|
||||||
#define IEEE802154_FRAMECTRL_VERSION 0x3000 /* Source addressing mode, bits 12-13 */
|
#define IEEE802154_FRAMECTRL_VERSION 0x3000 /* Source addressing mode, bits 12-13 */
|
||||||
#define IEEE802154_FRAMECTRL_SADDR 0xC000 /* Source addressing mode, bits 14-15 */
|
#define IEEE802154_FRAMECTRL_SADDR 0xc000 /* Source addressing mode, bits 14-15 */
|
||||||
|
|
||||||
#define IEEE802154_FRAMECTRL_SHIFT_FTYPE 0 /* Frame type, bits 0-2 */
|
#define IEEE802154_FRAMECTRL_SHIFT_FTYPE 0 /* Frame type, bits 0-2 */
|
||||||
#define IEEE802154_FRAMECTRL_SHIFT_SEC 3 /* Security Enabled, bit 3 */
|
#define IEEE802154_FRAMECTRL_SHIFT_SEC 3 /* Security Enabled, bit 3 */
|
||||||
|
@ -180,9 +179,9 @@
|
||||||
* Seee IEEE 802.15.4/2011 5.2.2.1.2 page 62
|
* Seee IEEE 802.15.4/2011 5.2.2.1.2 page 62
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define IEEE802154_SFSPEC_BEACONORDER 0x000F /* Beacon order, bits 0-3 */
|
#define IEEE802154_SFSPEC_BEACONORDER 0x000f /* Beacon order, bits 0-3 */
|
||||||
#define IEEE802154_SFSPEC_SFORDER 0x00F0 /* Superframe Order, bit 4-7 */
|
#define IEEE802154_SFSPEC_SFORDER 0x00f0 /* Superframe Order, bit 4-7 */
|
||||||
#define IEEE802154_SFSPEC_FINCAPSLOT 0x0F00 /* Final CAP Slot, bit 8-11 */
|
#define IEEE802154_SFSPEC_FINCAPSLOT 0x0f00 /* Final CAP Slot, bit 8-11 */
|
||||||
#define IEEE802154_SFSPEC_BLE 0x1000 /* Battery Life Ext, bit 12 */
|
#define IEEE802154_SFSPEC_BLE 0x1000 /* Battery Life Ext, bit 12 */
|
||||||
#define IEEE802154_SFSPEC_PANCOORD 0x4000 /* PAN Coordinator, bit 14 */
|
#define IEEE802154_SFSPEC_PANCOORD 0x4000 /* PAN Coordinator, bit 14 */
|
||||||
#define IEEE802154_SFSPEC_ASSOCPERMIT 0x8000 /* Association Permit, bit 15 */
|
#define IEEE802154_SFSPEC_ASSOCPERMIT 0x8000 /* Association Permit, bit 15 */
|
||||||
|
@ -208,7 +207,7 @@
|
||||||
* Seee IEEE 802.15.4/2011 5.2.2.1.3 page 63
|
* Seee IEEE 802.15.4/2011 5.2.2.1.3 page 63
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define IEEE802154_GTSDIR_MASK 0x7F /* GTS Directions Mask, bits 0-6 */
|
#define IEEE802154_GTSDIR_MASK 0x7f /* GTS Directions Mask, bits 0-6 */
|
||||||
|
|
||||||
#define IEEE802154_GTSDIR_SHIFT_MASK 0 /* GTS Directions Mask, bits 0-6 */
|
#define IEEE802154_GTSDIR_SHIFT_MASK 0 /* GTS Directions Mask, bits 0-6 */
|
||||||
|
|
||||||
|
@ -240,7 +239,7 @@
|
||||||
/* IEEE 802.15.4 PHY constants */
|
/* IEEE 802.15.4 PHY constants */
|
||||||
|
|
||||||
#define IEEE802154_MAX_PHY_PACKET_SIZE 127
|
#define IEEE802154_MAX_PHY_PACKET_SIZE 127
|
||||||
#define IEEE802154_TURN_AROUND_TIME 12 /*symbol periods*/
|
#define IEEE802154_TURN_AROUND_TIME 12 /* symbol periods*/
|
||||||
|
|
||||||
/* IEEE 802.15.4 MAC constants */
|
/* IEEE 802.15.4 MAC constants */
|
||||||
|
|
||||||
|
@ -280,9 +279,9 @@
|
||||||
|
|
||||||
#define MAX_ORPHAN_ADDR 32 /* REVISIT */
|
#define MAX_ORPHAN_ADDR 32 /* REVISIT */
|
||||||
|
|
||||||
/****************************************************************************
|
/*****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/* IEEE 802.15.4 MAC status codes */
|
/* IEEE 802.15.4 MAC status codes */
|
||||||
|
|
||||||
|
@ -458,7 +457,7 @@ enum ieee802154_attr_e
|
||||||
IEEE802154_ATTR_MAC_PANCOORD_EXT_ADDR,
|
IEEE802154_ATTR_MAC_PANCOORD_EXT_ADDR,
|
||||||
IEEE802154_ATTR_MAC_PANCOORD_SHORT_ADDR,
|
IEEE802154_ATTR_MAC_PANCOORD_SHORT_ADDR,
|
||||||
|
|
||||||
/* Non-standard MAC Attributes*/
|
/* Non-standard MAC Attributes */
|
||||||
|
|
||||||
IEEE802154_ATTR_MAC_DEVMODE,
|
IEEE802154_ATTR_MAC_DEVMODE,
|
||||||
};
|
};
|
||||||
|
@ -474,6 +473,7 @@ enum ieee802154_frametype_e
|
||||||
};
|
};
|
||||||
|
|
||||||
/* MAC command IDs */
|
/* MAC command IDs */
|
||||||
|
|
||||||
/* TODO: Change terminology to be "current primitive" */
|
/* TODO: Change terminology to be "current primitive" */
|
||||||
|
|
||||||
enum ieee802154_cmdid_e
|
enum ieee802154_cmdid_e
|
||||||
|
@ -596,7 +596,7 @@ struct ieee802154_pandesc_s
|
||||||
|
|
||||||
struct ieee802154_addr_s coordaddr;
|
struct ieee802154_addr_s coordaddr;
|
||||||
|
|
||||||
uint8_t chan; /* current channel occupied by the network */
|
uint8_t chan; /* current channel occupied by the network */
|
||||||
uint8_t chpage; /* current channel page occupied by the network */
|
uint8_t chpage; /* current channel page occupied by the network */
|
||||||
|
|
||||||
/* The superframe specifications received in the beacon frame */
|
/* The superframe specifications received in the beacon frame */
|
||||||
|
@ -682,6 +682,7 @@ union ieee802154_phyattr_u
|
||||||
int32_t txpwr;
|
int32_t txpwr;
|
||||||
uint32_t symdur_picosec;
|
uint32_t symdur_picosec;
|
||||||
uint8_t fcslen;
|
uint8_t fcslen;
|
||||||
|
|
||||||
/* TODO: Fill this out as we implement supported get/set commands */
|
/* TODO: Fill this out as we implement supported get/set commands */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -896,7 +897,8 @@ struct ieee802154_data_ind_s
|
||||||
* Primitive: MCPS-PURGE.request
|
* Primitive: MCPS-PURGE.request
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Allows the next higher layer to purge an MSDU from the transaction queue.
|
* Allows the next higher layer to purge an MSDU from the transaction
|
||||||
|
* queue.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
@ -923,17 +925,18 @@ struct ieee802154_assoc_req_s
|
||||||
|
|
||||||
FAR struct ieee802154_primitive_s *flink;
|
FAR struct ieee802154_primitive_s *flink;
|
||||||
|
|
||||||
uint8_t chan; /* Channel number to attempt association */
|
uint8_t chan; /* Channel number to attempt association */
|
||||||
uint8_t chpage; /* Channel page to attempt association */
|
uint8_t chpage; /* Channel page to attempt association */
|
||||||
|
|
||||||
/* TODO:
|
/* TODO:
|
||||||
* This is a non-standard field. I believe there is a catch 22 in the
|
* This is a non-standard field. I believe there is a catch 22 in the
|
||||||
* standard and until I can figure it out, I'm adding this boolean to let the
|
* standard and until I can figure it out, I'm adding this boolean to let
|
||||||
* application tell the MAC whether it is trying to assocaite with a beacon
|
* the application tell the MAC whether it is trying to associate with a
|
||||||
* enabled PAN or non-beacon enabled PAN. If it is beacon-enabled, the MAC
|
* beacon enabled PAN or non-beacon enabled PAN. If it is beacon-enabled,
|
||||||
* will track the beacon first before transmitting the association. This can
|
* the MAC will track the beacon first before transmitting the
|
||||||
* take some time depending on the beacon interval. If the PAN is non-beacon
|
* association. This can take some time depending on the beacon interval.
|
||||||
* enabled, the association request is sent immediately via CSMA.
|
* If the PAN is non-beacon enabled, the association request is sent
|
||||||
|
* immediately via CSMA.
|
||||||
*
|
*
|
||||||
* The catch 22: The standard outlines the procedure for associating: reset
|
* The catch 22: The standard outlines the procedure for associating: reset
|
||||||
* the MAC, scan to find PAN's and pass coordinator address info to
|
* the MAC, scan to find PAN's and pass coordinator address info to
|
||||||
|
@ -1018,7 +1021,7 @@ struct ieee802154_assoc_resp_s
|
||||||
|
|
||||||
uint8_t devaddr[IEEE802154_EADDRSIZE];
|
uint8_t devaddr[IEEE802154_EADDRSIZE];
|
||||||
|
|
||||||
/* Address assigned to the device. 0xFFFF if failure */
|
/* Address assigned to the device. 0xffff if failure */
|
||||||
|
|
||||||
uint8_t assocsaddr[IEEE802154_SADDRSIZE];
|
uint8_t assocsaddr[IEEE802154_SADDRSIZE];
|
||||||
|
|
||||||
|
@ -1037,8 +1040,8 @@ struct ieee802154_assoc_resp_s
|
||||||
* Primitive: MLME-ASSOCIATE.confirm
|
* Primitive: MLME-ASSOCIATE.confirm
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Used to inform the next higher layer of the initiating device whether its
|
* Used to inform the next higher layer of the initiating device whether
|
||||||
* request to associate was successful or unsuccessful.
|
* its request to associate was successful or unsuccessful.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
@ -1155,11 +1158,11 @@ struct ieee802154_disassoc_conf_s
|
||||||
* Primitive: MLME-BEACONNOTIFY.indication
|
* Primitive: MLME-BEACONNOTIFY.indication
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Used to send parameters contained within a beacon frame received by the
|
* Used to send parameters contained within a beacon frame received by
|
||||||
* MAC sublayer to the next higher layer when either macAutoRequest is set to
|
* the MAC sublayer to the next higher layer when either macAutoRequest is
|
||||||
* FALSE or when the beacon frame contains one or more octets of payload. The
|
* set to FALSE or when the beacon frame contains one or more octets of
|
||||||
* primitive also sends a measure of the LQI and the time the beacon frame
|
* payload. The primitive also sends a measure of the LQI and the time the
|
||||||
* was received.
|
* beacon frame was received.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
@ -1211,9 +1214,9 @@ struct ieee802154_commstatus_ind_s
|
||||||
* Primitive: MLME-GTS.request
|
* Primitive: MLME-GTS.request
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Allows a device to send a request to the PAN coordinator to allocate a new
|
* Allows a device to send a request to the PAN coordinator to allocate a
|
||||||
* GTS or to deallocate an existing GTS. This primitive is also used by the
|
* new GTS or to deallocate an existing GTS. This primitive is also used
|
||||||
* PAN coordinator to initiate a GTS deallocation.
|
* by the PAN coordinator to initiate a GTS deallocation.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
@ -1236,8 +1239,8 @@ struct ieee802154_gts_req_s
|
||||||
* Primitive: MLME-GTS.confirm
|
* Primitive: MLME-GTS.confirm
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Reports the results of a request to allocate a new GTS or to deallocate an
|
* Reports the results of a request to allocate a new GTS or to deallocate
|
||||||
* existing GTS.
|
* an existing GTS.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
@ -1280,8 +1283,8 @@ struct ieee802154_gts_ind_s
|
||||||
* Primitive: MLME-ORPHAN.indication
|
* Primitive: MLME-ORPHAN.indication
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Generated by the MLME of a coordinator and issued to its next higher layer
|
* Generated by the MLME of a coordinator and issued to its next higher
|
||||||
* on receipt of an orphan notification command.
|
* layer on receipt of an orphan notification command.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
@ -1468,10 +1471,10 @@ struct ieee802154_get_req_s
|
||||||
* Attempts to write the given value to the indicated PIB attribute.
|
* Attempts to write the given value to the indicated PIB attribute.
|
||||||
*
|
*
|
||||||
* NOTE: The standard specifies that confirmation should be indicated via
|
* NOTE: The standard specifies that confirmation should be indicated via
|
||||||
* the asynchronous MLME-SET.confirm primitive. However, in our implementation
|
* the asynchronous MLME-SET.confirm primitive. However, in our
|
||||||
* there is no reason not to synchronously return the status immediately.
|
* implementation there is no reason not to synchronously return the status
|
||||||
* Therefore, we do merge the functionality of the MLME-SET.request and
|
* immediately. Therefore, we do merge the functionality of the
|
||||||
* MLME-SET.confirm primitives together.
|
* MLME-SET.request and MLME-SET.confirm primitives together.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
@ -1489,9 +1492,9 @@ struct ieee802154_set_req_s
|
||||||
* Primitive: MLME-START.request
|
* Primitive: MLME-START.request
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Used by the PAN coordinator to initiate a new PAN or to begin using a new
|
* Used by the PAN coordinator to initiate a new PAN or to begin using a
|
||||||
* superframe configuration. This primitive is also used by a device already
|
* new superframe configuration. This primitive is also used by a device
|
||||||
* associated with an existing PAN to begin using a new superframe
|
* already associated with an existing PAN to begin using a new superframe
|
||||||
* configuration.
|
* configuration.
|
||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
@ -1689,9 +1692,9 @@ union ieee802154_primitive_u
|
||||||
struct ieee802154_primitive_s
|
struct ieee802154_primitive_s
|
||||||
{
|
{
|
||||||
/* Must be first member so that we can interchange between the actual
|
/* Must be first member so that we can interchange between the actual
|
||||||
* primitive and this extended struct. Note, all frames also have the first
|
* primitive and this extended struct. Note, all frames also have the
|
||||||
* entry as a forward link to a primitive so that primitives can be contained
|
* first entry as a forward link to a primitive so that primitives can be
|
||||||
* in lists.
|
* contained in lists.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
union ieee802154_primitive_u u;
|
union ieee802154_primitive_u u;
|
||||||
|
@ -1718,9 +1721,9 @@ union ieee802154_macarg_u
|
||||||
struct ieee802154_start_req_s startreq; /* MAC802154IOC_MLME_START_REQUEST */
|
struct ieee802154_start_req_s startreq; /* MAC802154IOC_MLME_START_REQUEST */
|
||||||
struct ieee802154_sync_req_s syncreq; /* MAC802154IOC_MLME_SYNC_REQUEST */
|
struct ieee802154_sync_req_s syncreq; /* MAC802154IOC_MLME_SYNC_REQUEST */
|
||||||
struct ieee802154_poll_req_s pollreq; /* MAC802154IOC_MLME_POLL_REQUEST */
|
struct ieee802154_poll_req_s pollreq; /* MAC802154IOC_MLME_POLL_REQUEST */
|
||||||
/* To be determined */ /* MAC802154IOC_MLME_DPS_REQUEST */
|
/* MAC802154IOC_MLME_DPS_REQUEST */
|
||||||
/* To be determined */ /* MAC802154IOC_MLME_SOUNDING_REQUEST */
|
/* MAC802154IOC_MLME_SOUNDING_REQUEST */
|
||||||
/* To be determined */ /* MAC802154IOC_MLME_CALIBRATE_REQUEST */
|
/* MAC802154IOC_MLME_CALIBRATE_REQUEST */
|
||||||
|
|
||||||
struct sigevent event; /* MAC802154IOC_NOTIFY_REGISTER */
|
struct sigevent event; /* MAC802154IOC_NOTIFY_REGISTER */
|
||||||
struct ieee802154_primitive_s primitive; /* MAC802154IOC_GET_EVENT */
|
struct ieee802154_primitive_s primitive; /* MAC802154IOC_GET_EVENT */
|
||||||
|
@ -1755,13 +1758,13 @@ extern "C"
|
||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/*****************************************************************************
|
||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
struct ieee802154_radio_s; /* Forward reference */
|
struct ieee802154_radio_s; /* Forward reference */
|
||||||
|
|
||||||
/****************************************************************************
|
/*****************************************************************************
|
||||||
* Name: mac802154_create
|
* Name: mac802154_create
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
|
@ -1783,11 +1786,11 @@ struct ieee802154_radio_s; /* Forward reference */
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* An opaque reference to the MAC state data.
|
* An opaque reference to the MAC state data.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
MACHANDLE mac802154_create(FAR struct ieee802154_radio_s *radiodev);
|
MACHANDLE mac802154_create(FAR struct ieee802154_radio_s *radiodev);
|
||||||
|
|
||||||
/****************************************************************************
|
/*****************************************************************************
|
||||||
* Name: mac802154dev_register
|
* Name: mac802154dev_register
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
|
@ -1803,11 +1806,11 @@ MACHANDLE mac802154_create(FAR struct ieee802154_radio_s *radiodev);
|
||||||
* Zero (OK) is returned on success. Otherwise a negated errno value is
|
* Zero (OK) is returned on success. Otherwise a negated errno value is
|
||||||
* returned to indicate the nature of the failure.
|
* returned to indicate the nature of the failure.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
int mac802154dev_register(MACHANDLE mac, int minor);
|
int mac802154dev_register(MACHANDLE mac, int minor);
|
||||||
|
|
||||||
/****************************************************************************
|
/*****************************************************************************
|
||||||
* Name: mac802154netdev_register
|
* Name: mac802154netdev_register
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
|
@ -1821,19 +1824,19 @@ int mac802154dev_register(MACHANDLE mac, int minor);
|
||||||
* Zero (OK) is returned on success. Otherwise a negated errno value is
|
* Zero (OK) is returned on success. Otherwise a negated errno value is
|
||||||
* returned to indicate the nature of the failure.
|
* returned to indicate the nature of the failure.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
int mac802154netdev_register(MACHANDLE mac);
|
int mac802154netdev_register(MACHANDLE mac);
|
||||||
|
|
||||||
/****************************************************************************
|
/*****************************************************************************
|
||||||
* Name: ieee802154_primitivepool_initialize
|
* Name: ieee802154_primitivepool_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function initializes the primitive allocator. Primitives are defined
|
* This function initializes the primitive allocator. Primitives are
|
||||||
* in the standard and are used to pass information between the MAC layer and
|
* defined in the standard and are used to pass information between the
|
||||||
* the next highest layer. They are a data type abstraction. This function must
|
* MAC layer and the next highest layer. They are a data type abstraction.
|
||||||
* be called early in the initialization sequence before any radios
|
* This function must be called early in the initialization sequence
|
||||||
* begin operation.
|
* before any radios begin operation.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* None
|
* None
|
||||||
|
@ -1841,11 +1844,11 @@ int mac802154netdev_register(MACHANDLE mac);
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
void ieee802154_primitivepool_initialize(void);
|
void ieee802154_primitivepool_initialize(void);
|
||||||
|
|
||||||
/****************************************************************************
|
/*****************************************************************************
|
||||||
* Name: ieee802154_primitive_allocate
|
* Name: ieee802154_primitive_allocate
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
|
@ -1865,21 +1868,22 @@ void ieee802154_primitivepool_initialize(void);
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* A reference to the allocated primitive structure. All user fields in this
|
* A reference to the allocated primitive structure. All user fields in
|
||||||
* structure have been zeroed. On a failure to allocate, NULL is
|
* this structure have been zeroed. On a failure to allocate, NULL is
|
||||||
* returned.
|
* returned.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
FAR struct ieee802154_primitive_s *ieee802154_primitive_allocate(void);
|
FAR struct ieee802154_primitive_s *ieee802154_primitive_allocate(void);
|
||||||
|
|
||||||
/****************************************************************************
|
/*****************************************************************************
|
||||||
* Name: ieee802154_primitive_free
|
* Name: ieee802154_primitive_free
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* The ieee802154_primitive_free function will return a primitive structure to
|
* The ieee802154_primitive_free function will return a primitive
|
||||||
* the free pool if it was a pre-allocated primitive structure. If the primitive
|
* structure to the free pool if it was a pre-allocated primitive
|
||||||
* was allocated dynamically it will be deallocated.
|
* structure. If the primitive was allocated dynamically it will be
|
||||||
|
* deallocated.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* prim - primitive structure to free
|
* prim - primitive structure to free
|
||||||
|
@ -1887,7 +1891,7 @@ FAR struct ieee802154_primitive_s *ieee802154_primitive_allocate(void);
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
void ieee802154_primitive_free(FAR struct ieee802154_primitive_s *prim);
|
void ieee802154_primitive_free(FAR struct ieee802154_primitive_s *prim);
|
||||||
|
|
||||||
|
|
|
@ -282,9 +282,9 @@ static FAR struct nxfonts_glyph_s *
|
||||||
|
|
||||||
/* Try to find the glyph in the list of pre-rendered glyphs */
|
/* Try to find the glyph in the list of pre-rendered glyphs */
|
||||||
|
|
||||||
for (prev = NULL, glyph = priv->head;
|
for (prev = NULL, glyph = priv->head;
|
||||||
glyph != NULL;
|
glyph != NULL;
|
||||||
prev = glyph, glyph = glyph->flink)
|
prev = glyph, glyph = glyph->flink)
|
||||||
{
|
{
|
||||||
/* Check if we found the glyph for this character */
|
/* Check if we found the glyph for this character */
|
||||||
|
|
||||||
|
@ -433,9 +433,12 @@ static inline void nxf_fillglyph(FAR struct nxfonts_fcache_s *priv,
|
||||||
|
|
||||||
/* Get two 32-bit values for alternating 32 representations */
|
/* Get two 32-bit values for alternating 32 representations */
|
||||||
|
|
||||||
pixel[0] = (uint32_t)priv->bgcolor << 8 | (uint32_t)priv->bgcolor >> 16;
|
pixel[0] = (uint32_t)priv->bgcolor << 8 |
|
||||||
pixel[1] = (uint32_t)priv->bgcolor << 16 | (uint32_t)priv->bgcolor >> 8;
|
(uint32_t)priv->bgcolor >> 16;
|
||||||
pixel[2] = (uint32_t)priv->bgcolor << 24 | (uint32_t)priv->bgcolor;
|
pixel[1] = (uint32_t)priv->bgcolor << 16 |
|
||||||
|
(uint32_t)priv->bgcolor >> 8;
|
||||||
|
pixel[2] = (uint32_t)priv->bgcolor << 24 |
|
||||||
|
(uint32_t)priv->bgcolor;
|
||||||
|
|
||||||
for (row = 0; row < glyph->height; row++)
|
for (row = 0; row < glyph->height; row++)
|
||||||
{
|
{
|
||||||
|
@ -532,7 +535,9 @@ static inline FAR struct nxfonts_glyph_s *
|
||||||
|
|
||||||
if (glyph != NULL)
|
if (glyph != NULL)
|
||||||
{
|
{
|
||||||
/* Save the character code, dimensions, and physical width of the glyph */
|
/* Save the character code, dimensions, and physical width of the
|
||||||
|
* glyph.
|
||||||
|
*/
|
||||||
|
|
||||||
glyph->code = ch;
|
glyph->code = ch;
|
||||||
glyph->width = width;
|
glyph->width = width;
|
||||||
|
@ -660,7 +665,7 @@ FCACHE nxf_cache_connect(enum nx_fontid_e fontid,
|
||||||
/* Allocate memory for the (empty) font cache */
|
/* Allocate memory for the (empty) font cache */
|
||||||
|
|
||||||
priv = (FAR struct nxfonts_fcache_s *)
|
priv = (FAR struct nxfonts_fcache_s *)
|
||||||
lib_zalloc(sizeof( struct nxfonts_fcache_s));
|
lib_zalloc(sizeof(struct nxfonts_fcache_s));
|
||||||
|
|
||||||
if (priv == NULL)
|
if (priv == NULL)
|
||||||
{
|
{
|
||||||
|
@ -784,7 +789,8 @@ errout_with_lock:
|
||||||
* font handle is invalid upon return in either case.
|
* font handle is invalid upon return in either case.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* fhandle - A font cache handle previously returned by nxf_cache_connect();
|
* fhandle - A font cache handle previously returned by
|
||||||
|
* nxf_cache_connect();
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* None
|
* None
|
||||||
|
@ -864,7 +870,8 @@ void nxf_cache_disconnect(FCACHE fhandle)
|
||||||
* cache.
|
* cache.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* fhandle - A font cache handle previously returned by nxf_cache_connect();
|
* fhandle - A font cache handle previously returned by
|
||||||
|
* nxf_cache_connect();
|
||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* Zero (OK) is returned if the metrics were
|
* Zero (OK) is returned if the metrics were
|
||||||
|
@ -896,7 +903,8 @@ NXHANDLE nxf_cache_getfonthandle(FCACHE fhandle)
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
FAR const struct nxfonts_glyph_s *nxf_cache_getglyph(FCACHE fhandle, uint8_t ch)
|
FAR const struct nxfonts_glyph_s *
|
||||||
|
nxf_cache_getglyph(FCACHE fhandle, uint8_t ch)
|
||||||
{
|
{
|
||||||
FAR struct nxfonts_fcache_s *priv = (FAR struct nxfonts_fcache_s *)fhandle;
|
FAR struct nxfonts_fcache_s *priv = (FAR struct nxfonts_fcache_s *)fhandle;
|
||||||
FAR struct nxfonts_glyph_s *glyph;
|
FAR struct nxfonts_glyph_s *glyph;
|
||||||
|
|
|
@ -70,8 +70,8 @@ static struct icmpv6_notify_s *g_icmpv6_waiters;
|
||||||
* is sent so that there is no race condition when icmpv6_wait() is called.
|
* is sent so that there is no race condition when icmpv6_wait() is called.
|
||||||
*
|
*
|
||||||
* Assumptions:
|
* Assumptions:
|
||||||
* This function is called from icmpv6_neighbor() and executes in the normal
|
* This function is called from icmpv6_neighbor() and executes in the
|
||||||
* tasking environment.
|
* normal tasking environment.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -286,8 +286,9 @@ int icmpv6_rwait(FAR struct icmpv6_rnotify_s *notify, unsigned int timeout)
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void icmpv6_rnotify(FAR struct net_driver_s *dev, const net_ipv6addr_t draddr,
|
void icmpv6_rnotify(FAR struct net_driver_s *dev,
|
||||||
const net_ipv6addr_t prefix, unsigned int preflen)
|
const net_ipv6addr_t draddr, const net_ipv6addr_t prefix,
|
||||||
|
unsigned int preflen)
|
||||||
{
|
{
|
||||||
FAR struct icmpv6_rnotify_s *curr;
|
FAR struct icmpv6_rnotify_s *curr;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,8 @@
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are
|
||||||
|
* met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
@ -37,17 +38,18 @@
|
||||||
* contributors may be used to endorse or promote products derived
|
* contributors may be used to endorse or promote products derived
|
||||||
* from this software without specific prior written permission.
|
* from this software without specific prior written permission.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef _NET_SIXLOWPAN_SIXLOWPAN_INTERNAL_H
|
#ifndef _NET_SIXLOWPAN_SIXLOWPAN_INTERNAL_H
|
||||||
|
@ -194,8 +196,8 @@ struct ieee802_txmetadata_s
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* This structure holds the packet metadata as a union when multiple different
|
/* This structure holds the packet metadata as a union when multiple
|
||||||
* radio type are supported.
|
* different radio types are supported.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
union sixlowpan_metadata_u
|
union sixlowpan_metadata_u
|
||||||
|
@ -251,9 +253,9 @@ struct iob_s; /* Forward reference */
|
||||||
* Name: sixlowpan_send
|
* Name: sixlowpan_send
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Process an outgoing UDP or ICMPv6 packet. Takes an IP packet and formats
|
* Process an outgoing UDP or ICMPv6 packet. Takes an IP packet and
|
||||||
* it to be sent on an 802.15.4 network using 6lowpan. Called from common
|
* formats it to be sent on an 802.15.4 network using 6lowpan. Called
|
||||||
* UDP/ICMPv6 send logic.
|
* from common UDP/ICMPv6 send logic.
|
||||||
*
|
*
|
||||||
* The payload data is in the caller 'buf' and is of length 'buflen'.
|
* The payload data is in the caller 'buf' and is of length 'buflen'.
|
||||||
* Compressed headers will be added and if necessary the packet is
|
* Compressed headers will be added and if necessary the packet is
|
||||||
|
@ -398,12 +400,12 @@ int sixlowpan_queue_frames(FAR struct radio_driver_s *radio,
|
||||||
* Name: sixlowpan_hc06_initialize
|
* Name: sixlowpan_hc06_initialize
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* sixlowpan_hc06_initialize() is called during OS initialization at power-up
|
* sixlowpan_hc06_initialize() is called during OS initialization at
|
||||||
* reset. It is called from the common sixlowpan_initialize() function.
|
* power-up reset. It is called from the common sixlowpan_initialize()
|
||||||
* sixlowpan_hc06_initialize() configures HC06 networking data structures.
|
* function. sixlowpan_hc06_initialize() configures HC06 networking data
|
||||||
* It is called prior to platform-specific driver initialization so that
|
* structures. It is called prior to platform-specific driver
|
||||||
* the 6LoWPAN networking subsystem is prepared to deal with network
|
* initialization so that the 6LoWPAN networking subsystem is prepared to
|
||||||
* driver initialization actions.
|
* deal with network driver initialization actions.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* None
|
* None
|
||||||
|
@ -571,10 +573,10 @@ int sixlowpan_uncompresshdr_hc1(FAR struct radio_driver_s *radio,
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* sixlowpan_nexthopaddr(): If the destination is on-link, extract the
|
* sixlowpan_nexthopaddr(): If the destination is on-link, extract the
|
||||||
* IEEE 802.15.14 destination address from the destination IP address. If the
|
* IEEE 802.15.14 destination address from the destination IP address. If
|
||||||
* destination is not reachable directly, use the routing table (if available)
|
* the destination is not reachable directly, use the routing table (if
|
||||||
* or fall back to the default router IP address and use the router IP address
|
* available) or fall back to the default router IP address and use the
|
||||||
* to derive the IEEE 802.15.4 MAC address.
|
* router IP address to derive the IEEE 802.15.4 MAC address.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
@ -601,15 +603,17 @@ int sixlowpan_nexthopaddr(FAR struct radio_driver_s *radio,
|
||||||
* (eaddr).
|
* (eaddr).
|
||||||
*
|
*
|
||||||
* sixlowpan_islinklocal() and sixlowpan_ismacbased() will return true for
|
* sixlowpan_islinklocal() and sixlowpan_ismacbased() will return true for
|
||||||
* address created in this fashion. sixlowpan_destaddrfromip() is intended to
|
* address created in this fashion. sixlowpan_destaddrfromip() is
|
||||||
* handle a tagged address or any size. Local addresses are of a fixed but
|
* intended to handle a tagged address or any size. Local addresses are
|
||||||
* configurable size and sixlowpan_isaddrbased() is for use with such local
|
* of a fixed but configurable size and sixlowpan_isaddrbased() is for use
|
||||||
* addresses.
|
* with such local addresses.
|
||||||
*
|
*
|
||||||
* 128 112 96 80 64 48 32 16
|
* 128 112 96 80 64 48 32 16
|
||||||
* ---- ---- ---- ---- ---- ---- ---- ----
|
* ---- ---- ---- ---- ---- ---- ---- ----
|
||||||
* fe80 0000 0000 0000 0000 00ff fe00 xxxx 2-byte short address IEEE 48-bit MAC
|
* fe80 0000 0000 0000 0000 00ff fe00 xxxx 2-byte short address IEEE
|
||||||
* fe80 0000 0000 0000 xxxx xxxx xxxx xxxx 8-byte extended address IEEE EUI-64
|
* 48-bit MAC
|
||||||
|
* fe80 0000 0000 0000 xxxx xxxx xxxx xxxx 8-byte extended address IEEE
|
||||||
|
* EUI-64
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
|
@ -61,13 +61,16 @@
|
||||||
|
|
||||||
struct sixlowpan_send_s
|
struct sixlowpan_send_s
|
||||||
{
|
{
|
||||||
FAR struct devif_callback_s *s_cb; /* Reference to callback instance */
|
FAR struct devif_callback_s *s_cb; /* Reference to callback
|
||||||
sem_t s_waitsem; /* Supports waiting for driver events */
|
* instance */
|
||||||
int s_result; /* The result of the transfer */
|
sem_t s_waitsem; /* Supports waiting for
|
||||||
FAR const struct ipv6_hdr_s *s_ipv6hdr; /* IPv6 header, followed by UDP or ICMP header. */
|
* driver events */
|
||||||
|
int s_result; /* The result of the transfer */
|
||||||
|
FAR const struct ipv6_hdr_s *s_ipv6hdr; /* IPv6 header, followed by
|
||||||
|
* UDP or ICMP header. */
|
||||||
FAR const struct netdev_varaddr_s *s_destmac; /* Destination MAC address */
|
FAR const struct netdev_varaddr_s *s_destmac; /* Destination MAC address */
|
||||||
FAR const void *s_buf; /* Data to send */
|
FAR const void *s_buf; /* Data to send */
|
||||||
size_t s_len; /* Length of data in buf */
|
size_t s_len; /* Length of data in buf */
|
||||||
};
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -169,9 +172,9 @@ end_wait:
|
||||||
* Name: sixlowpan_send
|
* Name: sixlowpan_send
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Process an outgoing UDP or ICMPv6 packet. Takes an IP packet and formats
|
* Process an outgoing UDP or ICMPv6 packet. Takes an IP packet and
|
||||||
* it to be sent on an 802.15.4 network using 6lowpan. Called from common
|
* formats it to be sent on an 802.15.4 network using 6lowpan. Called
|
||||||
* UDP/ICMPv6 send logic.
|
* from common UDP/ICMPv6 send logic.
|
||||||
*
|
*
|
||||||
* The payload data is in the caller 'buf' and is of length 'buflen'.
|
* The payload data is in the caller 'buf' and is of length 'buflen'.
|
||||||
* Compressed headers will be added and if necessary the packet is
|
* Compressed headers will be added and if necessary the packet is
|
||||||
|
|
|
@ -75,16 +75,18 @@
|
||||||
|
|
||||||
struct sixlowpan_send_s
|
struct sixlowpan_send_s
|
||||||
{
|
{
|
||||||
FAR struct socket *s_sock; /* Internal socket reference */
|
FAR struct socket *s_sock; /* Internal socket reference */
|
||||||
FAR struct devif_callback_s *s_cb; /* Reference to callback instance */
|
FAR struct devif_callback_s *s_cb; /* Reference to callback
|
||||||
sem_t s_waitsem; /* Supports waiting for driver events */
|
* instance */
|
||||||
int s_result; /* The result of the transfer */
|
sem_t s_waitsem; /* Supports waiting for
|
||||||
|
* driver events */
|
||||||
|
int s_result; /* The result of the transfer */
|
||||||
FAR const struct netdev_varaddr_s *s_destmac; /* Destination MAC address */
|
FAR const struct netdev_varaddr_s *s_destmac; /* Destination MAC address */
|
||||||
FAR const uint8_t *s_buf; /* Data to send */
|
FAR const uint8_t *s_buf; /* Data to send */
|
||||||
size_t s_buflen; /* Length of data in buf */
|
size_t s_buflen; /* Length of data in buf */
|
||||||
ssize_t s_sent; /* The number of bytes sent */
|
ssize_t s_sent; /* The number of bytes sent */
|
||||||
uint32_t s_isn; /* Initial sequence number */
|
uint32_t s_isn; /* Initial sequence number */
|
||||||
uint32_t s_acked; /* The number of bytes acked */
|
uint32_t s_acked; /* The number of bytes acked */
|
||||||
};
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -99,7 +101,8 @@ struct sixlowpan_send_s
|
||||||
* data payload as necessary.
|
* data payload as necessary.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* ipv6tcp - A reference to a structure containing the IPv6 and TCP headers.
|
* ipv6tcp - A reference to a structure containing the IPv6 and TCP
|
||||||
|
* headers.
|
||||||
* buf - The beginning of the payload data
|
* buf - The beginning of the payload data
|
||||||
* buflen - The length of the payload data.
|
* buflen - The length of the payload data.
|
||||||
*
|
*
|
||||||
|
@ -449,15 +452,17 @@ static uint16_t tcp_send_eventhandler(FAR struct net_driver_s *dev,
|
||||||
}
|
}
|
||||||
|
|
||||||
ninfo("s_buflen=%u s_sent=%u mss=%u winsize=%u sndlen=%d\n",
|
ninfo("s_buflen=%u s_sent=%u mss=%u winsize=%u sndlen=%d\n",
|
||||||
sinfo->s_buflen, sinfo->s_sent, conn->mss, conn->winsize, sndlen);
|
sinfo->s_buflen, sinfo->s_sent, conn->mss, conn->winsize,
|
||||||
|
sndlen);
|
||||||
|
|
||||||
if (sndlen > 0)
|
if (sndlen > 0)
|
||||||
{
|
{
|
||||||
/* Set the sequence number for this packet. NOTE: The network updates
|
/* Set the sequence number for this packet. NOTE: The network
|
||||||
* sndseq on receipt of ACK *before* this function is called. In that
|
* updates sndseq on receipt of ACK *before* this function is
|
||||||
* case sndseq will point to the next unacknowledged byte (which might
|
* called. In that case sndseq will point to the next
|
||||||
* have already been sent). We will overwrite the value of sndseq
|
* unacknowledged byte (which might have already been sent). We
|
||||||
* here before the packet is sent.
|
* will overwrite the value of sndseq here before the packet is
|
||||||
|
* sent.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
seqno = sinfo->s_sent + sinfo->s_isn;
|
seqno = sinfo->s_sent + sinfo->s_isn;
|
||||||
|
@ -493,8 +498,8 @@ static uint16_t tcp_send_eventhandler(FAR struct net_driver_s *dev,
|
||||||
/* Increment the count of bytes sent, the number of unacked bytes,
|
/* Increment the count of bytes sent, the number of unacked bytes,
|
||||||
* and the total count of TCP packets sent.
|
* and the total count of TCP packets sent.
|
||||||
*
|
*
|
||||||
* NOTE: tcp_appsend() normally increments conn->tx_unacked based on
|
* NOTE: tcp_appsend() normally increments conn->tx_unacked based
|
||||||
* the value of dev->d_sndlen. However, dev->d_len is always
|
* on the value of dev->d_sndlen. However, dev->d_len is always
|
||||||
* zero for 6LoWPAN since it does not send via the dev->d_buf
|
* zero for 6LoWPAN since it does not send via the dev->d_buf
|
||||||
* but, rather, uses a backdoor frame interface with the IEEE
|
* but, rather, uses a backdoor frame interface with the IEEE
|
||||||
* 802.15.4 MAC.
|
* 802.15.4 MAC.
|
||||||
|
@ -677,8 +682,8 @@ static int sixlowpan_send_packet(FAR struct socket *psock,
|
||||||
* Name: psock_6lowpan_tcp_send
|
* Name: psock_6lowpan_tcp_send
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* psock_6lowpan_tcp_send() call may be used only when the TCP socket is in a
|
* psock_6lowpan_tcp_send() call may be used only when the TCP socket is
|
||||||
* connected state (so that the intended recipient is known).
|
* in a connected state (so that the intended recipient is known).
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* psock - An instance of the internal socket structure.
|
* psock - An instance of the internal socket structure.
|
||||||
|
@ -889,7 +894,8 @@ void sixlowpan_tcp_send(FAR struct net_driver_s *dev,
|
||||||
* units of 32-bit words).
|
* units of 32-bit words).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
hdrlen = IPv6_HDRLEN + (((uint16_t)ipv6hdr->tcp.tcpoffset >> 4) << 2);
|
hdrlen = IPv6_HDRLEN +
|
||||||
|
(((uint16_t)ipv6hdr->tcp.tcpoffset >> 4) << 2);
|
||||||
|
|
||||||
/* Drop the packet if the buffer length is less than this. */
|
/* Drop the packet if the buffer length is less than this. */
|
||||||
|
|
||||||
|
|
|
@ -52,11 +52,12 @@
|
||||||
* Name: sixlowpan_udp_chksum
|
* Name: sixlowpan_udp_chksum
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Perform the checksum calcaultion over the IPv6, protocol headers, and
|
* Perform the checksum calculation over the IPv6, protocol headers, and
|
||||||
* data payload as necessary.
|
* data payload as necessary.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* ipv6udp - A reference to a structure containing the IPv6 and UDP headers.
|
* ipv6udp - A reference to a structure containing the IPv6 and UDP
|
||||||
|
* headers.
|
||||||
* buf - The beginning of the payload data
|
* buf - The beginning of the payload data
|
||||||
* buflen - The length of the payload data.
|
* buflen - The length of the payload data.
|
||||||
*
|
*
|
||||||
|
@ -238,7 +239,8 @@ ssize_t psock_6lowpan_udp_sendto(FAR struct socket *psock,
|
||||||
|
|
||||||
/* Copy the source and destination addresses */
|
/* Copy the source and destination addresses */
|
||||||
|
|
||||||
net_ipv6addr_hdrcopy(ipv6udp.ipv6.destipaddr, to6->sin6_addr.in6_u.u6_addr16);
|
net_ipv6addr_hdrcopy(ipv6udp.ipv6.destipaddr,
|
||||||
|
to6->sin6_addr.in6_u.u6_addr16);
|
||||||
if (!net_ipv6addr_cmp(conn->u.ipv6.laddr, g_ipv6_unspecaddr))
|
if (!net_ipv6addr_cmp(conn->u.ipv6.laddr, g_ipv6_unspecaddr))
|
||||||
{
|
{
|
||||||
net_ipv6addr_hdrcopy(ipv6udp.ipv6.srcipaddr, conn->u.ipv6.laddr);
|
net_ipv6addr_hdrcopy(ipv6udp.ipv6.srcipaddr, conn->u.ipv6.laddr);
|
||||||
|
@ -292,7 +294,8 @@ ssize_t psock_6lowpan_udp_sendto(FAR struct socket *psock,
|
||||||
|
|
||||||
ret = sixlowpan_send(dev, &conn->list,
|
ret = sixlowpan_send(dev, &conn->list,
|
||||||
(FAR const struct ipv6_hdr_s *)&ipv6udp,
|
(FAR const struct ipv6_hdr_s *)&ipv6udp,
|
||||||
buf, buflen, &destmac, _SO_TIMEOUT(psock->s_sndtimeo));
|
buf, buflen, &destmac,
|
||||||
|
_SO_TIMEOUT(psock->s_sndtimeo));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
nerr("ERROR: sixlowpan_send() failed: %d\n", ret);
|
nerr("ERROR: sixlowpan_send() failed: %d\n", ret);
|
||||||
|
|
Loading…
Reference in a new issue