Merge branch 'topic/core-cleanup' into for-linus
[safe/jmp/linux-2.6] / include / linux / hdlc.h
index db390c5..ee275c8 100644 (file)
 #include <linux/netdevice.h>
 #include <linux/hdlc/ioctl.h>
 
-
-/* Used by all network devices here, pointed to by netdev_priv(dev) */
-struct hdlc_device_desc {
-       int (*netif_rx)(struct sk_buff *skb);
-       struct net_device_stats stats;
-};
-
 /* This structure is a private property of HDLC protocols.
    Hardware drivers have no interest here */
 
@@ -44,18 +37,21 @@ struct hdlc_proto {
        void (*detach)(struct net_device *dev);
        int (*ioctl)(struct net_device *dev, struct ifreq *ifr);
        __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev);
+       int (*netif_rx)(struct sk_buff *skb);
+       netdev_tx_t (*xmit)(struct sk_buff *skb, struct net_device *dev);
        struct module *module;
        struct hdlc_proto *next; /* next protocol in the list */
 };
 
 
+/* Pointed to by netdev_priv(dev) */
 typedef struct hdlc_device {
        /* used by HDLC layer to take control over HDLC device from hw driver*/
        int (*attach)(struct net_device *dev,
                      unsigned short encoding, unsigned short parity);
 
        /* hardware driver must handle this instead of dev->hard_start_xmit */
-       int (*xmit)(struct sk_buff *skb, struct net_device *dev);
+       netdev_tx_t (*xmit)(struct sk_buff *skb, struct net_device *dev);
 
        /* Things below are for HDLC layer internal use only */
        const struct hdlc_proto *proto;
@@ -64,7 +60,7 @@ typedef struct hdlc_device {
        spinlock_t state_lock;
        void *state;
        void *priv;
-}hdlc_device;
+} hdlc_device;
 
 
 
@@ -83,18 +79,11 @@ void unregister_hdlc_protocol(struct hdlc_proto *proto);
 
 struct net_device *alloc_hdlcdev(void *priv);
 
-
-static __inline__ struct hdlc_device_desc* dev_to_desc(struct net_device *dev)
+static inline struct hdlc_device* dev_to_hdlc(struct net_device *dev)
 {
        return netdev_priv(dev);
 }
 
-static __inline__ hdlc_device* dev_to_hdlc(struct net_device *dev)
-{
-       return netdev_priv(dev) + sizeof(struct hdlc_device_desc);
-}
-
-
 static __inline__ void debug_frame(const struct sk_buff *skb)
 {
        int i;
@@ -114,18 +103,16 @@ static __inline__ void debug_frame(const struct sk_buff *skb)
 int hdlc_open(struct net_device *dev);
 /* Must be called by hardware driver when HDLC device is being closed */
 void hdlc_close(struct net_device *dev);
+/* May be used by hardware driver */
+int hdlc_change_mtu(struct net_device *dev, int new_mtu);
+/* Must be pointed to by hw driver's dev->netdev_ops->ndo_start_xmit */
+netdev_tx_t hdlc_start_xmit(struct sk_buff *skb, struct net_device *dev);
 
 int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto,
-                        int (*rx)(struct sk_buff *skb), size_t size);
+                        size_t size);
 /* May be used by hardware driver to gain control over HDLC device */
 void detach_hdlc_protocol(struct net_device *dev);
 
-static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev)
-{
-       return &dev_to_desc(dev)->stats;
-}
-
-
 static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb,
                                         struct net_device *dev)
 {