How to cleanly unload libertas module

Dan Williams dcbw at redhat.com
Tue Jul 8 12:28:54 EDT 2008


On Tue, 2008-07-08 at 09:10 +0200, Cyril HAENEL wrote:
> Our need is to have the current consumption of the board as low as 
> possible when there is nothing to do. The board needs to wake up approx 
> every hour, connect to a server and get data. Because for now the driver 
> doesn't implements the standby mode, we need to find another solution. 
> We looked in the driver to see if we can implement the standby function 
> ourself, but it seems to be complicated for us.
> So my idea is to reset the wlan module when we don't it to save power. 
> We have seen that the wlan module consumption is very low when we put it 
> in reset.

Any idea what the difference between TX power off and module unloaded
is?  I'm pretty sure we can support power control fairly easily.  After
that, "Deep Sleep" mode should be fairly straightforward as well, and
it's somewhat documented in the 5.1 firmware spec too.

Dan

> Regards,
> Cyril
> 
> 
> Dan Williams a écrit :
> 
> >On Fri, 2008-07-04 at 09:42 +0200, Holger Schurig wrote:
> >  
> >
> >>>When I do an ifdown to unregister the wlan interface, and I
> >>>try to unload the libertas_cs and libertas modules, it does't
> >>>work because rmmod says me that the module is busy.
> >>>      
> >>>
> >>Works for me (with compact flash):
> >>
> >>ifdown eth1
> >>pccardctl eject
> >>rmmod libertas_cs
> >>rmmod libertas
> >>    
> >>
> >
> >Yeah, because I think you can disconnect the device itself (pccardctl
> >eject) and then libertas cleans up and frees stuff.  If the card is
> >soldered on or otherwise not removable, this probably won't work.
> >
> >  
> >
> >>Note that, because the CF driver registered itself with the 
> >>PCMCIA subsystem, just doing "ifdown eth1" doesn't set the usage 
> >>count to 0. After all, you can still access the card when the 
> >>interface is down. Maybe the same is true for SDIO. You must do 
> >>your SDIO-equivalent of "pccardctl eject", so that the driver 
> >>get's de-registered. In the SDIO case, you must trigger that the 
> >>SDIO subsystem calls your if_sdio_remove() function.
> >>    
> >>
> >
> >ifdown just stops the queues (lbs_eth_stop).  ifup starts them again.
> >You'd have to rmmod the driver to close the device and disconnect it
> >completely.  The current architecture loads the firmware and grabs the
> >device on probe.  We should try to track down where the module reference
> >is coming from though, just to understand whether it _should_ be there
> >or not.  Ideally you can rmmod the module at any time and it cleans up
> >after itself.
> >
> >What you probably really want is the ability to power down the
> >transmitter, which would be "iwconfig ethX txpower off".  Or is that not
> >sufficient?
> >
> >Dan
> >
> >
> >_______________________________________________
> >libertas-dev mailing list
> >libertas-dev at lists.infradead.org
> >http://lists.infradead.org/mailman/listinfo/libertas-dev
> >
> >
> >  
> >
> 




More information about the libertas-dev mailing list