]> cvs.zerfleddert.de Git - usb-driver/blobdiff - usb-driver.c
some links, libusb-dev
[usb-driver] / usb-driver.c
index fa2611e8c3ea19c9261a4f4488fa083554076aec..a34e5e45347f3639e83f7ac7e3ae19d9fd0292e7 100644 (file)
@@ -241,6 +241,7 @@ int pp_transfer(WD_TRANSFER *tr, int fd, unsigned int request, unsigned char *wd
        int ret = 0;
        unsigned long port = (unsigned long)tr->dwPort;
        unsigned char val;
+       static int last_pp_write = 0;
 
        DPRINTF("dwPort: 0x%lx, cmdTrans: %lu, dwbytes: %ld, fautoinc: %ld, dwoptions: %ld\n",
                        (unsigned long)tr->dwPort, tr->cmdTrans, tr->dwBytes,
@@ -268,6 +269,7 @@ int pp_transfer(WD_TRANSFER *tr, int fd, unsigned int request, unsigned char *wd
 
                        case PP_WRITE:
                                ret = ioctl(parportfd, PPWDATA, &val);
+                               last_pp_write = val;
                                break;
 
                        default:
@@ -276,10 +278,17 @@ int pp_transfer(WD_TRANSFER *tr, int fd, unsigned int request, unsigned char *wd
                                break;
                }
        } else if (port == ppbase + PP_STATUS) {
-               DPRINTF("status port\n");
+               DPRINTF("status port (last write: %d)\n", last_pp_write);
                switch(tr->cmdTrans) {
                        case PP_READ:
                                ret = ioctl(parportfd, PPRSTATUS, &val);
+#ifdef FORCE_PC3_IDENT
+                               val &= 95;
+                               if (last_pp_write & 64)
+                                       val |= 32;
+                               else
+                                       val |= 128;
+#endif
                                break;
 
                        case PP_WRITE:
Impressum, Datenschutz