Skip to contentSkip to conversation

Q: how to update platform power state for the network driver

DISCUSSION Vladimir Kondratiev 4 participants 9 messages Jan 9, 2013 – Jan 14, 2013

lore
Share & tools
lore
#0 lore raw

Hi,

in 60g spec (802.11ad, references to this doc.), station should set "power source" bit in the:

8.4.2.130.3 DMG PCP/AP Capability Information field

This information used to construct "PCP factor" that used in:

10.1.4.3.4 PCP selection in a PBSS

This procedure replaces GO negotiation in P2P. "power source" bit above specified as:

The Power Source field is set to 0 if the STA is battery powered, and is set to 1 otherwise.

What is the best way to obtain this info in the network driver?

Thanks, Vladimir.

#1 lore raw
Quoted 8 lines · Vladimir Kondratiev

Hi,

in 60g spec (802.11ad, references to this doc.), station should set "power source" bit in the:

8.4.2.130.3 DMG PCP/AP Capability Information field

This information used to construct "PCP factor" that used in:

Quoted 7 lines

10.1.4.3.4 PCP selection in a PBSS

This procedure replaces GO negotiation in P2P. "power source" bit above specified as:

The Power Source field is set to 0 if the STA is battery powered, and is set to 1 otherwise.

What is the best way to obtain this info in the network driver?

You can't really do that very well. Set it in wpa_supplicant according to the configuration. It might even query the power source on a laptop, but I suspect this is a somewhat different use case anyway.

johannes

#2 lore raw
In reply to Vladimir Kondratiev
Quoted 2 lines · Vladimir Kondratiev

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

#3 lore raw

Hi Vladimir,

Quoted 6 lines · Vladimir Kondratiev
Quoted 2 lines · Vladimir Kondratiev

What is the best way to obtain this info in the network driver?

Found:

Quoted 7 lines

#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,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
#4 lore raw
Quoted 5 lines · Julian Calaby
Quoted 2 lines

#include <linux/power_supply.h>
int power_supply_is_system_supplied(void);

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.

Sure, thanks for input

#5 lore raw
In reply to Julian Calaby
Quoted 11 lines · Julian Calaby
Quoted 7 lines

#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.

I'm also worried that this power_supply interface is not supported in all platforms. Does anyone know how widely it's used?

Signature · 1 line
Kalle Valo
#6 lore raw
In reply to Vladimir Kondratiev
Quoted 11 lines · Vladimir Kondratiev

in 60g spec (802.11ad, references to this doc.), station should set "power source" bit in the:

8.4.2.130.3 DMG PCP/AP Capability Information field

This information used to construct "PCP factor" that used in:

10.1.4.3.4 PCP selection in a PBSS

This procedure replaces GO negotiation in P2P. "power source" bit above specified as:

The Power Source field is set to 0 if the STA is battery powered, and is set to 1 otherwise.

Scary! Just of curiosity, how is this bit supposed to be used in real life?

Signature · 1 line
Kalle Valo
#7 lore raw
Quoted 3 lines · Kalle Valo
Quoted 1 line · Vladimir Kondratiev

in 60g spec (802.11ad, references to this doc.), station should set "power source" bit in the:

[skip]

Quoted 3 lines

Scary! Just of curiosity, how is this bit supposed to be used in real life?

In 60g, you have new ah-hoc network type, PBSS, that should be used for P2P (spec mandates it) In PBSS, there is AP-like entity called PCP. Instead of P2P GO negotiation, GO choosen before, on lower layer, when selecting PCP. In this decision, "best suitable" candidate selected PCP, based on "PCP factor" calculated for each peer. Most significant bit there is "power" since one who is AC powered is better candidate.

Bottom line - this is to elect as P2P GO AC-powered one (if there is such peer).

Thanks, Vladimir

#8 lore raw
Quoted 9 lines · Vladimir Kondratiev
Quoted 3 lines · Kalle Valo
Quoted 1 line · Vladimir Kondratiev

in 60g spec (802.11ad, references to this doc.), station should set "power source" bit in the:

[skip]

Quoted 3 lines

Scary! Just of curiosity, how is this bit supposed to be used in real life?

Quoted 7 lines

In 60g, you have new ah-hoc network type, PBSS, that should be used for P2P (spec mandates it) In PBSS, there is AP-like entity called PCP. Instead of P2P GO negotiation, GO choosen before, on lower layer, when selecting PCP. In this decision, "best suitable" candidate selected PCP, based on "PCP factor" calculated for each peer. Most significant bit there is "power" since one who is AC powered is better candidate.

Bottom line - this is to elect as P2P GO AC-powered one (if there is such peer).

Ok, so it's just a sort of priority bit. That's not bad.

Signature · 1 line
Kalle Valo