kevin wrote:
>
[snippage]
>
> I am using Mandrake 8.0, with their kernel 2.4.3-20mdk; no other patches
> or changes. The latest driver I tried is based on Greg K-H's
First, there have been some updates to usb-skeleton.c.
You might want to use a later kernel, or at least usb-skeleton.c.
> usb-skeletion.c code, version 0.3, 5-29-01. I changed skel_ to pencam_
> and Skeleton to STV0680, put in the correct Vendor and Product codes
> (0x0553/0x0202) and added the pencam_set_camera function to do the
> initialization. There is a call to that function from the pencam_init
> function, at the very end just before the ret statement (see below). The
> usb_set_config/interface statments are used in the Windows driver and
> the linux command line program to download images; I'm not sure they are
> necessary here but I added them to make sure I was communicating with
> the camera. I have removed the else info("Set ... OK"); but left the
> code in here and manually typed in the messages in the log below. There
> is also a big comment section with the codes obtained from the Windows
> usb sniff program. Examinig buf contents after the 3rd call should give
> me the vendor/product codes back (test/debug check), but I never get
> that far. The crash occurs with the first usb_control_msg statement
> (there are about 12 total; I commented out all but one until I find the
> problem).
>
> Note: PENCAM_TIMEOUT is set to 1000 by a define
>
> /************************************************************/
> static void pencam_set_camera(struct usb_pencam *dev)
> {
> unsigned char buf[40];
This <buf> should be kmalloc-ed (as Roman just wrote as I was
writing this).
> int i;
> unsigned int pipe;
> unsigned char request_type = 0xc1;
>
> memset(buf,0,sizeof(buf));
>
[snip]
>
> /* Now the linux code */
>
> if (usb_set_configuration(dev->udev, 1) < 0)
> info("FAILED to set config");
> else
> info("Set configuration OK");
>
> if (usb_set_interface(dev->udev, 0,0) < 0)
> info("FAILED to set interface");
> else
> info("Set interface OK");
It would be good practice to save the return values from usb_set_xyz()
above and include it in the info() calls in the failure cases,
to see why they failed (when they do fail).
> if ((i = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev,0),
> 0x8a, 0xc1, 0, 0, buf, 0x02, PENCAM_TIMEOUT)) < 0)
> return i;
>
> /* commented out everything below until I figure out what is wrong */
[snip]
Can you point to a usb_control_msg() or usb_set_xyz() call that
fails?
[much snippage; I confess, it was too long for me :]
> (Set config OK)
> (Set interface OK)
>
> invalid operand: 0000
> CPU: 0
> EIP: 0010:[<c88f165d>]
> EFLAGS: 00010202
> eax: 00000300 ebx: c4c79dec ecx: c29c2c00 edx: 04000300
> esi: c541af60 edi: c29c2c00 ebp: 00000000 esp: c4c79dc4
> ds: 0018 es: 0018 ss: 0018
> Process insmod (pid: 1551, stackpage=c4c79000)
> Stack: 0000008a 000000c1 00000000 00000000 c4c79dec 00000002 000003e8
> 00000000
> 00000000 00000086 00000000 00000000 00000000 00000000 00000000
> 00000000
> 00000000 00000000 00000000 00000000 c0113e93 c88f2130 c88f2130
> 00000000
> Call Trace: [<c0113e93>] [<c88f2130>] [<c88f2130>] [<c88f197e>]
> [<c0129463>] [<c88f22a4>] [<c88f2360>]
> [<c8851ae9>] [<c88f22a4>] [<c88f2494>] [<c88f237c>] [<c885c340>]
> [<c885186c>] [<c8851845>] [<c8851845>]
> [<c885c348>] [<c88f1a50>] [<c8851116>] [<c88f2360>] [<c88510f3>]
> [<c88f1000>] [<c88f1a5d>] [<c88f2360>]
> [<c012972e>] [<c0129754>] [<c0114aa8>] [<c8851000>] [<c8851000>]
> [<c88f2480>] [<c88fe000>] [<c88f1060>]
> [<c0106f23>]
>
> Code: 0f 44 c2 0d 80 00 00 80 50 8b 0e 51 e8 2a 0b f6 ff 83 c4 30
Needs to be run thru ksymoops.
~Randy
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel