Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tulip: fix 21142 with 10Mbps without negotiation

with current kernels, tulip 21142 ethernet controllers fail to connect
to a 10Mbps only (i.e. without negotiation-partner) network. It used
to work in 2.4 kernels. Fix that. Tested on a 21142 Rev 0x11.

Signed-off-by: Philippe De Muyter <phdm@macqel.be>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Philippe De Muyter and committed by
David S. Miller
f99ec064 c25b9abb

+19 -4
+19 -4
drivers/net/tulip/21142.c
··· 9 9 10 10 Please refer to Documentation/DocBook/tulip-user.{pdf,ps,html} 11 11 for more information on this driver. 12 + 13 + DC21143 manual "21143 PCI/CardBus 10/100Mb/s Ethernet LAN Controller 14 + Hardware Reference Manual" is currently available at : 15 + http://developer.intel.com/design/network/manuals/278074.htm 16 + 12 17 Please submit bugs to http://bugzilla.kernel.org/ . 13 18 */ 14 19 ··· 37 32 int csr12 = ioread32(ioaddr + CSR12); 38 33 int next_tick = 60*HZ; 39 34 int new_csr6 = 0; 35 + int csr14 = ioread32(ioaddr + CSR14); 40 36 37 + /* CSR12[LS10,LS100] are not reliable during autonegotiation */ 38 + if ((csr14 & 0x80) && (csr12 & 0x7000) != 0x5000) 39 + csr12 |= 6; 41 40 if (tulip_debug > 2) 42 41 printk(KERN_INFO"%s: 21143 negotiation status %8.8x, %s.\n", 43 42 dev->name, csr12, medianame[dev->if_port]); ··· 85 76 new_csr6 = 0x83860000; 86 77 dev->if_port = 3; 87 78 iowrite32(0, ioaddr + CSR13); 88 - iowrite32(0x0003FF7F, ioaddr + CSR14); 79 + iowrite32(0x0003FFFF, ioaddr + CSR14); 89 80 iowrite16(8, ioaddr + CSR15); 90 81 iowrite32(1, ioaddr + CSR13); 91 82 } ··· 141 132 struct tulip_private *tp = netdev_priv(dev); 142 133 void __iomem *ioaddr = tp->base_addr; 143 134 int csr12 = ioread32(ioaddr + CSR12); 135 + int csr14 = ioread32(ioaddr + CSR14); 144 136 137 + /* CSR12[LS10,LS100] are not reliable during autonegotiation */ 138 + if ((csr14 & 0x80) && (csr12 & 0x7000) != 0x5000) 139 + csr12 |= 6; 145 140 if (tulip_debug > 1) 146 141 printk(KERN_INFO"%s: 21143 link status interrupt %8.8x, CSR5 %x, " 147 - "%8.8x.\n", dev->name, csr12, csr5, ioread32(ioaddr + CSR14)); 142 + "%8.8x.\n", dev->name, csr12, csr5, csr14); 148 143 149 144 /* If NWay finished and we have a negotiated partner capability. */ 150 145 if (tp->nway && !tp->nwayset && (csr12 & 0x7000) == 0x5000) { ··· 156 143 int negotiated = tp->sym_advertise & (csr12 >> 16); 157 144 tp->lpar = csr12 >> 16; 158 145 tp->nwayset = 1; 159 - if (negotiated & 0x0100) dev->if_port = 5; 146 + /* If partner cannot negotiate, it is 10Mbps Half Duplex */ 147 + if (!(csr12 & 0x8000)) dev->if_port = 0; 148 + else if (negotiated & 0x0100) dev->if_port = 5; 160 149 else if (negotiated & 0x0080) dev->if_port = 3; 161 150 else if (negotiated & 0x0040) dev->if_port = 4; 162 151 else if (negotiated & 0x0020) dev->if_port = 0; ··· 229 214 tp->timer.expires = RUN_AT(3*HZ); 230 215 add_timer(&tp->timer); 231 216 } else if (dev->if_port == 5) 232 - iowrite32(ioread32(ioaddr + CSR14) & ~0x080, ioaddr + CSR14); 217 + iowrite32(csr14 & ~0x080, ioaddr + CSR14); 233 218 } else if (dev->if_port == 0 || dev->if_port == 4) { 234 219 if ((csr12 & 4) == 0) 235 220 printk(KERN_INFO"%s: 21143 10baseT link beat good.\n",