Re: [PATCH 09/10] ieee802154: add serial dongle driver

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alan Cox
Date: Monday, June 1, 2009 - 2:52 pm

> > > +	return _send_pending_data(zbdev);

You should check write_room before writing if you want some control - you
can also then respect internal flow control via the wakeup mechanism.

Something like:
                /* Wait for space */
                while ((space = tty_write_room(tty)) < len) {
                        if (file->f_flags & O_NONBLOCK) {
                                err = -EAGAIN;
                                break;
                        }
                        interruptible_sleep_on(&tty->write_wait);
                        if (signal_pending(current)) {
                                err = -EINTR;
                                break;
                        }
                }
                /* Shove the entire frame down */
                tty->ops->write(tty, data, len);
 

The fact the drive is entirely under my control and not potentially being
spewed at from a hostile network. Also the fact that it takes about 30
seconds to spank a misbehaving drive and reset it. The network laye
generally uses time checks (search for ratelimit()).


Ok


No I'm still running around clobbering them all - and slip needed a
partial rewrite first.

	zbdev->tty = tty_kref_get(tty);

	tty_kref_put(foo);


The bluetooth one needs killing too. I will do that tomorrow ...

How many releases ago - the entire tty buffering layer has been rewritten
over time. tty->low_latency requires driver specific support that most
don't have. Also as of 2.6.30rc you'll get debug spew if you misuse it.

If you still need it we need to know why.



The tty layer has a lot of "yes, those are also buggy" - which is why I'm
currently half way through systematically brutalising it.



That depends what you need. tty_mode_ioctl() gives you all the mode
stuff, n_tty_ioctl_helper adds things like software flow management which
don't actually look relevant to your ldisc ?

Any other queries let me know, and if the tty->low_latency is still
needed let me know and we'll figure out why between us, as it should not
be.

Alan
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC][WIP] IEEE 802.15.4 implementation for Linux v1, Dmitry Eremin-Solenikov, (Mon Jun 1, 7:54 am)
[PATCH 01/10] crc-itu-t: add bit-reversed calculation, Dmitry Eremin-Solenikov, (Mon Jun 1, 7:54 am)
[PATCH 02/10] Add constants for the ieee 802.15.4/ZigBee stack, Dmitry Eremin-Solenikov, (Mon Jun 1, 7:54 am)
[PATCH 03/10] net: add IEEE 802.15.4 socket family impleme ..., Dmitry Eremin-Solenikov, (Mon Jun 1, 7:54 am)
[PATCH 04/10] net: add NL802154 interface for configuratio ..., Dmitry Eremin-Solenikov, (Mon Jun 1, 7:54 am)
[PATCH 05/10] ieee802154: add simple HardMAC driver sample, Dmitry Eremin-Solenikov, (Mon Jun 1, 7:54 am)
[PATCH 06/10] mac802154: add a software MAC 802.15.4 imple ..., Dmitry Eremin-Solenikov, (Mon Jun 1, 7:54 am)
[PATCH 07/10] ieee802154: add virtual loopback driver, Dmitry Eremin-Solenikov, (Mon Jun 1, 7:54 am)
[PATCH 08/10] tty_io: export tty_class, Dmitry Eremin-Solenikov, (Mon Jun 1, 7:54 am)
[PATCH 09/10] ieee802154: add serial dongle driver, Dmitry Eremin-Solenikov, (Mon Jun 1, 7:54 am)
[PATCH 10/10] ieee802154: add at86rf230/rf231 spi driver, Dmitry Eremin-Solenikov, (Mon Jun 1, 7:54 am)
Re: [PATCH 08/10] tty_io: export tty_class, Alan Cox, (Mon Jun 1, 8:07 am)
Re: [PATCH 08/10] tty_io: export tty_class, Dmitry Eremin-Solenikov, (Mon Jun 1, 8:10 am)
Re: [PATCH 08/10] tty_io: export tty_class, Alan Cox, (Mon Jun 1, 8:34 am)
Re: [PATCH 09/10] ieee802154: add serial dongle driver, Dmitry Eremin-Solenikov, (Mon Jun 1, 1:29 pm)
Re: [PATCH 10/10] ieee802154: add at86rf230/rf231 spi driver, Dmitry Eremin-Solenikov, (Mon Jun 1, 1:33 pm)
Re: [PATCH 09/10] ieee802154: add serial dongle driver, Alan Cox, (Mon Jun 1, 2:52 pm)
Ответ: [PATCH 10/10] ieee802154: add at86rf230/, Dmitry Eremin-Solenikov, (Tue Jun 2, 1:29 am)
Re: , Marcel Holtmann, (Tue Jun 2, 1:36 am)
Re: , Florian Fainelli, (Tue Jun 2, 1:46 am)
Re: Ответ: [PATCH 10/10] ieee802154: add at86rf, Maxim Osipov, (Tue Jun 2, 1:49 am)
Re: , Sergey Lapin, (Tue Jun 2, 1:52 am)
Re: , Holger Schurig, (Tue Jun 2, 2:15 am)
Re: , Jonathan Cameron, (Tue Jun 2, 2:29 am)
Re: ?????: [PATCH 10/10] ieee802154: add at86rf230/rf231 s ..., Dmitry Eremin-Solenikov, (Tue Jun 2, 4:42 am)
Re: [PATCH 08/10] tty_io: export tty_class, Dmitry Eremin-Solenikov, (Tue Jun 2, 7:22 am)
Re: [PATCH 08/10] tty_io: export tty_class, Alan Cox, (Tue Jun 2, 7:35 am)
Re: [PATCH 09/10] ieee802154: add serial dongle driver, Sergey Lapin, (Tue Jun 2, 7:43 am)
Re: [PATCH 03/10] net: add IEEE 802.15.4 socket family imp ..., Dmitry Eremin-Solenikov, (Thu Jun 4, 4:16 am)
Re: [PATCH 03/10] net: add IEEE 802.15.4 socket family imp ..., Dmitry Eremin-Solenikov, (Thu Jun 4, 7:10 am)
Re: [RFC][WIP] IEEE 802.15.4 implementation for Linux v1, Dmitry Eremin-Solenikov, (Thu Jun 4, 9:49 pm)
Re: [RFC][WIP] IEEE 802.15.4 implementation for Linux v1, Maxim Osipov, (Fri Jun 12, 10:37 pm)
Re: [RFC][WIP] IEEE 802.15.4 implementation for Linux v1, Pavel Machek, (Sat Jun 20, 11:40 pm)