Lines Matching +full:tp +full:- +full:link

5 	Written/copyright 1994-2001 by Donald Becker.
15 /* Understanding the PNIC_II - everything is this file is based
24 * -----
25 * Bit 24 - SCR
26 * Bit 23 - PCS
27 * Bit 22 - TTM (Trasmit Threshold Mode)
28 * Bit 18 - Port Select
29 * Bit 13 - Start - 1, Stop - 0 Transmissions
30 * Bit 11:10 - Loop Back Operation Mode
31 * Bit 9 - Full Duplex mode (Advertise 10BaseT-FD is CSR14<7> is set)
32 * Bit 1 - Start - 1, Stop - 0 Receive
36 * ------
37 * Bit 19 - PAUSE-Pause
38 * Bit 18 - Advertise T4
39 * Bit 17 - Advertise 100baseTx-FD
40 * Bit 16 - Advertise 100baseTx-HD
41 * Bit 12 - LTE - Link Test Enable
42 * Bit 7 - ANE - Auto Negotiate Enable
43 * Bit 6 - HDE - Advertise 10baseT-HD
44 * Bit 2 - Reset to Power down - kept as 1 for normal operation
45 * Bit 1 - Loop Back enable for 10baseT MCC
49 * ------
50 * Bit 25 - Partner can do T4
51 * Bit 24 - Partner can do 100baseTx-FD
52 * Bit 23 - Partner can do 100baseTx-HD
53 * Bit 22 - Partner can do 10baseT-FD
54 * Bit 21 - Partner can do 10baseT-HD
55 * Bit 15 - LPN is 1 if all above bits are valid other wise 0
56 * Bit 14:12 - autonegotiation state (write 001 to start autonegotiate)
57 * Bit 3 - Autopolarity state
58 * Bit 2 - LS10B - link state of 10baseT 0 - good, 1 - failed
59 * Bit 1 - LS100B - link state of 100baseT 0 - good, 1 - failed
63 *-------------------------
81 struct tulip_private *tp = from_timer(tp, t, timer); in pnic2_timer() local
82 struct net_device *dev = tp->dev; in pnic2_timer()
83 void __iomem *ioaddr = tp->base_addr; in pnic2_timer()
87 dev_info(&dev->dev, "PNIC2 negotiation status %08x\n", in pnic2_timer()
91 mod_timer(&tp->timer, RUN_AT(next_tick)); in pnic2_timer()
98 struct tulip_private *tp = netdev_priv(dev); in pnic2_start_nway() local
99 void __iomem *ioaddr = tp->base_addr; in pnic2_start_nway()
110 /* bit 17 - advetise 100baseTx-FD */ in pnic2_start_nway()
111 if (tp->sym_advertise & 0x0100) csr14 |= 0x00020000; in pnic2_start_nway()
113 /* bit 16 - advertise 100baseTx-HD */ in pnic2_start_nway()
114 if (tp->sym_advertise & 0x0080) csr14 |= 0x00010000; in pnic2_start_nway()
116 /* bit 6 - advertise 10baseT-HD */ in pnic2_start_nway()
117 if (tp->sym_advertise & 0x0020) csr14 |= 0x00000040; in pnic2_start_nway()
119 /* Now set bit 12 Link Test Enable, Bit 7 Autonegotiation Enable in pnic2_start_nway()
129 dev->if_port = 0; in pnic2_start_nway()
130 tp->nway = tp->mediasense = 1; in pnic2_start_nway()
131 tp->nwayset = tp->lpar = 0; in pnic2_start_nway()
135 tp->csr6 = ioread32(ioaddr + CSR6); in pnic2_start_nway()
137 netdev_dbg(dev, "On Entry to Nway, csr6=%08x\n", tp->csr6); in pnic2_start_nway()
142 tp->csr6 = tp->csr6 & 0xfe3bd1fd; in pnic2_start_nway()
145 /* advertise 10baseT-FD for the negotiation (bit 9) */ in pnic2_start_nway()
146 if (tp->sym_advertise & 0x0040) tp->csr6 |= 0x00000200; in pnic2_start_nway()
150 * and "Stop" - reset both Transmit (bit 13) and Receive (bit 1) in pnic2_start_nway()
152 tp->csr6 |= 0x01000000; in pnic2_start_nway()
154 iowrite32(tp->csr6, ioaddr + CSR6); in pnic2_start_nway()
172 struct tulip_private *tp = netdev_priv(dev); in pnic2_lnk_change() local
173 void __iomem *ioaddr = tp->base_addr; in pnic2_lnk_change()
180 dev_info(&dev->dev, in pnic2_lnk_change()
181 "PNIC2 link status interrupt %08x, CSR5 %x, %08x\n", in pnic2_lnk_change()
185 * check bits 14:12 for bit pattern 101 - all is good in pnic2_lnk_change()
187 if (tp->nway && !tp->nwayset) { in pnic2_lnk_change()
195 /* get the link partners reply and mask out all but in pnic2_lnk_change()
196 * bits 24-21 which show the partners capabilities in pnic2_lnk_change()
201 * 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD in pnic2_lnk_change()
204 int negotiated = ((csr12 >> 16) & 0x01E0) & tp->sym_advertise; in pnic2_lnk_change()
205 tp->lpar = (csr12 >> 16); in pnic2_lnk_change()
206 tp->nwayset = 1; in pnic2_lnk_change()
208 if (negotiated & 0x0100) dev->if_port = 5; in pnic2_lnk_change()
209 else if (negotiated & 0x0080) dev->if_port = 3; in pnic2_lnk_change()
210 else if (negotiated & 0x0040) dev->if_port = 4; in pnic2_lnk_change()
211 else if (negotiated & 0x0020) dev->if_port = 0; in pnic2_lnk_change()
214 dev_info(&dev->dev, in pnic2_lnk_change()
216 csr12, tp->sym_advertise); in pnic2_lnk_change()
217 tp->nwayset = 0; in pnic2_lnk_change()
218 /* so check if 100baseTx link state is okay */ in pnic2_lnk_change()
219 if ((csr12 & 2) == 0 && (tp->sym_advertise & 0x0180)) in pnic2_lnk_change()
220 dev->if_port = 3; in pnic2_lnk_change()
224 tp->full_duplex = 0; in pnic2_lnk_change()
225 if ((dev->if_port == 4) || (dev->if_port == 5)) in pnic2_lnk_change()
226 tp->full_duplex = 1; in pnic2_lnk_change()
229 if (tp->nwayset) in pnic2_lnk_change()
230 dev_info(&dev->dev, in pnic2_lnk_change()
231 "Switching to %s based on link negotiation %04x & %04x = %04x\n", in pnic2_lnk_change()
232 medianame[dev->if_port], in pnic2_lnk_change()
233 tp->sym_advertise, tp->lpar, in pnic2_lnk_change()
237 /* remember to turn off bit 7 - autonegotiate in pnic2_lnk_change()
253 tp->csr6 = (ioread32(ioaddr + CSR6) & 0xfe3bd1fd); in pnic2_lnk_change()
261 if (dev->if_port & 1) tp->csr6 |= 0x01840000; in pnic2_lnk_change()
262 else tp->csr6 |= 0x00400000; in pnic2_lnk_change()
265 if (tp->full_duplex) tp->csr6 |= 0x00000200; in pnic2_lnk_change()
271 tp->csr6, in pnic2_lnk_change()
278 tulip_start_rxtx(tp); in pnic2_lnk_change()
283 dev_info(&dev->dev, in pnic2_lnk_change()
284 "Autonegotiation failed, using %s, link beat status %04x\n", in pnic2_lnk_change()
285 medianame[dev->if_port], csr12); in pnic2_lnk_change()
287 /* remember to turn off bit 7 - autonegotiate in pnic2_lnk_change()
300 dev->if_port = 0; in pnic2_lnk_change()
301 tp->nway = 0; in pnic2_lnk_change()
302 tp->nwayset = 1; in pnic2_lnk_change()
304 /* set to 10baseTx-HD - see Data Port Selection in pnic2_lnk_change()
307 tp->csr6 = (ioread32(ioaddr + CSR6) & 0xfe3bd1fd); in pnic2_lnk_change()
308 tp->csr6 |= 0x00400000; in pnic2_lnk_change()
310 tulip_restart_rxtx(tp); in pnic2_lnk_change()
317 if ((tp->nwayset && (csr5 & 0x08000000) && in pnic2_lnk_change()
318 (dev->if_port == 3 || dev->if_port == 5) && in pnic2_lnk_change()
319 (csr12 & 2) == 2) || (tp->nway && (csr5 & (TPLnkFail)))) { in pnic2_lnk_change()
321 /* Link blew? Maybe restart NWay. */ in pnic2_lnk_change()
324 netdev_dbg(dev, "Ugh! Link blew?\n"); in pnic2_lnk_change()
326 del_timer_sync(&tp->timer); in pnic2_lnk_change()
328 tp->timer.expires = RUN_AT(3*HZ); in pnic2_lnk_change()
329 add_timer(&tp->timer); in pnic2_lnk_change()
335 if (dev->if_port == 3 || dev->if_port == 5) { in pnic2_lnk_change()
337 /* we are at 100mb and a potential link change occurred */ in pnic2_lnk_change()
340 dev_info(&dev->dev, "PNIC2 %s link beat %s\n", in pnic2_lnk_change()
341 medianame[dev->if_port], in pnic2_lnk_change()
344 /* check 100 link beat */ in pnic2_lnk_change()
346 tp->nway = 0; in pnic2_lnk_change()
347 tp->nwayset = 1; in pnic2_lnk_change()
350 if ((csr12 & 2) && ! tp->medialock) { in pnic2_lnk_change()
351 del_timer_sync(&tp->timer); in pnic2_lnk_change()
353 tp->timer.expires = RUN_AT(3*HZ); in pnic2_lnk_change()
354 add_timer(&tp->timer); in pnic2_lnk_change()
360 if (dev->if_port == 0 || dev->if_port == 4) { in pnic2_lnk_change()
362 /* we are at 10mb and a potential link change occurred */ in pnic2_lnk_change()
365 dev_info(&dev->dev, "PNIC2 %s link beat %s\n", in pnic2_lnk_change()
366 medianame[dev->if_port], in pnic2_lnk_change()
370 tp->nway = 0; in pnic2_lnk_change()
371 tp->nwayset = 1; in pnic2_lnk_change()
374 if ((csr12 & 4) && ! tp->medialock) { in pnic2_lnk_change()
375 del_timer_sync(&tp->timer); in pnic2_lnk_change()
377 tp->timer.expires = RUN_AT(3*HZ); in pnic2_lnk_change()
378 add_timer(&tp->timer); in pnic2_lnk_change()
386 dev_info(&dev->dev, "PNIC2 Link Change Default?\n"); in pnic2_lnk_change()
388 /* if all else fails default to trying 10baseT-HD */ in pnic2_lnk_change()
389 dev->if_port = 0; in pnic2_lnk_change()
395 /* set to 10baseTx-HD - see Data Port Selection in pnic2_lnk_change()
398 tp->csr6 = (ioread32(ioaddr + CSR6) & 0xfe3bd1fd); in pnic2_lnk_change()
399 tp->csr6 |= 0x00400000; in pnic2_lnk_change()
401 tulip_restart_rxtx(tp); in pnic2_lnk_change()