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:
Gregory Nutt 2017-09-10 10:13:33 -06:00
parent 435dd39d4c
commit 334d1734dc
8 changed files with 61 additions and 10 deletions

View File

@ -2403,8 +2403,8 @@ static int spirit_properties(FAR struct radio_driver_s *netdev,
/* General */
properties->sp_addrlen = 1; /* Length of an address */
properties->sp_pktlen = CONFIG_SPIRIT_PKTLEN; /* Fixed packet length */
properties->sp_addrlen = 1; /* Length of an address */
properties->sp_framelen = CONFIG_SPIRIT_PKTLEN; /* Fixed packet length */
/* Multicast address */

View File

@ -59,7 +59,7 @@
struct radiodev_properties_s
{
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_bcast; /* Broadcast address */
#ifdef CONFIG_NET_STARPOINT

View File

@ -50,7 +50,7 @@
* -Add compression options to UDP, currently only supports
* both ports compressed or both ports elided
* -Verify TC/FL compression works
* -Add stateless multicast option
* -Add multicast support for M=1 and DAC=1
*/
/****************************************************************************

View File

@ -606,6 +606,23 @@ void sixlowpan_ipfromaddr(FAR const struct netdev_varaddr_s *addr,
bool sixlowpan_ismacbased(const net_ipv6addr_t ipaddr,
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
*

View File

@ -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
*

View File

@ -1005,8 +1005,8 @@ static int lo_properties(FAR struct radio_driver_s *netdev,
/* General */
properties->sp_addrlen = LO_ADDRSIZE; /* Length of an address */
properties->sp_pktlen = LO_FRAMELEN; /* Fixed frame length */
properties->sp_addrlen = LO_ADDRSIZE; /* Length of an address */
properties->sp_framelen = LO_FRAMELEN; /* Fixed frame length */
/* Multicast address (uses broadcast address)
*

View File

@ -1159,8 +1159,8 @@ static int macnet_properties(FAR struct radio_driver_s *netdev,
/* General */
properties->sp_addrlen = MACNET_ADDRSIZE; /* Length of an address */
properties->sp_pktlen = MACNET_FRAMELEN; /* Fixed frame length */
properties->sp_addrlen = MACNET_ADDRSIZE; /* Length of an address */
properties->sp_framelen = MACNET_FRAMELEN; /* Fixed frame length */
/* Multicast address (uses broadcast address)
*

View File

@ -961,8 +961,8 @@ static int lo_properties(FAR struct radio_driver_s *netdev,
/* General */
properties->sp_addrlen = CONFIG_PKTRADIO_ADDRLEN; /* Length of an address */
properties->sp_pktlen = CONFIG_NET_6LOWPAN_FRAMELEN; /* Fixed frame length */
properties->sp_addrlen = CONFIG_PKTRADIO_ADDRLEN; /* Length of an address */
properties->sp_framelen = CONFIG_NET_6LOWPAN_FRAMELEN; /* Fixed frame length */
/* Multicast address */