rkagan at mail.ru
Sun Mar 13 04:34:16 EST 2005
On Sat, Mar 12, 2005 at 11:37:16PM +0100, matthieu castet wrote:
> usbatm use intfdata for storing its private data, so the driver
> shouldn't use it.
> But how could the driver recover its private data for example for an ioctl?
> Could the driver assume that there is always usbatm private data and use
> usbatm->driver_data ?
It's up to you. usbatm calls subdriver's ->bind method in its probe
routine before anything else, so you can store your driver_data and then
rely on it. If you need to handle multiple interfaces, you need to make
sure that usbatm_usb_probe is called for only one of them, and
explicitly claim others from within ->bind.
> For the atm statistic (rate and state), is it safe to access it any time ?
> Some modem could start their stats loop in heavy init, because they need
> to know the state of the modem in order to send it the correct part of
> the firmware. Is it need to check if atm_start finished before updating
> atm stats ?
->atm_start is naturally run _after_ ->heavy_init.
Why not do the stats _in_ the ->atm_start?
More information about the Usbatm