lkml.org 
[lkml]   [1999]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectOld driver porting questions
I'm porting an old handheld scanner driver (Mustek scanners with GI1904
ISA card) to Linux 2.2 (or maybe 2.3). I have a couple of questions about
the changed kernel interface.

* how to convert memcpy_tofs and memcpy_fromfs to copy_{to,from}_user?
Should I just change the function names in function calls or is there
something else to consider?

* {get_put}_fs_long - is it now just {get,put}_user?

* select_wait and select_table were converted to poll_wait and poll_table.
How should I use the poll_* interface?

If I had a select function in the driver that first did some stuff and
then a select_wait, should I now write the poll function that just does
the poll_wait forst and the the rest?

* The former select function used

cli();
...
sti();

to protect the inner workings of the function.

Now, this doesn't sound good. I don't have SMP here so SMP compliancy is
not obligatory but I'd like to write it in the proper way. What should
this become?

save_flags(flags);
cli();
...
restore_flags(flags);

is probably better but still not what I want. Some spinlock?

* struct file_operations has a new member flush. What's that?

* struct file_operations has llseek, but the old driver has a method
called lseek. Has lseek been changed to llseek with some semantic changes?

* request_irq now has additional parameters:
unsigned long flags, const char *device, void *dev_id
and free_irq requires the same dev_id. What are these? name is clear.
Flags and dev_id are not. Is dev_ide just for the same driver to
distinguish between several real devices? What to put in flags for normal
ISA bus card?

---
Meelis Roos (mroos@tartu.cyber.ee)



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.055 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site