mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
6LoWPAN/Radio: Rename radio property sp_pktlen to sp_framelen. Add 6LoWPAN utility to get the max frame length (not yet hooked in)
This commit is contained in:
@@ -2403,8 +2403,8 @@ static int spirit_properties(FAR struct radio_driver_s *netdev,
|
|||||||
|
|
||||||
/* General */
|
/* General */
|
||||||
|
|
||||||
properties->sp_addrlen = 1; /* Length of an address */
|
properties->sp_addrlen = 1; /* Length of an address */
|
||||||
properties->sp_pktlen = CONFIG_SPIRIT_PKTLEN; /* Fixed packet length */
|
properties->sp_framelen = CONFIG_SPIRIT_PKTLEN; /* Fixed packet length */
|
||||||
|
|
||||||
/* Multicast address */
|
/* Multicast address */
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
struct radiodev_properties_s
|
struct radiodev_properties_s
|
||||||
{
|
{
|
||||||
uint8_t sp_addrlen; /* Length of an address */
|
uint8_t sp_addrlen; /* Length of an address */
|
||||||
uint8_t sp_pktlen; /* Fixed packet/frame size (up to 255) */
|
uint8_t sp_framelen; /* Fixed packet/frame size (up to 255) */
|
||||||
struct netdev_varaddr_s sp_mcast; /* Multicast address */
|
struct netdev_varaddr_s sp_mcast; /* Multicast address */
|
||||||
struct netdev_varaddr_s sp_bcast; /* Broadcast address */
|
struct netdev_varaddr_s sp_bcast; /* Broadcast address */
|
||||||
#ifdef CONFIG_NET_STARPOINT
|
#ifdef CONFIG_NET_STARPOINT
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
* -Add compression options to UDP, currently only supports
|
* -Add compression options to UDP, currently only supports
|
||||||
* both ports compressed or both ports elided
|
* both ports compressed or both ports elided
|
||||||
* -Verify TC/FL compression works
|
* -Verify TC/FL compression works
|
||||||
* -Add stateless multicast option
|
* -Add multicast support for M=1 and DAC=1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
@@ -606,6 +606,23 @@ void sixlowpan_ipfromaddr(FAR const struct netdev_varaddr_s *addr,
|
|||||||
bool sixlowpan_ismacbased(const net_ipv6addr_t ipaddr,
|
bool sixlowpan_ismacbased(const net_ipv6addr_t ipaddr,
|
||||||
FAR const struct netdev_varaddr_s *addr);
|
FAR const struct netdev_varaddr_s *addr);
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: sixlowpan_radio_framelen
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Get the maximum frame length supported by radio network drvier.
|
||||||
|
*
|
||||||
|
* Input parameters:
|
||||||
|
* radio - Reference to a radio network driver state instance.
|
||||||
|
*
|
||||||
|
* Returned Value:
|
||||||
|
* A non-negative, maximum frame lengthis returned on success; A negated
|
||||||
|
* errno valueis returned on any failure.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
int sixlowpan_radio_framelen(FAR struct radio_driver_s *radio);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: sixlowpan_src_panid
|
* Name: sixlowpan_src_panid
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -508,6 +508,40 @@ bool sixlowpan_ismacbased(const net_ipv6addr_t ipaddr,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: sixlowpan_radio_framelen
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Get the maximum frame length supported by radio network drvier.
|
||||||
|
*
|
||||||
|
* Input parameters:
|
||||||
|
* radio - Reference to a radio network driver state instance.
|
||||||
|
*
|
||||||
|
* Returned Value:
|
||||||
|
* A non-negative, maximum frame lengthis returned on success; A negated
|
||||||
|
* errno valueis returned on any failure.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
int sixlowpan_radio_framelen(FAR struct radio_driver_s *radio)
|
||||||
|
{
|
||||||
|
struct radiodev_properties_s properties;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
/* Only the radio driver knows the correct max frame length supported by
|
||||||
|
* the radio.
|
||||||
|
*/
|
||||||
|
|
||||||
|
DEBUGASSERT(radio->r_properties != NULL);
|
||||||
|
ret = radio->r_properties(radio, &properties);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (int)properties.sp_framelen;
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: sixlowpan_src_panid
|
* Name: sixlowpan_src_panid
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1005,8 +1005,8 @@ static int lo_properties(FAR struct radio_driver_s *netdev,
|
|||||||
|
|
||||||
/* General */
|
/* General */
|
||||||
|
|
||||||
properties->sp_addrlen = LO_ADDRSIZE; /* Length of an address */
|
properties->sp_addrlen = LO_ADDRSIZE; /* Length of an address */
|
||||||
properties->sp_pktlen = LO_FRAMELEN; /* Fixed frame length */
|
properties->sp_framelen = LO_FRAMELEN; /* Fixed frame length */
|
||||||
|
|
||||||
/* Multicast address (uses broadcast address)
|
/* Multicast address (uses broadcast address)
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1159,8 +1159,8 @@ static int macnet_properties(FAR struct radio_driver_s *netdev,
|
|||||||
|
|
||||||
/* General */
|
/* General */
|
||||||
|
|
||||||
properties->sp_addrlen = MACNET_ADDRSIZE; /* Length of an address */
|
properties->sp_addrlen = MACNET_ADDRSIZE; /* Length of an address */
|
||||||
properties->sp_pktlen = MACNET_FRAMELEN; /* Fixed frame length */
|
properties->sp_framelen = MACNET_FRAMELEN; /* Fixed frame length */
|
||||||
|
|
||||||
/* Multicast address (uses broadcast address)
|
/* Multicast address (uses broadcast address)
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -961,8 +961,8 @@ static int lo_properties(FAR struct radio_driver_s *netdev,
|
|||||||
|
|
||||||
/* General */
|
/* General */
|
||||||
|
|
||||||
properties->sp_addrlen = CONFIG_PKTRADIO_ADDRLEN; /* Length of an address */
|
properties->sp_addrlen = CONFIG_PKTRADIO_ADDRLEN; /* Length of an address */
|
||||||
properties->sp_pktlen = CONFIG_NET_6LOWPAN_FRAMELEN; /* Fixed frame length */
|
properties->sp_framelen = CONFIG_NET_6LOWPAN_FRAMELEN; /* Fixed frame length */
|
||||||
|
|
||||||
/* Multicast address */
|
/* Multicast address */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user