aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-02-06 06:52:44 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-06 06:52:44 -0500
commit655d2ce073f5927194dbc28d2bd3c062a4a3caac (patch)
tree9fa289764e2b3cd8dbdc6d11299f0f16b93414b6 /include
parent9c1ca6e68a5d8d58776833b6496c0656a10be50c (diff)
parent370076d932ff56a02b9c5328729a69d432cd4b32 (diff)
Merge branch 'upstream-davem' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
Diffstat (limited to 'include')
-rw-r--r--include/linux/hdlc.h25
1 files changed, 7 insertions, 18 deletions
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index db390c511ada..6115545a5b9c 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -26,13 +26,6 @@
26#include <linux/netdevice.h> 26#include <linux/netdevice.h>
27#include <linux/hdlc/ioctl.h> 27#include <linux/hdlc/ioctl.h>
28 28
29
30/* Used by all network devices here, pointed to by netdev_priv(dev) */
31struct hdlc_device_desc {
32 int (*netif_rx)(struct sk_buff *skb);
33 struct net_device_stats stats;
34};
35
36/* This structure is a private property of HDLC protocols. 29/* This structure is a private property of HDLC protocols.
37 Hardware drivers have no interest here */ 30 Hardware drivers have no interest here */
38 31
@@ -44,12 +37,15 @@ struct hdlc_proto {
44 void (*detach)(struct net_device *dev); 37 void (*detach)(struct net_device *dev);
45 int (*ioctl)(struct net_device *dev, struct ifreq *ifr); 38 int (*ioctl)(struct net_device *dev, struct ifreq *ifr);
46 __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev); 39 __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev);
40 int (*netif_rx)(struct sk_buff *skb);
47 struct module *module; 41 struct module *module;
48 struct hdlc_proto *next; /* next protocol in the list */ 42 struct hdlc_proto *next; /* next protocol in the list */
49}; 43};
50 44
51 45
46/* Pointed to by dev->priv */
52typedef struct hdlc_device { 47typedef struct hdlc_device {
48 struct net_device_stats stats;
53 /* used by HDLC layer to take control over HDLC device from hw driver*/ 49 /* used by HDLC layer to take control over HDLC device from hw driver*/
54 int (*attach)(struct net_device *dev, 50 int (*attach)(struct net_device *dev,
55 unsigned short encoding, unsigned short parity); 51 unsigned short encoding, unsigned short parity);
@@ -83,18 +79,11 @@ void unregister_hdlc_protocol(struct hdlc_proto *proto);
83 79
84struct net_device *alloc_hdlcdev(void *priv); 80struct net_device *alloc_hdlcdev(void *priv);
85 81
86 82static inline struct hdlc_device* dev_to_hdlc(struct net_device *dev)
87static __inline__ struct hdlc_device_desc* dev_to_desc(struct net_device *dev)
88{
89 return netdev_priv(dev);
90}
91
92static __inline__ hdlc_device* dev_to_hdlc(struct net_device *dev)
93{ 83{
94 return netdev_priv(dev) + sizeof(struct hdlc_device_desc); 84 return dev->priv;
95} 85}
96 86
97
98static __inline__ void debug_frame(const struct sk_buff *skb) 87static __inline__ void debug_frame(const struct sk_buff *skb)
99{ 88{
100 int i; 89 int i;
@@ -116,13 +105,13 @@ int hdlc_open(struct net_device *dev);
116void hdlc_close(struct net_device *dev); 105void hdlc_close(struct net_device *dev);
117 106
118int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, 107int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto,
119 int (*rx)(struct sk_buff *skb), size_t size); 108 size_t size);
120/* May be used by hardware driver to gain control over HDLC device */ 109/* May be used by hardware driver to gain control over HDLC device */
121void detach_hdlc_protocol(struct net_device *dev); 110void detach_hdlc_protocol(struct net_device *dev);
122 111
123static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev) 112static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev)
124{ 113{
125 return &dev_to_desc(dev)->stats; 114 return &dev_to_hdlc(dev)->stats;
126} 115}
127 116
128 117