This patch extends the concept of Linux 2.5's dev_* logging macros to support network devices. Analogous netdev_* macros are defined. This feature is part of an effort to simplify error-log analysis by programs (such as health/configuration monitors) and by ordinary people who need clearer error reporting. This is a modification of a proposal from earlier this month. The changes reflect suggestions and recent changes in the net-driver infrastructure: - With Steve Hemminger's creation of the "net" device class a few days ago, the network device's interface name is now sufficient to find the information about the underlying device in sysfs (even without running ethtool). So these macros no longer log the device's driver name and bus ID. - Several people have recommended that the netdev_* macros should support screening of messages using the NETIF_MSG_* message levels. In response, I've added an optional arg to the macros by which the caller can indicate under what circumstances the message is to be logged. MESSAGE-LEVEL SUPPORT Drivers that currently use the NETIF_MSG_* message levels to screen messages include a bitmap called msg_enable in their driver-private data. Then they do something like if (netif_msg_rx_err(privdata)) { printk(KERN_ERR "%s: No mem: dropped packet\n", netdev->name); } Using these new macros, this could be expressed as netdev_err(netdev, RX_ERR, "No mem: dropped packet\n"); To log a message unconditionally, omit the message-level arg or specify ALL: netdev_err(netdev,, "Fatal bus error...\n"); or netdev_err(netdev, ALL, "Fatal bus error...\n"); This feature requires the msg_enable bitmap to be moved to the net_device struct. (This also means that the ETHTOOL_GMSGLVL and ETHTOOL_SMSGLVL ioctl requests can be coded once rather than copied and pasted from driver to driver. This goes for 4 other ETHTOOL_* requests as well. Code for ethtool_common_request(), which implements these 6 requests, is available on request.) Jim Keniston IBM Linux Technology Center -----