Commit c755a968 authored by François Romieu's avatar François Romieu Committed by Jeff Garzik

WAN drivers update 5/5:

New file and directory include/linux/hdlc/ioctl.h, containing
only WAN ioctl-related definitions.
Update include/linux/if.h to reference these structures, providing
us with complete type safety, including through ioctls.
parent 0a1e27af
...@@ -18,20 +18,6 @@ ...@@ -18,20 +18,6 @@
#define CLOCK_TXINT 3 /* Internal TX and external RX clock */ #define CLOCK_TXINT 3 /* Internal TX and external RX clock */
#define CLOCK_TXFROMRX 4 /* TX clock derived from external RX clock */ #define CLOCK_TXFROMRX 4 /* TX clock derived from external RX clock */
typedef struct {
unsigned int clock_rate; /* bits per second */
unsigned int clock_type; /* internal, external, TX-internal etc. */
unsigned short loopback;
}sync_serial_settings; /* V.35, V.24, X.21 */
typedef struct {
unsigned int clock_rate; /* bits per second */
unsigned int clock_type; /* internal, external, TX-internal etc. */
unsigned short loopback;
unsigned int slot_map;
}te1_settings; /* T1, E1 */
#define ENCODING_DEFAULT 0 /* Default (current) setting */ #define ENCODING_DEFAULT 0 /* Default (current) setting */
#define ENCODING_NRZ 1 #define ENCODING_NRZ 1
...@@ -50,38 +36,11 @@ typedef struct { ...@@ -50,38 +36,11 @@ typedef struct {
#define PARITY_CRC32_PR0_CCITT 6 /* CRC32, initial value 0x00000000 */ #define PARITY_CRC32_PR0_CCITT 6 /* CRC32, initial value 0x00000000 */
#define PARITY_CRC32_PR1_CCITT 7 /* CRC32, initial value 0xFFFFFFFF */ #define PARITY_CRC32_PR1_CCITT 7 /* CRC32, initial value 0xFFFFFFFF */
typedef struct {
unsigned short encoding;
unsigned short parity;
}raw_hdlc_proto;
#define LMI_DEFAULT 0 /* Default (current) setting */ #define LMI_DEFAULT 0 /* Default (current) setting */
#define LMI_NONE 1 /* No LMI, all PVCs are static */ #define LMI_NONE 1 /* No LMI, all PVCs are static */
#define LMI_ANSI 2 /* ANSI Annex D */ #define LMI_ANSI 2 /* ANSI Annex D */
#define LMI_CCITT 3 /* ITU-T Annex A */ #define LMI_CCITT 3 /* ITU-T Annex A */
typedef struct {
unsigned int t391;
unsigned int t392;
unsigned int n391;
unsigned int n392;
unsigned int n393;
unsigned short lmi;
unsigned short dce; /* 1 for DCE (network side) operation */
}fr_proto;
typedef struct {
unsigned int dlci;
}fr_proto_pvc; /* for creating/deleting FR PVCs */
typedef struct {
unsigned int interval;
unsigned int timeout;
}cisco_proto;
/* PPP doesn't need any info now - supply length = 0 to ioctl */ /* PPP doesn't need any info now - supply length = 0 to ioctl */
...@@ -90,6 +49,7 @@ typedef struct { ...@@ -90,6 +49,7 @@ typedef struct {
#include <linux/skbuff.h> #include <linux/skbuff.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <net/syncppp.h> #include <net/syncppp.h>
#include <linux/hdlc/ioctl.h>
#define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */ #define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */
#define HDLC_MAX_MRU (HDLC_MAX_MTU + 10) /* max 10 bytes for FR */ #define HDLC_MAX_MRU (HDLC_MAX_MTU + 10) /* max 10 bytes for FR */
......
#ifndef __HDLC_IOCTL_H__
#define __HDLC_IOCTL_H__
typedef struct {
unsigned int clock_rate; /* bits per second */
unsigned int clock_type; /* internal, external, TX-internal etc. */
unsigned short loopback;
} sync_serial_settings; /* V.35, V.24, X.21 */
typedef struct {
unsigned int clock_rate; /* bits per second */
unsigned int clock_type; /* internal, external, TX-internal etc. */
unsigned short loopback;
unsigned int slot_map;
} te1_settings; /* T1, E1 */
typedef struct {
unsigned short encoding;
unsigned short parity;
} raw_hdlc_proto;
typedef struct {
unsigned int t391;
unsigned int t392;
unsigned int n391;
unsigned int n392;
unsigned int n393;
unsigned short lmi;
unsigned short dce; /* 1 for DCE (network side) operation */
} fr_proto;
typedef struct {
unsigned int dlci;
} fr_proto_pvc; /* for creating/deleting FR PVCs */
typedef struct {
unsigned int interval;
unsigned int timeout;
} cisco_proto;
/* PPP doesn't need any info now - supply length = 0 to ioctl */
union hdlc_settings {
raw_hdlc_proto raw_hdlc;
cisco_proto cisco;
fr_proto fr;
fr_proto_pvc fr_pvc;
};
union line_settings {
sync_serial_settings sync;
te1_settings te1;
};
#endif /* __HDLC_IOCTL_H__ */
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/types.h> /* for "__kernel_caddr_t" et al */ #include <linux/types.h> /* for "__kernel_caddr_t" et al */
#include <linux/socket.h> /* for "struct sockaddr" et al */ #include <linux/socket.h> /* for "struct sockaddr" et al */
#include <linux/hdlc/ioctl.h>
/* Standard interface flags (netdevice->flags). */ /* Standard interface flags (netdevice->flags). */
#define IFF_UP 0x1 /* interface is up */ #define IFF_UP 0x1 /* interface is up */
...@@ -95,10 +96,15 @@ struct ifmap ...@@ -95,10 +96,15 @@ struct ifmap
struct if_settings struct if_settings
{ {
unsigned int type; /* Type of physical device or protocol */ unsigned int type; /* Type of physical device or protocol */
unsigned int data_length; /* device/protocol data length */ union {
void * data; /* pointer to data, ignored if length = 0 */ /* {atm/eth/dsl}_settings anyone ? */
union hdlc_settings ifsu_hdlc;
union line_settings ifsu_line;
} ifs_ifsu;
}; };
#define ifs_hdlc ifs_ifsu.ifsu_hdlc
#define ifs_line ifs_ifsu.ifsu_line
/* /*
* Interface request structure used for socket * Interface request structure used for socket
...@@ -129,7 +135,7 @@ struct ifreq ...@@ -129,7 +135,7 @@ struct ifreq
char ifru_slave[IFNAMSIZ]; /* Just fits the size */ char ifru_slave[IFNAMSIZ]; /* Just fits the size */
char ifru_newname[IFNAMSIZ]; char ifru_newname[IFNAMSIZ];
char * ifru_data; char * ifru_data;
struct if_settings ifru_settings; struct if_settings *ifru_settings;
} ifr_ifru; } ifr_ifru;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment