.. | .. |
---|
50 | 50 | |
---|
51 | 51 | */ |
---|
52 | 52 | |
---|
| 53 | +#include <linux/build_bug.h> |
---|
53 | 54 | #include <linux/module.h> |
---|
54 | 55 | #include <linux/kernel.h> |
---|
55 | 56 | #include <linux/jiffies.h> |
---|
.. | .. |
---|
112 | 113 | static void __NS8390_init(struct net_device *dev, int startp); |
---|
113 | 114 | |
---|
114 | 115 | static unsigned version_printed; |
---|
115 | | -static u32 msg_enable; |
---|
116 | | -module_param(msg_enable, uint, 0444); |
---|
| 116 | +static int msg_enable; |
---|
| 117 | +static const int default_msg_level = (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_RX_ERR | |
---|
| 118 | + NETIF_MSG_TX_ERR); |
---|
| 119 | +module_param(msg_enable, int, 0444); |
---|
117 | 120 | MODULE_PARM_DESC(msg_enable, "Debug message level (see linux/netdevice.h for bitmap)"); |
---|
118 | 121 | |
---|
119 | 122 | /* |
---|
.. | .. |
---|
251 | 254 | * completed (or failed) - i.e. never posted a Tx related interrupt. |
---|
252 | 255 | */ |
---|
253 | 256 | |
---|
254 | | -static void __ei_tx_timeout(struct net_device *dev) |
---|
| 257 | +static void __ei_tx_timeout(struct net_device *dev, unsigned int txqueue) |
---|
255 | 258 | { |
---|
256 | 259 | unsigned long e8390_base = dev->base_addr; |
---|
257 | 260 | struct ei_device *ei_local = netdev_priv(dev); |
---|
.. | .. |
---|
597 | 600 | ei_local->txing = 1; |
---|
598 | 601 | NS8390_trigger_send(dev, ei_local->tx2, ei_local->tx_start_page + 6); |
---|
599 | 602 | netif_trans_update(dev); |
---|
600 | | - ei_local->tx2 = -1, |
---|
| 603 | + ei_local->tx2 = -1; |
---|
601 | 604 | ei_local->lasttx = 2; |
---|
602 | | - } else |
---|
603 | | - ei_local->lasttx = 20, ei_local->txing = 0; |
---|
| 605 | + } else { |
---|
| 606 | + ei_local->lasttx = 20; |
---|
| 607 | + ei_local->txing = 0; |
---|
| 608 | + } |
---|
604 | 609 | } else if (ei_local->tx2 < 0) { |
---|
605 | 610 | if (ei_local->lasttx != 2 && ei_local->lasttx != -2) |
---|
606 | 611 | pr_err("%s: bogus last_tx_buffer %d, tx2=%d\n", |
---|
.. | .. |
---|
612 | 617 | netif_trans_update(dev); |
---|
613 | 618 | ei_local->tx1 = -1; |
---|
614 | 619 | ei_local->lasttx = 1; |
---|
615 | | - } else |
---|
616 | | - ei_local->lasttx = 10, ei_local->txing = 0; |
---|
| 620 | + } else { |
---|
| 621 | + ei_local->lasttx = 10; |
---|
| 622 | + ei_local->txing = 0; |
---|
| 623 | + } |
---|
617 | 624 | } /* else |
---|
618 | 625 | netdev_warn(dev, "unexpected TX-done interrupt, lasttx=%d\n", |
---|
619 | 626 | ei_local->lasttx); |
---|
.. | .. |
---|
969 | 976 | { |
---|
970 | 977 | struct ei_device *ei_local = netdev_priv(dev); |
---|
971 | 978 | |
---|
972 | | - if ((msg_enable & NETIF_MSG_DRV) && (version_printed++ == 0)) |
---|
973 | | - pr_info("%s", version); |
---|
974 | | - |
---|
975 | 979 | ether_setup(dev); |
---|
976 | 980 | |
---|
977 | 981 | spin_lock_init(&ei_local->page_lock); |
---|
978 | 982 | |
---|
979 | | - ei_local->msg_enable = msg_enable; |
---|
| 983 | + ei_local->msg_enable = netif_msg_init(msg_enable, default_msg_level); |
---|
| 984 | + |
---|
| 985 | + if (netif_msg_drv(ei_local) && (version_printed++ == 0)) |
---|
| 986 | + pr_info("%s", version); |
---|
980 | 987 | } |
---|
981 | 988 | |
---|
982 | 989 | /** |
---|
.. | .. |
---|
1014 | 1021 | ? (0x48 | ENDCFG_WTS | (ei_local->bigendian ? ENDCFG_BOS : 0)) |
---|
1015 | 1022 | : 0x48; |
---|
1016 | 1023 | |
---|
1017 | | - if (sizeof(struct e8390_pkt_hdr) != 4) |
---|
1018 | | - panic("8390.c: header struct mispacked\n"); |
---|
| 1024 | + BUILD_BUG_ON(sizeof(struct e8390_pkt_hdr) != 4); |
---|
1019 | 1025 | /* Follow National Semi's recommendations for initing the DP83902. */ |
---|
1020 | 1026 | ei_outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD); /* 0x21 */ |
---|
1021 | 1027 | ei_outb_p(endcfg, e8390_base + EN0_DCFG); /* 0x48 or 0x49 */ |
---|