Deleted Added
full compact
if_ct.c (276750) if_ct.c (283291)
1/*-
2 * Cronyx-Tau adapter driver for FreeBSD.
3 * Supports PPP/HDLC and Cisco/HDLC protocol in synchronous mode,
4 * and asynchronous channels with full modem control.
5 * Keepalive protocol implemented in both Cisco and PPP modes.
6 *
7 * Copyright (C) 1994-2002 Cronyx Engineering.
8 * Author: Serge Vakulenko, <vak@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_ct.c,v 1.1.2.31 2004/06/23 17:09:13 rik Exp $
22 */
23
24#include <sys/cdefs.h>
1/*-
2 * Cronyx-Tau adapter driver for FreeBSD.
3 * Supports PPP/HDLC and Cisco/HDLC protocol in synchronous mode,
4 * and asynchronous channels with full modem control.
5 * Keepalive protocol implemented in both Cisco and PPP modes.
6 *
7 * Copyright (C) 1994-2002 Cronyx Engineering.
8 * Author: Serge Vakulenko, <vak@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_ct.c,v 1.1.2.31 2004/06/23 17:09:13 rik Exp $
22 */
23
24#include <sys/cdefs.h>
25__FBSDID("$FreeBSD: head/sys/dev/ctau/if_ct.c 276750 2015-01-06 12:59:37Z rwatson $");
25__FBSDID("$FreeBSD: head/sys/dev/ctau/if_ct.c 283291 2015-05-22 17:05:21Z jkim $");
26
27#include <sys/param.h>
28#include <sys/proc.h>
29#include <sys/systm.h>
30#include <sys/kernel.h>
31#include <sys/module.h>
32#include <sys/mbuf.h>
33#include <sys/sockio.h>

--- 607 unchanged lines hidden (view full) ---

641 bus_release_resource (dev, SYS_RES_DRQ, bd->drq_rid,
642 bd->drq_res);
643 bus_release_resource (dev, SYS_RES_IOPORT, bd->base_rid,
644 bd->base_res);
645 mtx_destroy (&bd->ct_mtx);
646 return ENXIO;
647 }
648
26
27#include <sys/param.h>
28#include <sys/proc.h>
29#include <sys/systm.h>
30#include <sys/kernel.h>
31#include <sys/module.h>
32#include <sys/mbuf.h>
33#include <sys/sockio.h>

--- 607 unchanged lines hidden (view full) ---

641 bus_release_resource (dev, SYS_RES_DRQ, bd->drq_rid,
642 bd->drq_res);
643 bus_release_resource (dev, SYS_RES_IOPORT, bd->base_rid,
644 bd->base_res);
645 mtx_destroy (&bd->ct_mtx);
646 return ENXIO;
647 }
648
649 callout_init (&led_timo[unit], CALLOUT_MPSAFE);
649 callout_init (&led_timo[unit], 1);
650 s = splimp ();
651 if (bus_setup_intr (dev, bd->irq_res,
652 INTR_TYPE_NET|INTR_MPSAFE,
653 NULL, ct_intr, bd, &bd->intrhand)) {
654 printf ("ct%d: Can't setup irq %ld\n", unit, irq);
655 bd->board = 0;
656 adapter [unit] = 0;
657 free (b, M_DEVBUF);

--- 22 unchanged lines hidden (view full) ---

680 if (! ct_bus_dma_mem_alloc (unit, c->num, &d->dmamem))
681 continue;
682 d->board = b;
683 d->chan = c;
684 d->bd = bd;
685 c->sys = d;
686 channel [b->num*NCHAN + c->num] = d;
687 sprintf (d->name, "ct%d.%d", b->num, c->num);
650 s = splimp ();
651 if (bus_setup_intr (dev, bd->irq_res,
652 INTR_TYPE_NET|INTR_MPSAFE,
653 NULL, ct_intr, bd, &bd->intrhand)) {
654 printf ("ct%d: Can't setup irq %ld\n", unit, irq);
655 bd->board = 0;
656 adapter [unit] = 0;
657 free (b, M_DEVBUF);

--- 22 unchanged lines hidden (view full) ---

680 if (! ct_bus_dma_mem_alloc (unit, c->num, &d->dmamem))
681 continue;
682 d->board = b;
683 d->chan = c;
684 d->bd = bd;
685 c->sys = d;
686 channel [b->num*NCHAN + c->num] = d;
687 sprintf (d->name, "ct%d.%d", b->num, c->num);
688 callout_init (&d->timeout_handle, CALLOUT_MPSAFE);
688 callout_init (&d->timeout_handle, 1);
689
690#ifdef NETGRAPH
691 if (ng_make_node_common (&typestruct, &d->node) != 0) {
692 printf ("%s: cannot make common node\n", d->name);
693 channel [b->num*NCHAN + c->num] = 0;
694 c->sys = 0;
695 ct_bus_dma_mem_free (&d->dmamem);
696 continue;

--- 1460 unchanged lines hidden (view full) ---

2157
2158 switch (type) {
2159 case MOD_LOAD:
2160#ifdef NETGRAPH
2161 if (ng_newtype (&typestruct))
2162 printf ("Failed to register ng_ct\n");
2163#endif
2164 ++load_count;
689
690#ifdef NETGRAPH
691 if (ng_make_node_common (&typestruct, &d->node) != 0) {
692 printf ("%s: cannot make common node\n", d->name);
693 channel [b->num*NCHAN + c->num] = 0;
694 c->sys = 0;
695 ct_bus_dma_mem_free (&d->dmamem);
696 continue;

--- 1460 unchanged lines hidden (view full) ---

2157
2158 switch (type) {
2159 case MOD_LOAD:
2160#ifdef NETGRAPH
2161 if (ng_newtype (&typestruct))
2162 printf ("Failed to register ng_ct\n");
2163#endif
2164 ++load_count;
2165 callout_init (&timeout_handle, CALLOUT_MPSAFE);
2165 callout_init (&timeout_handle, 1);
2166 callout_reset (&timeout_handle, hz*5, ct_timeout, 0);
2167 break;
2168 case MOD_UNLOAD:
2169 if (load_count == 1) {
2170 printf ("Removing device entry for Tau-ISA\n");
2171#ifdef NETGRAPH
2172 ng_rmtype (&typestruct);
2173#endif

--- 33 unchanged lines hidden ---
2166 callout_reset (&timeout_handle, hz*5, ct_timeout, 0);
2167 break;
2168 case MOD_UNLOAD:
2169 if (load_count == 1) {
2170 printf ("Removing device entry for Tau-ISA\n");
2171#ifdef NETGRAPH
2172 ng_rmtype (&typestruct);
2173#endif

--- 33 unchanged lines hidden ---