[PARPORT] Parport_pc functions


Tim Waugh (tim@cyberelk.demon.co.uk)
Tue, 10 Mar 1998 22:46:45 +0000 (GMT)


Hi guys,

Does any of this look right?

Tim.
*/

--- linux/drivers/misc/parport_pc.c~ Sat Mar 7 14:51:32 1998
+++ linux/drivers/misc/parport_pc.c Tue Mar 10 22:05:05 1998
@@ -134,12 +134,12 @@
 
 void parport_pc_write_fifo(struct parport *p, unsigned char v)
 {
- /* FIXME */
+ outb (v, p->base+CONFIGA);
 }
 
 unsigned char parport_pc_read_fifo(struct parport *p)
 {
- return 0; /* FIXME */
+ return inb (p->base+CONFIGA);
 }
 
 void parport_pc_disable_irq(struct parport *p)
@@ -186,22 +186,34 @@
 
 size_t parport_pc_epp_read_block(struct parport *p, void *buf, size_t length)
 {
- return 0; /* FIXME */
+ size_t got = 0;
+ for (; got < length; got++) {
+ *buf++ = inb (p->base+EPPREG);
+ if (inb (p->base+STATUS) & 0x01)
+ break;
+ }
+ return got;
 }
 
 size_t parport_pc_epp_write_block(struct parport *p, void *buf, size_t length)
 {
- return 0; /* FIXME */
+ size_t written = 0;
+ for (; written < length; written++) {
+ outb (*buf++, p->base+EPPREG);
+ if (inb (p->base+STATUS) & 0x01)
+ break;
+ }
+ return written;
 }
 
 int parport_pc_ecp_read_block(struct parport *p, void *buf, size_t length, void (*fn)(struct parport *, void *, size_t), void *handle)
 {
- return 0; /* FIXME */
+ return -ENOSYS; /* FIXME */
 }
 
 int parport_pc_ecp_write_block(struct parport *p, void *buf, size_t length, void (*fn)(struct parport *, void *, size_t), void *handle)
 {
- return 0; /* FIXME */
+ return -ENOSYS; /* FIXME */
 }
 
 int parport_pc_examine_irq(struct parport *p)

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Wed 30 Dec 1998 - 10:17:32 EST