Subject: umass for Pentax Optio 430
To: None <current-users@netbsd.org>
From: Martti Kuparinen <martti.kuparinen@iki.fi>
List: current-users
Date: 02/20/2002 08:46:40
Hi!

I'm trying to get my new Pentax Optio 430 digital camera to work
with -current (updated and compiled 2002-02-19). It seems like we
need some kind of umass_quirk.c hack to make this work. Unfortunately
I've no experience in USB at all so I really need pointers and
help with this one.

I have modified usbdevs and umass_quirks.c and regenerated the .h
files.  I have tried several combinations of different UMASS_QUIRK_*
and PQUIRK_* settings (including UMASS_QUIRK_FORCE_SHORT_INQUIRY).
With the attached patch I get the following output (longer output
with umassdebug and usbdebug set to 0xffffffff at the end of this mail):

umass0 at uhub0 port 1 configuration 1 interface 0
umass0: ASAHI PENTAX PENTAX OPTIO 430, rev 1.00/10.00, addr 2
umass0: using ATAPI over CBI
atapibus0 at umass0 channel 0: 2 targets
probe(umass0:0:0): invalid return code from adapter: 3

With "UMASS_QUIRK_NO_START_STOP" + "PQUIRK_NOTUR | PQUIRK_NOSENSE" I get this:

umass0 at uhub0 port 1 configuration 1 interface 0
umass0: ASAHI PENTAX PENTAX OPTIO 430, rev 1.00/10.00, addr 2
umass0: using ATAPI over CBI
atapibus0 at umass0 channel 0: 2 targets
scsipi_inqmatch: 2/0/1 <, , >
sd0 at atapibus0 drive 0: <PENTAX, DIGITAL_CAMERA, 1.00> type 0 direct removable
sd0(umass0:0:0): invalid return code from adapter: 3
sd0: drive offline

Any ideas what else to try?

Martti


Index: umass_quirks.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/usb/umass_quirks.c,v
retrieving revision 1.11
diff -u -r1.11 umass_quirks.c
--- umass_quirks.c	2002/02/11 21:13:35	1.11
+++ umass_quirks.c	2002/02/20 06:14:47
@@ -66,6 +66,14 @@
 	  NULL, NULL
 	},

+	{ { USB_VENDOR_ASAHIOPTICAL, USB_PRODUCT_ASAHIOPTICAL_OPTIO430 },
+	  UMASS_WPROTO_UNSPEC, UMASS_CPROTO_UNSPEC,
+	  UMASS_QUIRK_FORCE_SHORT_INQUIRY,
+	  0,
+	  UMATCH_DEVCLASS_DEVSUBCLASS_DEVPROTO,
+	  NULL, NULL,
+	},
+
 	{ { USB_VENDOR_INSYSTEM, USB_PRODUCT_INSYSTEM_USBCABLE },
 	  UMASS_WPROTO_CBI, UMASS_CPROTO_ATAPI,
 	  UMASS_QUIRK_NO_START_STOP,
Index: usbdevs
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/usb/usbdevs,v
retrieving revision 1.229
diff -u -r1.229 usbdevs
--- usbdevs	2002/02/19 14:12:02	1.229
+++ usbdevs	2002/02/20 06:14:47
@@ -437,6 +437,9 @@
 product APPLE OPTMOUSE		0x0302	Optical mouse
 product APPLE SPEAKERS		0x1101	Speakers

+/* Asahi Optical */
+product ASAHIOPTICAL OPTIO430	0x0004	Pentax Optio 430
+
 /* Asante products */
 product ASANTE EA		0x1427	Ethernet Adapter





usbd_new_device bus=0xc097f000 port=1 depth=1 speed=2
usbd_new_device: adding unit addr=2, rev=100, class=0, subclass=0, protocol=0, maxpacket=8, len=18, speed=2
usbd_new_device: new dev (addr 2), dev=0xc0a94f00, parent=0xc0979bc0
usbd_probe_and_attach: trying device specific drivers
usbd_probe_and_attach: no device specific driver found
usbd_probe_and_attach: looping over 1 configurations
usbd_set_config_index: (addr 1) cno=2 attr=0x40, selfpowered=1, power=0
usbd_set_config_index: set config 1
umass0 at uhub0 port 1 configuration 1 interface 0
umass0: ASAHI PENTAX PENTAX OPTIO 430, rev 1.00/10.00, addr 2
umass0: using ATAPI over CBI
umass0: umass_attach_bus: ATAPI
atapibus0 at umass0 channel 0: 2 targets
umass_atapi_probe_device: atapi=0xc0a7bd80 target=0
umass_atapi_probe_device: doing inquiry
umass0: umass_scsi_cmd: at 1014147812.080055: 0:0 xs=0xc0a37000 cmd=0x12 datalen=74 (quirks=0x8000, poll=0)
xs(0xc0a37000): xs_control(0x00401004)xs_status(0x00000000)periph(0xc0a9e200)retr(0x4)timo(0x2710)cmd(0xc0a37088)len(0xc)data(0xcb138344)len(0x4a)res(0x4a)err(0x0)bp(0x0)probe(umass0:0:0):  command: 0x12,0x0,0x0,0x0,0x4a,0x0,0x0,0x0,0x0,0x0,0x0,0x0-[74 bytes]
------------------------------
000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
------------------------------
umass_scsi_cmd: async dir=1, cmdlen=12 datalen=74
umass0: umass_cbi_transfer cmd=0x12, len=74
umass0: Handling CBI state 10 (CBI Command), xfer=0xc0a32a00, NORMAL_COMPLETION
umass0: start xfer buffer=0xcb138344 buflen=74 flags=0x5 timeout=15000
umass0: Handling CBI state 11 (CBI Data), xfer=0xc0a32900, NORMAL_COMPLETION
umass0: CBI_DATA actlen=36
umass0: 0x 008000011f00000050454e5441582020 buffer=0xcb138344, buflen=36
umass0: 0x 4449474954414c5f43414d4552412020
umass0: 0x 312e3030
umass_scsipi_cb: at 1014147812.087904, delta=7849: xs=0xc0a37000 residue=38 status=1
umass0: umass_cbi_transfer cmd=0x03, len=32
umass0: Handling CBI state 10 (CBI Command), xfer=0xc0a32a00, STALLED
umass0: Command Transport failed
umass_scsipi_sense_cb: xs=0xc0a37000 residue=32 status=2
umass0: Autosense failed, status 2
umass_scsipi_sense_cb: return xs->error=3, xs->xs_status=0x1 xs->resid=38
probe(umass0:0:0): scsipi_done
probe(umass0:0:0):  command: 0x12,0x0,0x0,0x0,0x4a,0x0,0x0,0x0,0x0,0x0,0x0,0x0-[74 bytes]
------------------------------
000: 00 80 00 01 1f 00 00 00 50 45 4e 54 41 58 20 20
016: 44 49 47 49 54 41 4c 5f 43 41 4d 45 52 41 20 20
032: 31 2e 30 30 00 00 00 00 00 00 00 00 00 00 00 00
048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
------------------------------
probe(umass0:0:0): invalid return code from adapter: 3
probe(umass0:0:0): scsipi_free_xs
umass_atapi_probe_device: scsipi_inquire failed
umass_atapi_probe_device: atapi=0xc0a7bd80 target=1
umass0: Attach finished