[linux-usb-devel] [RFC] Conexant AccessRunner ADSL USB modem driver

Roman Kagan rkagan at mail.ru
Sat Jan 15 06:02:13 EST 2005


  Hi Duncan,

On Mon, 2005-01-10 at 17:44 +0100, Duncan Sands wrote:
> (3) Setting the MAC address in cxacru_got_firmware.  This one worries me: we create
> the ATM device when the device is probed.  The firmware is loaded at some later time
> (in a kernel thread, because it would take too long for khubd).  At that point the
> MAC address is changed.  What if this change in the MAC address confuses user space
> tools or other parts of the kernel?

Changing the MAC address of a working device from userspace is allowed
(see ip(8) link set DEVICE address LLADDR), so doing it here may also be
fine.  However, having given it some thought, I now tend to believe that
the right solution is to create the ATM device only when it's usable,
i.e. after the firmware is loaded (and the MAC address is known).

> There are two problems with this: (1)
> the ATM device won't turn up when the USB device turns up but at a later time; that
> means that scripts (or humans) will have to wait for the device to be created;

This is the common problem of using a device before it's ready.  The
right answer to it is using hotplug.  This will require adding driver
model support to ATM, though; class/atm or something like that.  I'll
try to look at how easily this can be done.

>  (2) firmware loading may fail at probe time (because eg the firmware is on a partition
> that hasn't been mounted yet); right now the driver handles this by trying to load the
> firmware again when you open the ATM device - but if there is no ATM device then that
> strategy needs to be replaced with something else, but what?

I'd simply make sure that the firmware is available no later than the
driver module itself is, and then let the hotplug/udev/initramfs people
figure out how to handle staged system initialisation :)

(As a side note, on my machines I currently do /sys scan and
coldplugging from within initramfs with minimal module set first, then
mount the root filesystem with all the necessary stuff and repeat.  This
may have issues, though).

Cheers,
  Roman.




More information about the Usbatm mailing list