Now that most of this file is new, stylify the rest and correct the

style bugs (space/tab) introduced by me.
This commit is contained in:
Hartmut Brandt 2003-06-18 10:53:49 +00:00
parent 44be139bbb
commit 92fe9ad65b

View File

@ -40,19 +40,19 @@
/*
* Classification of ATM cards.
*/
#define ATM_DEVICE_UNKNOWN 0
#define ATM_DEVICE_PCA200E 1 /* Fore/Marconi PCA200-E */
#define ATM_DEVICE_HE155 2 /* Fore/Marconi HE155 */
#define ATM_DEVICE_HE622 3 /* Fore/Marconi HE622 */
#define ATM_DEVICE_ENI155P 4 /* Efficient networks 155p */
#define ATM_DEVICE_ADP155P 5 /* Adaptec 155p */
#define ATM_DEVICE_UNKNOWN 0
#define ATM_DEVICE_PCA200E 1 /* Fore/Marconi PCA200-E */
#define ATM_DEVICE_HE155 2 /* Fore/Marconi HE155 */
#define ATM_DEVICE_HE622 3 /* Fore/Marconi HE622 */
#define ATM_DEVICE_ENI155P 4 /* Efficient networks 155p */
#define ATM_DEVICE_ADP155P 5 /* Adaptec 155p */
#define ATM_DEVICE_FORELE25 6 /* ForeRunnerLE 25 */
#define ATM_DEVICE_FORELE155 7 /* ForeRunnerLE 155 */
#define ATM_DEVICE_NICSTAR25 8 /* other 77211 25.6MBit */
#define ATM_DEVICE_NICSTAR25 8 /* other 77211 25.6MBit */
#define ATM_DEVICE_NICSTAR155 9 /* other 77211 155MBit */
/* map to strings and vendors */
#define ATM_DEVICE_NAMES \
#define ATM_DEVICE_NAMES \
{ "Unknown", "Unknown" }, \
{ "PCA200-E", "Fore/Marconi" }, \
{ "HE155", "Fore/Marconi" }, \
@ -122,23 +122,23 @@ struct atmio_vcc {
};
/* VCC flags */
#define ATMIO_FLAG_LLCSNAP 0x0002 /* same as ATM_PH_LLCSNAP */
#define ATMIO_FLAG_NG 0x0010 /* owned by netgraph */
#define ATMIO_FLAG_HARP 0x0020 /* owned by HARP */
#define ATMIO_FLAG_NORX 0x0100 /* not receiving on this VCC */
#define ATMIO_FLAG_NOTX 0x0200 /* not transmitting on this VCC */
#define ATMIO_FLAG_PVC 0x0400 /* this is a PVC */
#define ATMIO_FLAGS "\020\2LLCSNAP\5NG\6HARP\11NORX\12NOTX\13PVC"
#define ATMIO_FLAG_LLCSNAP 0x0002 /* same as ATM_PH_LLCSNAP */
#define ATMIO_FLAG_NG 0x0010 /* owned by netgraph */
#define ATMIO_FLAG_HARP 0x0020 /* owned by HARP */
#define ATMIO_FLAG_NORX 0x0100 /* not receiving on this VCC */
#define ATMIO_FLAG_NOTX 0x0200 /* not transmitting on this VCC */
#define ATMIO_FLAG_PVC 0x0400 /* this is a PVC */
#define ATMIO_FLAGS "\020\2LLCSNAP\5NG\6HARP\11NORX\12NOTX\13PVC"
#define ATMIO_AAL_0 0 /* pure cells */
#define ATMIO_AAL_34 4 /* AAL3 and 4 */
#define ATMIO_AAL_5 5 /* AAL5 */
#define ATMIO_AAL_RAW 10 /* whatever the card does */
#define ATMIO_AAL_0 0 /* pure cells */
#define ATMIO_AAL_34 4 /* AAL3 and 4 */
#define ATMIO_AAL_5 5 /* AAL5 */
#define ATMIO_AAL_RAW 10 /* whatever the card does */
#define ATMIO_TRAFFIC_UBR 0
#define ATMIO_TRAFFIC_CBR 1
#define ATMIO_TRAFFIC_ABR 2
#define ATMIO_TRAFFIC_VBR 3
#define ATMIO_TRAFFIC_UBR 0
#define ATMIO_TRAFFIC_CBR 1
#define ATMIO_TRAFFIC_ABR 2
#define ATMIO_TRAFFIC_VBR 3
/*
* VCC table
@ -155,9 +155,9 @@ struct atmio_vcctable {
* different opinions on what the correct values are.
*/
#define ATM_RATE_25_6M 59259
#define ATM_RATE_155M 353208
#define ATM_RATE_622M 1412830
#define ATM_RATE_2_4G 5651320
#define ATM_RATE_155M 353208
#define ATM_RATE_622M 1412830
#define ATM_RATE_2_4G 5651320
/*
* Common fields for all ATM interfaces. Each driver's softc must start with
@ -187,75 +187,73 @@ struct atmio_closevcc {
};
#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
#define RTALLOC1(A,B) rtalloc1((A),(B))
#define RTALLOC1(A,B) rtalloc1((A),(B))
#elif defined(__FreeBSD__)
#define RTALLOC1(A,B) rtalloc1((A),(B),0UL)
#define RTALLOC1(A,B) rtalloc1((A),(B),0UL)
#endif
/*
* pseudo header for packet transmission
*/
struct atm_pseudohdr {
u_int8_t atm_ph[4]; /* flags+VPI+VCI1(msb)+VCI2(lsb) */
uint8_t atm_ph[4]; /* flags+VPI+VCI1(msb)+VCI2(lsb) */
};
#define ATM_PH_FLAGS(X) ((X)->atm_ph[0])
#define ATM_PH_VPI(X) ((X)->atm_ph[1])
#define ATM_PH_VCI(X) ((((X)->atm_ph[2]) << 8) | ((X)->atm_ph[3]))
#define ATM_PH_SETVCI(X,V) { \
#define ATM_PH_FLAGS(X) ((X)->atm_ph[0])
#define ATM_PH_VPI(X) ((X)->atm_ph[1])
#define ATM_PH_VCI(X) ((((X)->atm_ph[2]) << 8) | ((X)->atm_ph[3]))
#define ATM_PH_SETVCI(X,V) { \
(X)->atm_ph[2] = ((V) >> 8) & 0xff; \
(X)->atm_ph[3] = ((V) & 0xff); \
}
#define ATM_PH_AAL5 0x01 /* use AAL5? (0 == aal0) */
#define ATM_PH_LLCSNAP 0x02 /* use the LLC SNAP encoding (iff aal5) */
#define ATM_PH_AAL5 0x01 /* use AAL5? (0 == aal0) */
#define ATM_PH_LLCSNAP 0x02 /* use the LLC SNAP encoding (iff aal5) */
#define ATM_PH_DRIVER7 0x40 /* reserve for driver's use */
#define ATM_PH_DRIVER8 0x80 /* reserve for driver's use */
#define ATM_PH_DRIVER7 0x40 /* reserve for driver's use */
#define ATM_PH_DRIVER8 0x80 /* reserve for driver's use */
#define ATMMTU 9180 /* ATM MTU size for IP */
#define ATMMTU 9180 /* ATM MTU size for IP */
/* XXX: could be 9188 with LLC/SNAP according
to comer */
/* user's ioctl hook for raw atm mode */
#define SIOCRAWATM _IOWR('a', 122, int) /* set driver's raw mode */
#define SIOCRAWATM _IOWR('a', 122, int) /* set driver's raw mode */
/* atm_pseudoioctl: turns on and off RX VCIs [for internal use only!] */
struct atm_pseudoioctl {
struct atm_pseudohdr aph;
void *rxhand;
struct atm_pseudohdr aph;
void *rxhand;
};
#define SIOCATMENA _IOWR('a', 123, struct atm_pseudoioctl) /* enable */
#define SIOCATMDIS _IOWR('a', 124, struct atm_pseudoioctl) /* disable */
#define SIOCATMGETVCCS _IOW('a', 125, struct atmio_vcctable)
#define SIOCATMOPENVCC _IOR('a', 126, struct atmio_openvcc)
#define SIOCATMCLOSEVCC _IOR('a', 127, struct atmio_closevcc)
#define SIOCATMENA _IOWR('a', 123, struct atm_pseudoioctl) /* enable */
#define SIOCATMDIS _IOWR('a', 124, struct atm_pseudoioctl) /* disable */
#define SIOCATMGETVCCS _IOW('a', 125, struct atmio_vcctable)
#define SIOCATMOPENVCC _IOR('a', 126, struct atmio_openvcc)
#define SIOCATMCLOSEVCC _IOR('a', 127, struct atmio_closevcc)
#define SIOCATMGVCCS _IOWR('i', 230, struct ifreq)
#define SIOCATMGVCCS _IOWR('i', 230, struct ifreq)
/*
* XXX forget all the garbage in if_llc.h and do it the easy way
*/
#define ATMLLC_HDR "\252\252\3\0\0\0"
#define ATMLLC_HDR "\252\252\3\0\0\0"
struct atmllc {
u_int8_t llchdr[6]; /* aa.aa.03.00.00.00 */
u_int8_t type[2]; /* "ethernet" type */
uint8_t llchdr[6]; /* aa.aa.03.00.00.00 */
uint8_t type[2]; /* "ethernet" type */
};
/* ATM_LLC macros: note type code in host byte order */
#define ATM_LLC_TYPE(X) (((X)->type[0] << 8) | ((X)->type[1]))
#define ATM_LLC_SETTYPE(X,V) { \
(X)->type[0] = ((V) >> 8) & 0xff; \
(X)->type[1] = ((V) & 0xff); \
}
#define ATM_LLC_TYPE(X) (((X)->type[0] << 8) | ((X)->type[1]))
#define ATM_LLC_SETTYPE(X, V) do { \
(X)->type[0] = ((V) >> 8) & 0xff; \
(X)->type[1] = ((V) & 0xff); \
} while (0)
#ifdef _KERNEL
void atm_ifattach(struct ifnet *);
void atm_ifdetach(struct ifnet *);
void atm_input(struct ifnet *, struct atm_pseudohdr *,
struct mbuf *, void *);
struct mbuf *, void *);
int atm_output(struct ifnet *, struct mbuf *, struct sockaddr *,
struct rtentry *);
struct rtentry *);
#endif