Skip navigation.
Home
The QNX Community Portal

View topic - The devc-ser8250 shut-down

The devc-ser8250 shut-down

Read-only archive of qnx.ddk (Writing device drivers for scanners, video card, optical mouse, etc) at inn.qnx.com

The devc-ser8250 shut-down

Postby jacus » 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
jacus
Senior Member
 
Posts: 239
Joined: Tue Apr 22, 2003 8:36 am

RE: The devc-ser8250 shut-down

Postby maschoen » Thu Aug 02, 2007 3:23 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.
maschoen
QNX Master
 
Posts: 2644
Joined: Wed Jun 25, 2003 5:18 pm

Re: The devc-ser8250 shut-down

Postby jacus » 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
jacus
Senior Member
 
Posts: 239
Joined: Tue Apr 22, 2003 8:36 am

Re: The devc-ser8250 shut-down

Postby maschoen » Fri Aug 03, 2007 7:11 pm

jacus wrote: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.
maschoen
QNX Master
 
Posts: 2644
Joined: Wed Jun 25, 2003 5:18 pm


Return to qnx.ddk

Who is online

Users browsing this forum: No registered users and 1 guest

cron