Google luky.org euqset.org

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linux HDLC Stack - N2 module


Adam Anthony <AAnthony@xxxxxxx> :
[...]
> 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


$B$3$N>pJs$,$"$J$?$NC5$7$F$$?$b$N$+$I$&$+A*Br$7$F$/$@$5$!#(B
yes/$B$^$5$K$3$l$@!*(B   no/$B0c$&$J$!(B   part/$B0lIt8+$D$+$C$?(B   try/$B$3$l$G;n$7$F$_$k(B

$B$"$J$?$,C5$7$F$$?>pJs$O$I$N$h$&$J$3$H$+!"$4<+M3$K5-F~2<$5$!#FC$K!V$^$5$K$3$l$@!*!W$H8@$&>l9g$O5-F~$r$*4j$$7$^$9!#(B
$BNc(B:$B!VJ#?t$N%^%7%s$+$i(BCATV$B7PM3$G(Bipmasquerade$B$rMxMQ$7$F(BWeb$B$r;2>H$7$?$>l9g$N@_Dj$K$D$$F!W(B
References: