Re: How to write a new line discipline?
Am 16.03.2004 um 06:59 schrieb Daniel O'Connor: The current disciplines seem to be either very very old, or 'hacks' for things like PPP or SLIP :( In another life, I put together a small line discipline to talk to dumb UPSes that signal via DTR and RTS, and can be shut down via DSR or CTS. This was in the 2.2 timeframe, so I doubt this will be of much use to you, but here it is anyway: http://ftp.hanse.de/pub/people/stefan.bethke/FreeBSD/dumb_ups -0.01.tar.gz Stefan -- Stefan Bethke [EMAIL PROTECTED] Fon +49 170 346 0140 ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: How to write a new line discipline?
On Tue, 16 Mar 2004 19:04, Bernd Walter wrote: Don't forget that there are chips (e.g. uftdi(4) based) that can control txenable themself without OS interaction. You can't expect the userland software to know. Well, no, but I envisage this is something the line discipline does when it needs to write to the bus, some of the cards we get do automatic direction control, some don't. Using an USB RS232 Interface with an RTS controlled RS232-RS485 converter is unlikely to work in many cases for timing reasons. Yes :( I needed half-duplex RS485 for modbus which fortunately is a 8 bit protocoll, but does addressing by using strict bus idle times. It was very tricky to do the timing good enough in userland. Currently I'm using uftdi(4) based chips, but I think the next generation will be a special kernel driver for self build modbus USB devices to allow interleaving support for higher throughput. I think other RS485 protocolls might be better with special non tty based kernel drivers too. uart(4) layering seems to be a good starter for connecting such a driver to various generic interfaces without loosing the ability to have protocoll specialized hardware. I have a new PCI card on the back burner, although I would be interested in seeing more details on your USB approach if possible as it would be nice to control our own supply of this hardware (nothing sucks more than not being able to buy vital equipment..) -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au The nice thing about standards is that there are so many of them to choose from. -- Andrew Tanenbaum GPG Fingerprint - 9A8C 569F 685A D928 5140 AE4B 319B 41F4 5D17 FDD5 ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: How to write a new line discipline?
On Tue, Mar 16, 2004 at 04:29:04PM +1030, Daniel O'Connor wrote: Hi, My company uses RS485 to talk to various pieces of hardware, and currently to do this we have a hacked up copy of sio which talks to a conventional RS485 card, while this works well it would be nicer to be able to use different 485 cards via the puc driver instead of having to use a custom driver. Our custom driver only understands 8250/16550/etc UARTS which is another limitation (not currently an issue though :) It was suggested a while ago by phk (I think..) that a line discipline would be the best approach, and I think this makes sense. The protocol in question uses the parity bit as a 9th bit to signal an address byte (only 256 addresses on this bus). I can't see how a line discipline can directly control and read the parity information, and to set various control lines (specifically RTS) to switch the transceiver into transmit mode when necessary. Don't forget that there are chips (e.g. uftdi(4) based) that can control txenable themself without OS interaction. You can't expect the userland software to know. Using an USB RS232 Interface with an RTS controlled RS232-RS485 converter is unlikely to work in many cases for timing reasons. I needed half-duplex RS485 for modbus which fortunately is a 8 bit protocoll, but does addressing by using strict bus idle times. It was very tricky to do the timing good enough in userland. Currently I'm using uftdi(4) based chips, but I think the next generation will be a special kernel driver for self build modbus USB devices to allow interleaving support for higher throughput. I think other RS485 protocolls might be better with special non tty based kernel drivers too. uart(4) layering seems to be a good starter for connecting such a driver to various generic interfaces without loosing the ability to have protocoll specialized hardware. -- B.Walter BWCThttp://www.bwct.de [EMAIL PROTECTED] [EMAIL PROTECTED] ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]