Custom Driver to Serial Driver Read Interface Problem

Custom Driver to Serial Driver Read Interface Problem

Post by Abdij Bha » Sat, 04 May 2002 18:10:07



Hi,
 I am writing a kernel mode device driver which needs to read and write data
from serial port ( /dev/ttyS1 in this case ).
 The driver is for an embedded system target MIPS running on Linux. However
my problem is both on standard Intel PC running Red Hat Linux (Kernel
2.4-7). So all the further discussion will be for standard Linux PC; since
if i get this to work i should get my embeddded system to work too.

 I have two approaches to accomplish my task.

1. Open /dev/ttyS1 from my Kernel mode Device Driver and then read/write
data.

2. Write my own custom serial port device driver. Disable the standard Linux
serial port device driver and load my custom serial driver.

 Approach 1 seems to be the easier and best suited for my task. And hence i
am working on it.

 I could successfully open the serial port (/dev/ttyS1) from my Kernel mode
Device Driver. I could successfully write data into it too. [ Using kcp.c as
my reference which uses filp_open, FILE_FD->f_op->write Kernel API ].

 However i am facing problem while reading data from the Serial Port using
the same reference API's [ FILE_FD->f_op->read API ].

 This is what i am doing.

 I have a test harnsess [ user mode application ] that opens my kernel mode
driver [ i have tried both blocked and non blocked mode approaches ]. In my
Kernel driver I use the same mode to open the standard serial port (
/dev/ttyS1 ) using filp_open API.
 The test harness is in a continuous loop to read 4 bytes from my kernel
mode device driver. In my Kernel mode device driver's read routine, i also
read from /dev/ttyS1 using FILE_FD->f_op->read API for the same number of
bytes. But i observe that i am not getting any data from the standard serial
port device driver [/dev/ttyS1]. I get a return value of -512 when i
terminate my user mode test harness (using ctrl c ).

 I am at my wits end as to what the problem might be. Can somebody please
enlighten me on the same. Any help and suggestion regarding the same would
be appreciated greatly.

 Thanks a lot in advance.

Thanks and Regards,
Abdij
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

Custom Driver to Serial Driver Read Interface Problem

Post by Alan Co » Sat, 04 May 2002 22:40:14


Quote:>  I am writing a kernel mode device driver which needs to read and write data
> from serial port ( /dev/ttyS1 in this case ).

You want to be a line discipline. Take a look at slip.c as an example. Thats
a line discipline one end and a network protocol the other. It gets called
when there is stuff for reading and room to send, it has calls to send more
data
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. DDE to TCP/IP Comm Driver Avail,DDE2TCP,Demo Program Avail,Custom Drivers Avail

        DDE to TCP/IP Real Time Data Pump

DDE2TCP, is a Real Time Data Pump used as a data bridge
between DDE applications and ANY host system using
TCP/IP (SUN,HP,IBM,Apple, etc).  DDE2TCP runs in the
background, totally transparent between server and target
system.

DDE2TCP is perfect for use with any MMI system or spread
sheet such as FIX,WONDERWARE,GENESIS,LabTech,EXCEL,LOTUS
for real time update of SQL databases residing on other hosts.
DDE2TCP comes with it's own configurator for fast and effective
setup.  DDE2TCP runs on WINDOWS 3.1,3.11,95 and NT.  Site
licenses,volume discounts and modifications are available.
For more information on this product or our other porducts
and custom services contact:

                Marshall Rowe
                Custom Technology
                640 N. LaSalle Ste 284
                (773) 384-4104


        VISIT our WEB
        site    WWW.CUSTOM-TECH.COM                      

2. Jaton 67P/TV ( Trident 9685) and RedHat 4.2

3. DDE to TCP/IP Comm Driver Avail,DDE2TCP, Custom Drivers Avail

4. Pointer for vi editor FAQ

5. DDE to TCP/IP Comm. Driver Avail.,DDE2TCP,Sample Prog Avail,Custom Drivers Too!

6. defragfs, bad bit map size ?

7. DDE to TCP/IP Comm Driver Avail,DDE2TCP,Sample Prog Avail,Custom Drivers Too.

8. Lpd spool directories privileges

9. DDE to TCP/IP Comm Driver Avail,DDE2TCP,Sample Prog Avail,Custom Drivers Too!

10. DDE to TCP/IP Comm Drivers Avail,DDE2TCP,Sample Prog Avail,Custom Drivers Too!

11. DDE to TCP/IP hosts Comm Driver Avail.,DDE2TCP,Free Sample Prog,Custom Drivers.

12. DDE to TCP/IP Comm Driver via TCP/IP Avail,DDE2TCP,Custom Drivers Avail

13. Custom serial driver(using register_serial) for PC16550D,very slow