Lines Matching +full:0 +full:x0409
70 * [0]=current protocol
73 * [1]=supported protocol mask (mask&(1<<n)!=0 means
82 #define LPIOC_SET_PROTOCOL _IOC(_IOC_WRITE, 'P', IOCNR_SET_PROTOCOL, 0)
84 #define LPIOC_HP_SET_CHANNEL _IOC(_IOC_WRITE, 'P', IOCNR_HP_SET_CHANNEL, 0)
85 /* Get two-int array: [0]=bus number, [1]=device address: */
87 /* Get two-int array: [0]=vendor ID, [1]=product ID: */
90 #define LPIOC_SOFT_RESET _IOC(_IOC_NONE, 'P', IOCNR_SOFT_RESET, 0);
104 #define USBLP_REQ_GET_ID 0x00
105 #define USBLP_REQ_GET_STATUS 0x01
106 #define USBLP_REQ_RESET 0x02
107 #define USBLP_REQ_HP_CHANNEL_CHANGE_REQUEST 0x00 /* HP Vendor-specific */
110 #define USBLP_MINOR_BASE 0
173 dev_dbg(dev, "usblp=0x%p\n", usblp); in usblp_dump()
174 dev_dbg(dev, "dev=0x%p\n", usblp->dev); in usblp_dump()
176 dev_dbg(dev, "readbuf=0x%p\n", usblp->readbuf); in usblp_dump()
209 #define USBLP_QUIRK_BIDIR 0x1 /* reports bidir but requires unidirectional mode (no INs/reads) */
210 #define USBLP_QUIRK_USB_INIT 0x2 /* needs vendor USB init string */
211 #define USBLP_QUIRK_BAD_CLASS 0x4 /* descriptor uses vendor-specific Class or SubClass */
214 { 0x03f0, 0x0004, USBLP_QUIRK_BIDIR }, /* HP DeskJet 895C */
215 { 0x03f0, 0x0104, USBLP_QUIRK_BIDIR }, /* HP DeskJet 880C */
216 { 0x03f0, 0x0204, USBLP_QUIRK_BIDIR }, /* HP DeskJet 815C */
217 { 0x03f0, 0x0304, USBLP_QUIRK_BIDIR }, /* HP DeskJet 810C/812C */
218 { 0x03f0, 0x0404, USBLP_QUIRK_BIDIR }, /* HP DeskJet 830C */
219 { 0x03f0, 0x0504, USBLP_QUIRK_BIDIR }, /* HP DeskJet 885C */
220 { 0x03f0, 0x0604, USBLP_QUIRK_BIDIR }, /* HP DeskJet 840C */
221 { 0x03f0, 0x0804, USBLP_QUIRK_BIDIR }, /* HP DeskJet 816C */
222 { 0x03f0, 0x1104, USBLP_QUIRK_BIDIR }, /* HP Deskjet 959C */
223 { 0x0409, 0xefbe, USBLP_QUIRK_BIDIR }, /* NEC Picty900 (HP OEM) */
224 { 0x0409, 0xbef4, USBLP_QUIRK_BIDIR }, /* NEC Picty760 (HP OEM) */
225 { 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */
226 { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */
227 { 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820, by zut <kernel@zut.de> */
228 { 0x04f9, 0x000d, USBLP_QUIRK_BIDIR }, /* Brother Industries, Ltd HL-1440 Laser Printer */
229 { 0x04b8, 0x0202, USBLP_QUIRK_BAD_CLASS }, /* Seiko Epson Receipt Printer M129C */
230 { 0, 0 }
262 dir ? usb_rcvctrlpipe(usblp->dev, 0) : usb_sndctrlpipe(usblp->dev, 0), in usblp_ctrl_msg()
265 "usblp_control_msg: rq: 0x%02x dir: %d recip: %d value: %d idx: %d len: %#x result: %d\n", in usblp_ctrl_msg()
267 return retval < 0 ? retval : 0; in usblp_ctrl_msg()
271 …usblp_ctrl_msg(usblp, USBLP_REQ_GET_STATUS, USB_TYPE_CLASS, USB_DIR_IN, USB_RECIP_INTERFACE, 0, st…
275 usblp_ctrl_msg(usblp, USBLP_REQ_RESET, USB_TYPE_CLASS, USB_DIR_OUT, USB_RECIP_OTHER, 0, NULL, 0)
289 if (ret == 0) in usblp_hp_channel_change_request()
290 *new_channel = buf[0]; in usblp_hp_channel_change_request()
321 if (status < 0) in usblp_bulk_read()
345 if (status < 0) in usblp_bulk_write()
349 usblp->no_paper = 0; in usblp_bulk_write()
365 unsigned char status, newerr = 0; in usblp_check_status()
369 if ((error = usblp_read_status(usblp, usblp->statusbuf)) < 0) { in usblp_check_status()
374 return 0; in usblp_check_status()
397 if (usblp_submit_read(usblp) < 0) in handle_bidir()
400 return 0; in handle_bidir()
414 if (minor < 0) in usblp_open()
438 if (retval < 0) in usblp_open()
444 usblp->wstatus = 0; in usblp_open()
445 usblp->rcomplete = 0; in usblp_open()
447 if (handle_bidir(usblp) < 0) { in usblp_open()
449 usblp->used = 0; in usblp_open()
481 usblp->used = 0; in usblp_release()
491 return 0; in usblp_release()
498 __poll_t ret = 0; in usblp_poll()
526 int retval = 0; in usblp_ioctl()
535 "usblp_ioctl: cmd=0x%x (%c nr=%d len=%d dir=%d)\n", cmd, in usblp_ioctl()
549 if (length < 0) { in usblp_ioctl()
572 twoints[0] = usblp->current_protocol; in usblp_ioctl()
573 twoints[1] = 0; in usblp_ioctl()
576 if (usblp->protocol[i].alt_setting >= 0) in usblp_ioctl()
604 if (retval < 0) { in usblp_ioctl()
612 le16_to_cpu(usblp->dev->descriptor.idVendor) != 0x03F0 || in usblp_ioctl()
620 if (err < 0) { in usblp_ioctl()
641 twoints[0] = usblp->dev->bus->busnum; in usblp_ioctl()
652 usblp->minor, twoints[0], twoints[1]); in usblp_ioctl()
662 twoints[0] = le16_to_cpu(usblp->dev->descriptor.idVendor); in usblp_ioctl()
672 "usblp%d is VID=0x%4.4X, PID=0x%4.4X\n", in usblp_ioctl()
673 usblp->minor, twoints[0], twoints[1]); in usblp_ioctl()
727 urb = usb_alloc_urb(0, GFP_KERNEL); in usblp_new_writeurb()
748 ssize_t writecount = 0; in usblp_write()
754 if ((rv = usblp_wwait(usblp, !!(file->f_flags & O_NONBLOCK))) < 0) in usblp_write()
777 usblp->wcomplete = 0; in usblp_write()
779 if ((rv = usb_submit_urb(writeurb, GFP_KERNEL)) < 0) { in usblp_write()
780 usblp->wstatus = 0; in usblp_write()
782 usblp->no_paper = 0; in usblp_write()
795 if (rv < 0) { in usblp_write()
810 if (usblp->wstatus < 0) { in usblp_write()
852 if (rv < 0) in usblp_read()
860 if ((avail = usblp->rstatus) < 0) { in usblp_read()
869 if (count != 0 && in usblp_read()
876 if (usblp_submit_read(usblp) < 0) { in usblp_read()
878 if (count == 0) in usblp_read()
904 int err = 0; in usblp_wwait()
915 if (rc <= 0) in usblp_wwait()
918 if (schedule_timeout(msecs_to_jiffies(1500)) == 0) { in usblp_wwait()
949 return 0; in usblp_wtest()
976 if ((rc = usblp_rtest(usblp, nonblock)) < 0) { in usblp_rwait_and_lock()
980 if (rc == 0) /* Keep it locked */ in usblp_rwait_and_lock()
1001 return 0; in usblp_rtest()
1019 urb = usb_alloc_urb(0, GFP_KERNEL); in usblp_submit_read()
1031 usblp->readcount = 0; /* XXX Why here? */ in usblp_submit_read()
1032 usblp->rcomplete = 0; in usblp_submit_read()
1034 if ((rc = usb_submit_urb(urb, GFP_KERNEL)) < 0) { in usblp_submit_read()
1043 return 0; in usblp_submit_read()
1057 * Returns 1 if found, 0 if not found.
1073 for (i = 0; quirk_printers[i].vendorId; i++) { in usblp_quirks()
1078 return 0; in usblp_quirks()
1110 if (usblp->device_id_string[0] == 0 && in ieee1284_id_show()
1111 usblp->device_id_string[1] == 0) in ieee1284_id_show()
1112 return 0; in ieee1284_id_show()
1182 if (protocol < 0) { in usblp_probe()
1184 "incompatible printer-class device 0x%4.4X/0x%4.4X\n", in usblp_probe()
1192 if (usblp_set_protocol(usblp, protocol) < 0) { in usblp_probe()
1201 usblp_check_status(usblp, 0); in usblp_probe()
1217 "usblp%d: USB %sdirectional printer dev %d if %d alt %d proto %d vid 0x%4.4X pid 0x%4.4X\n", in usblp_probe()
1225 return 0; in usblp_probe()
1272 for (p = 0; p < USBLP_MAX_PROTOCOLS; p++) in usblp_select_alts()
1276 for (i = 0; i < if_alt->num_altsetting; i++) { in usblp_select_alts()
1343 if (alts < 0) in usblp_set_protocol()
1346 if (r < 0) { in usblp_set_protocol()
1357 return 0; in usblp_set_protocol()
1367 err = usblp_get_id(usblp, 0, usblp->device_id_string, USBLP_DEVICE_ID_SIZE - 1); in usblp_cache_device_id_string()
1368 if (err < 0) { in usblp_cache_device_id_string()
1372 usblp->device_id_string[0] = usblp->device_id_string[1] = '\0'; in usblp_cache_device_id_string()
1384 usblp->device_id_string[length] = '\0'; in usblp_cache_device_id_string()
1405 usblp->present = 0; in usblp_disconnect()
1425 #if 0 /* XXX Do we want this? What if someone is reading, should we fail? */ in usblp_suspend()
1431 return 0; in usblp_suspend()
1451 { USB_DEVICE(0x04b8, 0x0202) }, /* Seiko Epson Receipt Printer M129C */