aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/8390/pcnet_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/8390/pcnet_cs.c')
-rw-r--r--drivers/net/ethernet/8390/pcnet_cs.c62
1 files changed, 34 insertions, 28 deletions
diff --git a/drivers/net/ethernet/8390/pcnet_cs.c b/drivers/net/ethernet/8390/pcnet_cs.c
index 46c5aadaca8e..eea33d667fb0 100644
--- a/drivers/net/ethernet/8390/pcnet_cs.c
+++ b/drivers/net/ethernet/8390/pcnet_cs.c
@@ -67,7 +67,7 @@
67#define PCNET_RDC_TIMEOUT (2*HZ/100) /* Max wait in jiffies for Tx RDC */ 67#define PCNET_RDC_TIMEOUT (2*HZ/100) /* Max wait in jiffies for Tx RDC */
68 68
69static const char *if_names[] = { "auto", "10baseT", "10base2"}; 69static const char *if_names[] = { "auto", "10baseT", "10base2"};
70 70static u32 pcnet_msg_enable;
71 71
72/*====================================================================*/ 72/*====================================================================*/
73 73
@@ -558,6 +558,7 @@ static int pcnet_config(struct pcmcia_device *link)
558 int start_pg, stop_pg, cm_offset; 558 int start_pg, stop_pg, cm_offset;
559 int has_shmem = 0; 559 int has_shmem = 0;
560 hw_info_t *local_hw_info; 560 hw_info_t *local_hw_info;
561 struct ei_device *ei_local;
561 562
562 dev_dbg(&link->dev, "pcnet_config\n"); 563 dev_dbg(&link->dev, "pcnet_config\n");
563 564
@@ -607,6 +608,8 @@ static int pcnet_config(struct pcmcia_device *link)
607 mii_phy_probe(dev); 608 mii_phy_probe(dev);
608 609
609 SET_NETDEV_DEV(dev, &link->dev); 610 SET_NETDEV_DEV(dev, &link->dev);
611 ei_local = netdev_priv(dev);
612 ei_local->msg_enable = pcnet_msg_enable;
610 613
611 if (register_netdev(dev) != 0) { 614 if (register_netdev(dev) != 0) {
612 pr_notice("register_netdev() failed\n"); 615 pr_notice("register_netdev() failed\n");
@@ -616,7 +619,7 @@ static int pcnet_config(struct pcmcia_device *link)
616 if (info->flags & (IS_DL10019|IS_DL10022)) { 619 if (info->flags & (IS_DL10019|IS_DL10022)) {
617 u_char id = inb(dev->base_addr + 0x1a); 620 u_char id = inb(dev->base_addr + 0x1a);
618 netdev_info(dev, "NE2000 (DL100%d rev %02x): ", 621 netdev_info(dev, "NE2000 (DL100%d rev %02x): ",
619 (info->flags & IS_DL10022) ? 22 : 19, id); 622 (info->flags & IS_DL10022) ? 22 : 19, id);
620 if (info->pna_phy) 623 if (info->pna_phy)
621 pr_cont("PNA, "); 624 pr_cont("PNA, ");
622 } else { 625 } else {
@@ -1063,9 +1066,9 @@ static void ei_watchdog(u_long arg)
1063 if (info->phy_id == info->eth_phy) { 1066 if (info->phy_id == info->eth_phy) {
1064 if (p) 1067 if (p)
1065 netdev_info(dev, "autonegotiation complete: " 1068 netdev_info(dev, "autonegotiation complete: "
1066 "%sbaseT-%cD selected\n", 1069 "%sbaseT-%cD selected\n",
1067 ((p & 0x0180) ? "100" : "10"), 1070 ((p & 0x0180) ? "100" : "10"),
1068 ((p & 0x0140) ? 'F' : 'H')); 1071 ((p & 0x0140) ? 'F' : 'H'));
1069 else 1072 else
1070 netdev_info(dev, "link partner did not autonegotiate\n"); 1073 netdev_info(dev, "link partner did not autonegotiate\n");
1071 } 1074 }
@@ -1081,7 +1084,7 @@ static void ei_watchdog(u_long arg)
1081 mdio_write(mii_addr, info->phy_id, 0, 0x0400); 1084 mdio_write(mii_addr, info->phy_id, 0, 0x0400);
1082 info->phy_id ^= info->pna_phy ^ info->eth_phy; 1085 info->phy_id ^= info->pna_phy ^ info->eth_phy;
1083 netdev_info(dev, "switched to %s transceiver\n", 1086 netdev_info(dev, "switched to %s transceiver\n",
1084 (info->phy_id == info->eth_phy) ? "ethernet" : "PNA"); 1087 (info->phy_id == info->eth_phy) ? "ethernet" : "PNA");
1085 mdio_write(mii_addr, info->phy_id, 0, 1088 mdio_write(mii_addr, info->phy_id, 0,
1086 (info->phy_id == info->eth_phy) ? 0x1000 : 0); 1089 (info->phy_id == info->eth_phy) ? 0x1000 : 0);
1087 info->link_status = 0; 1090 info->link_status = 0;
@@ -1128,9 +1131,9 @@ static void dma_get_8390_hdr(struct net_device *dev,
1128 unsigned int nic_base = dev->base_addr; 1131 unsigned int nic_base = dev->base_addr;
1129 1132
1130 if (ei_status.dmaing) { 1133 if (ei_status.dmaing) {
1131 netdev_notice(dev, "DMAing conflict in dma_block_input." 1134 netdev_err(dev, "DMAing conflict in dma_block_input."
1132 "[DMAstat:%1x][irqlock:%1x]\n", 1135 "[DMAstat:%1x][irqlock:%1x]\n",
1133 ei_status.dmaing, ei_status.irqlock); 1136 ei_status.dmaing, ei_status.irqlock);
1134 return; 1137 return;
1135 } 1138 }
1136 1139
@@ -1159,13 +1162,14 @@ static void dma_block_input(struct net_device *dev, int count,
1159 unsigned int nic_base = dev->base_addr; 1162 unsigned int nic_base = dev->base_addr;
1160 int xfer_count = count; 1163 int xfer_count = count;
1161 char *buf = skb->data; 1164 char *buf = skb->data;
1165 struct ei_device *ei_local = netdev_priv(dev);
1162 1166
1163 if ((ei_debug > 4) && (count != 4)) 1167 if ((netif_msg_rx_status(ei_local)) && (count != 4))
1164 netdev_dbg(dev, "[bi=%d]\n", count+4); 1168 netdev_dbg(dev, "[bi=%d]\n", count+4);
1165 if (ei_status.dmaing) { 1169 if (ei_status.dmaing) {
1166 netdev_notice(dev, "DMAing conflict in dma_block_input." 1170 netdev_err(dev, "DMAing conflict in dma_block_input."
1167 "[DMAstat:%1x][irqlock:%1x]\n", 1171 "[DMAstat:%1x][irqlock:%1x]\n",
1168 ei_status.dmaing, ei_status.irqlock); 1172 ei_status.dmaing, ei_status.irqlock);
1169 return; 1173 return;
1170 } 1174 }
1171 ei_status.dmaing |= 0x01; 1175 ei_status.dmaing |= 0x01;
@@ -1183,7 +1187,8 @@ static void dma_block_input(struct net_device *dev, int count,
1183 /* This was for the ALPHA version only, but enough people have been 1187 /* This was for the ALPHA version only, but enough people have been
1184 encountering problems that it is still here. */ 1188 encountering problems that it is still here. */
1185#ifdef PCMCIA_DEBUG 1189#ifdef PCMCIA_DEBUG
1186 if (ei_debug > 4) { /* DMA termination address check... */ 1190 /* DMA termination address check... */
1191 if (netif_msg_rx_status(ei_local)) {
1187 int addr, tries = 20; 1192 int addr, tries = 20;
1188 do { 1193 do {
1189 /* DON'T check for 'inb_p(EN0_ISR) & ENISR_RDC' here 1194 /* DON'T check for 'inb_p(EN0_ISR) & ENISR_RDC' here
@@ -1196,8 +1201,8 @@ static void dma_block_input(struct net_device *dev, int count,
1196 } while (--tries > 0); 1201 } while (--tries > 0);
1197 if (tries <= 0) 1202 if (tries <= 0)
1198 netdev_notice(dev, "RX transfer address mismatch," 1203 netdev_notice(dev, "RX transfer address mismatch,"
1199 "%#4.4x (expected) vs. %#4.4x (actual).\n", 1204 "%#4.4x (expected) vs. %#4.4x (actual).\n",
1200 ring_offset + xfer_count, addr); 1205 ring_offset + xfer_count, addr);
1201 } 1206 }
1202#endif 1207#endif
1203 outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */ 1208 outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
@@ -1213,12 +1218,12 @@ static void dma_block_output(struct net_device *dev, int count,
1213 pcnet_dev_t *info = PRIV(dev); 1218 pcnet_dev_t *info = PRIV(dev);
1214#ifdef PCMCIA_DEBUG 1219#ifdef PCMCIA_DEBUG
1215 int retries = 0; 1220 int retries = 0;
1221 struct ei_device *ei_local = netdev_priv(dev);
1216#endif 1222#endif
1217 u_long dma_start; 1223 u_long dma_start;
1218 1224
1219#ifdef PCMCIA_DEBUG 1225#ifdef PCMCIA_DEBUG
1220 if (ei_debug > 4) 1226 netif_dbg(ei_local, tx_queued, dev, "[bo=%d]\n", count);
1221 netdev_dbg(dev, "[bo=%d]\n", count);
1222#endif 1227#endif
1223 1228
1224 /* Round the count up for word writes. Do we need to do this? 1229 /* Round the count up for word writes. Do we need to do this?
@@ -1227,9 +1232,9 @@ static void dma_block_output(struct net_device *dev, int count,
1227 if (count & 0x01) 1232 if (count & 0x01)
1228 count++; 1233 count++;
1229 if (ei_status.dmaing) { 1234 if (ei_status.dmaing) {
1230 netdev_notice(dev, "DMAing conflict in dma_block_output." 1235 netdev_err(dev, "DMAing conflict in dma_block_output."
1231 "[DMAstat:%1x][irqlock:%1x]\n", 1236 "[DMAstat:%1x][irqlock:%1x]\n",
1232 ei_status.dmaing, ei_status.irqlock); 1237 ei_status.dmaing, ei_status.irqlock);
1233 return; 1238 return;
1234 } 1239 }
1235 ei_status.dmaing |= 0x01; 1240 ei_status.dmaing |= 0x01;
@@ -1256,7 +1261,8 @@ static void dma_block_output(struct net_device *dev, int count,
1256#ifdef PCMCIA_DEBUG 1261#ifdef PCMCIA_DEBUG
1257 /* This was for the ALPHA version only, but enough people have been 1262 /* This was for the ALPHA version only, but enough people have been
1258 encountering problems that it is still here. */ 1263 encountering problems that it is still here. */
1259 if (ei_debug > 4) { /* DMA termination address check... */ 1264 /* DMA termination address check... */
1265 if (netif_msg_tx_queued(ei_local)) {
1260 int addr, tries = 20; 1266 int addr, tries = 20;
1261 do { 1267 do {
1262 int high = inb_p(nic_base + EN0_RSARHI); 1268 int high = inb_p(nic_base + EN0_RSARHI);
@@ -1267,8 +1273,8 @@ static void dma_block_output(struct net_device *dev, int count,
1267 } while (--tries > 0); 1273 } while (--tries > 0);
1268 if (tries <= 0) { 1274 if (tries <= 0) {
1269 netdev_notice(dev, "Tx packet transfer address mismatch," 1275 netdev_notice(dev, "Tx packet transfer address mismatch,"
1270 "%#4.4x (expected) vs. %#4.4x (actual).\n", 1276 "%#4.4x (expected) vs. %#4.4x (actual).\n",
1271 (start_page << 8) + count, addr); 1277 (start_page << 8) + count, addr);
1272 if (retries++ == 0) 1278 if (retries++ == 0)
1273 goto retry; 1279 goto retry;
1274 } 1280 }
@@ -1277,10 +1283,10 @@ static void dma_block_output(struct net_device *dev, int count,
1277 1283
1278 while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0) 1284 while ((inb_p(nic_base + EN0_ISR) & ENISR_RDC) == 0)
1279 if (time_after(jiffies, dma_start + PCNET_RDC_TIMEOUT)) { 1285 if (time_after(jiffies, dma_start + PCNET_RDC_TIMEOUT)) {
1280 netdev_notice(dev, "timeout waiting for Tx RDC.\n"); 1286 netdev_warn(dev, "timeout waiting for Tx RDC.\n");
1281 pcnet_reset_8390(dev); 1287 pcnet_reset_8390(dev);
1282 NS8390_init(dev, 1); 1288 NS8390_init(dev, 1);
1283 break; 1289 break;
1284 } 1290 }
1285 1291
1286 outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */ 1292 outb_p(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */