Skip navigation.
Home
The QNX Community Portal

View topic - How to port linux driver code??

How to port linux driver code??

For discussion of realtime and/or embedded programming.

How to port linux driver code??

Postby garyritu » Thu Sep 10, 2009 1:59 pm

Hi All,
I need to port linux driver code to QNX driver for the serial port, which uses the pci interface. Please find linux code available with me.
As per the code, a serial core driver was used and in low level tty driver is used.
My queries are as follows,

1. How to port following stuctures uart_port, uart_info, etc??
2. How to port struct uart_ops pointer, which defines a list of functions that the serial core uses to call back into the port-specific serial driver. This structure is defined as:
struct uart_ops {
unsigned int (*tx_empty)(struct uart_port *);
void (*set_mctrl)(struct uart_port *,
unsigned int mctrl);
unsigned int (*get_mctrl)(struct uart_port *);
void (*stop_tx)(struct uart_port *,
unsigned int tty_stop);
void (*start_tx)(struct uart_port *,
int (*startup)(struct uart_port *);
void (*shutdown)(struct uart_port *);
...................................
}

3. As per my observation, function serial_serocco_start_tx() is writing data on the port and function serial_serocco_handle_irq() is reading data from serial port. Please correct me, if i am wrong ???

4. Can the QNX structure TTYDEV, TTYCTRL will help me out???
Attachments
serocco.zip
serocco code
(23.11 KiB) Downloaded 142 times
garyritu
Active Member
 
Posts: 58
Joined: Fri May 22, 2009 7:09 am

RE: How to port linux driver code??

Postby mario » Thu Sep 10, 2009 5:34 pm

QNX serial driver are TOTALLY different then the Linux driver. You need to understand what the Linux driver does and the architecture of the QNX devc-* drivers and write it pretty much from scratch.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

RE: How to port linux driver code??

Postby garyritu » Sat Sep 12, 2009 6:57 pm

Hello Mario,
I have started to port the serocco code and initiliazation of pci was done using the standard resource manager. But now i have to port the write and read functionality. As per my observation on linux code ,
1. serial_serocco_start_tx function would be used for write call of Resoure Manager.
2. serial_serocco_handle_irq function would be used for read call of Resoure Manager.

Please correct me if i am wrong ???
garyritu
Active Member
 
Posts: 58
Joined: Fri May 22, 2009 7:09 am


Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 2 guests

cron