The devc-ser8250 shut-down

bridged with qnx.ddk
Post Reply
Jacek Rudnicki

The devc-ser8250 shut-down

Post by Jacek Rudnicki » Thu Aug 02, 2007 10:17 am

Hi,

What devc-ser8250 function is called during driver termination ?
I mean moment just after SIGTERM signal delivery (# slay devc-ser8250).

My goal is to implement custom shut-down scenario for serial driver.

Jacek

maschoen

RE: The devc-ser8250 shut-down

Post by maschoen » Thu Aug 02, 2007 3:58 pm

I don't have the answer handy, but I suspect that at most the driver
will turn off transmission and set the control lines. I'm curious
as to what you mean by "custom shut-down". If you want to
send some final data, you would be better off to catch SIGTERM in your
application. If you are actually shutting the computer off, there
is no requirement that you shut down the driver at all.

Jacek Rudnicki

Re: The devc-ser8250 shut-down

Post by Jacek Rudnicki » Fri Aug 03, 2007 8:47 am

Hi,
I don't have the answer handy, but I suspect that at most the driver
will turn off transmission and set the control lines. I'm curious
I can't agree about the control lines. For me the devc-ser8250 doesn't
touch them at all.
as to what you mean by "custom shut-down". If you want to
I would like to:
- send XOFF,
- reset all UART channels (dedicated to chipset/hardware),
- turn off RTS and DTR line.
send some final data, you would be better off to catch SIGTERM in your
application. If you are actually shutting the computer off, there
is no requirement that you shut down the driver at all.
Custom shut-down must be implemented in serial driver.

Can anybody tell me where should I put code responsible
for driver termination ?

Do I need to cach SIGTERM signal ?
Can this be done in different way ?

Jacek

maschoen

Re: The devc-ser8250 shut-down

Post by maschoen » Fri Aug 03, 2007 7:58 pm

jacuswrote:

I can't agree about the control lines. For me the devc-ser8250
doesn't
touch them at all.

Well I did say "suspect".
I would like to:
- send XOFF,
- reset all UART channels (dedicated to chipset/hardware),
- turn off RTS and DTR line.
This doesn't sound too challenging. By Reset, did you mean, do a chip
reset, or did you mean reset the UART parameters, eg. baud and
parity.
I ask because a chip reset would likely turn RTS and DTR off.
Can anybody tell me where should I put code responsible
for driver termination ?

I don't think I understand the question. Obviously you need to catch
any important signals. For shutdown you probably want to catch
SIGPWR.
The code could be in the signal handler, or you could just set a flag
so that termination is handled outside of the handler. Of course,
then you need to ensure that this outside code is executed.
Do I need to catch SIGTERM signal ?

You might want to check the documentation on the various
signals you can catch. Catching a signal is one obvious way to deal
with process termination.
Can this be done in different way ?
If you know when you want the driver to stop, you could create a
custom IOCTL call, or even a custom QNX message.

Post Reply

Return to “qnx.ddk”