6

Is there a way in OpenWrt to read the current value of the RTS threshold for a specific interface without installing iwconfig?

What I'm looking for is the value of RTS thr that can be found in the output of iwconfig device:

wlp2s0    IEEE 802.11bgn  ESSID:"my_essid"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:DE:AD:BE:EF:00   
          Bit Rate=54 Mb/s   Tx-Power=16 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off

Since iwconfig is deprecated, I'm looking for a way to obtain this value with iw or by reading some system files.

What seems strange is that with iw I can set the RTS threshold by using

 iw phy phy0 set rts 80

but I can't read it. After that command the output of iwconfig is

wlp2s0    IEEE 802.11bgn  ESSID:"my_essid"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: 00:DE:AD:BE:EF:00    
          Bit Rate=54 Mb/s   Tx-Power=16 dBm   
          Retry  long limit:7   RTS thr=80 B   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=70/70  Signal level=-19 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:26  Invalid misc:1916   Missed beacon:0

So the actual question is: where does iwconfig read the value of RTS thr?

2 Answers 2

4

While iwconfig prints the RTS threshold anyway, iw prints it only when the RTS mechanism is enabled.

In order to read the value the command is

iw phy phy0 info | grep RTS

which outputs no lines if RTS is off or something like

RTS threshold: <number>

if it's enabled.

1
  • 1
    When you know there's only one wireless device, you can shorten this to iw phy | grep RTS. Jul 31, 2020 at 16:46
0

This took a while to route out but I think what you're asking is as follows. In the output of iwconfig:

$ sudo iwconfig
wlp3s0    IEEE 802.11bgn  ESSID:"none_of_your_business_1"  
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:22:3F:03:5C:67   
          Bit Rate=54 Mb/s   Tx-Power=14 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=62/70  Signal level=-48 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:225   Missed beacon:0

Specifically this line:

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

These values are accessible under the /sys filesystem if you know where to look. My WiFi device is located here under the /sys:

$ sudo more /sys/kernel/debug/iwlwifi/0000:03:00.0/iwldvm/debug/ucode_rx_stats

The corresponding lines from that file?

Statistics_Rx - OFDM:               current  cumulative       delta         max
  unresponded_rts:                        0           0           0           0
1
  • The value of unresponded_rts is related to the topic but that's not what I'm looking for; that file is also driver-dependent and I'm not using an Intel card. I edited the question to make it (hopefully) clearer Apr 7, 2014 at 14:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .