OpenQNX :: The QNX Community Portal

Jul 25, 2008 - 04:35 PM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 27 unlogged users and 2 registered users online.

You can log-in or register for a user account here.

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
jacus
Post subject: The devc-ser8250 shut-down  PostPosted: Aug 02, 2007 - 10:17 AM
Senior Member


Joined: Apr 22, 2003
Posts: 238

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
 
 View user's profile Send private message  
Reply with quote Back to top
maschoen
Post subject: RE: The devc-ser8250 shut-down  PostPosted: Aug 02, 2007 - 03:23 PM
QNX Master


Joined: Jun 25, 2003
Posts: 1045

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.
 
 View user's profile Send private message Send e-mail Visit poster's website  
Reply with quote Back to top
jacus
Post subject: Re: The devc-ser8250 shut-down  PostPosted: Aug 03, 2007 - 08:47 AM
Senior Member


Joined: Apr 22, 2003
Posts: 238

Hi,

Quote:
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.

Quote:
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.

Quote:
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
 
 View user's profile Send private message  
Reply with quote Back to top
maschoen
Post subject: Re: The devc-ser8250 shut-down  PostPosted: Aug 03, 2007 - 07:11 PM
QNX Master


Joined: Jun 25, 2003
Posts: 1045

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".

Quote:

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.

Quote:

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.

Quote:

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.

Quote:

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.
 
 View user's profile Send private message Send e-mail Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
All logos and trademarks in this site are property of their respective owners. The comments are property of their posters.
Powered by OpenQNX: The QNX Community Portal Site
QNX and the QNX logo are registered trademarks of QNX Software Systems.