From: Francois Romieu <romieu@fr.zoreil.com>
To: Adam Anthony <AAnthony@sbs.com>
Cc: khc@pm.waw.pl, linux-kernel@vger.kernel.org
Subject: Re: Linux HDLC Stack - N2 module
Date: Thu, 13 Jan 2005 23:41:07 +0100 [thread overview]
Message-ID: <20050113224107.GA32656@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <4F23E557A0317D45864097982DE907941A38A8@pilotmail.sbscorp.sbs.com>
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
next prev parent reply other threads:[~2005-01-13 22:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-13 16:02 Adam Anthony
2005-01-13 22:41 ` Francois Romieu [this message]
2005-01-14 1:53 ` Krzysztof Halasa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050113224107.GA32656@electric-eye.fr.zoreil.com \
--to=romieu@fr.zoreil.com \
--cc=AAnthony@sbs.com \
--cc=khc@pm.waw.pl \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®