On 15-Nov-2002 Oliver Neukum wrote:
> 
>> Yes, I think you are right.
>> To test your idea, I moved the initialization
>>
>>         init_MUTEX(&usb_bus_list_lock);
>>
>> from usb_init() to just before the call to usb_scan_devices()
>> in usb_register() and the oops went away and cpia worked.
>>
>>
>> I see that in the working code prior to 2.4.13, usb_init() doesnt handle
>> any usb_bus_list_lock initialization.  Hmmm.

<snip>
> 
> No, don't do complicated halfmeasures.
> Add a call to usb_init to main.c::do_basic_setup if you compile usb into the
> kernel.

To test this strategy, I've done this, and put an 
"extern int __init usb_init(void);"   (is the "static int _init usb_init(void);"
in drivers/usb/usb.c a conflict with this?)
declaration in include/linux/usb.h, included usb.h in init/main.c, etc, so it
compiles OK,
but the link step fails:

ld -m elf_i386 -T /usr/src/linux-2.4.20-rc1/arch/i386/vmlinux.lds -e stext
arch/i386/kernel/head.o arch/i386/kernel/init_task.o init/main.o init/version.o
init/do_mounts.o \
        --start-group \
        arch/i386/kernel/kernel.o arch/i386/mm/mm.o kernel/kernel.o mm/mm.o
fs/fs.o ipc/ipc.o \
         drivers/parport/driver.o drivers/char/char.o drivers/block/block.o
drivers/misc/misc.o drivers/net/net.o drivers/media/media.o
drivers/char/agp/agp.o drivers/char/drm/drm.o drivers/ide/idedriver.o
drivers/cdrom/driver.o drivers/sound/sounddrivers.o drivers/pci/driver.o
drivers/video/video.o drivers/usb/usbdrv.o \
        net/network.o \
        /usr/src/linux-2.4.20-rc1/arch/i386/lib/lib.a
/usr/src/linux-2.4.20-rc1/lib/lib.a
/usr/src/linux-2.4.20-rc1/arch/i386/lib/lib.a \
        --end-group \
        -o vmlinux
init/main.o: In function `do_basic_setup':
init/main.o(.text.init+0x80f): undefined reference to `usb_init'
make: *** [vmlinux] Error 1

------------------------------------------
but look in usbdrv.o, usb_init is there!!

$ grep usb_init drivers/usb/*.o
Binary file usbcore.o matches
Binary file usbdrv.o matches
Binary file usb.o matches
---------drivers/usb/usb.c (unchanged)-------------
static int __init usb_init(void)
{
        init_MUTEX(&usb_bus_list_lock);
        usb_major_init();
        usbdevfs_init();
        usb_hub_init();

        return 0;
}
---include/linux/usb.h------------------------
<snip>
#endif /* CONFIG_USB_DEVICEFS */

extern int __init usb_init(void);

#endif  /* __KERNEL__ */

#endif
----init/main.c----------------------------------
<snip>
#ifdef CONFIG_USB
#include <linux/usb.h>
#endif
<snip>
ifdef CONFIG_TC
        tc_init();
#endif

#ifdef CONFIG_USB
        usb_init();
#endif
<snip>
------------------------------

init/main.c already initializes , e.g., the zorro driver, and I can't see
anything that is done for zorro that I didnt now do for usb_init.    What have I
overlooked?

Duncan




-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to