usbatm question

Roman Kagan rkagan at mail.ru
Mon Mar 14 00:35:12 EST 2005


On Sun, Mar 13, 2005 at 09:42:48PM +0100, matthieu castet wrote:
> Once we have finish to send all your options, we need to monitor the 
> state of the modem :
> - if it is not yet synchronized or in initialization we ask again its state.
> - If the state is failed, we reboot it
> - if it is operational, we start to monitor the modem : we ask other 
> stats info(including rate), when we receive the answer, we ask the 
> following stat info. When finish asking all the stat info, we ask again 
> the state of the modem.

I'm a bit confused here.  Do you mean that "failed" is considered a
transient error happening every now and then during modem operation,
which needs graceful recovery (reboot)?

AFAICT usbatm was written with the following typical usage in mind:

 - driver binds to the device and tries to figure out if it needs
   lengthy initialization (firmware upload and the like)

 - if it does, the driver enters ->heavy_init, performs modem
   initialization and checks if it has succeeded

 - if it hasn't, the failure is considered fatal, and ->heavy_init
   returns nonzero failure code; then usbatm unbinds the driver from the
   device

 - otherwise (either after successful ->heavy_init or immediately after
   ->bind if it returned need_heavy == 0) usbatm initializes ATM device
   and calls ->atm_start.

If the modem has to be rebooted from time to time during normal
operation (grrrr...) I suggest not to use heavy_init, as you need a
reboot hook all the time.

Cheers,
  Roman.



More information about the Usbatm mailing list