Re: [PATCH 2/2] lapb-nl: Added driver

From: Alan Cox
Date: Fri Jun 01 2012 - 10:51:22 EST


On the socket family side I was thinking not of a "lapb-nl" socket layer
but a simple pure LAPB socket - that just uses interface name type
addressing and only supported SOCK_RAW for raw data frames over LAPB
encodings.


> > Again the sl->tty locking needs sorting (I think this may well be true of
> > slip and the others too)
>
> Could you please explain a bit more on this?

In modern kernels the tty object is refcounted and not locked by any big
global locks.

So in your open do

tty = tty_kref_get(tty);

and in the close
tty_kref_put(tty);

and you are guaranteed the tty won't vanish under you between those
points.

> > Why flush ?
> Problems occured a long time ago, will remove and check.

That should be handled by the core code now.

> The whole thing is data packat transfer. Application is also notified when
> packet is delivered. That's it, no fancy stuff. There is also UDP code, but it is
> weird mess, and I think if it is to live or be removed. What do you think?

Weird mess removal is always good stuff.

Alan
--
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/