[sane-devel] Hai, about probe_scanner can't be probed
Fan Dan
dan_fancn@hotmail.com
Tue, 08 Apr 2003 22:41:33 +0800
Hai, Henning
Today, I modified scanner.c for Mustek A3Pro usb scanner (0x055f
0x0401)
In probe_scanner.
modified
have_bulk_in = 1
have_bulk_out =2
have_intr = 3
to
have_bulk_in = 0
have_bulk_out = 1
have_bulk_intr = 2
/////////////////////////////////////////
+ have_bulk_in--
+ have_bulk_out--
+ have_intr--
if (!(scn = kmalloc (sizeof (struct scn_usb_data), GFP_KERNEL))) {
err("probe_scanner: Out of memory.");
up(&scn_mutex);
return NULL;
}
memset (scn, 0, sizeof(struct scn_usb_data));
init_MUTEX(&(scn->sem)); /* Initializes to unlocked */
/////////////////////////////////////////
then scanner that has three endpoints can be probed successly, because
maxpacketout[3] = 0, but maxpacketout[2] = 1 in USB module;
And scanner can be writed, but we can't read from that. so I midified some
code int read_scanner function.
//////////////////////////////////////////////////////
- result = usb_bulk_msg(dev, usb_rcvbulkpipe(dev, scn->bulk_in_ep), ibuf,
this_read, &partial, scn->rd_nak_timeout);
+ result = usb_bulk_msg(dev, usb_rcvbulkpipe(dev, scn->bulk_out_ep), ibuf,
this_read, &partial, scn->rd_nak_timeout);
/////////////////////////////////////////////////////
Then scanner can be write and read.
I have test that we can write some bytes to DRAM of scanner, then read them
for scanner, that is OK. ioctl also is OK.
I want to know that there are three endpoint in scanner, but why both in
bulk and out bulk are in same ep? Whether is that OK??
Good Lucky!
Dan
_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn