Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err()

This commit is contained in:
Gregory Nutt
2016-06-11 15:50:49 -06:00
parent e99301d7c2
commit a1469a3e95
1091 changed files with 5971 additions and 5966 deletions
+2 -2
View File
@@ -704,7 +704,7 @@ static int cs89x0_interrupt(int irq, FAR void *context)
case ISQ_BUFEVENT:
if ((isq & ISQ_BUFEVENT_TXUNDERRUN) != 0)
{
ndbg("Transmit underrun\n");
nerr("Transmit underrun\n");
#ifdef CONFIG_CS89x0_XMITEARLY
cd89x0->cs_txunderrun++;
if (cd89x0->cs_txunderrun == 3)
@@ -819,7 +819,7 @@ static int cs89x0_ifup(struct net_driver_s *dev)
{
struct cs89x0_driver_s *cs89x0 = (struct cs89x0_driver_s *)dev->d_private;
ndbg("Bringing up: %d.%d.%d.%d\n",
nerr("Bringing up: %d.%d.%d.%d\n",
dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff,
(dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24);
+14 -14
View File
@@ -865,7 +865,7 @@ static void dm9x_receive(FAR struct dm9x_driver_s *dm9x)
{
/* Bad RX packet... update statistics */
ndbg("Received packet with errors: %02x\n", rx.desc.rx_status);
nerr("Received packet with errors: %02x\n", rx.desc.rx_status);
NETDEV_RXERRORS(&dm9x->dm_dev);
/* Drop this packet and continue to check the next packet */
@@ -877,7 +877,7 @@ static void dm9x_receive(FAR struct dm9x_driver_s *dm9x)
else if (rx.desc.rx_len < ETH_HDRLEN || rx.desc.rx_len > (CONFIG_NET_ETH_MTU + 2))
{
ndbg("RX length error\n");
nerr("RX length error\n");
NETDEV_RXERRORS(&dm9x->dm_dev);
/* Drop this packet and continue to check the next packet */
@@ -1042,7 +1042,7 @@ static void dm9x_txdone(struct dm9x_driver_s *dm9x)
}
else
{
ndbg("Bad TX count (TX1END)\n");
nerr("Bad TX count (TX1END)\n");
}
}
@@ -1054,7 +1054,7 @@ static void dm9x_txdone(struct dm9x_driver_s *dm9x)
}
else
{
ndbg("Bad TX count (TX2END)\n");
nerr("Bad TX count (TX2END)\n");
}
}
@@ -1144,7 +1144,7 @@ static int dm9x_interrupt(int irq, FAR void *context)
}
up_mdelay(1);
}
ndbg("delay: %dmS speed: %s\n", i, dm9x->dm_b100M ? "100M" : "10M");
nerr("delay: %dmS speed: %s\n", i, dm9x->dm_b100M ? "100M" : "10M");
}
/* Check if we received an incoming packet */
@@ -1206,16 +1206,16 @@ static void dm9x_txtimeout(int argc, uint32_t arg, ...)
{
struct dm9x_driver_s *dm9x = (struct dm9x_driver_s *)arg;
ndbg("TX timeout\n");
nerr("TX timeout\n");
/* Increment statistics and dump debug info */
NETDEV_TXTIMEOUTS(dm9x->dm_dev);
ndbg(" TX packet count: %d\n", dm9x->dm_ntxpending);
ndbg(" TX read pointer address: 0x%02x:%02x\n",
nerr(" TX packet count: %d\n", dm9x->dm_ntxpending);
nerr(" TX read pointer address: 0x%02x:%02x\n",
getreg(DM9X_TRPAH), getreg(DM9X_TRPAL));
ndbg(" Memory data write address: 0x%02x:%02x (DM9010)\n",
nerr(" Memory data write address: 0x%02x:%02x (DM9010)\n",
getreg(DM9X_MDWAH), getreg(DM9X_MDWAL));
/* Then reset the DM90x0 */
@@ -1342,7 +1342,7 @@ static int dm9x_ifup(struct net_driver_s *dev)
uint8_t netstatus;
int i;
ndbg("Bringing up: %d.%d.%d.%d\n",
nerr("Bringing up: %d.%d.%d.%d\n",
dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff,
(dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24);
@@ -1372,7 +1372,7 @@ static int dm9x_ifup(struct net_driver_s *dev)
up_mdelay(1);
}
ndbg("delay: %dmS speed: %s\n", i, dm9x->dm_b100M ? "100M" : "10M");
nerr("delay: %dmS speed: %s\n", i, dm9x->dm_b100M ? "100M" : "10M");
/* Set and activate a timer process */
@@ -1407,7 +1407,7 @@ static int dm9x_ifdown(struct net_driver_s *dev)
struct dm9x_driver_s *dm9x = (struct dm9x_driver_s *)dev->d_private;
irqstate_t flags;
ndbg("Stopping\n");
nerr("Stopping\n");
/* Disable the DM9X interrupt */
@@ -1456,7 +1456,7 @@ static int dm9x_txavail(struct net_driver_s *dev)
struct dm9x_driver_s *dm9x = (struct dm9x_driver_s *)dev->d_private;
irqstate_t flags;
ndbg("Polling\n");
nerr("Polling\n");
flags = enter_critical_section();
/* Ignore the notification if the interface is not yet up */
@@ -1557,7 +1557,7 @@ static int dm9x_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac)
static void dm9x_bringup(struct dm9x_driver_s *dm9x)
{
ndbg("Initializing\n");
nerr("Initializing\n");
/* Set the internal PHY power-on, GPIOs normal, and wait 2ms */
+1 -1
View File
@@ -799,7 +799,7 @@ static int e1000_ifup(struct net_driver_s *dev)
{
struct e1000_dev *e1000 = (struct e1000_dev *)dev->d_private;
ndbg("Bringing up: %d.%d.%d.%d\n",
nerr("Bringing up: %d.%d.%d.%d\n",
dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff,
(dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24);
+3 -3
View File
@@ -455,7 +455,7 @@ static void ftmac100_init(FAR struct ftmac100_driver_s *priv)
FAR unsigned char *kmem;
int i;
ndbg ("%s()\n", __func__);
nerr ("%s()\n", __func__);
/* Disable all interrupts */
@@ -1311,12 +1311,12 @@ static int ftmac100_ifup(struct net_driver_s *dev)
FAR struct ftmac100_driver_s *priv = (FAR struct ftmac100_driver_s *)dev->d_private;
#ifdef CONFIG_NET_IPv4
ndbg("Bringing up: %d.%d.%d.%d\n",
nerr("Bringing up: %d.%d.%d.%d\n",
dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff,
(dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24);
#endif
#ifdef CONFIG_NET_IPv6
ndbg("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
nerr("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
dev->d_ipv6addr[0], dev->d_ipv6addr[1], dev->d_ipv6addr[2],
dev->d_ipv6addr[3], dev->d_ipv6addr[4], dev->d_ipv6addr[5],
dev->d_ipv6addr[6], dev->d_ipv6addr[7]);
+3 -3
View File
@@ -203,7 +203,7 @@ static int lo_txpoll(FAR struct net_driver_s *dev)
else
#endif
{
ndbg("WARNING: Unrecognized packet type dropped: %02x\n", IPv4BUF->vhl);
nerr("WARNING: Unrecognized packet type dropped: %02x\n", IPv4BUF->vhl);
NETDEV_RXDROPPED(&priv->lo_dev);
priv->lo_dev.d_len = 0;
}
@@ -323,12 +323,12 @@ static int lo_ifup(FAR struct net_driver_s *dev)
FAR struct lo_driver_s *priv = (FAR struct lo_driver_s *)dev->d_private;
#ifdef CONFIG_NET_IPv4
ndbg("Bringing up: %d.%d.%d.%d\n",
nerr("Bringing up: %d.%d.%d.%d\n",
dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff,
(dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24);
#endif
#ifdef CONFIG_NET_IPv6
ndbg("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
nerr("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
dev->d_ipv6addr[0], dev->d_ipv6addr[1], dev->d_ipv6addr[2],
dev->d_ipv6addr[3], dev->d_ipv6addr[4], dev->d_ipv6addr[5],
dev->d_ipv6addr[6], dev->d_ipv6addr[7]);
+8 -8
View File
@@ -82,10 +82,10 @@
*/
#ifdef CONFIG_NETDEV_PHY_DEBUG
# define phydbg dbg
# define phyerr err
# define phyllerr llerr
#else
# define phydbg(x...)
# define phyerr(x...)
# define phyllerr(x...)
#endif
@@ -208,14 +208,14 @@ static FAR struct phy_notify_s *phy_find_unassigned(void)
/* Return the client entry assigned to the caller */
phy_semgive();
phydbg("Returning client %d\n", i);
phyerr("Returning client %d\n", i);
return client;
}
}
/* Ooops... too many */
ndbg("ERROR: No free client entries\n");
nerr("ERROR: No free client entries\n");
phy_semgive();
return NULL;
}
@@ -243,7 +243,7 @@ static FAR struct phy_notify_s *phy_find_assigned(FAR const char *intf,
/* Return the matching client entry to the caller */
phy_semgive();
phydbg("Returning client %d\n", i);
phyerr("Returning client %d\n", i);
return client;
}
}
@@ -367,7 +367,7 @@ int phy_notify_subscribe(FAR const char *intf, pid_t pid, int signo,
if (pid == 0)
{
pid = getpid();
phydbg("Actual PID=%d\n", pid);
phyerr("Actual PID=%d\n", pid);
}
/* Check if this client already exists */
@@ -387,7 +387,7 @@ int phy_notify_subscribe(FAR const char *intf, pid_t pid, int signo,
client = phy_find_unassigned();
if (!client)
{
ndbg("ERROR: Failed to allocate a client entry\n");
nerr("ERROR: Failed to allocate a client entry\n");
return -ENOMEM;
}
@@ -446,7 +446,7 @@ int phy_notify_unsubscribe(FAR const char *intf, pid_t pid)
client = phy_find_assigned(intf, pid);
if (!client)
{
ndbg("ERROR: No such client\n");
nerr("ERROR: No such client\n");
return -ENOENT;
}
+2 -2
View File
@@ -855,12 +855,12 @@ static int skel_ifup(FAR struct net_driver_s *dev)
FAR struct skel_driver_s *priv = (FAR struct skel_driver_s *)dev->d_private;
#ifdef CONFIG_NET_IPv4
ndbg("Bringing up: %d.%d.%d.%d\n",
nerr("Bringing up: %d.%d.%d.%d\n",
dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff,
(dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24);
#endif
#ifdef CONFIG_NET_IPv6
ndbg("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
nerr("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
dev->d_ipv6addr[0], dev->d_ipv6addr[1], dev->d_ipv6addr[2],
dev->d_ipv6addr[3], dev->d_ipv6addr[4], dev->d_ipv6addr[5],
dev->d_ipv6addr[6], dev->d_ipv6addr[7]);
+7 -7
View File
@@ -438,7 +438,7 @@ static void slip_txtask(int argc, FAR char *argv[])
systime_t msec_now;
unsigned int hsec;
ndbg("index: %d\n", index);
nerr("index: %d\n", index);
DEBUGASSERT(index < CONFIG_NET_SLIP_NINTERFACES);
/* Get our private data structure instance and wake up the waiting
@@ -616,7 +616,7 @@ static inline void slip_receive(FAR struct slip_driver_s *priv)
break;
default:
ndbg("ERROR: Protocol violation: %02x\n", ch);
nerr("ERROR: Protocol violation: %02x\n", ch);
break;
}
@@ -661,7 +661,7 @@ static int slip_rxtask(int argc, FAR char *argv[])
net_lock_t flags;
int ch;
ndbg("index: %d\n", index);
nerr("index: %d\n", index);
DEBUGASSERT(index < CONFIG_NET_SLIP_NINTERFACES);
/* Get our private data structure instance and wake up the waiting
@@ -779,7 +779,7 @@ static int slip_ifup(FAR struct net_driver_s *dev)
{
FAR struct slip_driver_s *priv = (FAR struct slip_driver_s *)dev->d_private;
ndbg("Bringing up: %d.%d.%d.%d\n",
nerr("Bringing up: %d.%d.%d.%d\n",
dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff,
(dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24);
@@ -958,7 +958,7 @@ int slip_initialize(int intf, FAR const char *devname)
priv->fd = open(devname, O_RDWR, 0666);
if (priv->fd < 0)
{
ndbg("ERROR: Failed to open %s: %d\n", devname, errno);
nerr("ERROR: Failed to open %s: %d\n", devname, errno);
return -errno;
}
@@ -983,7 +983,7 @@ int slip_initialize(int intf, FAR const char *devname)
(FAR char * const *)argv);
if (priv->rxpid < 0)
{
ndbg("ERROR: Failed to start receiver task\n");
nerr("ERROR: Failed to start receiver task\n");
return -errno;
}
@@ -998,7 +998,7 @@ int slip_initialize(int intf, FAR const char *devname)
(FAR char * const *)argv);
if (priv->txpid < 0)
{
ndbg("ERROR: Failed to start receiver task\n");
nerr("ERROR: Failed to start receiver task\n");
return -errno;
}
+2 -2
View File
@@ -646,12 +646,12 @@ static int tun_ifup(struct net_driver_s *dev)
FAR struct tun_device_s *priv = (FAR struct tun_device_s *)dev->d_private;
#ifdef CONFIG_NET_IPv4
ndbg("Bringing up: %d.%d.%d.%d\n",
nerr("Bringing up: %d.%d.%d.%d\n",
dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff,
(dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24);
#endif
#ifdef CONFIG_NET_IPv6
ndbg("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
nerr("Bringing up: %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
dev->d_ipv6addr[0], dev->d_ipv6addr[1], dev->d_ipv6addr[2],
dev->d_ipv6addr[3], dev->d_ipv6addr[4], dev->d_ipv6addr[5],
dev->d_ipv6addr[6], dev->d_ipv6addr[7]);
+1 -1
View File
@@ -546,7 +546,7 @@ static int vnet_ifup(struct net_driver_s *dev)
{
FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private;
ndbg("Bringing up: %d.%d.%d.%d\n",
nerr("Bringing up: %d.%d.%d.%d\n",
dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff,
(dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24);