diff options
| author | Jeff Garzik <jgarzik@redhat.com> | 2004-02-06 14:00:35 -0500 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@redhat.com> | 2004-02-06 14:00:35 -0500 |
| commit | 0c92609a946c935ca95af41f13e999dca5eec42e (patch) | |
| tree | e70796a04696a207243eecba3dafd453f785d5c7 /include/linux | |
| parent | f4d8611049b6a0e69973f263c93e4c71c854be82 (diff) | |
| parent | 3980a81c02155fdacfb040f6bf57203989964788 (diff) | |
Merge redhat.com:/spare/repo/linux-2.5
into redhat.com:/spare/repo/netdev-2.6/netdev-alloc-6
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/hdlc.h | 57 | ||||
| -rw-r--r-- | include/linux/lapb.h | 28 |
2 files changed, 40 insertions, 45 deletions
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index 7b35bd079439..4b925472ac16 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h @@ -75,7 +75,7 @@ typedef struct { typedef struct pvc_device_struct { - struct hdlc_device_struct *master; + struct net_device *master; struct net_device *main; struct net_device *ether; /* bridged Ethernet interface */ struct pvc_device_struct *next; /* Sorted in ascending DLCI order */ @@ -96,11 +96,10 @@ typedef struct pvc_device_struct { typedef struct hdlc_device_struct { /* To be initialized by hardware driver */ - struct net_device netdev; /* master net device - must be first */ struct net_device_stats stats; /* used by HDLC layer to take control over HDLC device from hw driver*/ - int (*attach)(struct hdlc_device_struct *hdlc, + int (*attach)(struct net_device *dev, unsigned short encoding, unsigned short parity); /* hardware driver must handle this instead of dev->hard_start_xmit */ @@ -109,13 +108,13 @@ typedef struct hdlc_device_struct { /* Things below are for HDLC layer internal use only */ struct { - int (*open)(struct hdlc_device_struct *hdlc); - void (*close)(struct hdlc_device_struct *hdlc); + int (*open)(struct net_device *dev); + void (*close)(struct net_device *dev); /* if open & DCD */ - void (*start)(struct hdlc_device_struct *hdlc); + void (*start)(struct net_device *dev); /* if open & !DCD */ - void (*stop)(struct hdlc_device_struct *hdlc); + void (*stop)(struct net_device *dev); void (*detach)(struct hdlc_device_struct *hdlc); int (*netif_rx)(struct sk_buff *skb); @@ -167,16 +166,17 @@ typedef struct hdlc_device_struct { int new_mtu); }ppp; }state; + void *priv; }hdlc_device; -int hdlc_raw_ioctl(hdlc_device *hdlc, struct ifreq *ifr); -int hdlc_raw_eth_ioctl(hdlc_device *hdlc, struct ifreq *ifr); -int hdlc_cisco_ioctl(hdlc_device *hdlc, struct ifreq *ifr); -int hdlc_ppp_ioctl(hdlc_device *hdlc, struct ifreq *ifr); -int hdlc_fr_ioctl(hdlc_device *hdlc, struct ifreq *ifr); -int hdlc_x25_ioctl(hdlc_device *hdlc, struct ifreq *ifr); +int hdlc_raw_ioctl(struct net_device *dev, struct ifreq *ifr); +int hdlc_raw_eth_ioctl(struct net_device *dev, struct ifreq *ifr); +int hdlc_cisco_ioctl(struct net_device *dev, struct ifreq *ifr); +int hdlc_ppp_ioctl(struct net_device *dev, struct ifreq *ifr); +int hdlc_fr_ioctl(struct net_device *dev, struct ifreq *ifr); +int hdlc_x25_ioctl(struct net_device *dev, struct ifreq *ifr); /* Exported from hdlc.o */ @@ -185,19 +185,14 @@ int hdlc_x25_ioctl(hdlc_device *hdlc, struct ifreq *ifr); int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); /* Must be used by hardware driver on module startup/exit */ -int register_hdlc_device(hdlc_device *hdlc); -void unregister_hdlc_device(hdlc_device *hdlc); - - -static __inline__ struct net_device* hdlc_to_dev(hdlc_device *hdlc) -{ - return &hdlc->netdev; -} +int register_hdlc_device(struct net_device *dev); +void unregister_hdlc_device(struct net_device *dev); +struct net_device *alloc_hdlcdev(void *priv); static __inline__ hdlc_device* dev_to_hdlc(struct net_device *dev) { - return (hdlc_device*)dev; + return netdev_priv(dev); } @@ -207,12 +202,6 @@ static __inline__ pvc_device* dev_to_pvc(struct net_device *dev) } -static __inline__ const char *hdlc_to_name(hdlc_device *hdlc) -{ - return hdlc_to_dev(hdlc)->name; -} - - static __inline__ void debug_frame(const struct sk_buff *skb) { int i; @@ -229,11 +218,11 @@ static __inline__ void debug_frame(const struct sk_buff *skb) /* Must be called by hardware driver when HDLC device is being opened */ -int hdlc_open(hdlc_device *hdlc); +int hdlc_open(struct net_device *dev); /* Must be called by hardware driver when HDLC device is being closed */ -void hdlc_close(hdlc_device *hdlc); +void hdlc_close(struct net_device *dev); /* Called by hardware driver when DCD line level changes */ -void hdlc_set_carrier(int on, hdlc_device *hdlc); +void hdlc_set_carrier(int on, struct net_device *dev); /* May be used by hardware driver to gain control over HDLC device */ static __inline__ void hdlc_proto_detach(hdlc_device *hdlc) @@ -244,6 +233,12 @@ static __inline__ void hdlc_proto_detach(hdlc_device *hdlc) } +static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev) +{ + return &dev_to_hdlc(dev)->stats; +} + + static __inline__ unsigned short hdlc_type_trans(struct sk_buff *skb, struct net_device *dev) { diff --git a/include/linux/lapb.h b/include/linux/lapb.h index 2eeb76f2cf5c..ce709e1885cc 100644 --- a/include/linux/lapb.h +++ b/include/linux/lapb.h @@ -24,12 +24,12 @@ #define LAPB_DCE 0x04 struct lapb_register_struct { - void (*connect_confirmation)(void *token, int reason); - void (*connect_indication)(void *token, int reason); - void (*disconnect_confirmation)(void *token, int reason); - void (*disconnect_indication)(void *token, int reason); - int (*data_indication)(void *token, struct sk_buff *skb); - void (*data_transmit)(void *token, struct sk_buff *skb); + void (*connect_confirmation)(struct net_device *dev, int reason); + void (*connect_indication)(struct net_device *dev, int reason); + void (*disconnect_confirmation)(struct net_device *dev, int reason); + void (*disconnect_indication)(struct net_device *dev, int reason); + int (*data_indication)(struct net_device *dev, struct sk_buff *skb); + void (*data_transmit)(struct net_device *dev, struct sk_buff *skb); }; struct lapb_parms_struct { @@ -44,13 +44,13 @@ struct lapb_parms_struct { unsigned int mode; }; -extern int lapb_register(void *token, struct lapb_register_struct *callbacks); -extern int lapb_unregister(void *token); -extern int lapb_getparms(void *token, struct lapb_parms_struct *parms); -extern int lapb_setparms(void *token, struct lapb_parms_struct *parms); -extern int lapb_connect_request(void *token); -extern int lapb_disconnect_request(void *token); -extern int lapb_data_request(void *token, struct sk_buff *skb); -extern int lapb_data_received(void *token, struct sk_buff *skb); +extern int lapb_register(struct net_device *dev, struct lapb_register_struct *callbacks); +extern int lapb_unregister(struct net_device *dev); +extern int lapb_getparms(struct net_device *dev, struct lapb_parms_struct *parms); +extern int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms); +extern int lapb_connect_request(struct net_device *dev); +extern int lapb_disconnect_request(struct net_device *dev); +extern int lapb_data_request(struct net_device *dev, struct sk_buff *skb); +extern int lapb_data_received(struct net_device *dev, struct sk_buff *skb); #endif |
