mirror of
https://github.com/apache/nuttx.git
synced 2025-12-12 22:05:54 +08:00
wireless: pktradio: nxstyle fixes
various nxstyle fixes to fix the CI complains. Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
committed by
Xiang Xiao
parent
e36d93f600
commit
de11caffba
@@ -91,7 +91,9 @@
|
|||||||
# error No support for CONFIG_PKTRADIO_ADDRLEN other than {1,2,8}
|
# error No support for CONFIG_PKTRADIO_ADDRLEN other than {1,2,8}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* TX poll delay = 1 seconds. CLK_TCK is the number of clock ticks per second */
|
/* TX poll delay = 1 seconds.
|
||||||
|
* CLK_TCK is the number of clock ticks per second
|
||||||
|
*/
|
||||||
|
|
||||||
#define LO_WDDELAY (1*CLK_TCK)
|
#define LO_WDDELAY (1*CLK_TCK)
|
||||||
|
|
||||||
@@ -194,10 +196,12 @@ static int lo_properties(FAR struct radio_driver_s *netdev,
|
|||||||
* Create a MAC-based IP address from the IEEE 802.15.14 short or extended
|
* Create a MAC-based IP address from the IEEE 802.15.14 short or extended
|
||||||
* address assigned to the node.
|
* address assigned to the node.
|
||||||
*
|
*
|
||||||
* 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
|
||||||
* fe80 0000 0000 0000 xxxx xxxx xxxx xxxx 8-byte extended address IEEE EUI-64
|
* short address IEEE 48-bit MAC
|
||||||
|
* fe80 0000 0000 0000 xxxx xxxx xxxx xxxx 8-byte
|
||||||
|
* extended address IEEE EUI-64
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -229,15 +233,20 @@ static void lo_addr2ip(FAR struct net_driver_s *dev)
|
|||||||
dev->d_ipv6addr[4] = 0;
|
dev->d_ipv6addr[4] = 0;
|
||||||
dev->d_ipv6addr[5] = HTONS(0x00ff);
|
dev->d_ipv6addr[5] = HTONS(0x00ff);
|
||||||
dev->d_ipv6addr[6] = HTONS(0xfe00);
|
dev->d_ipv6addr[6] = HTONS(0xfe00);
|
||||||
dev->d_ipv6addr[7] = (uint16_t)g_mac_addr[0] << 8 | (uint16_t)g_mac_addr[1];
|
dev->d_ipv6addr[7] = (uint16_t)g_mac_addr[0] << 8 |
|
||||||
|
(uint16_t)g_mac_addr[1];
|
||||||
|
|
||||||
#elif CONFIG_PKTRADIO_ADDRLEN == 8
|
#elif CONFIG_PKTRADIO_ADDRLEN == 8
|
||||||
/* Set the IP address based on the 8-byte address */
|
/* Set the IP address based on the 8-byte address */
|
||||||
|
|
||||||
dev->d_ipv6addr[4] = (uint16_t)g_mac_addr[0] << 8 | (uint16_t)g_mac_addr[1];
|
dev->d_ipv6addr[4] = (uint16_t)g_mac_addr[0] << 8 |
|
||||||
dev->d_ipv6addr[5] = (uint16_t)g_mac_addr[2] << 8 | (uint16_t)g_mac_addr[3];
|
(uint16_t)g_mac_addr[1];
|
||||||
dev->d_ipv6addr[6] = (uint16_t)g_mac_addr[4] << 8 | (uint16_t)g_mac_addr[5];
|
dev->d_ipv6addr[5] = (uint16_t)g_mac_addr[2] << 8 |
|
||||||
dev->d_ipv6addr[7] = (uint16_t)g_mac_addr[6] << 8 | (uint16_t)g_mac_addr[7];
|
(uint16_t)g_mac_addr[3];
|
||||||
|
dev->d_ipv6addr[6] = (uint16_t)g_mac_addr[4] << 8 |
|
||||||
|
(uint16_t)g_mac_addr[5];
|
||||||
|
dev->d_ipv6addr[7] = (uint16_t)g_mac_addr[6] << 8 |
|
||||||
|
(uint16_t)g_mac_addr[7];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -248,10 +257,12 @@ static void lo_addr2ip(FAR struct net_driver_s *dev)
|
|||||||
* Create a netmask of a MAC-based IP address which may be based on either
|
* Create a netmask of a MAC-based IP address which may be based on either
|
||||||
* the IEEE 802.15.14 short or extended address of the MAC.
|
* the IEEE 802.15.14 short or extended address of the MAC.
|
||||||
*
|
*
|
||||||
* 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
|
||||||
* fe80 0000 0000 0000 xxxx xxxx xxxx xxxx 8-byte extended address IEEE EUI-64
|
* short address IEEE 48-bit MAC
|
||||||
|
* fe80 0000 0000 0000 xxxx xxxx xxxx xxxx 8-byte
|
||||||
|
* extended address IEEE EUI-64
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -505,15 +516,15 @@ static int lo_ifup(FAR struct net_driver_s *dev)
|
|||||||
dev->d_ipv6addr[6], dev->d_ipv6addr[7]);
|
dev->d_ipv6addr[6], dev->d_ipv6addr[7]);
|
||||||
|
|
||||||
#if CONFIG_PKTRADIO_ADDRLEN == 1
|
#if CONFIG_PKTRADIO_ADDRLEN == 1
|
||||||
ninfo(" Node: %02x\n",
|
ninfo("Node: %02x\n",
|
||||||
dev->d_mac.radio.nv_addr[0]);
|
dev->d_mac.radio.nv_addr[0]);
|
||||||
|
|
||||||
#elif CONFIG_PKTRADIO_ADDRLEN == 2
|
#elif CONFIG_PKTRADIO_ADDRLEN == 2
|
||||||
ninfo(" Node: %02x:%02x\n",
|
ninfo("Node: %02x:%02x\n",
|
||||||
dev->d_mac.radio.nv_addr[0], dev->d_mac.radio.nv_addr[1]);
|
dev->d_mac.radio.nv_addr[0], dev->d_mac.radio.nv_addr[1]);
|
||||||
|
|
||||||
#elif CONFIG_PKTRADIO_ADDRLEN == 8
|
#elif CONFIG_PKTRADIO_ADDRLEN == 8
|
||||||
ninfo(" Node: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x PANID=%02x:%02x\n",
|
ninfo("Node: %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x PANID=%02x:%02x\n",
|
||||||
dev->d_mac.radio.nv_addr[0], dev->d_mac.radio.nv_addr[1],
|
dev->d_mac.radio.nv_addr[0], dev->d_mac.radio.nv_addr[1],
|
||||||
dev->d_mac.radio.nv_addr[2], dev->d_mac.radio.nv_addr[3],
|
dev->d_mac.radio.nv_addr[2], dev->d_mac.radio.nv_addr[3],
|
||||||
dev->d_mac.radio.nv_addr[4], dev->d_mac.radio.nv_addr[5],
|
dev->d_mac.radio.nv_addr[4], dev->d_mac.radio.nv_addr[5],
|
||||||
@@ -693,7 +704,8 @@ static int lo_addmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac)
|
|||||||
* Name: lo_rmmac
|
* Name: lo_rmmac
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* NuttX Callback: Remove the specified MAC address from the hardware multicast
|
* NuttX Callback:
|
||||||
|
* Remove the specified MAC address from the hardware multicast
|
||||||
* address filtering
|
* address filtering
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
@@ -913,7 +925,9 @@ static int lo_req_data(FAR struct radio_driver_s *netdev,
|
|||||||
DEBUGASSERT(iob->io_offset == MAC_HDRLEN);
|
DEBUGASSERT(iob->io_offset == MAC_HDRLEN);
|
||||||
memset(iob->io_data, 0, MAC_HDRLEN);
|
memset(iob->io_data, 0, MAC_HDRLEN);
|
||||||
|
|
||||||
/* Add the IOB to the tail of the queue of framelist to be looped back */
|
/* Add the IOB to the tail of the queue of framelist to be looped
|
||||||
|
* back
|
||||||
|
*/
|
||||||
|
|
||||||
if (priv->lo_tail == NULL)
|
if (priv->lo_tail == NULL)
|
||||||
{
|
{
|
||||||
@@ -1049,16 +1063,17 @@ int pktradio_loopback(void)
|
|||||||
priv->lo_polldog = wd_create(); /* Create periodic poll timer */
|
priv->lo_polldog = wd_create(); /* Create periodic poll timer */
|
||||||
|
|
||||||
#ifdef CONFIG_NET_6LOWPAN
|
#ifdef CONFIG_NET_6LOWPAN
|
||||||
/* Make sure the our single packet buffer is attached. We must do this before
|
/* Make sure the our single packet buffer is attached.
|
||||||
* registering the device since, once the device is registered, a packet may
|
* We must do this before registering the device since,
|
||||||
|
* once the device is registered, a packet may
|
||||||
* be attempted to be forwarded and require the buffer.
|
* be attempted to be forwarded and require the buffer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
priv->lo_radio.r_dev.d_buf = g_iobuffer.rb_buf;
|
priv->lo_radio.r_dev.d_buf = g_iobuffer.rb_buf;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Register the loopabck device with the OS so that socket IOCTLs can be
|
/* Register the loopabck device with the OS so that socket IOCTLs can
|
||||||
* performed.
|
* be performed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
netdev_register(&priv->lo_radio.r_dev, NET_LL_PKTRADIO);
|
netdev_register(&priv->lo_radio.r_dev, NET_LL_PKTRADIO);
|
||||||
|
|||||||
Reference in New Issue
Block a user