Which func or line in kernel source calls usb_rtusb_probe??

Live forum: http://rt2x00.serialmonkey.com/viewtopic.php?t=4783

salvage

09-05-2008 14:14:54

Hi,
I am trying to debugging rt73.ko step by step, using vmware and kgdb on my laptop. In rtmp_main.c there are codes
//**********************
struct usb_driver rtusb_driver = {
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)
.owner = THIS_MODULE,
#endif
.name="rt73",
.probe=usb_rtusb_probe,//see, it points to usb_rtusb_probe.
.disconnect=usb_rtusb_disconnect,
.id_table=rtusb_usb_id,
};
//*********************
I tried to step into func usb_probe_interface which is in drivers/usb/core filefolder, but i failed.
//**********************

static int usb_probe_interface(struct device *dev)
{
struct usb_interface * intf = to_usb_interface(dev);
struct usb_driver * driver = to_usb_driver(dev->driver);
const struct usb_device_id *id;
int error = -ENODEV;

dev_dbg(dev, "%s\n", __FUNCTION__);

if (!driver->probe)
return error;
/* FIXME we'd much prefer to just resume it ... */
if (interface_to_usbdev(intf)->state == USB_STATE_SUSPENDED)
return -EHOSTUNREACH;

id = usb_match_id (intf, driver->id_table);
if (id) {
dev_dbg (dev, "%s - got id\n", __FUNCTION__);

/* Interface "power state" doesn't correspond to any hardware
* state whatsoever. We use it to record when it's bound to
* a driver that may start I/0 it's not frozen/quiesced.
*/
mark_active(intf);
intf->condition = USB_INTERFACE_BINDING;
error = driver->probe (intf, id);//here is where I wanna step into.!!!!!!!!
if (error) {
mark_quiesced(intf);
intf->condition = USB_INTERFACE_UNBOUND;
} else
intf->condition = USB_INTERFACE_BOUND;
}

return error;
}
//*****************
I am not quite familiar with the kernel source now, for my purpose is only to debug rt73.ko. I don't think func "usb_rtusb_probe" cannot be stopped, bacause when I set breakpoints at functions which is called by this function, it did stopped there. Maybe it's because I did not find the right func which did call it, from which I can enter into rt73.ko and set breakpoints in this function, not only listing its codes.
Can anyone tell me where to find the correct interface func?
Thank you very much!!!! oops shock

fatah

12-05-2008 05:05:45

From my opinion, it is Linux kernel function somewhere listed in /proc/kallsyms who calls usb_rtusb_probe() upon device exist identified from rtusb_usb_id list.

salvage

08-07-2008 13:27:49

Thank you so much!
It seems that the software driver cannot be stepped into by kgdb. I have given up it and use the printk. D