Messages in this thread | | | Date | Thu, 13 Jan 2005 23:41:07 +0100 | From | Francois Romieu <> | Subject | Re: Linux HDLC Stack - N2 module |
| |
Adam Anthony <AAnthony@sbs.com> : [...] > It seems like the transmit buffers aren't getting emptied after transmit, > because I can only transmit a few frames before traffic halts. Transmit > statistics don't increment either, but I am seeing frames on the remote end. > Has the N2 module been tested with recent kernels? Is it useable?
No idea.
> If not, which module will show me the genius of the Linux HDLC "stack"?
struct foo_dev_priv { /* Device private stuff here */ ... struct net_device *dev; }
...
static int foo_init_one(...) { struct foo_dev_priv *priv; struct net_device *dev; hdlc_device *hdlc;
priv = kmalloc(sizeof(*priv), GFP_KERNEL); if (!priv) goto damn_it; memset(priv, 0, ...);
dev = alloc_hdlcdev(priv); if (!dev) goto crap; memset(dev, 0, ...);
priv->dev = dev;
hdlc = dev_to_hdlc(dev); hdlc->xmit = foo_start_xmit(); hdlc->attach = foo_hdlc_attach();
ret = register_hdlc_device(hdlc); if (ret < 0) goto not_my_day; ... }
static int foo_start_xmit(struct sk_buff *skb, struct net_device *dev) { /* The usual linux hard_start_xmit() handler of a net_device */ ... }
unregister_hdlc_device() balances register_hdlc_device(). hdlc_to_dev(hdlc) is the counterpart of dev_to_hdlc(dev).
Impressing, is not it ?
-- Ueimor - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |