Hi Vladimir, On Thu, Jan 10, 2013 at 11:06 PM, Vladimir Kondratiev <qca_vkondrat@xxxxxxxxxxxxxxxx> wrote: > On Wednesday, January 09, 2013 07:20:06 PM Vladimir Kondratiev wrote: >> What is the best way to obtain this info in the network driver? >> > > Found: > > #include <linux/power_supply.h> > int power_supply_is_system_supplied(void); > > returns: > positive if system is AC supplied, > 0 if battery supplied > negative on error One minor point: you might want to add the ability to override this, even if it's only through debugfs so that people testing the code, or with unusual requirements can set this how they want / need it. Thanks, -- Julian Calaby Email: julian.calaby@xxxxxxxxx Profile: http://www.google.com/profiles/julian.calaby/ .Plan: http://sites.google.com/site/juliancalaby/ -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html