Skip to contentSkip to conversation

question about generalized way for RSSI notification

DISCUSSION Alexey Perevalov 2 participants 3 messages Nov 29, 2013 – Dec 3, 2013

lore
Share & tools
lore
#0 lore raw

Dear wireless subsystem maintainers,

I have a question regarding RSSI notification to the user space.
Right now this information available in /proc/net/wireless.
That generalized method is not depending on driver implementation, driver just need to provide wireless statistics.

I found 2 places in kernel which report about RSSI to user space eventually. First place, it's wlan_rndis driver base implementation ./drivers/net/wireless/rndis_wlan.c. The second place, it's mac80211 driver - beacon frame handling.

Unfortunately wireless driver we're using isn't rndis based and isn't mac80211 based. We don't want to depends on driver code.

What community think in this situation, is it possible to add notifier with following responsibility:
send netlink notification in case of signal level changed according
to predefined by user threshold?

Technically it will looks like rndis_wlan approach - timer function with predefined frequency.

This functionality is needed to reduce user space daemon activity which provides information to GUI wifi indicator. Also such approach could decrease time reaction on signal level changes. Currently, some OSes has 1 second interval, another one has 3 seconds for checking RSSI.

Signature · 2 lines
Best regards,
Alexey Perevalov
#1 lore raw
Quoted 11 lines · Alexey Perevalov

Dear wireless subsystem maintainers,

I have a question regarding RSSI notification to the user space. Right now this information available in /proc/net/wireless. That generalized method is not depending on driver implementation, driver just need to provide wireless statistics.

I found 2 places in kernel which report about RSSI to user space eventually. First place, it's wlan_rndis driver base implementation ./drivers/net/wireless/rndis_wlan.c.
The second place, it's mac80211 driver - beacon frame handling.

Do you mean ieee80211_rx_mgmt_beacon()?

Quoted 3 lines

Unfortunately wireless driver we're using isn't rndis based and isn't mac80211 based.
We don't want to depends on driver code.

There's another possibility: use cfg80211 for the driver's configuration interface. cfg80211 is actually just some utility code that implements the nl80211 API (which replaces the old WEXT configuration API). Any driver can use cfg80211, not just ones based on the mac80211 software stack. In fact, a number of the older "fullmac" drivers (libertas, orinico) have been ported to use the cfg80211 API for all configuration handling.

Quoted 4 lines

What community think in this situation, is it possible to add notifier with following responsibility:
send netlink notification in case of signal level changed according
to predefined by user threshold?

Look at net/wireless/nl80211.c; these are the entry points when userspace is configuring the driver with nl80211 commands. Userspace would set up CQM thresholds with the NL80211_CMD_SET_CQM command, which then gets passed to your driver. Your driver could then set up a timer or level triggers based on the userspace parameters, and then call cfg80211_cqm_rssi_notify() as appropriate to send the notification to userspace.

Dan

Quoted 9 lines

Technically it will looks like rndis_wlan approach - timer function with predefined frequency.

This functionality is needed to reduce user space daemon activity which provides information to GUI wifi indicator.
Also such approach could decrease time reaction on signal level changes. Currently, some OSes has 1 second interval,
another one has 3 seconds for checking RSSI.

#2 lore raw

Hi Dan,

Thank you very much, already existing netlink interface is really what we need. And beacon frame it's better place to send notification about RSSI.

Quoted 8 lines · Dan Williams
Quoted 7 lines · Alexey Perevalov

Dear wireless subsystem maintainers,

I have a question regarding RSSI notification to the user space. Right now this information available in /proc/net/wireless. That generalized method is not depending on driver implementation, driver just need to provide wireless statistics.

Quoted 5 lines
Quoted 4 lines

I found 2 places in kernel which report about RSSI to user space eventually. First place, it's wlan_rndis driver base implementation ./drivers/net/wireless/rndis_wlan.c.
The second place, it's mac80211 driver - beacon frame handling.

Do you mean ieee80211_rx_mgmt_beacon()?

Yes I meant IEEE80211_STYPE_BEACON handling which use already existing netlink infrastructure.

Quoted 34 lines
Quoted 3 lines

Unfortunately wireless driver we're using isn't rndis based and isn't mac80211 based.
We don't want to depends on driver code.

There's another possibility: use cfg80211 for the driver's configuration interface. cfg80211 is actually just some utility code that implements the nl80211 API (which replaces the old WEXT configuration API). Any driver can use cfg80211, not just ones based on the mac80211 software stack. In fact, a number of the older "fullmac" drivers (libertas, orinico) have been ported to use the cfg80211 API for all configuration handling.

Quoted 4 lines

What community think in this situation, is it possible to add notifier with following responsibility:
send netlink notification in case of signal level changed according
to predefined by user threshold?

Look at net/wireless/nl80211.c; these are the entry points when userspace is configuring the driver with nl80211 commands. Userspace would set up CQM thresholds with the NL80211_CMD_SET_CQM command, which then gets passed to your driver. Your driver could then set up a timer or level triggers based on the userspace parameters, and then call cfg80211_cqm_rssi_notify() as appropriate to send the notification to userspace.

Dan

Quoted 9 lines

Technically it will looks like rndis_wlan approach - timer function with predefined frequency.

This functionality is needed to reduce user space daemon activity which provides information to GUI wifi indicator.
Also such approach could decrease time reaction on signal level changes. Currently, some OSes has 1 second interval,
another one has 3 seconds for checking RSSI.

Signature · 2 lines
Best regards,
Alexey Perevalov