"Randy.Dunlap" wrote:
>
>
> Do you mean:
> pipe = usb_rcvctrlpipe(dev->udev,0);
> here?
> I'd suggest using cut & paste to correctly show us what you
> are using. "usbrcvpipe" isn't a [full] USB macro name.
Right, I should have used cut and paste. Here is my pencam_set_camera
function at present (I have cut out all but the first of the vendor
specific codes, since the crash occurs there):
---------------- cut ----------------------------
static int pencam_set_camera(struct usb_pencam *dev)
{
unsigned char *buf;
int i;
int pipe;
if ((dev->udev) == NULL) {
info("dev->udev is NULL");
return -1;
}
buf = kmalloc (16, GFP_KERNEL);
if (buf == NULL) {
err ("Out of memory");
return -1;
}
memset(buf,0,sizeof(buf));
if ((i = usb_set_configuration(dev->udev, 1)) < 0) {
info("FAILED to set config");
return i;
}
else
info("Set configuration OK");
if ((i = usb_set_interface(dev->udev, 0,0)) < 0) {
info("FAILED to set interface");
return i;
}
else
info("Set interface OK");
info("Setting pipe");
pipe = usb_rcvctrlpipe(dev->udev,0);
info("Pipe Set");
if ((i = usb_control_msg(dev->udev, pipe,
0x8a, 0xc1, 0, 0, buf, 0x02, PENCAM_TIMEOUT)) < 0)
return i;
kfree(buf);
return 0;
}
-------------------- cut ------------------
This function is called from the end of the pencam_probe function, which
is just the skel_probe function from usb-skeleton.c with the skel
replaced by pencam, and with the call to pencam_set_camera at the end:
--------------------- cut -------------------
static void * pencam_probe(struct usb_device *udev, unsigned int ifnum,
const struct usb_device_id *id)
{
struct usb_pencam *dev = NULL;
struct usb_interface *interface;
struct usb_interface_descriptor *iface_desc;
struct usb_endpoint_descriptor *endpoint;
int minor;
int buffer_size;
int i;
char name[10];
/* See if the device offered us matches what we can accept */
if ((udev->descriptor.idVendor != USB_PENCAM_VENDOR_ID) ||
(udev->descriptor.idProduct != USB_PENCAM_PRODUCT_ID)) {
return NULL;
}
---------------------------------------------------------------
I cut out all the middle stuff, which is unchanged from sket_probe,
other than the correct Vendor/product id's
---------------------------------------------------------------
exit:
up (&minor_table_mutex);
/* put in test of communication with camera */
if (pencam_set_camera(dev) != 0) {
info("Could not initialize camera");
return NULL;
}
return dev;
}
------------------------------ cut --------------------------
In the dmesg output I get the "Set configuration OK", "Set interface
OK", "Setting pipe" messages and then the "invalid operand: 0000".
Now the oops file. I am using the stock Mandrake 8.0 distribution,
kernel 2.4.3-20mdk, with the ksymoops rpm that came with it. Apparently
I am missing some debugging package, or the kernel is not built with
some debugging info. This is the output of
"ksymoops -v /boot/vmlinuz-2.4.3-20mdk -m System.map-2.4.3-20mdk -LK
oops.file > logoops.txt" :
-----------------------------------------------------
ksymoops 2.3.7 on i586 2.4.3-20mdk. Options used
-v /boot/vmlinuz-2.4.3-20mdk (specified)
-K (specified)
-L (specified)
-o /lib/modules/2.4.3-20mdk/ (default)
-m /boot/System.map-2.4.3-20mdk (specified)
Error (pclose_local): read_nm_symbols pclose failed 0x100
Warning (read_vmlinux): no kernel symbols in vmlinux, is
/boot/vmlinuz-2.4.3-20mdk a valid vmlinux file?
No modules in ksyms, skipping objects
invalid operand: 0000
CPU: 0
EIP: 0010:[<c88d06b3>]
Using defaults from ksymoops -t elf32-i386 -a i386
EFLAGS: 00010202
eax: c37f3e00 ebx: 04000300 ecx: c3a70000 edx: 00000300
esi: c3c78e20 edi: c37d6dc0 ebp: 00000000 esp: c7d2be0c
ds: 0018 es: 0018 ss: 0018
Process insmod (pid: 1808, stackpage=c7d2b000)
Stack: c88d10fa 00000000 00000000 c7d2be4c c7d2be4c c88d1230 c37d6dc0
c88d09de
c37d6dc0 00000000 00000000 c0110cc4 00000286 00000001 c0229ab0
c37d6840
636e6570 00306d61 00000286 00000000 c02298d8 c01294ea c22dd3e0
c88d13e4
Call Trace: [<c88d10fa>] [<c88d1230>] [<c88d09de>] [<c0110cc4>]
[<c01294ea>] [<c88d13e4>] [<c88d14a0>]
[<c8851ae9>] [<c88d13e4>] [<c88d15d4>] [<c88d14bc>] [<c885c340>]
[<c885186c>] [<c8851845>] [<c8851845>]
[<c885c348>] [<c88d0ad0>] [<c8851116>] [<c88d14a0>] [<c88510f3>]
[<c88d0000>] [<c88d0add>] [<c88d14a0>]
[<c012972e>] [<c0129754>] [<c0114aa8>] [<c8851000>] [<c8851000>]
[<c88d15c0>] [<c88ec000>] [<c88d0060>]
[<c0106f23>]
Code: 0f 45 da e8 b1 36 84 f7 c7 04 24 e8 03 00 00 81 cb 80 00 00
>>EIP; c88d06b3 <END_OF_CODE+85a181f/????> <=====
Trace; c88d10fa <END_OF_CODE+85a2266/????>
Trace; c88d1230 <END_OF_CODE+85a239c/????>
Trace; c88d09de <END_OF_CODE+85a1b4a/????>
Trace; c0110cc4 <do_page_fault+0/47c>
Trace; c01294ea <__alloc_pages+66/240>
Trace; c88d13e4 <END_OF_CODE+85a2550/????>
Trace; c88d14a0 <END_OF_CODE+85a260c/????>
Trace; c8851ae9 <END_OF_CODE+8522c55/????>
Trace; c88d13e4 <END_OF_CODE+85a2550/????>
Trace; c88d15d4 <END_OF_CODE+85a2740/????>
Trace; c88d14bc <END_OF_CODE+85a2628/????>
Trace; c885c340 <END_OF_CODE+852d4ac/????>
Trace; c885186c <END_OF_CODE+85229d8/????>
Trace; c8851845 <END_OF_CODE+85229b1/????>
Trace; c8851845 <END_OF_CODE+85229b1/????>
Trace; c885c348 <END_OF_CODE+852d4b4/????>
Trace; c88d0ad0 <END_OF_CODE+85a1c3c/????>
Trace; c8851116 <END_OF_CODE+8522282/????>
Trace; c88d14a0 <END_OF_CODE+85a260c/????>
Trace; c88510f3 <END_OF_CODE+852225f/????>
Trace; c88d0000 <END_OF_CODE+85a116c/????>
Trace; c88d0add <END_OF_CODE+85a1c49/????>
Trace; c88d14a0 <END_OF_CODE+85a260c/????>
Trace; c012972e <__free_pages+1a/1c>
Trace; c0129754 <free_pages+24/28>
Trace; c0114aa8 <sys_init_module+590/634>
Trace; c8851000 <END_OF_CODE+852216c/????>
Trace; c8851000 <END_OF_CODE+852216c/????>
Trace; c88d15c0 <END_OF_CODE+85a272c/????>
Trace; c88ec000 <END_OF_CODE+85bd16c/????>
Trace; c88d0060 <END_OF_CODE+85a11cc/????>
Trace; c0106f23 <system_call+33/40>
Code; c88d06b3 <END_OF_CODE+85a181f/????>
00000000 <_EIP>:
Code; c88d06b3 <END_OF_CODE+85a181f/????> <=====
0: 0f 45 da cmovne %edx,%ebx <=====
Code; c88d06b6 <END_OF_CODE+85a1822/????>
3: e8 b1 36 84 f7 call f78436b9 <_EIP+0xf78436b9>
c0113d6c <printk+0/134>
Code; c88d06bb <END_OF_CODE+85a1827/????>
8: c7 04 24 e8 03 00 00 movl $0x3e8,(%esp,1)
Code; c88d06c2 <END_OF_CODE+85a182e/????>
f: 81 cb 80 00 00 00 or $0x80,%ebx
1 warning and 1 error issued. Results may not be reliable.
------------------------------------------------------
>From the "Warning (read_vmlinux): no kernel symbols in vmlinux, is
/boot/vmlinuz-2.4.3-20mdk a valid vmlinux file?" (must be valid; it's
the only one there and the system boots) I assume that the kernel is not
built with the necessary kernel symbols. I will have to recompile the
kernel, but I am not sure what option to enable in "make menuconfig" to
do this; I looked through the options and couldn't find that particular
one. "code maturity level support, loadable module support, processor
type features, general setup" have nearly all options either compiled in
or marked as M). Where do I look for that? Or am I just missing some
package? Thanks,
Kevin
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel