drivers/net: Run all wireless drivers through tools/nxstyle, correcting as many complaints as possible.

This commit is contained in:
Gregory Nutt 2019-12-05 14:54:50 -06:00
parent 504b0e8b5b
commit 2a83c0808c
9 changed files with 46 additions and 32 deletions

View File

@ -77,6 +77,7 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* If processing is not done at the interrupt level, then work queue support
* is required.
*/
@ -317,7 +318,7 @@ union rx_desc_u
struct dm9x_driver_s
{
bool dm_bifup; /* true:ifup false:ifdown */
bool dm_b100M; /* true:speed == 100M; false:speed == 10M */
bool dm_b100m; /* true:speed == 100M; false:speed == 10M */
uint8_t dm_ntxpending; /* Count of packets pending transmission */
uint8_t ncrxpackets; /* Number of continuous rx packets */
WDOG_ID dm_txpoll; /* TX poll timer */
@ -728,7 +729,7 @@ static int dm9x_transmit(FAR struct dm9x_driver_s *priv)
* mode, that can be 2 packets, otherwise it is a single packet.
*/
if (priv->dm_ntxpending < 1 || (priv->dm_b100M && priv->dm_ntxpending < 2))
if (priv->dm_ntxpending < 1 || (priv->dm_b100m && priv->dm_ntxpending < 2))
{
/* Increment count of packets transmitted */
@ -838,7 +839,7 @@ static int dm9x_txpoll(FAR struct net_driver_s *dev)
* packet.
*/
if (priv->dm_ntxpending > 1 || !priv->dm_b100M)
if (priv->dm_ntxpending > 1 || !priv->dm_b100m)
{
/* Returning a non-zero value will terminate the poll operation */
@ -1184,19 +1185,20 @@ static void dm9x_interrupt_work(FAR void *arg)
if (dm9x_phyread(priv, 0) & 0x2000)
{
priv->dm_b100M = true;
priv->dm_b100m = true;
}
else
{
priv->dm_b100M = false;
priv->dm_b100m = false;
}
break;
}
up_mdelay(1);
}
nerr("ERROR: delay: %dmS speed: %s\n",
i, priv->dm_b100M ? "100M" : "10M");
i, priv->dm_b100m ? "100M" : "10M");
}
/* Check if we received an incoming packet */
@ -1410,7 +1412,7 @@ static void dm9x_poll_work(FAR void *arg)
* mode, that can be 2 packets, otherwise it is a single packet.
*/
if (priv->dm_ntxpending < 1 || (priv->dm_b100M && priv->dm_ntxpending < 2))
if (priv->dm_ntxpending < 1 || (priv->dm_b100m && priv->dm_ntxpending < 2))
{
/* If so, update TCP timing states and poll the network for new XMIT data */
@ -1528,7 +1530,7 @@ static int dm9x_ifup(FAR struct net_driver_s *dev)
/* Check link state and media speed (waiting up to 3s for link OK) */
priv->dm_b100M = false;
priv->dm_b100m = false;
for (i = 0; i < 3000; i++)
{
netstatus = getreg(DM9X_NETS);
@ -1540,15 +1542,17 @@ static int dm9x_ifup(FAR struct net_driver_s *dev)
netstatus = getreg(DM9X_NETS);
if ((netstatus & DM9X_NETS_SPEED) == 0)
{
priv->dm_b100M = true;
priv->dm_b100m = true;
}
break;
}
i++;
up_mdelay(1);
}
ninfo("delay: %dmS speed: %s\n", i, priv->dm_b100M ? "100M" : "10M");
ninfo("delay: %dmS speed: %s\n", i, priv->dm_b100m ? "100M" : "10M");
/* Set and activate a timer process */
@ -1636,13 +1640,12 @@ static void dm9x_txavail_work(FAR void *arg)
net_lock();
if (priv->dm_bifup)
{
/* Check if there is room in the DM90x0 to hold another packet. In 100M
* mode, that can be 2 packets, otherwise it is a single packet.
*/
if (priv->dm_ntxpending < 1 ||
(priv->dm_b100M && priv->dm_ntxpending < 2))
(priv->dm_b100m && priv->dm_ntxpending < 2))
{
/* If so, then poll the network for new XMIT data */
@ -1881,17 +1884,19 @@ static void dm9x_reset(FAR struct dm9x_driver_s *priv)
/* Wait up to 1 second for the link to be OK */
priv->dm_b100M = false;
priv->dm_b100m = false;
for (i = 0; i < 1000; i++)
{
if (dm9x_phyread(priv, 0x1) & 0x4)
{
if (dm9x_phyread(priv, 0) &0x2000)
if (dm9x_phyread(priv, 0) & 0x2000)
{
priv->dm_b100M = true;
priv->dm_b100m = true;
}
break;
}
up_mdelay(1);
}

View File

@ -962,7 +962,7 @@ static inline void enc_wrbuffer(FAR struct enc_driver_s *priv,
*/
SPI_SELECT(priv->spi, SPIDEV_ETHERNET(0), false);
enc_bmdump(ENC_WBM, buffer, buflen+1);
enc_bmdump(ENC_WBM, buffer, buflen + 1);
}
/****************************************************************************

View File

@ -529,7 +529,6 @@ static inline void enc_setethrst(FAR struct enc_driver_s *priv)
static void enc_setbank(FAR struct enc_driver_s *priv, uint8_t bank)
{
/* Check if a bank has to be set and if the bank setting has changed.
* For registers that are available on all banks, the bank command is set
* to 0.
@ -2737,10 +2736,10 @@ static int enc_reset(FAR struct enc_driver_s *priv)
return -ENODEV;
}
/**
* Wait at least 256 μs for the PHY registers and PHY status bits to become
/* Wait at least 256 μs for the PHY registers and PHY status bits to become
* available.
*/
up_udelay(256);
/* Initialize RX/TX buffers */

View File

@ -68,6 +68,7 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* If processing is not done at the interrupt level, then work queue support
* is required.
*/
@ -316,6 +317,7 @@ static int ftmac100_transmit(FAR struct ftmac100_driver_s *priv)
priv->tx_pending++;
/* Enable Tx polling */
/* FIXME: enable interrupts */
putreg32(1, &iobase->txpd);
@ -789,6 +791,7 @@ static void ftmac100_receive(FAR struct ftmac100_driver_s *priv)
}
}
#endif
priv->rx_pointer = (priv->rx_pointer + 1) &
(CONFIG_FTMAC100_RX_DESC - 1);
@ -1594,6 +1597,7 @@ int ftmac100_initialize(int intf)
/* Put the interface in the down state. This usually amounts to resetting
* the device and/or calling ftmac100_ifdown().
*/
ftmac100_reset(priv);
/* Read the MAC address from the hardware into priv->ft_dev.d_mac.ether.ether_addr_octet */

View File

@ -420,6 +420,7 @@ static int lan91c111_transmit(FAR struct net_driver_s *dev)
*
* If odd size then last byte is included in ctl word.
*/
pages = ((dev->d_len & ~1) + 6) >> 8;
while (1)
@ -536,6 +537,7 @@ static int lan91c111_txpoll(FAR struct net_driver_s *dev)
arp_out(dev);
}
#endif /* CONFIG_NET_IPv4 */
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv6(dev->d_flags))
{
@ -599,6 +601,7 @@ static void lan91c111_reply(FAR struct net_driver_s *dev)
arp_out(dev);
}
#endif
#ifdef CONFIG_NET_IPv6
if (IFF_IS_IPv6(dev->d_flags))
{

View File

@ -104,7 +104,7 @@
struct phy_notify_s
{
bool assigned;
char intf[CONFIG_PHY_NOTIFICATION_MAXINTFLEN+1];
char intf[CONFIG_PHY_NOTIFICATION_MAXINTFLEN + 1];
pid_t pid;
struct sigevent event;
struct sigwork_s work;

View File

@ -1194,7 +1194,8 @@ int skel_initialize(int intf)
* the device and/or calling skel_ifdown().
*/
/* Read the MAC address from the hardware into priv->sk_dev.d_mac.ether.ether_addr_octet
/* Read the MAC address from the hardware into
* priv->sk_dev.d_mac.ether.ether_addr_octet
* Applies only if the Ethernet MAC has its own internal address.
*/

View File

@ -631,7 +631,7 @@ static inline void slip_receive(FAR struct slip_driver_s *priv)
default:
{
if (priv->rxlen < CONFIG_NET_SLIP_PKTSIZE+2)
if (priv->rxlen < CONFIG_NET_SLIP_PKTSIZE + 2)
{
priv->rxbuf[priv->rxlen++] = ch;
}

View File

@ -518,6 +518,7 @@ static ssize_t telnet_receive(FAR struct telnet_dev_s *priv,
break;
case STATE_DONT:
/* Reply with a WONT */
telnet_sendopt(priv, TELNET_WONT, ch);
@ -554,6 +555,7 @@ static ssize_t telnet_receive(FAR struct telnet_dev_s *priv,
/* Handle NAWS sub-option negotiation */
case STATE_SB_NAWS:
/* Update cols / rows based on received byte count */
switch (priv->td_sb_count)