⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scanner.h

📁 Driver for USB Scanners (linux-2.6)
💻 H
📖 第 1 页 / 共 2 页
字号:
	{ USB_DEVICE(0x05da, 0x30d8) },	/* ScanMaker 5900 */
	{ USB_DEVICE(0x04a7, 0x0224) },	/* Scanport 3000 (actually Visioneer?)*/
	/* The following SCSI-over-USB Microtek devices are supported by the
	   microtek driver: Enable SCSI and USB Microtek in kernel config */
	//	{ USB_DEVICE(0x05da, 0x0099) },	/* ScanMaker X6 - X6U */
	//	{ USB_DEVICE(0x05da, 0x0094) },	/* Phantom 336CX - C3 */
	//	{ USB_DEVICE(0x05da, 0x00a0) },	/* Phantom 336CX - C3 #2 */
	//	{ USB_DEVICE(0x05da, 0x009a) },	/* Phantom C6 */
	//	{ USB_DEVICE(0x05da, 0x00a3) },	/* ScanMaker V6USL */
	//	{ USB_DEVICE(0x05da, 0x80a3) },	/* ScanMaker V6USL #2 */
	//	{ USB_DEVICE(0x05da, 0x80ac) },	/* ScanMaker V6UL - SpicyU */
	/* Minolta */
	{ USB_DEVICE(0x0686, 0x400d) }, /* Scan Dual III */
	/* The following SCSI-over-USB Minolta devices are supported by the
	   hpusbscsi driver: Enable SCSI and USB hpusbscsi in kernel config */
	//	{ USB_DEVICE(0x0638, 0x026a) }, /* Minolta Dimage Scan Dual II */
	//	{ USB_DEVICE(0x0686, 0x4004) }, /* Scan Elite II (need interrupt ep) */
	/* Mustek */
	{ USB_DEVICE(0x0400, 0x1000) },	/* BearPaw 1200 (National Semiconductor LM9831) */
	{ USB_DEVICE(0x0400, 0x1001) }, /* BearPaw 2400 (National Semiconductor LM9832) */
	{ USB_DEVICE(0x055f, 0x0001) },	/* ScanExpress 1200 CU */
	{ USB_DEVICE(0x055f, 0x0002) },	/* ScanExpress 600 CU */
	{ USB_DEVICE(0x055f, 0x0003) },	/* ScanExpress 1200 USB */
	{ USB_DEVICE(0x055f, 0x0006) },	/* ScanExpress 1200 UB */
	{ USB_DEVICE(0x055f, 0x0007) },	/* ScanExpress 1200 USB Plus */
	{ USB_DEVICE(0x055f, 0x0008) }, /* ScanExpress 1200 CU Plus */
	{ USB_DEVICE(0x055f, 0x0010) }, /* BearPaw 1200F */
	{ USB_DEVICE(0x055f, 0x0210) },	/* ScanExpress A3 USB */
	{ USB_DEVICE(0x055f, 0x0218) }, /* BearPaw 2400 TA */
	{ USB_DEVICE(0x055f, 0x0219) }, /* BearPaw 2400 TA Plus */
	{ USB_DEVICE(0x055f, 0x021c) }, /* BearPaw 1200 CU Plus */
	{ USB_DEVICE(0x055f, 0x021d) }, /* Bearpaw 2400 CU Plus */
	{ USB_DEVICE(0x055f, 0x021e) }, /* BearPaw 1200 TA/CS */
	{ USB_DEVICE(0x055f, 0x0400) }, /* BearPaw 2400 TA PRO */
	{ USB_DEVICE(0x055f, 0x0401) },	/* P 3600 A3 Pro */
	{ USB_DEVICE(0x055f, 0x0409) },	/* BearPaw 2448TA Pro */
	{ USB_DEVICE(0x055f, 0x0873) }, /* ScanExpress 600 USB */
	{ USB_DEVICE(0x055f, 0x1000) }, /* BearPaw 4800 TA PRO */
	//	{ USB_DEVICE(0x05d8, 0x4002) }, /* BearPaw 1200 CU and ScanExpress 1200 UB Plus (see Artec) */
	/* Nikon */
	{ USB_DEVICE(0x04b0, 0x4000) }, /* Coolscan LS 40 ED */
	/* Pacific Image Electronics */
	{ USB_DEVICE(0x05e3, 0x0120) },	/* PrimeFilm 1800u */
	/* Plustek */
	{ USB_DEVICE(0x07b3, 0x0001) },	/* 1212U */
	{ USB_DEVICE(0x07b3, 0x0005) }, /* Unknown */
	{ USB_DEVICE(0x07b3, 0x0007) }, /* Unknown */
	{ USB_DEVICE(0x07b3, 0x000F) }, /* Unknown */
	{ USB_DEVICE(0x07b3, 0x0010) }, /* OpticPro U12 */
	{ USB_DEVICE(0x07b3, 0x0011) }, /* OpticPro U24 */
	{ USB_DEVICE(0x07b3, 0x0012) }, /* Unknown */
	{ USB_DEVICE(0x07b3, 0x0013) }, /* UT12 */
	{ USB_DEVICE(0x07b3, 0x0014) }, /* Unknown */
	{ USB_DEVICE(0x07b3, 0x0015) }, /* OpticPro U24 */
	{ USB_DEVICE(0x07b3, 0x0016) }, /* Unknown */
	{ USB_DEVICE(0x07b3, 0x0017) }, /* OpticPro UT12/UT16/UT24 */
	{ USB_DEVICE(0x07b3, 0x0400) }, /* OpticPro 1248U */
	{ USB_DEVICE(0x07b3, 0x0401) }, /* OpticPro 1248U (another one) */
	{ USB_DEVICE(0x07b3, 0x0403) },	/* U16B */
	{ USB_DEVICE(0x07b3, 0x0413) },	/* OpticSlim 1200 */
	/* Primax/Colorado */
	{ USB_DEVICE(0x0461, 0x0300) },	/* G2-300 #1 */
	{ USB_DEVICE(0x0461, 0x0301) },	/* G2E-300 #1 */
	{ USB_DEVICE(0x0461, 0x0302) },	/* G2-300 #2 */
	{ USB_DEVICE(0x0461, 0x0303) },	/* G2E-300 #2 */
	{ USB_DEVICE(0x0461, 0x0340) },	/* Colorado USB 9600 */
	{ USB_DEVICE(0x0461, 0x0341) },	/* Colorado 600u */
	{ USB_DEVICE(0x0461, 0x0347) },	/* Primascan Colorado 2600u */
	{ USB_DEVICE(0x0461, 0x0360) },	/* Colorado USB 19200 */
	{ USB_DEVICE(0x0461, 0x0361) },	/* Colorado 1200u */
	{ USB_DEVICE(0x0461, 0x0380) },	/* G2-600 #1 */
	{ USB_DEVICE(0x0461, 0x0381) },	/* ReadyScan 636i */
	{ USB_DEVICE(0x0461, 0x0382) },	/* G2-600 #2 */
	{ USB_DEVICE(0x0461, 0x0383) },	/* G2E-600 */
	/* Prolink */
	{ USB_DEVICE(0x06dc, 0x0014) }, /* Winscan Pro 2448U */
	/* Reflecta  */
	{ USB_DEVICE(0x05e3, 0x0120) },	/* iScan 1800 */
	/* Relisis */
	// { USB_DEVICE(0x0475, 0x0103) },	/* Episode - undetected endpoint */
	{ USB_DEVICE(0x0475, 0x0210) }, /* Scorpio Ultra 3 */
	/* Seiko/Epson Corp. */
	{ USB_DEVICE(0x04b8, 0x0101) },	/* Perfection 636U and 636Photo */
	{ USB_DEVICE(0x04b8, 0x0102) }, /* GT-2200 */
	{ USB_DEVICE(0x04b8, 0x0103) },	/* Perfection 610 */
	{ USB_DEVICE(0x04b8, 0x0104) },	/* Perfection 1200U and 1200Photo*/
	{ USB_DEVICE(0x04b8, 0x0105) }, /* StylusScan 2000 */
	{ USB_DEVICE(0x04b8, 0x0106) },	/* Stylus Scan 2500 */
	{ USB_DEVICE(0x04b8, 0x0107) },	/* Expression 1600 */
	{ USB_DEVICE(0x04b8, 0x0109) }, /* Expression 1640XL */
	{ USB_DEVICE(0x04b8, 0x010a) }, /* Perfection 1640SU and 1640SU Photo */
	{ USB_DEVICE(0x04b8, 0x010b) }, /* Perfection 1240U */
	{ USB_DEVICE(0x04b8, 0x010c) }, /* Perfection 640U */
	{ USB_DEVICE(0x04b8, 0x010e) }, /* Expression 1680 */
	{ USB_DEVICE(0x04b8, 0x010f) }, /* Perfection 1250U */
	{ USB_DEVICE(0x04b8, 0x0110) }, /* Perfection 1650 */
	{ USB_DEVICE(0x04b8, 0x0112) }, /* Perfection 2450 - GT-9700 for the Japanese mkt */
	{ USB_DEVICE(0x04b8, 0x0114) }, /* Perfection 660 */
	{ USB_DEVICE(0x04b8, 0x011b) }, /* Perfection 2400 Photo */
	{ USB_DEVICE(0x04b8, 0x011c) }, /* Perfection 3200 */
	{ USB_DEVICE(0x04b8, 0x011d) }, /* Perfection 1260 */
	{ USB_DEVICE(0x04b8, 0x011e) }, /* Perfection 1660 Photo */
	{ USB_DEVICE(0x04b8, 0x011f) },	/* Perfection 1670 */
	{ USB_DEVICE(0x04b8, 0x0801) }, /* Stylus CX5200 */
	{ USB_DEVICE(0x04b8, 0x0802) }, /* Stylus CX3200 */
	/* Siemens */
	{ USB_DEVICE(0x0681, 0x0005) },	/* ID Mouse Professional */
	{ USB_DEVICE(0x0681, 0x0010) },	/* Cherry FingerTIP ID Board - Sensor */
	/* SYSCAN */
	{ USB_DEVICE(0x0a82, 0x4600) }, /* TravelScan 460/464 */
	/* Trust */
	{ USB_DEVICE(0x05cb, 0x1483) }, /* CombiScan 19200 */
	{ USB_DEVICE(0x05d8, 0x4006) }, /* Easy Webscan 19200 (repackaged Artec?) */
	/* Umax */
	{ USB_DEVICE(0x05d8, 0x4009) },	/* Astraslim (actually Artec?) */
	{ USB_DEVICE(0x1606, 0x0010) },	/* Astra 1220U */
	{ USB_DEVICE(0x1606, 0x0030) },	/* Astra 2000U */
	{ USB_DEVICE(0x1606, 0x0060) }, /* Astra 3400U/3450U */
	{ USB_DEVICE(0x1606, 0x0070) },	/* Astra 4400 */
	{ USB_DEVICE(0x1606, 0x0130) }, /* Astra 2100U */
	{ USB_DEVICE(0x1606, 0x0160) }, /* Astra 5400U */  
	{ USB_DEVICE(0x1606, 0x0230) },	/* Astra 2200U */
	/* Visioneer */
	{ USB_DEVICE(0x04a7, 0x0211) },	/* OneTouch 7600 USB */
	{ USB_DEVICE(0x04a7, 0x0221) },	/* OneTouch 5300 USB */
	{ USB_DEVICE(0x04a7, 0x0224) },	/* OneTouch 4800 USB */
	{ USB_DEVICE(0x04a7, 0x0226) },	/* OneTouch 5800 USB */
	{ USB_DEVICE(0x04a7, 0x0229) }, /* OneTouch 7100 USB */
	{ USB_DEVICE(0x04a7, 0x022c) },	/* OneTouch 9020 USB */
	{ USB_DEVICE(0x04a7, 0x0231) },	/* 6100 USB */
	{ USB_DEVICE(0x04a7, 0x0311) },	/* 6200 EPP/USB */
	{ USB_DEVICE(0x04a7, 0x0321) },	/* OneTouch 8100 EPP/USB */
	{ USB_DEVICE(0x04a7, 0x0331) }, /* OneTouch 8600 EPP/USB */
	{ USB_DEVICE(0x0461, 0x0345) }, /* 6200 (actually Primax?) */
	{ USB_DEVICE(0x0461, 0x0371) }, /* Onetouch 8920 USB (actually Primax?) */
	{ }				/* Terminating entry */
};

MODULE_DEVICE_TABLE (usb, scanner_device_ids);

#define IS_EP_BULK(ep)  ((ep)->bmAttributes == USB_ENDPOINT_XFER_BULK ? 1 : 0)
#define IS_EP_BULK_IN(ep) (IS_EP_BULK(ep) && ((ep)->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN)
#define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep)->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT)
#define IS_EP_INTR(ep) ((ep)->bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0)

#define USB_SCN_MINOR(X) iminor(X)

#ifdef DEBUG
#define SCN_DEBUG(X) X
#else
#define SCN_DEBUG(X)
#endif

#define IBUF_SIZE 32768
#define OBUF_SIZE 4096

/* read_scanner timeouts -- RD_NAK_TIMEOUT * RD_EXPIRE = Number of seconds */
#define RD_NAK_TIMEOUT (10*HZ)	/* Default number of X seconds to wait */
#define RD_EXPIRE 12		/* Number of attempts to wait X seconds */


/* read vendor and product IDs from the scanner */
#define SCANNER_IOCTL_VENDOR _IOR('U', 0x20, int)
#define SCANNER_IOCTL_PRODUCT _IOR('U', 0x21, int)
/* send/recv a control message to the scanner */
#define SCANNER_IOCTL_CTRLMSG _IOWR('U', 0x22, struct usb_ctrlrequest)

/* USB bInterfaceClass used by Hewlett-Packard ScanJet 3300c and Genius HR6
   USB - Vivid III */
#define SCN_CLASS_SCANJET 16

#define SCN_BASE_MNR 48		/* USB Scanners start at minor 48 */

static DECLARE_MUTEX (scn_mutex); /* Initializes to unlocked */

struct scn_usb_data {
	struct usb_device *scn_dev;
	struct urb *scn_irq;
	unsigned int ifnum;	/* Interface number of the USB device */
	int scn_minor;		/* Scanner minor - used in disconnect() */
	unsigned char button;	/* Front panel buffer */
	char isopen;		/* Not zero if the device is open */
	char present;		/* Not zero if device is present */
	char *obuf, *ibuf;	/* transfer buffers */
	char bulk_in_ep, bulk_out_ep, intr_ep; /* Endpoint assignments */
	wait_queue_head_t rd_wait_q; /* read timeouts */
	struct semaphore sem; /* lock to prevent concurrent reads or writes */
	unsigned int rd_nak_timeout; /* Seconds to wait before read() timeout. */
	struct kobject kobj;	/* Handles our reference counting */
};
#define to_scanner(d) container_of(d, struct scn_usb_data, kobj)

static struct usb_driver scanner_driver;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -