retire cp(4) driver

Sync serial (e.g. T1/T1/G.703) interfaces are obsolete, this driver
includes obfuscated source, and has reported potential security issues.

Differential Revision:  https://reviews.freebsd.org/D33468
This commit is contained in:
Ed Maste 2020-09-24 10:08:02 -04:00
parent 76f6751844
commit 895992bb66
11 changed files with 4 additions and 9253 deletions

View file

@ -52,6 +52,10 @@
# xargs -n1 | sort | uniq -d;
# done
# 20221213: remove sync serial drivers and utilities
OLD_FILES+=usr/share/man/man4/ce.4
OLD_FILES+=usr/share/man/man4/cp.4
# 20221202: remove trpt(8)
OLD_FILES+=usr/sbin/trpt
OLD_FILES+=usr/share/man/man8/trpt.8.gz

View file

@ -1,7 +1,6 @@
# $FreeBSD$
MAN= apm.4 \
cp.4 \
CPU_ELAN.4 \
glxiic.4 \
glxsb.4 \

View file

@ -1,101 +0,0 @@
.\" Copyright (c) 2003-2004 Roman Kurakin <rik@cronyx.ru>
.\" Copyright (c) 2003-2004 Cronyx Engineering
.\" All rights reserved.
.\"
.\" This software is distributed with NO WARRANTIES, not even the implied
.\" warranties for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.\"
.\" Authors grant any other persons or organisations a permission to use,
.\" modify and redistribute this software in source and binary forms,
.\" as long as this message is kept with the software, all derivative
.\" works or modified versions.
.\"
.\" Cronyx Id: cp.4,v 1.1.2.5 2004/06/21 17:47:40 rik Exp $
.\" $FreeBSD$
.\"
.Dd December 13, 2022
.Dt CP 4 i386
.Os
.Sh NAME
.Nm cp
.Nd "driver for synchronous Cronyx Tau-PCI WAN adapters"
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following line in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device cp"
.Ed
.Pp
Alternatively, to load the driver as a
module at boot time, place the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
if_cp_load="YES"
.Ed
.Pp
.Sh DEPRECATION NOTICE
The
.Nm
driver is not present in
.Fx 14.0
and later.
.Sh DESCRIPTION
The
.Nm
driver creates a
.Xr netgraph 4
node for each device found.
The node is usually paired with
.Xr ng_async 4 ,
.Xr ng_cisco 4 ,
.Xr ng_frame_relay 4
or with
.Xr ng_ppp 4
under control of net/mpd5 port.
.Pp
Refer to
.Xr sconfig 8
for information about the
.Nm
adapter configuration.
.Sh HARDWARE
The
.Nm
driver supports the following models of Tau-PCI WAN adapters:
.Pp
.Bl -tag -width 20n -compact
.It Cronyx Tau-PCI
V.35 and RS-232 interfaces
.It Cronyx Tau-PCI/R
RS-530(RS-449) and X.21 interfaces
.It Cronyx Tau-PCI-L
one V.35 and RS-232 interface, low profile
.It Cronyx Tau-PCI-L/R
one RS-530(RS-449) and X.21 interface, low profile
.It Cronyx Tau-PCI-E1
fractional E1 interfaces
.It Cronyx Tau-PCI-G703
unframed E1 interfaces
.It Cronyx Tau-PCI-2E1
fractional E1 and unframed E1 interfaces
.It Cronyx Tau-PCI-4E1
fractional E1 and unframed E1 interfaces
.It Cronyx Tau-PCI-E3
E3 interface
.It Cronyx Tau-PCI-T3
T3 interface
.It Cronyx Tau-PCI-STS1
STS-1 interface
.El
.Sh SEE ALSO
.Xr ce 4 ,
.Xr netgraph 4 ,
.Xr sconfig 8
.Sh HISTORY
The
.Nm
driver was added in
.Fx 5.3
and
.Fx 4.11 .

View file

@ -14,7 +14,6 @@ nodevice runfw
nodevice sf
nodevice ti
nodevice txp
nodevice cp
nodevice ipwfw
nodevice iwifw
nodevice iwmfw

File diff suppressed because it is too large Load diff

View file

@ -1,365 +0,0 @@
/*-
* Cronyx Tau-PCI DDK definitions.
*
* Copyright (C) 1999-2003 Cronyx Engineering.
* Author: Serge Vakulenko, <vak@cronyx.ru>
*
* Copyright (C) 2000-2004 Cronyx Engineering.
* Author: Roman Kurakin, <rik@cronyx.ru>
*
* This software is distributed with NO WARRANTIES, not even the implied
* warranties for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Authors grant any other persons or organisations a permission to use,
* modify and redistribute this software in source and binary forms,
* as long as this message is kept with the software, all derivative
* works or modified versions.
*
* $Cronyx: cpddk.h,v 1.8.4.20 2004/12/06 16:21:06 rik Exp $
* $FreeBSD$
*/
#define NBRD 6 /* the maximum number of installed boards */
#define NCHAN 4 /* the number of channels on the board */
#define NRBUF 64 /* the number of receive buffers per channel,
min 2 */
#define NTBUF 4 /* the number of transmit buffers per channel */
#define BUFSZ 1664 /* i/o buffer size (26*64, min 1601) */
#define QSZ 128 /* intr queue size (multiple of 32, min 32) */
#ifndef CPDDK_COBF_SAFE
#pragma pack(4)
typedef struct {
unsigned long bpv; /* bipolar violations */
unsigned long fse; /* frame sync errors */
unsigned long crce; /* CRC errors */
unsigned long rcrce; /* remote CRC errors (E-bit) */
unsigned long uas; /* unavailable seconds */
unsigned long les; /* line errored seconds */
unsigned long es; /* errored seconds */
unsigned long bes; /* bursty errored seconds */
unsigned long ses; /* severely errored seconds */
unsigned long oofs; /* out of frame seconds */
unsigned long css; /* controlled slip seconds */
unsigned long dm; /* degraded minutes */
} cp_gstat_t;
typedef struct { /* cross-connector parameters */
unsigned char ts [32]; /* timeslot number */
unsigned char link [32]; /* E1 link number */
} cp_dxc_t;
typedef struct {
unsigned long len; /* data buffer length, fe, hold, hi */
#define DESC_FE 0x80000000
#define DESC_HOLD 0x40000000
#define DESC_HI 0x20000000
#define DESC_LEN(v) ((v) >> 16 & 0x1fff)
unsigned long next; /* next descriptor pointer */
unsigned long data; /* pointer to data buffer */
unsigned long status; /* complete, receive abort, fe, len */
#define DESC_RA 0x00000200
#define DESC_C 0x40000000
unsigned long fe; /* pointer to frame end descriptor */
} cp_desc_t;
typedef struct {
cp_desc_t tdesc [NTBUF]; /* transmit buffer descriptors */
cp_desc_t rdesc [NRBUF]; /* receive buffer descriptors */
unsigned char tbuffer [NTBUF] [BUFSZ]; /* transmit buffers */
unsigned char rbuffer [NRBUF] [BUFSZ]; /* receive buffers */
} cp_buf_t;
typedef struct {
unsigned long iqrx [NCHAN] [QSZ]; /* rx intr queue */
unsigned long iqtx [NCHAN] [QSZ]; /* tx intr queue */
unsigned long iqlx [QSZ]; /* LBI intr queue */
} cp_qbuf_t;
typedef struct _cp_chan_t {
unsigned char *regs; /* base addr of channel registers */
volatile unsigned long *RXBAR, *TXBAR, *CFG;
volatile unsigned long *BRDA, *FRDA, *LRDA, *BTDA, *FTDA, *LTDA;
unsigned char CCR, CSR, GMD, GLS, E1CS, E1CR, E1EPS;
unsigned char num; /* channel number, 0..1 */
unsigned char type; /* channel type */
#define T_NONE 0 /* no channel */
#define T_SERIAL 1 /* V.35/RS */
#define T_G703 2 /* G.703 */
#define T_E1 3 /* E1 */
#define T_E3 4 /* E3 */
#define T_HSSI 5 /* HSSI */
#define T_DATA 6 /* no physical interface */
#define T_T3 7 /* T3 */
#define T_STS1 8 /* STS1 */
struct _cp_board_t *board; /* board pointer */
unsigned char dtr; /* DTR signal value */
unsigned char rts; /* RTS signal value */
unsigned long baud; /* data rate, bps */
unsigned char dpll; /* dpll mode */
unsigned char nrzi; /* nrzi mode */
unsigned char invtxc; /* invert tx clock */
unsigned char invrxc; /* invert rx clock */
unsigned char lloop; /* local loopback mode */
unsigned char rloop; /* remote loopback mode */
unsigned char gsyn; /* G.703 clock mode */
#define GSYN_INT 0 /* internal transmit clock source */
#define GSYN_RCV 1 /* transmit clock source = receive */
#define GSYN_RCV0 2 /* tclk = rclk from channel 0 */
#define GSYN_RCV1 3 /* ...from channel 1 */
#define GSYN_RCV2 4 /* ...from channel 2 */
#define GSYN_RCV3 5 /* ...from channel 3 */
unsigned char scrambler; /* G.703 scrambler enable */
unsigned long ts; /* E1 timeslot mask */
unsigned char higain; /* E1 high gain mode */
unsigned char use16; /* E1 use ts 16 */
unsigned char crc4; /* E1 enable CRC4 */
unsigned char phony; /* E1 phony mode */
unsigned char unfram; /* E1 unframed mode */
unsigned char monitor; /* E1 monitoring mode */
unsigned char dir; /* E1 direction mode */
cp_dxc_t dxc; /* E1 cross-connect params */
unsigned char ais; /* E3 AIS */
unsigned char losais; /* E3 AIS on LOS*/
unsigned char ber; /* E3 BER */
unsigned char cablen; /* E3 cable length */
unsigned char e3cr1; /* e3cr1 clone */
unsigned char scc_ien; /* SCC Interrupts enabled */
unsigned char ds_ien; /* DS Interrupts enabled */
unsigned long imr;
unsigned char ccr; /* CCR image */
unsigned long ccr0; /* CCR0 clone */
unsigned long ccr1; /* CCR1 clone */
unsigned long ccr2; /* CCR2 clone */
unsigned char gmd; /* G.703 MDi register image */
unsigned char e1cr; /* E1 CR register image */
unsigned char ds21x54; /* new tranceiver flag */
unsigned long rintr; /* receive interrupts */
unsigned long tintr; /* transmit interrupts */
ulong64 ibytes; /* input bytes */
ulong64 obytes; /* output bytes */
unsigned long ipkts; /* input packets */
unsigned long opkts; /* output packets */
unsigned long underrun; /* output underrun errors */
unsigned long overrun; /* input overrun errors */
unsigned long frame; /* input frame errors */
unsigned long crc; /* input crc errors */
unsigned short status; /* E1/G.703 line status bit mask */
#define ESTS_NOALARM 0x0001 /* no alarm present */
#define ESTS_FARLOF 0x0002 /* receiving far loss of framing */
#define ESTS_AIS 0x0008 /* receiving all ones */
#define ESTS_LOF 0x0020 /* loss of framing */
#define ESTS_LOS 0x0040 /* loss of signal */
#define ESTS_AIS16 0x0100 /* receiving all ones in timeslot 16 */
#define ESTS_FARLOMF 0x0200 /* receiving alarm in timeslot 16 */
#define ESTS_LOMF 0x0400 /* loss of multiframe sync */
#define ESTS_TSTREQ 0x0800 /* test code detected */
#define ESTS_TSTERR 0x1000 /* test error */
unsigned long totsec; /* total seconds elapsed */
unsigned long cursec; /* current seconds elapsed */
unsigned long degsec; /* degraded seconds */
unsigned long degerr; /* errors during degraded seconds */
cp_gstat_t currnt; /* current 15-min interval data */
cp_gstat_t total; /* total statistics data */
cp_gstat_t interval [48]; /* 12 hour period data */
unsigned long e3status; /* E3 status */
#define E3STS_LOS 0x00000002 /* Lost of synchronization */
#define E3STS_TXE 0x00000004 /* Transmit error */
#define E3STS_AIS 0x00000008 /* Transmit error */
unsigned long e3csec_5; /* 1/5 of second counter */
unsigned long e3tsec; /* total seconds coounter */
unsigned long e3ccv; /* E3 current 15-min cv errors */
unsigned long e3tcv; /* E3 total cv errors */
unsigned long e3icv[48]; /* E3 12 hour period cv errors */
unsigned long *iqrx; /* rx intr queue */
unsigned long *iqtx; /* tx intr queue */
int irn, itn;
unsigned char *tbuf [NTBUF]; /* transmit buffers */
cp_desc_t *tdesc; /* transmit buffer descriptors */
unsigned long tphys [NTBUF]; /* transmit buffer phys address */
unsigned long tdphys [NTBUF]; /* transmit descr phys addresses */
int tn; /* first active transmit buffer */
int te; /* first empty transmit buffer */
unsigned char *rbuf [NRBUF]; /* receive buffers */
cp_desc_t *rdesc; /* receive buffer descriptors */
unsigned long rphys [NRBUF]; /* receive buffer phys address */
unsigned long rdphys [NRBUF]; /* receive descr phys addresses */
int rn; /* first active receive buffer */
void *tag [NTBUF]; /* system dependent data per buffer */
void *sys; /* system dependent data per channel */
unsigned char debug; /* debug level, 0..2 */
unsigned char debug_shadow; /* debug shadow */
void (*transmit) (struct _cp_chan_t *c, void *tag, int len);
void (*receive) (struct _cp_chan_t *c, unsigned char *data, int len);
void (*error) (struct _cp_chan_t *c, int reason);
#define CP_FRAME 1
#define CP_CRC 2
#define CP_UNDERRUN 3
#define CP_OVERRUN 4
#define CP_OVERFLOW 5
} cp_chan_t;
typedef struct _cp_board_t {
unsigned char *base; /* base address of adapter registers */
unsigned char num; /* board number, 0..5 */
unsigned char type; /* board type Tau/TauE1/TauG703 */
#define B_TAUPCI 1 /* 2 channels V.35/RS */
#define B_TAUPCI_E3 2 /* 1 channel E3 */
#define B_TAUPCI_HSSI 3 /* 1 channel HSSI */
#define B_TAUPCI_G703 4 /* 2 channels G703 */
#define B_TAUPCI_E1 5 /* 2 channels E1 */
#define B_TAUPCI4 6 /* 4 channels V.35/RS */
#define B_TAUPCI4_G703 7 /* 2 channels G.703 + 2 channels V.35/RS */
#define B_TAUPCI4_4G703 8 /* 4 channels G.703 */
#define B_TAUPCI_2E1 9 /* 2 channels E1, 4 data ports */
#define B_TAUPCI4_E1 10 /* 2 channels E1 + 2 channels V.35/RS */
#define B_TAUPCI4_4E1 11 /* 4 channels E1 */
#define B_TAUPCI_L 12 /* 1 channel V.35/RS */
unsigned long osc; /* oscillator frequency */
char name[16]; /* board version name */
cp_chan_t chan[NCHAN]; /* channel structures */
unsigned char mux; /* E1 mux mode */
unsigned char dxc_cas; /* CAS cross-connection */
unsigned char bcr; /* BCR image */
unsigned char e1cfg; /* E1 CFG register image */
unsigned char gpidle; /* idle bits of gp port */
unsigned char E1DATA;
unsigned long intr; /* interrupt counter */
unsigned long *iqlx; /* LBI intr queue */
int iln;
unsigned char fw_type; /* firmware type */
#define FW_TAUPCI_NONE 0
#define FW_TAUPCI_E3_B 1
#define FW_TAUPCI_2E1_B 2
#define FW_TAUPCI_2E1_A 3
#define FW_TAUPCI_4E1_B 6
#define FW_TAUPCI_4E1_A 7
unsigned char *firmware[8]; /* external firmware */
void *sys;
} cp_board_t;
#pragma pack()
/* PCI device identifiers. */
extern unsigned short cp_vendor_id;
extern unsigned short cp_device_id;
/* Initialization. */
unsigned short cp_init (cp_board_t *b, int num, unsigned char *base);
void cp_reset (cp_board_t *b, cp_qbuf_t *buf, unsigned long phys);
void cp_hard_reset (cp_board_t *b);
unsigned long cp_regio (cp_chan_t *c, int op, int reg, unsigned long val);
#define REGIO_INB 0
#define REGIO_IN 1
#define REGIO_INS 2
#define REGIO_INX 3
#define REGIO_INB_OUTB 4
#define REGIO_OUTB 5
#define REGIO_OUTX 6
#define REGIO_R_W 7
#define REGIO_OUT_IN 8
#define REGIO_OUTB_INB 9
/* Callback registration. */
void cp_register_transmit (cp_chan_t *c, void (*func) (cp_chan_t*, void*, int));
void cp_register_receive (cp_chan_t *c, void (*func) (cp_chan_t*,
unsigned char*, int));
void cp_register_error (cp_chan_t *c, void (*func) (cp_chan_t*, int));
/* Data transmittion. */
void cp_start_chan (cp_chan_t *c, int tx, int rx, cp_buf_t *cb, unsigned long phys);
void cp_stop_chan (cp_chan_t *c);
void cp_start_e1 (cp_chan_t *c);
void cp_stop_e1 (cp_chan_t *c);
int cp_transmit_space (cp_chan_t *c);
int cp_send_packet (cp_chan_t *c, unsigned char *data, int len, void *tag);
/* Interrupt control. */
int cp_interrupt (cp_board_t *b);
int cp_interrupt_poll (cp_board_t *b, int ack);
void cp_handle_interrupt (cp_board_t *b);
void cp_enable_interrupt (cp_board_t *b, int on);
/* G.703 timer. */
void cp_g703_timer (cp_chan_t *c);
/* E1 timer. */
void cp_e1_timer (cp_chan_t *c);
/* E3 timer. */
void cp_e3_timer (cp_chan_t *c);
/* LED control. */
void cp_led (cp_board_t *b, int on);
/* Modem signals. */
void cp_set_dtr (cp_chan_t *c, int on);
void cp_set_rts (cp_chan_t *c, int on);
int cp_get_dsr (cp_chan_t *c);
int cp_get_cd (cp_chan_t *c);
int cp_get_cts (cp_chan_t *c);
int cp_get_txcerr (cp_chan_t *c);
int cp_get_rxcerr (cp_chan_t *c);
/* HDLC parameters. */
void cp_set_baud (cp_chan_t *c, int baud);
void cp_set_dpll (cp_chan_t *c, int on);
void cp_set_nrzi (cp_chan_t *c, int on);
void cp_set_invtxc (cp_chan_t *c, int on);
void cp_set_invrxc (cp_chan_t *c, int on);
void cp_set_lloop (cp_chan_t *c, int on);
/* Channel status, cable type. */
int cp_get_rloop (cp_chan_t *c);
int cp_get_lq (cp_chan_t *c);
int cp_get_cable (cp_chan_t *c);
#define CABLE_RS232 0
#define CABLE_V35 1
#define CABLE_RS530 2
#define CABLE_X21 3
#define CABLE_RS485 4
#define CABLE_NOT_ATTACHED 9
#define CABLE_COAX 10
#define CABLE_TP 11
/* E1/G.703 parameters. */
void cp_set_gsyn (cp_chan_t *c, int syn);
void cp_set_ts (cp_chan_t *c, unsigned long ts);
void cp_set_dir (cp_chan_t *c, int dir);
void cp_set_mux (cp_board_t *b, int on);
void cp_dxc_cas_enable (cp_board_t *b, int on);
void cp_set_dxc (cp_chan_t *c, cp_dxc_t *param);
void cp_set_higain (cp_chan_t *c, int on);
void cp_set_use16 (cp_chan_t *c, int on);
void cp_set_crc4 (cp_chan_t *c, int on);
void cp_set_phony (cp_chan_t *c, int on);
void cp_set_unfram (cp_chan_t *c, int on);
void cp_set_scrambler (cp_chan_t *c, int on);
void cp_set_monitor (cp_chan_t *c, int on);
/* E3 parameters. */
void cp_set_rloop (cp_chan_t *c, int on);
void cp_set_ber (cp_chan_t *c, int on);
void cp_set_cablen (cp_chan_t *c, int on);
void cp_set_losais (cp_chan_t *c, int on);
#endif /* CPDDK_COBF_SAFE */

View file

@ -1,519 +0,0 @@
/*-
* Ioctl interface to Cronyx serial drivers.
*
* Copyright (C) 1997-2002 Cronyx Engineering.
* Author: Serge Vakulenko, <vak@cronyx.ru>
*
* Copyright (C) 2001-2005 Cronyx Engineering.
* Author: Roman Kurakin, <rik@FreeBSD.org>
*
* Copyright (C) 2004-2005 Cronyx Engineering.
* Author: Leo Yuriev, <ly@cronyx.ru>
*
* This software is distributed with NO WARRANTIES, not even the implied
* warranties for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Authors grant any other persons or organisations permission to use
* or modify this software as long as this message is kept with the software,
* all derivative works or modified versions.
*
* Cronyx Id: cserial.h,v 1.4.2.2 2005/11/09 13:01:35 rik Exp $
* $FreeBSD$
*/
/*
* General channel statistics.
*/
struct serial_statistics {
unsigned long rintr; /* receive interrupts */
unsigned long tintr; /* transmit interrupts */
unsigned long mintr; /* modem interrupts */
unsigned long ibytes; /* input bytes */
unsigned long ipkts; /* input packets */
unsigned long ierrs; /* input errors */
unsigned long obytes; /* output bytes */
unsigned long opkts; /* output packets */
unsigned long oerrs; /* output errors */
};
/*
* Statistics for E1/G703 channels.
*/
struct e1_counters {
unsigned long bpv; /* bipolar violations */
unsigned long fse; /* frame sync errors */
unsigned long crce; /* CRC errors */
unsigned long rcrce; /* remote CRC errors (E-bit) */
unsigned long uas; /* unavailable seconds */
unsigned long les; /* line errored seconds */
unsigned long es; /* errored seconds */
unsigned long bes; /* bursty errored seconds */
unsigned long ses; /* severely errored seconds */
unsigned long oofs; /* out of frame seconds */
unsigned long css; /* controlled slip seconds */
unsigned long dm; /* degraded minutes */
};
struct e1_statistics {
unsigned long status; /* line status bit mask */
unsigned long cursec; /* seconds in current interval */
unsigned long totsec; /* total seconds elapsed */
struct e1_counters currnt; /* current 15-min interval data */
struct e1_counters total; /* total statistics data */
struct e1_counters interval [48]; /* 12 hour period data */
};
struct e3_statistics {
unsigned long status;
unsigned long cursec;
unsigned long totsec;
unsigned long ccv;
unsigned long tcv;
unsigned long icv[48];
};
#define M_ASYNC 0 /* asynchronous mode */
#define M_HDLC 1 /* bit-sync mode (HDLC) */
#define M_G703 2
#define M_E1 3
/*
* Receive error codes.
*/
#define ER_FRAMING 1 /* framing error */
#define ER_CHECKSUM 2 /* parity/CRC error */
#define ER_BREAK 3 /* break state */
#define ER_OVERFLOW 4 /* receive buffer overflow */
#define ER_OVERRUN 5 /* receive fifo overrun */
#define ER_UNDERRUN 6 /* transmit fifo underrun */
#define ER_SCC_FRAMING 7 /* subchannel framing error */
#define ER_SCC_OVERFLOW 8 /* subchannel receive buffer overflow */
#define ER_SCC_OVERRUN 9 /* subchannel receiver overrun */
#define ER_SCC_UNDERRUN 10 /* subchannel transmitter underrun */
#define ER_BUS 11 /* system bus is too busy (e.g PCI) */
/*
* E1 channel status.
*/
#define E1_NOALARM 0x0001 /* no alarm present */
#define E1_FARLOF 0x0002 /* receiving far loss of framing */
#define E1_CRC4E 0x0004 /* crc4 errors */
#define E1_AIS 0x0008 /* receiving all ones */
#define E1_LOF 0x0020 /* loss of framing */
#define E1_LOS 0x0040 /* loss of signal */
#define E1_AIS16 0x0100 /* receiving all ones in timeslot 16 */
#define E1_FARLOMF 0x0200 /* receiving alarm in timeslot 16 */
#define E1_LOMF 0x0400 /* loss of multiframe sync */
#define E1_TSTREQ 0x0800 /* test code detected */
#define E1_TSTERR 0x1000 /* test error */
#define E3_LOS 0x00000002 /* Lost of synchronization */
#define E3_TXE 0x00000004 /* Transmit error */
/*
* Query the mask of all registered channels, max 128.
*/
#define SERIAL_GETREGISTERED _IOR ('x', 0, char[16])
/*
* Attach/detach the protocol to the channel.
* The protocol is given by its name, char[8].
* For example "async", "hdlc", "cisco", "fr", "ppp".
*/
#define SERIAL_GETPROTO _IOR ('x', 1, char [8])
#define SERIAL_SETPROTO _IOW ('x', 1, char [8])
/*
* Query/set the hardware mode for the channel.
*/
#define SERIAL_GETMODE _IOR ('x', 2, int)
#define SERIAL_SETMODE _IOW ('x', 2, int)
#define SERIAL_ASYNC 1
#define SERIAL_HDLC 2
#define SERIAL_RAW 3
/*
* Get/clear the channel statistics.
*/
#define SERIAL_GETSTAT _IOR ('x', 3, struct serial_statistics)
#define SERIAL_GETESTAT _IOR ('x', 3, struct e1_statistics)
#define SERIAL_GETE3STAT _IOR ('x', 3, struct e3_statistics)
#define SERIAL_CLRSTAT _IO ('x', 3)
/*
* Query/set the synchronization mode and baud rate.
* If baud==0 then the external clock is used.
*/
#define SERIAL_GETBAUD _IOR ('x', 4, long)
#define SERIAL_SETBAUD _IOW ('x', 4, long)
/*
* Query/set the internal loopback mode,
* useful for debugging purposes.
*/
#define SERIAL_GETLOOP _IOR ('x', 5, int)
#define SERIAL_SETLOOP _IOW ('x', 5, int)
/*
* Query/set the DPLL mode, commonly used with NRZI
* for channels lacking synchro signals.
*/
#define SERIAL_GETDPLL _IOR ('x', 6, int)
#define SERIAL_SETDPLL _IOW ('x', 6, int)
/*
* Query/set the NRZI encoding (default is NRZ).
*/
#define SERIAL_GETNRZI _IOR ('x', 7, int)
#define SERIAL_SETNRZI _IOW ('x', 7, int)
/*
* Invert receive and transmit clock.
*/
#define SERIAL_GETINVCLK _IOR ('x', 8, int)
#define SERIAL_SETINVCLK _IOW ('x', 8, int)
/*
* Query/set the E1/G703 synchronization mode.
*/
#define SERIAL_GETCLK _IOR ('x', 9, int)
#define SERIAL_SETCLK _IOW ('x', 9, int)
#define E1CLK_RECOVERY -1
#define E1CLK_INTERNAL 0
#define E1CLK_RECEIVE 1
#define E1CLK_RECEIVE_CHAN0 2
#define E1CLK_RECEIVE_CHAN1 3
#define E1CLK_RECEIVE_CHAN2 4
#define E1CLK_RECEIVE_CHAN3 5
/*
* Query/set the E1 timeslot mask.
*/
#define SERIAL_GETTIMESLOTS _IOR ('x', 10, long)
#define SERIAL_SETTIMESLOTS _IOW ('x', 10, long)
/*
* Query/set the E1 subchannel timeslot mask.
*/
#define SERIAL_GETSUBCHAN _IOR ('x', 11, long)
#define SERIAL_SETSUBCHAN _IOW ('x', 11, long)
/*
* Query/set the high input sensitivity mode (E1).
*/
#define SERIAL_GETHIGAIN _IOR ('x', 12, int)
#define SERIAL_SETHIGAIN _IOW ('x', 12, int)
/*
* Query the input signal level in santibells.
*/
#define SERIAL_GETLEVEL _IOR ('x', 13, int)
/*
* Get the channel name.
*/
#define SERIAL_GETNAME _IOR ('x', 14, char [32])
/*
* Get version string.
*/
#define SERIAL_GETVERSIONSTRING _IOR ('x', 15, char [256])
/*
* Query/set master channel.
*/
#define SERIAL_GETMASTER _IOR ('x', 16, char [16])
#define SERIAL_SETMASTER _IOW ('x', 16, char [16])
/*
* Query/set keepalive.
*/
#define SERIAL_GETKEEPALIVE _IOR ('x', 17, int)
#define SERIAL_SETKEEPALIVE _IOW ('x', 17, int)
/*
* Query/set E1 configuration.
*/
#define SERIAL_GETCFG _IOR ('x', 18, char)
#define SERIAL_SETCFG _IOW ('x', 18, char)
/*
* Query/set debug.
*/
#define SERIAL_GETDEBUG _IOR ('x', 19, int)
#define SERIAL_SETDEBUG _IOW ('x', 19, int)
/*
* Query/set phony mode (E1).
*/
#define SERIAL_GETPHONY _IOR ('x', 20, int)
#define SERIAL_SETPHONY _IOW ('x', 20, int)
/*
* Query/set timeslot 16 usage mode (E1).
*/
#define SERIAL_GETUSE16 _IOR ('x', 21, int)
#define SERIAL_SETUSE16 _IOW ('x', 21, int)
/*
* Query/set crc4 mode (E1).
*/
#define SERIAL_GETCRC4 _IOR ('x', 22, int)
#define SERIAL_SETCRC4 _IOW ('x', 22, int)
/*
* Query/set the timeout to recover after transmit interrupt loss.
* If timo==0 recover will be disabled.
*/
#define SERIAL_GETTIMO _IOR ('x', 23, long)
#define SERIAL_SETTIMO _IOW ('x', 23, long)
/*
* Query/set port type for old models of Sigma
* -1 Fixed or cable select
* 0 RS-232
* 1 V35
* 2 RS-449
* 3 E1 (only for Windows 2000)
* 4 G.703 (only for Windows 2000)
* 5 DATA (only for Windows 2000)
* 6 E3 (only for Windows 2000)
* 7 T3 (only for Windows 2000)
* 8 STS1 (only for Windows 2000)
*/
#define SERIAL_GETPORT _IOR ('x', 25, int)
#define SERIAL_SETPORT _IOW ('x', 25, int)
/*
* Add the virtual channel DLCI (Frame Relay).
*/
#define SERIAL_ADDDLCI _IOW ('x', 26, int)
/*
* Invert receive clock.
*/
#define SERIAL_GETINVRCLK _IOR ('x', 27, int)
#define SERIAL_SETINVRCLK _IOW ('x', 27, int)
/*
* Invert transmit clock.
*/
#define SERIAL_GETINVTCLK _IOR ('x', 28, int)
#define SERIAL_SETINVTCLK _IOW ('x', 28, int)
/*
* Unframed E1 mode.
*/
#define SERIAL_GETUNFRAM _IOR ('x', 29, int)
#define SERIAL_SETUNFRAM _IOW ('x', 29, int)
/*
* E1 monitoring mode.
*/
#define SERIAL_GETMONITOR _IOR ('x', 30, int)
#define SERIAL_SETMONITOR _IOW ('x', 30, int)
/*
* Interrupt number.
*/
#define SERIAL_GETIRQ _IOR ('x', 31, int)
/*
* Reset.
*/
#define SERIAL_RESET _IO ('x', 32)
/*
* Hard reset.
*/
#define SERIAL_HARDRESET _IO ('x', 33)
/*
* Query cable type.
*/
#define SERIAL_GETCABLE _IOR ('x', 34, int)
/*
* Assignment of HDLC ports to E1 channels.
*/
#define SERIAL_GETDIR _IOR ('x', 35, int)
#define SERIAL_SETDIR _IOW ('x', 35, int)
struct dxc_table { /* cross-connector parameters */
unsigned char ts [32]; /* timeslot number */
unsigned char link [32]; /* E1 link number */
};
/*
* DXC cross-connector settings for E1 channels.
*/
#define SERIAL_GETDXC _IOR ('x', 36, struct dxc_table)
#define SERIAL_SETDXC _IOW ('x', 36, struct dxc_table)
/*
* Scrambler for G.703.
*/
#define SERIAL_GETSCRAMBLER _IOR ('x', 37, int)
#define SERIAL_SETSCRAMBLER _IOW ('x', 37, int)
/*
* Length of cable for T3 and STS-1.
*/
#define SERIAL_GETCABLEN _IOR ('x', 38, int)
#define SERIAL_SETCABLEN _IOW ('x', 38, int)
/*
* Remote loopback for E3, T3 and STS-1.
*/
#define SERIAL_GETRLOOP _IOR ('x', 39, int)
#define SERIAL_SETRLOOP _IOW ('x', 39, int)
/*
* G.703 line code
*/
#define SERIAL_GETLCODE _IOR ('x', 40, int)
#define SERIAL_SETLCODE _IOW ('x', 40, int)
/*
* MTU
*/
#define SERIAL_GETMTU _IOR ('x', 41, int)
#define SERIAL_SETMTU _IOW ('x', 41, int)
/*
* Receive Queue Length
*/
#define SERIAL_GETRQLEN _IOR ('x', 42, int)
#define SERIAL_SETRQLEN _IOW ('x', 42, int)
#ifdef __KERNEL__
#ifdef CRONYX_LYSAP
# define LYSAP_PEER_ADD _IOWR('x', 101, lysap_peer_config_t)
# define LYSAP_PEER_REMOVE _IOW('x', 102, unsigned)
# define LYSAP_PEER_INFO _IOWR('x', 103, lysap_peer_info_t)
# define LYSAP_PEER_COUNT _IOR('x', 104, unsigned)
# define LYSAP_PEER_ENUM _IOWR('x', 105, unsigned)
# define LYSAP_PEER_CLEAR _IOW('x', 106, unsigned)
# define LYSAP_CHAN_ADD _IOWR('x', 111, lysap_channel_config_t)
# define LYSAP_CHAN_REMOVE _IO('x', 112)
# define LYSAP_CHAN_INFO _IOR('x', 113, lysap_channel_info_t)
# define LYSAP_CHAN_COUNT _IOR('x', 114, unsigned)
# define LYSAP_CHAN_ENUM _IOWR('x', 115, unsigned)
# define LYSAP_CHAN_CLEAR _IO('x', 116)
# include "lysap-linux.h"
#else /* CRONYX_LYSAP */
typedef struct _lysap_channel_t lysap_channel_t;
typedef struct _lysap_channel_config_t lysap_channel_config_t;
typedef struct _LYSAP_DeviceInterfaceConfig LYSAP_DeviceInterfaceConfig;
typedef struct _LYSAP_ChannelConfig LYSAP_ChannelConfig;
typedef struct _lysap_buf_t lysap_buf_t;
#endif /* !CRONYX_LYSAP */
/*
* Dynamic binder interface.
*/
typedef struct _chan_t chan_t;
typedef struct _proto_t proto_t;
void binder_register_protocol (proto_t *p);
void binder_unregister_protocol (proto_t *p);
int binder_register_channel (chan_t *h, char *prefix, int minor);
void binder_unregister_channel (chan_t *h);
/*
* Hardware channel driver structure.
*/
struct sk_buff;
struct _chan_t {
char name [16];
int mtu; /* max packet size */
int fifosz; /* total hardware i/o buffer size */
int port; /* hardware base i/o port */
int irq; /* hardware interrupt line */
int minor; /* minor number 0..127, assigned by binder */
int debug; /* debug level, 0..2 */
int running; /* running, 0..1 */
struct _proto_t *proto; /* protocol interface data */
void *sw; /* protocol private data */
void *hw; /* hardware layer private data */
/* Interface to protocol */
int (*up) (chan_t *h);
void (*down) (chan_t *h);
int (*transmit) (chan_t *h, struct sk_buff *skb);
void (*set_dtr) (chan_t *h, int val);
void (*set_rts) (chan_t *h, int val);
int (*query_dtr) (chan_t *h);
int (*query_rts) (chan_t *h);
int (*query_dsr) (chan_t *h);
int (*query_cts) (chan_t *h);
int (*query_dcd) (chan_t *h);
/* Interface to async protocol */
void (*set_async_param) (chan_t *h, int baud, int bits, int parity,
int stop2, int ignpar, int rtscts,
int ixon, int ixany, int symstart, int symstop);
void (*send_break) (chan_t *h, int msec);
void (*send_xon) (chan_t *h);
void (*send_xoff) (chan_t *h);
void (*start_transmitter) (chan_t *h);
void (*stop_transmitter) (chan_t *h);
void (*flush_transmit_buffer) (chan_t *h);
/* Control interface */
int (*control) (chan_t *h, unsigned int cmd, unsigned long arg);
/* LYSAP interface */
struct lysap_t
{
lysap_channel_t *link;
int (*inspect_config)(chan_t *h, lysap_channel_config_t *,
LYSAP_DeviceInterfaceConfig *, LYSAP_ChannelConfig *);
unsigned long (*probe_freq)(chan_t *h, unsigned long freq);
unsigned long (*set_freq)(chan_t *h, unsigned long freq);
unsigned (*get_status)(chan_t *h);
int (*transmit) (chan_t *h, lysap_buf_t *b);
lysap_buf_t* (*alloc_buf) (chan_t *h, unsigned len);
int (*set_clock_master)(chan_t *h, int enable);
unsigned long (*get_master_freq)(chan_t *h);
} lysap;
};
/*
* Protocol driver structure.
*/
struct _proto_t {
char *name;
struct _proto_t *next;
/* Interface to channel */
void (*receive) (chan_t *h, struct sk_buff *skb);
void (*receive_error) (chan_t *h, int errcode);
void (*transmit) (chan_t *h);
void (*modem_event) (chan_t *h);
/* Interface to binder */
int (*open) (chan_t *h);
void (*close) (chan_t *h);
int (*read) (chan_t *h, unsigned short flg, char *buf, int len);
int (*write) (chan_t *h, unsigned short flg, const char *buf, int len);
int (*select) (chan_t *h, int type, void *st, struct file *filp);
struct fasync_struct *fasync;
/* Control interface */
int (*attach) (chan_t *h);
int (*detach) (chan_t *h);
int (*control) (chan_t *h, unsigned int cmd, unsigned long arg);
/* LYSAP interface */
void (*transmit_error) (chan_t *h, int errcode);
void (*lysap_notify_receive) (chan_t *h, lysap_buf_t *b);
void (*lysap_notify_transmit) (chan_t *h);
lysap_buf_t* (*lysap_get_data)(chan_t *h);
};
#endif /* KERNEL */

File diff suppressed because it is too large Load diff

View file

@ -1,27 +0,0 @@
/*-
* Defines for Cronyx-Tau-PCI adapter driver.
*
* Copyright (C) 1999-2004 Cronyx Engineering.
* Author: Kurakin Roman, <rik@cronyx.ru>
*
* This software is distributed with NO WARRANTIES, not even the implied
* warranties for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Authors grant any other persons or organisations a permission to use,
* modify and redistribute this software in source and binary forms,
* as long as this message is kept with the software, all derivative
* works or modified versions.
*
* $Cronyx: ng_cp.h,v 1.1.2.4 2004/01/27 14:39:11 rik Exp $
* $FreeBSD$
*/
#ifndef _CP_NETGRAPH_H_
#define _CP_NETGRAPH_H_
#define NG_CP_NODE_TYPE "cp"
#define NGM_CP_COOKIE 941049562
#define NG_CP_HOOK_RAW "rawdata"
#define NG_CP_HOOK_DEBUG "debug"
#endif /* _CP_NETGRAPH_H_ */

View file

@ -86,7 +86,6 @@ SUBDIR= \
${_chromebook_platform} \
${_ciss} \
${_coretemp} \
${_cp} \
${_cpsw} \
${_cpuctl} \
${_cpufreq} \
@ -810,9 +809,6 @@ _vmm= vmm
# XXX some of these can move now, but are untested on other architectures.
_3dfx= 3dfx
_3dfx_linux= 3dfx_linux
.if ${MK_SOURCELESS_HOST} != "no"
_cp= cp
.endif
_glxiic= glxiic
_glxsb= glxsb
_pcfclock= pcfclock

View file

@ -1,11 +0,0 @@
# $Cronyx: sys.modules.cp.Makefile,v 1.1.2.3 2004/04/28 16:17:57 rik Exp $
# $FreeBSD$
.PATH: ${SRCTOP}/sys/dev/cp
KMOD = if_cp
SRCS = if_cp.c cpddk.c
SRCS += device_if.h bus_if.h pci_if.h
.include <bsd.kmod.mk>
CWARNFLAGS.cpddk.c+= ${NO_WMISLEADING_INDENTATION}