Re: Problem with c-qcam

Tim Waugh (tim@cyberelk.demon.co.uk)
Tue, 6 Jul 1999 09:04:41 +0100 (GMT)


On Mon, 5 Jul 1999, Philip Blundell wrote:

> Yeah, I think it's Dale Whitfield <dale@elad.cix.co.uk>. The last we heard
> from him, he was hoping to have some changes made to the parport code to
> better support the VC driver.

This was for software-driven EPP transfers, wasn't it? I have a patch 'in
testing' (attached). I can't actually test it _myself_, since I don't
have any EPP devices..

Tim.
*/

--- linux/drivers/misc/parport_ieee1284_ops.c~ Tue Jul 6 08:15:21 1999
+++ linux/drivers/misc/parport_ieee1284_ops.c Tue Jul 6 08:54:35 1999
@@ -708,7 +708,35 @@
const void *buffer, size_t len,
int flags)
{
- return 0; /* FIXME */
+ /* This is untested */
+ unsigned char *bp = (unsigned char *) buffer;
+ size_t ret = 0;
+
+ parport_frob_control (port,
+ PARPORT_CONTROL_STROBE |
+ PARPORT_CONTROL_AUTOFD |
+ PARPORT_CONTROL_SELECT,
+ PARPORT_CONTROL_STROBE);
+ port->ops->data_forward (port);
+ for (; len > 0; len--, bp++) {
+ parport_write_data (port, *bp);
+
+ if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY,
+ PARPORT_STATUS_BUSY))
+ break;
+
+ /* Strobe data */
+ parport_frob_control (port, PARPORT_CONTROL_AUTOFD,
+ PARPORT_CONTROL_AUTOFD);
+
+ if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY, 0))
+ break;
+
+ parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0);
+ ret++;
+ }
+
+ return ret;
}

/* EPP mode, reverse channel, data. */
@@ -716,7 +744,33 @@
void *buffer, size_t len,
int flags)
{
- return 0; /* FIXME */
+ /* This is untested. */
+ unsigned char *bp = (unsigned char *) buffer;
+ unsigned ret = 0;
+
+ parport_frob_control (port,
+ PARPORT_CONTROL_STROBE |
+ PARPORT_CONTROL_AUTOFD |
+ PARPORT_CONTROL_SELECT, 0);
+ port->ops->data_reverse (port);
+ for (; len > 0; len--, bp++) {
+ if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY,
+ PARPORT_STATUS_BUSY))
+ break;
+
+ parport_frob_control (port, PARPORT_CONTROL_AUTOFD,
+ PARPORT_CONTROL_AUTOFD);
+
+ if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY, 0))
+ break;
+
+ *bp = parport_read_data (port);
+
+ parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0);
+ ret++;
+ }
+
+ return ret;
}

/* EPP mode, forward channel, addresses. */
@@ -724,7 +778,35 @@
const void *buffer, size_t len,
int flags)
{
- return 0; /* FIXME */
+ /* This is untested */
+ unsigned char *bp = (unsigned char *) buffer;
+ size_t ret = 0;
+
+ parport_frob_control (port,
+ PARPORT_CONTROL_STROBE |
+ PARPORT_CONTROL_SELECT |
+ PARPORT_CONTROL_AUTOFD,
+ PARPORT_CONTROL_STROBE);
+ port->ops->data_forward (port);
+ for (; len > 0; len--, bp++) {
+ parport_write_data (port, *bp);
+
+ if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY,
+ PARPORT_STATUS_BUSY))
+ break;
+
+ /* Strobe data */
+ parport_frob_control (port, PARPORT_CONTROL_SELECT,
+ PARPORT_CONTROL_SELECT);
+
+ if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY, 0))
+ break;
+
+ parport_frob_control (port, PARPORT_CONTROL_SELECT, 0);
+ ret++;
+ }
+
+ return ret;
}

/* EPP mode, reverse channel, addresses. */
@@ -732,5 +814,31 @@
void *buffer, size_t len,
int flags)
{
- return 0; /* FIXME */
+ /* This is untested. */
+ unsigned char *bp = (unsigned char *) buffer;
+ unsigned ret = 0;
+
+ parport_frob_control (port,
+ PARPORT_CONTROL_STROBE |
+ PARPORT_CONTROL_SELECT |
+ PARPORT_CONTROL_AUTOFD, 0);
+ port->ops->data_reverse (port);
+ for (; len > 0; len--, bp++) {
+ if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY,
+ PARPORT_STATUS_BUSY))
+ break;
+
+ parport_frob_control (port, PARPORT_CONTROL_SELECT,
+ PARPORT_CONTROL_SELECT);
+
+ if (parport_wait_peripheral (port, PARPORT_STATUS_BUSY, 0))
+ break;
+
+ *bp = parport_read_data (port);
+
+ parport_frob_control (port, PARPORT_CONTROL_SELECT, 0);
+ ret++;
+ }
+
+ return ret;
}

-
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/