Управление параметрами модуля Virt2real Wi-Fi 1.0

Материал из virt2real wiki
Перейти к: навигация, поиск

Содержание

Описание модуля Wi-Fi 1.0

Мезонин Wi-Fi 1.0


Тонкая настройка

При включённой в ядре опции DEBUG_FS появляется возможность управлять некоторыми параметрами модуля Wi-Fi. В частности, настройками спящего режима модуля.

Различные параметры представлены в виде файлов, которые находятся в каталоге

/sys/kernel/debug/lbs_wireless/wlan0
[root@virt2real wlan0]# ls
hostsleep          registers/         subscribed_events/
info               sleepparams


Описание параметров

sleepparams

Используется для установки параметров счётчика спящего режима

Путь: /sys/kernel/debug/lbs_wireless/wlan0/sleepparams

Использование:

прочитать текущие настройки счётчика спящего режима

cat sleepparams 

установить новые параметры счётчика спящего режима

echo "p1 p2 p3 p4 p5 p6" > sleepparams

где

p1 is Sleep clock error in ppm (0-65535)

p2 is Wakeup offset in usec (0-65535)

p3 is Clock stabilization time in usec (0-65535)

p4 is Control periodic calibration (0-2)

p5 is Control the use of external sleep clock (0-2)

p6 is reserved for debug (0-65535)


hostsleep

Используется для включения/выключения спячки хоста (т.е. Виртурилки), такой функционал пока не проверялся.

Примечение: перед установкой этого параметра требуется предварительная настройка с помощью утилиты ethtool. Что-то вроде параметра со значением "wol". Список доступных ключей утилиты можно посмотреть командой ethtool -h

Путь: /sys/kernel/debug/lbs_wireless/wlan0/hostsleep

Использование:

Прочитать текущее значение

cat hostsleep

Записать новое значение (1 - включить спячку хоста, 0 - отключить спячку хоста)

echo "1" > hostsleep
echo "0" > hostsleep


subscribed_events

The subscribed_events directory contains the interface for the subscribed events API.

Path: /sys/kernel/debug/lbs_wireless/wlan0/subscribed_events/

Each event is represented by a filename. Each filename consists of the following three fields:

Value Frequency Subscribed

To read the current values for a given event, do:

cat event

To set the current values, do:

echo "60 2 1" > event

Frequency field specifies the reporting frequency for this event. If it is set to 0, then the event is reported only once, and then automatically unsubscribed. If it is set to 1, then the event is reported every time it occurs. If it is set to N, then the event is reported every Nth time it occurs.

beacon_missed Value field specifies the number of consecutive missing beacons which triggers the LINK_LOSS event. This event is generated only once after which the firmware resets its state. At initialization, the LINK_LOSS event is subscribed by default. The default value of MissedBeacons is 60.

failure_count Value field specifies the consecutive failure count threshold which triggers the generation of the MAX_FAIL event. Once this event is generated, the consecutive failure count is reset to 0. At initialization, the MAX_FAIL event is NOT subscribed by default.

high_rssi This event is generated when the average received RSSI in beacons goes above a threshold, specified by Value.

low_rssi This event is generated when the average received RSSI in beacons goes below a threshold, specified by Value.

high_snr This event is generated when the average received SNR in beacons goes above a threshold, specified by Value.

low_snr This event is generated when the average received SNR in beacons goes below a threshold, specified by Value.


registers

Различные регистры модуля Wi-Fi

Путь: /sys/kernel/debug/lbs_wireless/wlan0/registers/


rdmac rdbbp rdrf

These commands are used to read the MAC, BBP and RF registers from the card. These commands take one parameter that specifies the offset location that is to be read. This parameter must be specified in hexadecimal (its possible to precede preceding the number with a "0x").

Usage:

echo "0xa123" > rdmac ; cat rdmac
echo "0xa123" > rdbbp ; cat rdbbp
echo "0xa123" > rdrf ; cat rdrf

wrmac wrbbp wrrf

These commands are used to write the MAC, BBP and RF registers in the card. These commands take two parameters that specify the offset location and the value that is to be written. This parameters must be specified in hexadecimal (its possible to precede the number with a "0x").

Usage:

echo "0xa123 0xaa" > wrmac
echo "0xa123 0xaa" > wrbbp
echo "0xa123 0xaa" > wrrf