Deleted Added
full compact
if_ct.c (180132) if_ct.c (183397)
1/*-
2 * Cronyx-Tau adapter driver for FreeBSD.
3 * Supports PPP/HDLC and Cisco/HDLC 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) 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 asyncronous 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 180132 2008-06-30 21:18:27Z rik $");
25__FBSDID("$FreeBSD: head/sys/dev/ctau/if_ct.c 183397 2008-09-27 08:51:18Z ed $");
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>

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

1213 CT_DEBUG (d, ("error #%d\n", data));
1214 }
1215}
1216
1217static int ct_open (struct cdev *dev, int oflags, int devtype, struct thread *td)
1218{
1219 drv_t *d;
1220
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>

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

1213 CT_DEBUG (d, ("error #%d\n", data));
1214 }
1215}
1216
1217static int ct_open (struct cdev *dev, int oflags, int devtype, struct thread *td)
1218{
1219 drv_t *d;
1220
1221 if (minor(dev) >= NCTAU*NCHAN || ! (d = channel[minor(dev)]))
1221 if (dev2unit(dev) >= NCTAU*NCHAN || ! (d = channel[dev2unit(dev)]))
1222 return ENXIO;
1223
1224 CT_DEBUG2 (d, ("ct_open\n"));
1225 return 0;
1226}
1227
1228static int ct_close (struct cdev *dev, int fflag, int devtype, struct thread *td)
1229{
1222 return ENXIO;
1223
1224 CT_DEBUG2 (d, ("ct_open\n"));
1225 return 0;
1226}
1227
1228static int ct_close (struct cdev *dev, int fflag, int devtype, struct thread *td)
1229{
1230 drv_t *d = channel [minor(dev)];
1230 drv_t *d = channel [dev2unit(dev)];
1231
1232 if (!d)
1233 return 0;
1234
1235 CT_DEBUG2 (d, ("ct_close\n"));
1236 return 0;
1237}
1238

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

1260 return status;
1261}
1262
1263/*
1264 * Process an ioctl request on /dev/cronyx/ctauN.
1265 */
1266static int ct_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
1267{
1231
1232 if (!d)
1233 return 0;
1234
1235 CT_DEBUG2 (d, ("ct_close\n"));
1236 return 0;
1237}
1238

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

1260 return status;
1261}
1262
1263/*
1264 * Process an ioctl request on /dev/cronyx/ctauN.
1265 */
1266static int ct_ioctl (struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td)
1267{
1268 drv_t *d = channel [minor (dev)];
1268 drv_t *d = channel [dev2unit (dev)];
1269 bdrv_t *bd;
1270 ct_chan_t *c;
1271 struct serial_statistics *st;
1272 struct e1_statistics *opte1;
1273 int error, s;
1274 char mask[16];
1275
1276 if (!d || !d->chan)

--- 989 unchanged lines hidden ---
1269 bdrv_t *bd;
1270 ct_chan_t *c;
1271 struct serial_statistics *st;
1272 struct e1_statistics *opte1;
1273 int error, s;
1274 char mask[16];
1275
1276 if (!d || !d->chan)

--- 989 unchanged lines hidden ---