mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
ieee80154: A few changes (some just guesses) to get a clean compilation.
This commit is contained in:
@@ -95,6 +95,7 @@
|
|||||||
|
|
||||||
/* Frame Type */
|
/* Frame Type */
|
||||||
|
|
||||||
|
#define IEEE802154_FC1_FTYPE 0x03
|
||||||
#define IEEE802154_FRAME_BEACON 0x00
|
#define IEEE802154_FRAME_BEACON 0x00
|
||||||
#define IEEE802154_FRAME_DATA 0x01
|
#define IEEE802154_FRAME_DATA 0x01
|
||||||
#define IEEE802154_FRAME_ACK 0x02
|
#define IEEE802154_FRAME_ACK 0x02
|
||||||
@@ -469,12 +470,12 @@ struct ieee802154_macops_s
|
|||||||
/* Start association with coordinator */
|
/* Start association with coordinator */
|
||||||
|
|
||||||
CODE int (*req_associate)(FAR struct ieee802154_mac_s *mac,
|
CODE int (*req_associate)(FAR struct ieee802154_mac_s *mac,
|
||||||
FAR struct ieee802154_assoc_request_s *request);
|
uint16_t panid, FAR uint8_t *coordeadr);
|
||||||
|
|
||||||
/* Start disassociation with coordinator */
|
/* Start disassociation with coordinator */
|
||||||
|
|
||||||
CODE int (*req_disassociate)(FAR struct ieee802154_mac_s *mac,
|
CODE int (*req_disassociate)(FAR struct ieee802154_mac_s *mac,
|
||||||
FAR struct ieee802154_disassoc_request_s *request);
|
FAR uint8_t *eadr, uint8_t reason);
|
||||||
|
|
||||||
/* Read the PIB */
|
/* Read the PIB */
|
||||||
|
|
||||||
@@ -664,9 +665,15 @@ extern "C"
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
#if 0 /* REVISIT: This form is not currently used by the driver */
|
||||||
FAR struct ieee802154_mac_s *
|
FAR struct ieee802154_mac_s *
|
||||||
mac802154_register(FAR struct ieee802154_radio_s *radiodev,
|
mac802154_register(FAR struct ieee802154_radio_s *radiodev,
|
||||||
FAR struct ieee802154_maccb_s *callbacks);
|
FAR struct ieee802154_maccb_s *callbacks);
|
||||||
|
#else /* This is the form used by the driver */
|
||||||
|
FAR struct ieee802154_mac_s *
|
||||||
|
mac802154_register(FAR struct ieee802154_radio_s *radiodev,
|
||||||
|
unsigned int minor);
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -38,17 +38,19 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <assert.h>
|
|
||||||
#include <debug.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <assert.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include <nuttx/kmalloc.h>
|
||||||
#include <nuttx/wireless/ieee802154/ieee802154_mac.h>
|
#include <nuttx/wireless/ieee802154/ieee802154_mac.h>
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Private Types
|
* Private Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@@ -143,21 +145,21 @@ static int mac802154_rsporphan(FAR struct ieee802154_mac_s *mac,
|
|||||||
|
|
||||||
static const struct ieee802154_macops_s mac802154ops =
|
static const struct ieee802154_macops_s mac802154ops =
|
||||||
{
|
{
|
||||||
.req_data = mac802154_reqdata
|
.req_data = mac802154_reqdata,
|
||||||
.req_purge = mac802154_reqpurge
|
.req_purge = mac802154_reqpurge,
|
||||||
.req_associate = mac802154_reqassociate
|
.req_associate = mac802154_reqassociate,
|
||||||
.req_disassociate= mac802154_reqdisassociate
|
.req_disassociate = mac802154_reqdisassociate,
|
||||||
.req_get = mac802154_reqget
|
.req_get = mac802154_reqget,
|
||||||
.req_gts = mac802154_reqgts
|
.req_gts = mac802154_reqgts,
|
||||||
.req_reset = mac802154_reqreset
|
.req_reset = mac802154_reqreset,
|
||||||
.req_rxenable = mac802154_reqrxenable
|
.req_rxenable = mac802154_reqrxenable,
|
||||||
.req_scan = mac802154_reqscan
|
.req_scan = mac802154_reqscan,
|
||||||
.req_set = mac802154_reqset
|
.req_set = mac802154_reqset,
|
||||||
.req_start = mac802154_reqstart
|
.req_start = mac802154_reqstart,
|
||||||
.req_sync = mac802154_reqsync
|
.req_sync = mac802154_reqsync,
|
||||||
.req_poll = mac802154_reqpoll
|
.req_poll = mac802154_reqpoll,
|
||||||
.rsp_associate = mac802154_rspassociate
|
.rsp_associate = mac802154_rspassociate,
|
||||||
.rsp_orphan = mac802154_rsporphan
|
.rsp_orphan = mac802154_rsporphan,
|
||||||
};
|
};
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -192,12 +194,13 @@ static int mac802154_defaultmib(FAR struct ieee802154_privmac_s *priv)
|
|||||||
|
|
||||||
priv->macBeaconPayloadLength = 0;
|
priv->macBeaconPayloadLength = 0;
|
||||||
priv->macBSN = 0; /* Shall be random */
|
priv->macBSN = 0; /* Shall be random */
|
||||||
priv->macCoordExtendedAddress[8];
|
//priv->macCoordExtendedAddress[8];
|
||||||
priv->macCoordShortAddress = 0xffff;
|
priv->macCoordShortAddress = 0xffff;
|
||||||
priv->macDSN = 0; /* Shall be random */
|
priv->macDSN = 0; /* Shall be random */
|
||||||
priv->macPANId = 0xffff;
|
priv->macPANId = 0xffff;
|
||||||
priv->macShortAddress = 0xffff;
|
priv->macShortAddress = 0xffff;
|
||||||
priv->macTransactionPersistenceTime = 0x01f4;
|
priv->macTransactionPersistenceTime = 0x01f4;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* Security MIB */
|
/* Security MIB */
|
||||||
|
|
||||||
@@ -207,6 +210,8 @@ static int mac802154_defaultmib(FAR struct ieee802154_privmac_s *priv)
|
|||||||
priv->macDefaultSecurityMaterialLength = 0x15;
|
priv->macDefaultSecurityMaterialLength = 0x15;
|
||||||
priv->macSecurityMode = 0;
|
priv->macSecurityMode = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -274,8 +279,7 @@ static int mac802154_reqpurge(FAR struct ieee802154_mac_s *mac,
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int mac802154_reqassociate(FAR struct ieee802154_mac_s *mac,
|
static int mac802154_reqassociate(FAR struct ieee802154_mac_s *mac,
|
||||||
uint16_t panid,
|
uint16_t panid, FAR uint8_t *coordeadr)
|
||||||
uint8_t *coordeadr)
|
|
||||||
{
|
{
|
||||||
FAR struct ieee802154_privmac_s * priv = (FAR struct ieee802154_privmac_s *)mac;
|
FAR struct ieee802154_privmac_s * priv = (FAR struct ieee802154_privmac_s *)mac;
|
||||||
return -ENOTTY;
|
return -ENOTTY;
|
||||||
|
|||||||
Reference in New Issue
Block a user