From de11caffba90f321b1fc63eb625adbf5475d62b7 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Thu, 23 Apr 2020 08:39:47 +0200 Subject: [PATCH] wireless: pktradio: nxstyle fixes various nxstyle fixes to fix the CI complains. Signed-off-by: Alin Jerpelea --- wireless/pktradio/pktradio_loopback.c | 61 +++++++++++++++++---------- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/wireless/pktradio/pktradio_loopback.c b/wireless/pktradio/pktradio_loopback.c index b91beca413..8681dffc0b 100644 --- a/wireless/pktradio/pktradio_loopback.c +++ b/wireless/pktradio/pktradio_loopback.c @@ -91,7 +91,9 @@ # error No support for CONFIG_PKTRADIO_ADDRLEN other than {1,2,8} #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) @@ -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 * address assigned to the node. * - * 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 xxxx xxxx xxxx xxxx 8-byte extended address IEEE EUI-64 + * 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 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[5] = HTONS(0x00ff); 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 /* 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[5] = (uint16_t)g_mac_addr[2] << 8 | (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]; + dev->d_ipv6addr[4] = (uint16_t)g_mac_addr[0] << 8 | + (uint16_t)g_mac_addr[1]; + dev->d_ipv6addr[5] = (uint16_t)g_mac_addr[2] << 8 | + (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 } @@ -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 * the IEEE 802.15.14 short or extended address of the MAC. * - * 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 xxxx xxxx xxxx xxxx 8-byte extended address IEEE EUI-64 + * 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 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]); #if CONFIG_PKTRADIO_ADDRLEN == 1 - ninfo(" Node: %02x\n", + ninfo("Node: %02x\n", dev->d_mac.radio.nv_addr[0]); #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]); #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[2], dev->d_mac.radio.nv_addr[3], 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 * * 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 * * Input Parameters: @@ -913,7 +925,9 @@ static int lo_req_data(FAR struct radio_driver_s *netdev, DEBUGASSERT(iob->io_offset == 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) { @@ -1049,16 +1063,17 @@ int pktradio_loopback(void) priv->lo_polldog = wd_create(); /* Create periodic poll timer */ #ifdef CONFIG_NET_6LOWPAN - /* Make sure the our single packet buffer is attached. We must do this before - * registering the device since, once the device is registered, a packet may + /* Make sure the our single packet buffer is attached. + * 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. */ priv->lo_radio.r_dev.d_buf = g_iobuffer.rb_buf; #endif - /* Register the loopabck device with the OS so that socket IOCTLs can be - * performed. + /* Register the loopabck device with the OS so that socket IOCTLs can + * be performed. */ netdev_register(&priv->lo_radio.r_dev, NET_LL_PKTRADIO);