lkml.org 
[lkml]   [2005]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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/

\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.056 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site