Florian Echtler <echtler <at> fs.tum.de> writes: 
 
> Hello everyone, 
>  
> I was just thinking about using an USB printer interface cable 
> as a cheap interface for some homebrewn hardware. However, it  
> would be truly convenient to be able to use all the output lines 
> that the standard parallel port offers: Select Printer, Autofeed, 
> Strobe and Init. 
>  
> I assume the Strobe signal is usually auto-generated in the  
> interface chip - not much of a problem. 
>  
> Are the other signals in any way accessible via USB? Any IOCTLs 
> in the usblp driver? I looked through the source and couldn't  
> find any.. 
 
I don't think that there are any signals that are directly 
controllable or accessible.  Control is done via messages. 
 
There are a few ioctl's.  The USB printer spec defines these: 
GET_DEVICE_ID, GET_PORT_STATUS, and SOFT_RESET. 
(You can get this spec. from www.usb.org) 
 
Did you look at the usblp.c source code?  It defines 
these ioctl's: 
 
/* ioctls: */ 
#define LPGETSTATUS             0x060b          /* same as in 
drivers/char/lp.c */ 
#define IOCNR_GET_DEVICE_ID             1 
#define IOCNR_GET_PROTOCOLS             2 
#define IOCNR_SET_PROTOCOL              3 
#define IOCNR_HP_SET_CHANNEL            4 
#define IOCNR_GET_BUS_ADDRESS           5 
#define IOCNR_GET_VID_PID               6 
#define IOCNR_SOFT_RESET                7 
/* Get device_id string: */ 
#define LPIOC_GET_DEVICE_ID(len) _IOC(_IOC_READ, 'P', IOCNR_GET_DEVICE_ID, 
len) 
/* The following ioctls were added for http://hpoj.sourceforge.net: */ 
/* Get two-int array: 
 * [0]=current protocol (1=7/1/1, 2=7/1/2, 3=7/1/3), 
 * [1]=supported protocol mask (mask&(1<<n)!=0 means 7/1/n supported): */ 
#define LPIOC_GET_PROTOCOLS(len) _IOC(_IOC_READ, 'P', IOCNR_GET_PROTOCOLS, 
len) 
/* Set protocol (arg: 1=7/1/1, 2=7/1/2, 3=7/1/3): */ 
#define LPIOC_SET_PROTOCOL _IOC(_IOC_WRITE, 'P', IOCNR_SET_PROTOCOL, 0) 
/* Set channel number (HP Vendor-specific command): */ 
#define LPIOC_HP_SET_CHANNEL _IOC(_IOC_WRITE, 'P', IOCNR_HP_SET_CHANNEL, 0) 
/* Get two-int array: [0]=bus number, [1]=device address: */ 
#define LPIOC_GET_BUS_ADDRESS(len) _IOC(_IOC_READ, 'P', IOCNR_GET_BUS_ADDRESS, 
len) 
/* Get two-int array: [0]=vendor ID, [1]=product ID: */ 
#define LPIOC_GET_VID_PID(len) _IOC(_IOC_READ, 'P', IOCNR_GET_VID_PID, len) 
/* Perform class specific soft reset */ 
#define LPIOC_SOFT_RESET _IOC(_IOC_NONE, 'P', IOCNR_SOFT_RESET, 0); 
 
~Randy 
 



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to