if_cp.c (193813) | if_cp.c (199407) |
---|---|
1/*- 2 * Cronyx-Tau-PCI adapter driver for FreeBSD. 3 * Supports PPP/HDLC, Cisco/HDLC and FrameRelay protocol in synchronous mode, 4 * and asyncronous channels with full modem control. 5 * Keepalive protocol implemented in both Cisco and PPP modes. 6 * 7 * Copyright (C) 1999-2004 Cronyx Engineering. 8 * Author: Kurakin Roman, <rik@cronyx.ru> --- 8 unchanged lines hidden (view full) --- 17 * modify and redistribute this software in source and binary forms, 18 * as long as this message is kept with the software, all derivative 19 * works or modified versions. 20 * 21 * Cronyx Id: if_cp.c,v 1.1.2.41 2004/06/23 17:09:13 rik Exp $ 22 */ 23 24#include <sys/cdefs.h> | 1/*- 2 * Cronyx-Tau-PCI adapter driver for FreeBSD. 3 * Supports PPP/HDLC, Cisco/HDLC and FrameRelay protocol in synchronous mode, 4 * and asyncronous channels with full modem control. 5 * Keepalive protocol implemented in both Cisco and PPP modes. 6 * 7 * Copyright (C) 1999-2004 Cronyx Engineering. 8 * Author: Kurakin Roman, <rik@cronyx.ru> --- 8 unchanged lines hidden (view full) --- 17 * modify and redistribute this software in source and binary forms, 18 * as long as this message is kept with the software, all derivative 19 * works or modified versions. 20 * 21 * Cronyx Id: if_cp.c,v 1.1.2.41 2004/06/23 17:09:13 rik Exp $ 22 */ 23 24#include <sys/cdefs.h> |
25__FBSDID("$FreeBSD: head/sys/dev/cp/if_cp.c 193813 2009-06-09 07:14:32Z imp $"); | 25__FBSDID("$FreeBSD: head/sys/dev/cp/if_cp.c 199407 2009-11-17 16:43:02Z jhb $"); |
26 27#include <sys/param.h> 28#include <sys/ucred.h> 29#include <sys/proc.h> 30#include <sys/systm.h> 31#include <sys/mbuf.h> 32#include <sys/kernel.h> 33#include <sys/module.h> --- 78 unchanged lines hidden (view full) --- 112 cp_dma_mem_t dmamem; 113#ifdef NETGRAPH 114 char nodename [NG_NODESIZE]; 115 hook_p hook; 116 hook_p debug_hook; 117 node_p node; 118 struct ifqueue queue; 119 struct ifqueue hi_queue; | 26 27#include <sys/param.h> 28#include <sys/ucred.h> 29#include <sys/proc.h> 30#include <sys/systm.h> 31#include <sys/mbuf.h> 32#include <sys/kernel.h> 33#include <sys/module.h> --- 78 unchanged lines hidden (view full) --- 112 cp_dma_mem_t dmamem; 113#ifdef NETGRAPH 114 char nodename [NG_NODESIZE]; 115 hook_p hook; 116 hook_p debug_hook; 117 node_p node; 118 struct ifqueue queue; 119 struct ifqueue hi_queue; |
120 short timeout; 121 struct callout timeout_handle; | |
122#else 123 struct ifqueue queue; 124 struct ifnet *ifp; 125#endif | 120#else 121 struct ifqueue queue; 122 struct ifnet *ifp; 123#endif |
124 short timeout; 125 struct callout timeout_handle; |
|
126 struct cdev *devt; 127} drv_t; 128 129typedef struct _bdrv_t { 130 cp_board_t *board; 131 struct resource *cp_res; 132 struct resource *cp_irq; 133 void *cp_intrhand; --- 12 unchanged lines hidden (view full) --- 146 147static void cp_receive (cp_chan_t *c, unsigned char *data, int len); 148static void cp_transmit (cp_chan_t *c, void *attachment, int len); 149static void cp_error (cp_chan_t *c, int data); 150static void cp_up (drv_t *d); 151static void cp_start (drv_t *d); 152static void cp_down (drv_t *d); 153static void cp_watchdog (drv_t *d); | 126 struct cdev *devt; 127} drv_t; 128 129typedef struct _bdrv_t { 130 cp_board_t *board; 131 struct resource *cp_res; 132 struct resource *cp_irq; 133 void *cp_intrhand; --- 12 unchanged lines hidden (view full) --- 146 147static void cp_receive (cp_chan_t *c, unsigned char *data, int len); 148static void cp_transmit (cp_chan_t *c, void *attachment, int len); 149static void cp_error (cp_chan_t *c, int data); 150static void cp_up (drv_t *d); 151static void cp_start (drv_t *d); 152static void cp_down (drv_t *d); 153static void cp_watchdog (drv_t *d); |
154static void cp_watchdog_timer (void *arg); |
|
154#ifdef NETGRAPH 155extern struct ng_type typestruct; 156#else 157static void cp_ifstart (struct ifnet *ifp); 158static void cp_tlf (struct sppp *sp); 159static void cp_tls (struct sppp *sp); | 155#ifdef NETGRAPH 156extern struct ng_type typestruct; 157#else 158static void cp_ifstart (struct ifnet *ifp); 159static void cp_tlf (struct sppp *sp); 160static void cp_tls (struct sppp *sp); |
160static void cp_ifwatchdog (struct ifnet *ifp); | |
161static int cp_sioctl (struct ifnet *ifp, u_long cmd, caddr_t data); 162static void cp_initialize (void *softc); 163#endif 164 165static cp_board_t *adapter [NBRD]; 166static drv_t *channel [NBRD*NCHAN]; 167static struct callout led_timo [NBRD]; 168static struct callout timeout_handle; --- 316 unchanged lines hidden (view full) --- 485 d->dmamem.size = sizeof(cp_buf_t); 486 if (! cp_bus_dma_mem_alloc (unit, c->num, &d->dmamem)) 487 continue; 488 channel [b->num*NCHAN + c->num] = d; 489 sprintf (d->name, "cp%d.%d", b->num, c->num); 490 d->board = b; 491 d->chan = c; 492 c->sys = d; | 161static int cp_sioctl (struct ifnet *ifp, u_long cmd, caddr_t data); 162static void cp_initialize (void *softc); 163#endif 164 165static cp_board_t *adapter [NBRD]; 166static drv_t *channel [NBRD*NCHAN]; 167static struct callout led_timo [NBRD]; 168static struct callout timeout_handle; --- 316 unchanged lines hidden (view full) --- 485 d->dmamem.size = sizeof(cp_buf_t); 486 if (! cp_bus_dma_mem_alloc (unit, c->num, &d->dmamem)) 487 continue; 488 channel [b->num*NCHAN + c->num] = d; 489 sprintf (d->name, "cp%d.%d", b->num, c->num); 490 d->board = b; 491 d->chan = c; 492 c->sys = d; |
493 callout_init (&d->timeout_handle, CALLOUT_MPSAFE); |
|
493#ifdef NETGRAPH 494 if (ng_make_node_common (&typestruct, &d->node) != 0) { 495 printf ("%s: cannot make common node\n", d->name); 496 d->node = NULL; 497 continue; 498 } 499 NG_NODE_SET_PRIVATE (d->node, d); 500 sprintf (d->nodename, "%s%d", NG_CP_NODE_TYPE, 501 c->board->num*NCHAN + c->num); 502 if (ng_name_node (d->node, d->nodename)) { 503 printf ("%s: cannot name node\n", d->nodename); 504 NG_NODE_UNREF (d->node); 505 continue; 506 } 507 d->queue.ifq_maxlen = IFQ_MAXLEN; 508 d->hi_queue.ifq_maxlen = IFQ_MAXLEN; 509 mtx_init (&d->queue.ifq_mtx, "cp_queue", NULL, MTX_DEF); 510 mtx_init (&d->hi_queue.ifq_mtx, "cp_queue_hi", NULL, MTX_DEF); | 494#ifdef NETGRAPH 495 if (ng_make_node_common (&typestruct, &d->node) != 0) { 496 printf ("%s: cannot make common node\n", d->name); 497 d->node = NULL; 498 continue; 499 } 500 NG_NODE_SET_PRIVATE (d->node, d); 501 sprintf (d->nodename, "%s%d", NG_CP_NODE_TYPE, 502 c->board->num*NCHAN + c->num); 503 if (ng_name_node (d->node, d->nodename)) { 504 printf ("%s: cannot name node\n", d->nodename); 505 NG_NODE_UNREF (d->node); 506 continue; 507 } 508 d->queue.ifq_maxlen = IFQ_MAXLEN; 509 d->hi_queue.ifq_maxlen = IFQ_MAXLEN; 510 mtx_init (&d->queue.ifq_mtx, "cp_queue", NULL, MTX_DEF); 511 mtx_init (&d->hi_queue.ifq_mtx, "cp_queue_hi", NULL, MTX_DEF); |
511 callout_init (&d->timeout_handle, CALLOUT_MPSAFE); | |
512#else /*NETGRAPH*/ 513 d->ifp = if_alloc(IFT_PPP); 514 if (d->ifp == NULL) { 515 printf ("%s: cannot if_alloc() interface\n", d->name); 516 continue; 517 } 518 d->ifp->if_softc = d; 519 if_initname (d->ifp, "cp", b->num * NCHAN + c->num); 520 d->ifp->if_mtu = PP_MTU; 521 d->ifp->if_flags = IFF_POINTOPOINT | IFF_MULTICAST; 522 d->ifp->if_ioctl = cp_sioctl; 523 d->ifp->if_start = cp_ifstart; | 512#else /*NETGRAPH*/ 513 d->ifp = if_alloc(IFT_PPP); 514 if (d->ifp == NULL) { 515 printf ("%s: cannot if_alloc() interface\n", d->name); 516 continue; 517 } 518 d->ifp->if_softc = d; 519 if_initname (d->ifp, "cp", b->num * NCHAN + c->num); 520 d->ifp->if_mtu = PP_MTU; 521 d->ifp->if_flags = IFF_POINTOPOINT | IFF_MULTICAST; 522 d->ifp->if_ioctl = cp_sioctl; 523 d->ifp->if_start = cp_ifstart; |
524 d->ifp->if_watchdog = cp_ifwatchdog; | |
525 d->ifp->if_init = cp_initialize; 526 d->queue.ifq_maxlen = NRBUF; 527 mtx_init (&d->queue.ifq_mtx, "cp_queue", NULL, MTX_DEF); 528 sppp_attach (d->ifp); 529 if_attach (d->ifp); 530 IFP2SP(d->ifp)->pp_tlf = cp_tlf; 531 IFP2SP(d->ifp)->pp_tls = cp_tls; 532 /* If BPF is in the kernel, call the attach for it. --- 65 unchanged lines hidden (view full) --- 598 /* Disable the interrupt request. */ 599 bus_teardown_intr (dev, bd->cp_irq, bd->cp_intrhand); 600 601 for (c=b->chan; c<b->chan+NCHAN; ++c) { 602 drv_t *d = (drv_t*) c->sys; 603 604 if (! d || ! d->chan->type) 605 continue; | 524 d->ifp->if_init = cp_initialize; 525 d->queue.ifq_maxlen = NRBUF; 526 mtx_init (&d->queue.ifq_mtx, "cp_queue", NULL, MTX_DEF); 527 sppp_attach (d->ifp); 528 if_attach (d->ifp); 529 IFP2SP(d->ifp)->pp_tlf = cp_tlf; 530 IFP2SP(d->ifp)->pp_tls = cp_tls; 531 /* If BPF is in the kernel, call the attach for it. --- 65 unchanged lines hidden (view full) --- 597 /* Disable the interrupt request. */ 598 bus_teardown_intr (dev, bd->cp_irq, bd->cp_intrhand); 599 600 for (c=b->chan; c<b->chan+NCHAN; ++c) { 601 drv_t *d = (drv_t*) c->sys; 602 603 if (! d || ! d->chan->type) 604 continue; |
605 callout_stop (&d->timeout_handle); |
|
606#ifndef NETGRAPH 607 /* Detach from the packet filter list of interfaces. */ 608 bpfdetach (d->ifp); 609 610 /* Detach from the sync PPP list. */ 611 sppp_detach (d->ifp); 612 613 /* Detach from the system list of interfaces. */ --- 20 unchanged lines hidden (view full) --- 634 bus_release_resource (dev, SYS_RES_MEMORY, PCIR_BAR(0), bd->cp_res); 635 636 CP_LOCK (bd); 637 cp_led_off (b); 638 CP_UNLOCK (bd); 639 callout_drain (&led_timo[b->num]); 640 splx (s); 641 | 606#ifndef NETGRAPH 607 /* Detach from the packet filter list of interfaces. */ 608 bpfdetach (d->ifp); 609 610 /* Detach from the sync PPP list. */ 611 sppp_detach (d->ifp); 612 613 /* Detach from the system list of interfaces. */ --- 20 unchanged lines hidden (view full) --- 634 bus_release_resource (dev, SYS_RES_MEMORY, PCIR_BAR(0), bd->cp_res); 635 636 CP_LOCK (bd); 637 cp_led_off (b); 638 CP_UNLOCK (bd); 639 callout_drain (&led_timo[b->num]); 640 splx (s); 641 |
642 s = splimp (); | |
643 for (c = b->chan; c < b->chan + NCHAN; ++c) { 644 drv_t *d = (drv_t*) c->sys; 645 646 if (! d || ! d->chan->type) 647 continue; | 642 for (c = b->chan; c < b->chan + NCHAN; ++c) { 643 drv_t *d = (drv_t*) c->sys; 644 645 if (! d || ! d->chan->type) 646 continue; |
647 callout_drain (&d->timeout_handle); |
|
648 channel [b->num*NCHAN + c->num] = 0; 649 /* Deallocate buffers. */ 650 cp_bus_dma_mem_free (&d->dmamem); 651 } 652 adapter [b->num] = 0; 653 cp_bus_dma_mem_free (&bd->dmamem); 654 free (b, M_DEVBUF); | 648 channel [b->num*NCHAN + c->num] = 0; 649 /* Deallocate buffers. */ 650 cp_bus_dma_mem_free (&d->dmamem); 651 } 652 adapter [b->num] = 0; 653 cp_bus_dma_mem_free (&bd->dmamem); 654 free (b, M_DEVBUF); |
655 splx (s); | |
656 mtx_destroy (&bd->cp_mtx); 657 return 0; 658} 659 660#ifndef NETGRAPH 661static void cp_ifstart (struct ifnet *ifp) 662{ 663 drv_t *d = ifp->if_softc; 664 bdrv_t *bd = d->board->sys; 665 666 CP_LOCK (bd); 667 cp_start (d); 668 CP_UNLOCK (bd); 669} 670 | 655 mtx_destroy (&bd->cp_mtx); 656 return 0; 657} 658 659#ifndef NETGRAPH 660static void cp_ifstart (struct ifnet *ifp) 661{ 662 drv_t *d = ifp->if_softc; 663 bdrv_t *bd = d->board->sys; 664 665 CP_LOCK (bd); 666 cp_start (d); 667 CP_UNLOCK (bd); 668} 669 |
671static void cp_ifwatchdog (struct ifnet *ifp) 672{ 673 drv_t *d = ifp->if_softc; 674 675 cp_watchdog (d); 676} 677 | |
678static void cp_tlf (struct sppp *sp) 679{ 680 drv_t *d = SP2IFP(sp)->if_softc; 681 682 CP_DEBUG2 (d, ("cp_tlf\n")); 683 /* XXXRIK: Don't forget to protect them by LOCK, or kill them. */ 684/* cp_set_dtr (d->chan, 0);*/ 685/* cp_set_rts (d->chan, 0);*/ --- 75 unchanged lines hidden (view full) --- 761static void cp_down (drv_t *d) 762{ 763 CP_DEBUG (d, ("cp_down\n")); 764 /* Interface is going down -- stop it. */ 765 cp_set_dtr (d->chan, 0); 766 cp_set_rts (d->chan, 0); 767 768 d->running = 0; | 670static void cp_tlf (struct sppp *sp) 671{ 672 drv_t *d = SP2IFP(sp)->if_softc; 673 674 CP_DEBUG2 (d, ("cp_tlf\n")); 675 /* XXXRIK: Don't forget to protect them by LOCK, or kill them. */ 676/* cp_set_dtr (d->chan, 0);*/ 677/* cp_set_rts (d->chan, 0);*/ --- 75 unchanged lines hidden (view full) --- 753static void cp_down (drv_t *d) 754{ 755 CP_DEBUG (d, ("cp_down\n")); 756 /* Interface is going down -- stop it. */ 757 cp_set_dtr (d->chan, 0); 758 cp_set_rts (d->chan, 0); 759 760 d->running = 0; |
761 callout_stop (&d->timeout_handle); |
|
769} 770 771/* 772 * Start the interface. Called on splimp(). 773 */ 774static void cp_up (drv_t *d) 775{ 776 CP_DEBUG (d, ("cp_up\n")); --- 45 unchanged lines hidden (view full) --- 822 cp_send_packet (d->chan, (u_char*) mtod (m, caddr_t), len, 0); 823 else { 824 u_char *buf = d->chan->tbuf[d->chan->te]; 825 m_copydata (m, 0, len, buf); 826 cp_send_packet (d->chan, buf, len, 0); 827 } 828 m_freem (m); 829 /* Set up transmit timeout, if the transmit ring is not empty.*/ | 762} 763 764/* 765 * Start the interface. Called on splimp(). 766 */ 767static void cp_up (drv_t *d) 768{ 769 CP_DEBUG (d, ("cp_up\n")); --- 45 unchanged lines hidden (view full) --- 815 cp_send_packet (d->chan, (u_char*) mtod (m, caddr_t), len, 0); 816 else { 817 u_char *buf = d->chan->tbuf[d->chan->te]; 818 m_copydata (m, 0, len, buf); 819 cp_send_packet (d->chan, buf, len, 0); 820 } 821 m_freem (m); 822 /* Set up transmit timeout, if the transmit ring is not empty.*/ |
830#ifdef NETGRAPH | |
831 d->timeout = 10; | 823 d->timeout = 10; |
832#else 833 d->ifp->if_timer = 10; 834#endif | |
835 } 836#ifndef NETGRAPH 837 d->ifp->if_drv_flags |= IFF_DRV_OACTIVE; 838#endif 839} 840 841/* 842 * Start output on the interface. 843 * Always called on splimp(). 844 */ 845static void cp_start (drv_t *d) 846{ 847 if (d->running) { 848 if (! d->chan->dtr) 849 cp_set_dtr (d->chan, 1); 850 if (! d->chan->rts) 851 cp_set_rts (d->chan, 1); 852 cp_send (d); | 824 } 825#ifndef NETGRAPH 826 d->ifp->if_drv_flags |= IFF_DRV_OACTIVE; 827#endif 828} 829 830/* 831 * Start output on the interface. 832 * Always called on splimp(). 833 */ 834static void cp_start (drv_t *d) 835{ 836 if (d->running) { 837 if (! d->chan->dtr) 838 cp_set_dtr (d->chan, 1); 839 if (! d->chan->rts) 840 cp_set_rts (d->chan, 1); 841 cp_send (d); |
842 callout_reset (&d->timeout_handle, hz, cp_watchdog_timer, d); |
|
853 } 854} 855 856/* 857 * Handle transmit timeouts. 858 * Recover after lost transmit interrupts. 859 * Always called on splimp(). 860 */ 861static void cp_watchdog (drv_t *d) 862{ | 843 } 844} 845 846/* 847 * Handle transmit timeouts. 848 * Recover after lost transmit interrupts. 849 * Always called on splimp(). 850 */ 851static void cp_watchdog (drv_t *d) 852{ |
863 bdrv_t *bd = d->board->sys; | |
864 CP_DEBUG (d, ("device timeout\n")); 865 if (d->running) { | 853 CP_DEBUG (d, ("device timeout\n")); 854 if (d->running) { |
866 int s = splimp (); 867 868 CP_LOCK (bd); | |
869 cp_stop_chan (d->chan); 870 cp_stop_e1 (d->chan); 871 cp_start_e1 (d->chan); 872 cp_start_chan (d->chan, 1, 1, 0, 0); 873 cp_set_dtr (d->chan, 1); 874 cp_set_rts (d->chan, 1); 875 cp_start (d); | 855 cp_stop_chan (d->chan); 856 cp_stop_e1 (d->chan); 857 cp_start_e1 (d->chan); 858 cp_start_chan (d->chan, 1, 1, 0, 0); 859 cp_set_dtr (d->chan, 1); 860 cp_set_rts (d->chan, 1); 861 cp_start (d); |
876 CP_UNLOCK (bd); 877 splx (s); | |
878 } 879} 880 | 862 } 863} 864 |
865static void cp_watchdog_timer (void *arg) 866{ 867 drv_t *d = arg; 868 bdrv_t *bd = d->board->sys; 869 870 CP_LOCK (bd); 871 if (d->timeout == 1) 872 cp_watchdog (d); 873 if (d->timeout) 874 d->timeout--; 875 callout_reset (&d->timeout_handle, hz, cp_watchdog_timer, d); 876 CP_UNLOCK (bd); 877} 878 |
|
881static void cp_transmit (cp_chan_t *c, void *attachment, int len) 882{ 883 drv_t *d = c->sys; 884 | 879static void cp_transmit (cp_chan_t *c, void *attachment, int len) 880{ 881 drv_t *d = c->sys; 882 |
885#ifdef NETGRAPH | |
886 d->timeout = 0; | 883 d->timeout = 0; |
887#else | 884#ifndef NETGRAPH |
888 ++d->ifp->if_opackets; 889 d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; | 885 ++d->ifp->if_opackets; 886 d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; |
890 d->ifp->if_timer = 0; | |
891#endif 892 cp_start (d); 893} 894 895static void cp_receive (cp_chan_t *c, unsigned char *data, int len) 896{ 897 drv_t *d = c->sys; 898 struct mbuf *m; --- 54 unchanged lines hidden (view full) --- 953 case CP_OVERFLOW: 954 CP_DEBUG (d, ("overflow error\n")); 955#ifndef NETGRAPH 956 ++d->ifp->if_ierrors; 957#endif 958 break; 959 case CP_UNDERRUN: 960 CP_DEBUG (d, ("underrun error\n")); | 887#endif 888 cp_start (d); 889} 890 891static void cp_receive (cp_chan_t *c, unsigned char *data, int len) 892{ 893 drv_t *d = c->sys; 894 struct mbuf *m; --- 54 unchanged lines hidden (view full) --- 949 case CP_OVERFLOW: 950 CP_DEBUG (d, ("overflow error\n")); 951#ifndef NETGRAPH 952 ++d->ifp->if_ierrors; 953#endif 954 break; 955 case CP_UNDERRUN: 956 CP_DEBUG (d, ("underrun error\n")); |
961#ifdef NETGRAPH | |
962 d->timeout = 0; | 957 d->timeout = 0; |
963#else | 958#ifndef NETGRAPH |
964 ++d->ifp->if_oerrors; 965 d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; | 959 ++d->ifp->if_oerrors; 960 d->ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; |
966 d->ifp->if_timer = 0; | |
967#endif 968 cp_start (d); 969 break; 970 default: 971 CP_DEBUG (d, ("error #%d\n", data)); 972 break; 973 } 974} --- 1218 unchanged lines hidden (view full) --- 2193 NG_NODE_SET_PRIVATE (node, NULL); 2194 NG_NODE_UNREF (node); 2195 } 2196 NG_NODE_REVIVE(node); /* Persistant node */ 2197#endif 2198 return 0; 2199} 2200 | 961#endif 962 cp_start (d); 963 break; 964 default: 965 CP_DEBUG (d, ("error #%d\n", data)); 966 break; 967 } 968} --- 1218 unchanged lines hidden (view full) --- 2187 NG_NODE_SET_PRIVATE (node, NULL); 2188 NG_NODE_UNREF (node); 2189 } 2190 NG_NODE_REVIVE(node); /* Persistant node */ 2191#endif 2192 return 0; 2193} 2194 |
2201static void ng_cp_watchdog (void *arg) 2202{ 2203 drv_t *d = arg; 2204 2205 if (d) { 2206 if (d->timeout == 1) 2207 cp_watchdog (d); 2208 if (d->timeout) 2209 d->timeout--; 2210 callout_reset (&d->timeout_handle, hz, ng_cp_watchdog, d); 2211 } 2212} 2213 | |
2214static int ng_cp_connect (hook_p hook) 2215{ 2216 drv_t *d = NG_NODE_PRIVATE (NG_HOOK_NODE (hook)); 2217 2218 if (d) { 2219 CP_DEBUG (d, ("Connect\n")); | 2195static int ng_cp_connect (hook_p hook) 2196{ 2197 drv_t *d = NG_NODE_PRIVATE (NG_HOOK_NODE (hook)); 2198 2199 if (d) { 2200 CP_DEBUG (d, ("Connect\n")); |
2220 callout_reset (&d->timeout_handle, hz, ng_cp_watchdog, d); | 2201 callout_reset (&d->timeout_handle, hz, cp_watchdog_timer, d); |
2221 } 2222 2223 return 0; 2224} 2225 2226static int ng_cp_disconnect (hook_p hook) 2227{ 2228 drv_t *d = NG_NODE_PRIVATE (NG_HOOK_NODE (hook)); --- 76 unchanged lines hidden --- | 2202 } 2203 2204 return 0; 2205} 2206 2207static int ng_cp_disconnect (hook_p hook) 2208{ 2209 drv_t *d = NG_NODE_PRIVATE (NG_HOOK_NODE (hook)); --- 76 unchanged lines hidden --- |