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

[PATCH] Generic HDLC WAN drivers - disable netif_carrier_off()

As we are currently unable to fix the problem with carrier and protocol
state signaling in net core I've to disable netif_carrier_off()
calls used by WAN protocol drivers. The attached patch should make
them working again.

The remaining netif_carrier_*() calls in hdlc_fr.c are fine as they
don't touch the physical device.

Signed-off-by: Krzysztof Halasa <khc@pm.waw.pl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Krzysztof Halasa and committed by
John W. Linville
1f7bad72 cd52d1ee

+16
+6
drivers/net/wan/hdlc_cisco.c
··· 192 192 "uptime %ud%uh%um%us)\n", 193 193 dev->name, days, hrs, 194 194 min, sec); 195 + #if 0 195 196 netif_carrier_on(dev); 197 + #endif 196 198 hdlc->state.cisco.up = 1; 197 199 } 198 200 } ··· 227 225 hdlc->state.cisco.settings.timeout * HZ)) { 228 226 hdlc->state.cisco.up = 0; 229 227 printk(KERN_INFO "%s: Link down\n", dev->name); 228 + #if 0 230 229 netif_carrier_off(dev); 230 + #endif 231 231 } 232 232 233 233 cisco_keepalive_send(dev, CISCO_KEEPALIVE_REQ, ··· 265 261 { 266 262 hdlc_device *hdlc = dev_to_hdlc(dev); 267 263 del_timer_sync(&hdlc->state.cisco.timer); 264 + #if 0 268 265 if (netif_carrier_ok(dev)) 269 266 netif_carrier_off(dev); 267 + #endif 270 268 hdlc->state.cisco.up = 0; 271 269 hdlc->state.cisco.request_sent = 0; 272 270 }
+4
drivers/net/wan/hdlc_fr.c
··· 545 545 546 546 hdlc->state.fr.reliable = reliable; 547 547 if (reliable) { 548 + #if 0 548 549 if (!netif_carrier_ok(dev)) 549 550 netif_carrier_on(dev); 551 + #endif 550 552 551 553 hdlc->state.fr.n391cnt = 0; /* Request full status */ 552 554 hdlc->state.fr.dce_changed = 1; ··· 562 560 } 563 561 } 564 562 } else { 563 + #if 0 565 564 if (netif_carrier_ok(dev)) 566 565 netif_carrier_off(dev); 566 + #endif 567 567 568 568 while (pvc) { /* Deactivate all PVCs */ 569 569 pvc_carrier(0, pvc);
+6
drivers/net/wan/hdlc_generic.c
··· 79 79 hdlc_device *hdlc = dev_to_hdlc(dev); 80 80 if (hdlc->proto.start) 81 81 return hdlc->proto.start(dev); 82 + #if 0 82 83 #ifdef DEBUG_LINK 83 84 if (netif_carrier_ok(dev)) 84 85 printk(KERN_ERR "hdlc_set_carrier_on(): already on\n"); 85 86 #endif 86 87 netif_carrier_on(dev); 88 + #endif 87 89 } 88 90 89 91 ··· 96 94 if (hdlc->proto.stop) 97 95 return hdlc->proto.stop(dev); 98 96 97 + #if 0 99 98 #ifdef DEBUG_LINK 100 99 if (!netif_carrier_ok(dev)) 101 100 printk(KERN_ERR "hdlc_set_carrier_off(): already off\n"); 102 101 #endif 103 102 netif_carrier_off(dev); 103 + #endif 104 104 } 105 105 106 106 ··· 298 294 if (result != 0) 299 295 return -EIO; 300 296 297 + #if 0 301 298 if (netif_carrier_ok(dev)) 302 299 netif_carrier_off(dev); /* no carrier until DCD goes up */ 300 + #endif 303 301 304 302 return 0; 305 303 }