enc28j60: Convert printk() to netdev_printk()
The debug prints of network operations will look better if network device name is printed. The benefit of that is a possibility to distinguish the actual hardware when more than one is installed on the system. Convert appropriate printk(KERN_DEBUG) to netdev_print(KERN_DEBUG, ndev). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
6eae14104f
commit
c93a0f2a7f
1 changed files with 27 additions and 24 deletions
|
@ -929,8 +929,8 @@ static void enc28j60_hw_rx(struct net_device *ndev)
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
if (netif_msg_rx_status(priv))
|
if (netif_msg_rx_status(priv))
|
||||||
printk(KERN_DEBUG DRV_NAME ": RX pk_addr:0x%04x\n",
|
netdev_printk(KERN_DEBUG, ndev, "RX pk_addr:0x%04x\n",
|
||||||
priv->next_pk_ptr);
|
priv->next_pk_ptr);
|
||||||
|
|
||||||
if (unlikely(priv->next_pk_ptr > RXEND_INIT)) {
|
if (unlikely(priv->next_pk_ptr > RXEND_INIT)) {
|
||||||
if (netif_msg_rx_err(priv))
|
if (netif_msg_rx_err(priv))
|
||||||
|
@ -1030,6 +1030,7 @@ static void enc28j60_hw_rx(struct net_device *ndev)
|
||||||
*/
|
*/
|
||||||
static int enc28j60_get_free_rxfifo(struct enc28j60_net *priv)
|
static int enc28j60_get_free_rxfifo(struct enc28j60_net *priv)
|
||||||
{
|
{
|
||||||
|
struct net_device *ndev = priv->netdev;
|
||||||
int epkcnt, erxst, erxnd, erxwr, erxrd;
|
int epkcnt, erxst, erxnd, erxwr, erxrd;
|
||||||
int free_space;
|
int free_space;
|
||||||
|
|
||||||
|
@ -1052,8 +1053,8 @@ static int enc28j60_get_free_rxfifo(struct enc28j60_net *priv)
|
||||||
}
|
}
|
||||||
mutex_unlock(&priv->lock);
|
mutex_unlock(&priv->lock);
|
||||||
if (netif_msg_rx_status(priv))
|
if (netif_msg_rx_status(priv))
|
||||||
printk(KERN_DEBUG DRV_NAME ": %s() free_space = %d\n",
|
netdev_printk(KERN_DEBUG, ndev, "%s() free_space = %d\n",
|
||||||
__func__, free_space);
|
__func__, free_space);
|
||||||
return free_space;
|
return free_space;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1120,13 +1121,14 @@ static int enc28j60_rx_interrupt(struct net_device *ndev)
|
||||||
|
|
||||||
pk_counter = locked_regb_read(priv, EPKTCNT);
|
pk_counter = locked_regb_read(priv, EPKTCNT);
|
||||||
if (pk_counter && netif_msg_intr(priv))
|
if (pk_counter && netif_msg_intr(priv))
|
||||||
printk(KERN_DEBUG DRV_NAME ": intRX, pk_cnt: %d\n", pk_counter);
|
netdev_printk(KERN_DEBUG, ndev, "intRX, pk_cnt: %d\n",
|
||||||
|
pk_counter);
|
||||||
if (pk_counter > priv->max_pk_counter) {
|
if (pk_counter > priv->max_pk_counter) {
|
||||||
/* update statistics */
|
/* update statistics */
|
||||||
priv->max_pk_counter = pk_counter;
|
priv->max_pk_counter = pk_counter;
|
||||||
if (netif_msg_rx_status(priv) && priv->max_pk_counter > 1)
|
if (netif_msg_rx_status(priv) && priv->max_pk_counter > 1)
|
||||||
printk(KERN_DEBUG DRV_NAME ": RX max_pk_cnt: %d\n",
|
netdev_printk(KERN_DEBUG, ndev, "RX max_pk_cnt: %d\n",
|
||||||
priv->max_pk_counter);
|
priv->max_pk_counter);
|
||||||
}
|
}
|
||||||
ret = pk_counter;
|
ret = pk_counter;
|
||||||
while (pk_counter-- > 0)
|
while (pk_counter-- > 0)
|
||||||
|
@ -1152,16 +1154,16 @@ static void enc28j60_irq_work_handler(struct work_struct *work)
|
||||||
if ((intflags & EIR_DMAIF) != 0) {
|
if ((intflags & EIR_DMAIF) != 0) {
|
||||||
loop++;
|
loop++;
|
||||||
if (netif_msg_intr(priv))
|
if (netif_msg_intr(priv))
|
||||||
printk(KERN_DEBUG DRV_NAME
|
netdev_printk(KERN_DEBUG, ndev, "intDMA(%d)\n",
|
||||||
": intDMA(%d)\n", loop);
|
loop);
|
||||||
locked_reg_bfclr(priv, EIR, EIR_DMAIF);
|
locked_reg_bfclr(priv, EIR, EIR_DMAIF);
|
||||||
}
|
}
|
||||||
/* LINK changed handler */
|
/* LINK changed handler */
|
||||||
if ((intflags & EIR_LINKIF) != 0) {
|
if ((intflags & EIR_LINKIF) != 0) {
|
||||||
loop++;
|
loop++;
|
||||||
if (netif_msg_intr(priv))
|
if (netif_msg_intr(priv))
|
||||||
printk(KERN_DEBUG DRV_NAME
|
netdev_printk(KERN_DEBUG, ndev, "intLINK(%d)\n",
|
||||||
": intLINK(%d)\n", loop);
|
loop);
|
||||||
enc28j60_check_link_status(ndev);
|
enc28j60_check_link_status(ndev);
|
||||||
/* read PHIR to clear the flag */
|
/* read PHIR to clear the flag */
|
||||||
enc28j60_phy_read(priv, PHIR);
|
enc28j60_phy_read(priv, PHIR);
|
||||||
|
@ -1172,8 +1174,8 @@ static void enc28j60_irq_work_handler(struct work_struct *work)
|
||||||
bool err = false;
|
bool err = false;
|
||||||
loop++;
|
loop++;
|
||||||
if (netif_msg_intr(priv))
|
if (netif_msg_intr(priv))
|
||||||
printk(KERN_DEBUG DRV_NAME
|
netdev_printk(KERN_DEBUG, ndev, "intTX(%d)\n",
|
||||||
": intTX(%d)\n", loop);
|
loop);
|
||||||
priv->tx_retry_count = 0;
|
priv->tx_retry_count = 0;
|
||||||
if (locked_regb_read(priv, ESTAT) & ESTAT_TXABRT) {
|
if (locked_regb_read(priv, ESTAT) & ESTAT_TXABRT) {
|
||||||
if (netif_msg_tx_err(priv))
|
if (netif_msg_tx_err(priv))
|
||||||
|
@ -1194,8 +1196,8 @@ static void enc28j60_irq_work_handler(struct work_struct *work)
|
||||||
|
|
||||||
loop++;
|
loop++;
|
||||||
if (netif_msg_intr(priv))
|
if (netif_msg_intr(priv))
|
||||||
printk(KERN_DEBUG DRV_NAME
|
netdev_printk(KERN_DEBUG, ndev, "intTXErr(%d)\n",
|
||||||
": intTXErr(%d)\n", loop);
|
loop);
|
||||||
locked_reg_bfclr(priv, ECON1, ECON1_TXRTS);
|
locked_reg_bfclr(priv, ECON1, ECON1_TXRTS);
|
||||||
enc28j60_read_tsv(priv, tsv);
|
enc28j60_read_tsv(priv, tsv);
|
||||||
if (netif_msg_tx_err(priv))
|
if (netif_msg_tx_err(priv))
|
||||||
|
@ -1209,9 +1211,9 @@ static void enc28j60_irq_work_handler(struct work_struct *work)
|
||||||
/* Transmit Late collision check for retransmit */
|
/* Transmit Late collision check for retransmit */
|
||||||
if (TSV_GETBIT(tsv, TSV_TXLATECOLLISION)) {
|
if (TSV_GETBIT(tsv, TSV_TXLATECOLLISION)) {
|
||||||
if (netif_msg_tx_err(priv))
|
if (netif_msg_tx_err(priv))
|
||||||
printk(KERN_DEBUG DRV_NAME
|
netdev_printk(KERN_DEBUG, ndev,
|
||||||
": LateCollision TXErr (%d)\n",
|
"LateCollision TXErr (%d)\n",
|
||||||
priv->tx_retry_count);
|
priv->tx_retry_count);
|
||||||
if (priv->tx_retry_count++ < MAX_TX_RETRYCOUNT)
|
if (priv->tx_retry_count++ < MAX_TX_RETRYCOUNT)
|
||||||
locked_reg_bfset(priv, ECON1,
|
locked_reg_bfset(priv, ECON1,
|
||||||
ECON1_TXRTS);
|
ECON1_TXRTS);
|
||||||
|
@ -1225,13 +1227,12 @@ static void enc28j60_irq_work_handler(struct work_struct *work)
|
||||||
if ((intflags & EIR_RXERIF) != 0) {
|
if ((intflags & EIR_RXERIF) != 0) {
|
||||||
loop++;
|
loop++;
|
||||||
if (netif_msg_intr(priv))
|
if (netif_msg_intr(priv))
|
||||||
printk(KERN_DEBUG DRV_NAME
|
netdev_printk(KERN_DEBUG, ndev, "intRXErr(%d)\n",
|
||||||
": intRXErr(%d)\n", loop);
|
loop);
|
||||||
/* Check free FIFO space to flag RX overrun */
|
/* Check free FIFO space to flag RX overrun */
|
||||||
if (enc28j60_get_free_rxfifo(priv) <= 0) {
|
if (enc28j60_get_free_rxfifo(priv) <= 0) {
|
||||||
if (netif_msg_rx_err(priv))
|
if (netif_msg_rx_err(priv))
|
||||||
printk(KERN_DEBUG DRV_NAME
|
netdev_printk(KERN_DEBUG, ndev, "RX Overrun\n");
|
||||||
": RX Overrun\n");
|
|
||||||
ndev->stats.rx_dropped++;
|
ndev->stats.rx_dropped++;
|
||||||
}
|
}
|
||||||
locked_reg_bfclr(priv, EIR, EIR_RXERIF);
|
locked_reg_bfclr(priv, EIR, EIR_RXERIF);
|
||||||
|
@ -1252,11 +1253,13 @@ static void enc28j60_irq_work_handler(struct work_struct *work)
|
||||||
*/
|
*/
|
||||||
static void enc28j60_hw_tx(struct enc28j60_net *priv)
|
static void enc28j60_hw_tx(struct enc28j60_net *priv)
|
||||||
{
|
{
|
||||||
|
struct net_device *ndev = priv->netdev;
|
||||||
|
|
||||||
BUG_ON(!priv->tx_skb);
|
BUG_ON(!priv->tx_skb);
|
||||||
|
|
||||||
if (netif_msg_tx_queued(priv))
|
if (netif_msg_tx_queued(priv))
|
||||||
printk(KERN_DEBUG DRV_NAME
|
netdev_printk(KERN_DEBUG, ndev, "Tx Packet Len:%d\n",
|
||||||
": Tx Packet Len:%d\n", priv->tx_skb->len);
|
priv->tx_skb->len);
|
||||||
|
|
||||||
if (netif_msg_pktdata(priv))
|
if (netif_msg_pktdata(priv))
|
||||||
dump_packet(__func__,
|
dump_packet(__func__,
|
||||||
|
|
Loading…
Add table
Reference in a new issue