Lines Matching +full:tp +full:- +full:link
5 Written/copyright 1994-2001 by Donald Becker.
30 struct tulip_private *tp = in t21142_media_task() local
32 struct net_device *dev = tp->dev; in t21142_media_task()
33 void __iomem *ioaddr = tp->base_addr; in t21142_media_task()
43 dev_info(&dev->dev, "21143 negotiation status %08x, %s\n", in t21142_media_task()
44 csr12, medianame[dev->if_port]); in t21142_media_task()
45 if (tulip_media_cap[dev->if_port] & MediaIsMII) { in t21142_media_task()
53 } else if (tp->nwayset) { in t21142_media_task()
56 dev_info(&dev->dev, in t21142_media_task()
57 "Using NWay-set %s media, csr12 %08x\n", in t21142_media_task()
58 medianame[dev->if_port], csr12); in t21142_media_task()
59 } else if (tp->medialock) { in t21142_media_task()
61 } else if (dev->if_port == 3) { in t21142_media_task()
62 if (csr12 & 2) { /* No 100mbps link beat, revert to 10mbps. */ in t21142_media_task()
64 dev_info(&dev->dev, in t21142_media_task()
65 "No 21143 100baseTx link beat, %08x, trying NWay\n", in t21142_media_task()
73 dev_info(&dev->dev, in t21142_media_task()
76 if (!(csr12 & 4)) { /* 10mbps link beat good. */ in t21142_media_task()
78 dev->if_port = 0; in t21142_media_task()
81 iowrite16(t21142_csr15[dev->if_port], ioaddr + CSR15); in t21142_media_task()
82 iowrite32(t21142_csr13[dev->if_port], ioaddr + CSR13); in t21142_media_task()
84 /* Select 100mbps port to check for link beat. */ in t21142_media_task()
86 dev->if_port = 3; in t21142_media_task()
93 dev_info(&dev->dev, "Testing new 21143 media %s\n", in t21142_media_task()
94 medianame[dev->if_port]); in t21142_media_task()
95 if (new_csr6 != (tp->csr6 & ~0x00D5)) { in t21142_media_task()
96 tp->csr6 &= 0x00D5; in t21142_media_task()
97 tp->csr6 |= new_csr6; in t21142_media_task()
99 tulip_restart_rxtx(tp); in t21142_media_task()
107 mod_timer(&tp->timer, RUN_AT(next_tick)); in t21142_media_task()
113 struct tulip_private *tp = netdev_priv(dev); in t21142_start_nway() local
114 void __iomem *ioaddr = tp->base_addr; in t21142_start_nway()
115 int csr14 = ((tp->sym_advertise & 0x0780) << 9) | in t21142_start_nway()
116 ((tp->sym_advertise & 0x0020) << 1) | 0xffbf; in t21142_start_nway()
118 dev->if_port = 0; in t21142_start_nway()
119 tp->nway = tp->mediasense = 1; in t21142_start_nway()
120 tp->nwayset = tp->lpar = 0; in t21142_start_nway()
127 tp->csr6 = 0x82420000 | (tp->sym_advertise & 0x0040 ? FullDuplex : 0); in t21142_start_nway()
128 iowrite32(tp->csr6, ioaddr + CSR6); in t21142_start_nway()
129 if (tp->mtable && tp->mtable->csr15dir) { in t21142_start_nway()
130 iowrite32(tp->mtable->csr15dir, ioaddr + CSR15); in t21142_start_nway()
131 iowrite32(tp->mtable->csr15val, ioaddr + CSR15); in t21142_start_nway()
141 struct tulip_private *tp = netdev_priv(dev); in t21142_lnk_change() local
142 void __iomem *ioaddr = tp->base_addr; in t21142_lnk_change()
150 dev_info(&dev->dev, in t21142_lnk_change()
151 "21143 link status interrupt %08x, CSR5 %x, %08x\n", in t21142_lnk_change()
155 if (tp->nway && !tp->nwayset && (csr12 & 0x7000) == 0x5000) { in t21142_lnk_change()
157 int negotiated = tp->sym_advertise & (csr12 >> 16); in t21142_lnk_change()
158 tp->lpar = csr12 >> 16; in t21142_lnk_change()
159 tp->nwayset = 1; in t21142_lnk_change()
161 if (!(csr12 & 0x8000)) dev->if_port = 0; in t21142_lnk_change()
162 else if (negotiated & 0x0100) dev->if_port = 5; in t21142_lnk_change()
163 else if (negotiated & 0x0080) dev->if_port = 3; in t21142_lnk_change()
164 else if (negotiated & 0x0040) dev->if_port = 4; in t21142_lnk_change()
165 else if (negotiated & 0x0020) dev->if_port = 0; in t21142_lnk_change()
167 tp->nwayset = 0; in t21142_lnk_change()
168 if ((csr12 & 2) == 0 && (tp->sym_advertise & 0x0180)) in t21142_lnk_change()
169 dev->if_port = 3; in t21142_lnk_change()
171 tp->full_duplex = (tulip_media_cap[dev->if_port] & MediaAlwaysFD) ? 1:0; in t21142_lnk_change()
174 if (tp->nwayset) in t21142_lnk_change()
175 dev_info(&dev->dev, in t21142_lnk_change()
176 "Switching to %s based on link negotiation %04x & %04x = %04x\n", in t21142_lnk_change()
177 medianame[dev->if_port], in t21142_lnk_change()
178 tp->sym_advertise, tp->lpar, in t21142_lnk_change()
181 dev_info(&dev->dev, in t21142_lnk_change()
182 "Autonegotiation failed, using %s, link beat status %04x\n", in t21142_lnk_change()
183 medianame[dev->if_port], csr12); in t21142_lnk_change()
186 if (tp->mtable) { in t21142_lnk_change()
188 for (i = 0; i < tp->mtable->leafcount; i++) in t21142_lnk_change()
189 if (tp->mtable->mleaf[i].media == dev->if_port) { in t21142_lnk_change()
190 int startup = ! ((tp->chip_id == DC21143 && (tp->revision == 48 || tp->revision == 65))); in t21142_lnk_change()
191 tp->cur_index = i; in t21142_lnk_change()
198 tp->csr6 = (dev->if_port & 1 ? 0x838E0000 : 0x82420000) | (tp->csr6 & 0x20ff); in t21142_lnk_change()
199 if (tp->full_duplex) in t21142_lnk_change()
200 tp->csr6 |= 0x0200; in t21142_lnk_change()
204 iowrite32(tp->csr6 | RxOn, ioaddr + CSR6); in t21142_lnk_change()
209 tulip_start_rxtx(tp); in t21142_lnk_change()
212 tp->csr6, ioread32(ioaddr + CSR6), in t21142_lnk_change()
214 } else if ((tp->nwayset && (csr5 & 0x08000000) && in t21142_lnk_change()
215 (dev->if_port == 3 || dev->if_port == 5) && in t21142_lnk_change()
217 (tp->nway && (csr5 & (TPLnkFail)))) { in t21142_lnk_change()
218 /* Link blew? Maybe restart NWay. */ in t21142_lnk_change()
219 del_timer_sync(&tp->timer); in t21142_lnk_change()
221 tp->timer.expires = RUN_AT(3*HZ); in t21142_lnk_change()
222 add_timer(&tp->timer); in t21142_lnk_change()
223 } else if (dev->if_port == 3 || dev->if_port == 5) { in t21142_lnk_change()
225 dev_info(&dev->dev, "21143 %s link beat %s\n", in t21142_lnk_change()
226 medianame[dev->if_port], in t21142_lnk_change()
228 if ((csr12 & 2) && ! tp->medialock) { in t21142_lnk_change()
229 del_timer_sync(&tp->timer); in t21142_lnk_change()
231 tp->timer.expires = RUN_AT(3*HZ); in t21142_lnk_change()
232 add_timer(&tp->timer); in t21142_lnk_change()
233 } else if (dev->if_port == 5) in t21142_lnk_change()
235 } else if (dev->if_port == 0 || dev->if_port == 4) { in t21142_lnk_change()
237 dev_info(&dev->dev, "21143 10baseT link beat good\n"); in t21142_lnk_change()
238 } else if (!(csr12 & 4)) { /* 10mbps link beat good. */ in t21142_lnk_change()
240 dev_info(&dev->dev, "21143 10mbps sensed media\n"); in t21142_lnk_change()
241 dev->if_port = 0; in t21142_lnk_change()
242 } else if (tp->nwayset) { in t21142_lnk_change()
244 dev_info(&dev->dev, "21143 using NWay-set %s, csr6 %08x\n", in t21142_lnk_change()
245 medianame[dev->if_port], tp->csr6); in t21142_lnk_change()
246 } else { /* 100mbps link beat good. */ in t21142_lnk_change()
248 dev_info(&dev->dev, "21143 100baseTx sensed media\n"); in t21142_lnk_change()
249 dev->if_port = 3; in t21142_lnk_change()
250 tp->csr6 = 0x838E0000 | (tp->csr6 & 0x20ff); in t21142_lnk_change()
253 tulip_restart_rxtx(tp); in t21142_lnk_change()