/* This structure is a private property of HDLC protocols.
Hardware drivers have no interest here */
struct hdlc_proto { int (*open)(struct net_device *dev); void (*close)(struct net_device *dev); void (*start)(struct net_device *dev); /* if open & DCD */ void (*stop)(struct net_device *dev); /* if open & !DCD */ void (*detach)(struct net_device *dev); int (*ioctl)(struct net_device *dev, struct if_settings *ifs);
__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) */ typedefstruct hdlc_device { /* used by HDLC layer to take control over HDLC device from hw driver*/ int (*attach)(struct net_device *dev, unsignedshort encoding, unsignedshort parity);
/* hardware driver must handle this instead of dev->hard_start_xmit */
netdev_tx_t (*xmit)(struct sk_buff *skb, struct net_device *dev);
/* Things below are for HDLC layer internal use only */ conststruct hdlc_proto *proto; int carrier; int open;
spinlock_t state_lock; void *state; void *priv;
} hdlc_device;
/* Exported from hdlc module */
/* Called by hardware driver when a user requests HDLC service */ int hdlc_ioctl(struct net_device *dev, struct if_settings *ifs);
/* Must be used by hardware driver on module startup/exit */ #define register_hdlc_device(dev) register_netdev(dev) void unregister_hdlc_device(struct net_device *dev);
static __inline__ void debug_frame(conststruct sk_buff *skb)
{ int i;
for (i=0; i < skb->len; i++) { if (i == 100) {
printk("...\n"); return;
}
printk(" %02X", skb->data[i]);
}
printk("\n");
}
/* Must be called by hardware driver when HDLC device is being opened */ 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); /* 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,
size_t size); /* May be used by hardware driver to gain control over HDLC device */ int detach_hdlc_protocol(struct net_device *dev);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.