Search Linux Wireless

Re: RFC Patch v2: Add signal strength to nl80211station info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 1, 2008 at 9:39 AM, Luis R. Rodriguez<lrodriguez@xxxxxxxxxxx> wrote:> On Mon, Dec 01, 2008 at 05:22:23AM -0800, Henning Rogge wrote:>> Am Monday 01 December 2008 12:17:36 schrieb Johannes Berg:>> > Even if you corrected the spelling to "bandwidth" you'd (a) be missing>> > documentation and (b) be using an entirely wrong term for what you're>> > doing.>>>> Changes since v1:>> - removed noise and quality from station info in NL80211>> - added bandwith to station info in NL80211>> - changed name of patch file to nl80211ext_v2.patch>>>> Changes since v2:>> - added kernel comment lines for new fields/enums>> - changed name of "bandwith" field to tx_bitrate>>>> Henning Rogge>>>> *************************************************>> Diplom Informatiker Henning Rogge>> Forschungsgesellschaft für>> Angewandte Naturwissenschaften e. V. (FGAN)>> Neuenahrer Str. 20, 53343 Wachtberg, Germany>> Tel.: 0049 (0)228 9435-961>> Fax: 0049 (0)228 9435-685>> E-Mail: rogge@xxxxxxx>> Web: www.fgan.de>> ************************************************>> Sitz der Gesellschaft: Bonn>> Registergericht: Amtsgericht Bonn VR 2530>> Vorstand: Dr. rer. nat. Ralf Dornhaus (Vors.), Prof. Dr. Joachim Ender>> (Stellv.)>>>> --------------------------------------------------->>>> diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h>> index e08c8bc..030feed 100644>> --- a/include/linux/nl80211.h>> +++ b/include/linux/nl80211.h>> @@ -404,6 +404,8 @@ enum nl80211_sta_flags {>>   * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station)>>   * @__NL80211_STA_INFO_AFTER_LAST: internal>>   * @NL80211_STA_INFO_MAX: highest possible station info attribute>> + * @NL80211_STA_INFO_SIGNAL: signal strength of last received package (u8,>> dBm)>> + * @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate (u16, 100 kbit/s)>>   */>>  enum nl80211_sta_info {>>       __NL80211_STA_INFO_INVALID,>> @@ -413,6 +415,8 @@ enum nl80211_sta_info {>>       NL80211_STA_INFO_LLID,>>       NL80211_STA_INFO_PLID,>>       NL80211_STA_INFO_PLINK_STATE,>> +     NL80211_STA_INFO_SIGNAL,>> +     NL80211_STA_INFO_TX_BITRATE,>>>>       /* keep last */>>       __NL80211_STA_INFO_AFTER_LAST,>> diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h>> index 1d57835..fd9964c 100644>> --- a/include/net/cfg80211.h>> +++ b/include/net/cfg80211.h>> @@ -167,6 +167,8 @@ struct station_parameters {>>   * @STATION_INFO_LLID: @llid filled>>   * @STATION_INFO_PLID: @plid filled>>   * @STATION_INFO_PLINK_STATE: @plink_state filled>> + * @STATION_INFO_SIGNAL: @signal filled>> + * @STATION_INFO_TX_BITRATE: @tx_bitrate filled>>   */>>  enum station_info_flags {>>       STATION_INFO_INACTIVE_TIME      = 1<<0,>> @@ -175,6 +177,8 @@ enum station_info_flags {>>       STATION_INFO_LLID               = 1<<3,>>       STATION_INFO_PLID               = 1<<4,>>       STATION_INFO_PLINK_STATE        = 1<<5,>> +     STATION_INFO_SIGNAL             = 1<<6,>> +     STATION_INFO_TX_BITRATE         = 1<<7,>>  };>>>>  /**>> @@ -189,6 +193,8 @@ enum station_info_flags {>>   * @llid: mesh local link id>>   * @plid: mesh peer link id>>   * @plink_state: mesh peer link state>> + * @signal: signal strength of last received package in dBm>> + * @tx_bitrate: current unicast tx rate in 100 kbit/sec>>   */>>  struct station_info {>>       u32 filled;>> @@ -198,6 +204,8 @@ struct station_info {>>       u16 llid;>>       u16 plid;>>       u8 plink_state;>> +     u8 signal;>> +     u16 tx_bitrate;>>  };>>>>  /**>> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c>> index 16423f9..f6ed5b5 100644>> --- a/net/mac80211/cfg.c>> +++ b/net/mac80211/cfg.c>> @@ -307,14 +307,24 @@ static int ieee80211_config_default_key(struct wiphy>> *wiphy,>>  static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)>>  {>>       struct ieee80211_sub_if_data *sdata = sta->sdata;>> +  struct ieee80211_supported_band *sband;>>>>       sinfo->filled = STATION_INFO_INACTIVE_TIME |>>                       STATION_INFO_RX_BYTES |>> -                     STATION_INFO_TX_BYTES;>> +                     STATION_INFO_TX_BYTES |>> +                     STATION_INFO_SIGNAL |>> +                     STATION_INFO_TX_BITRATE;>>>>       sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx);>>       sinfo->rx_bytes = sta->rx_bytes;>>       sinfo->tx_bytes = sta->tx_bytes;>> +     sinfo->signal = sta->last_signal;>> +>> +     sband = sta->local->hw.wiphy->bands[sta->local->hw.conf.channel->band];>> +     if (!(sta->last_tx_rate.flags & IEEE80211_TX_RC_MCS))>> +       sinfo->tx_bitrate = sband->bitrates[sta->last_tx_rate.idx].bitrate;>> +     else>> +       sinfo->tx_bitrate = 0;>> It would be nice to get this figured out before adding it. We got random> complaints from users claiming 802.11n wasn't working before because> iwconfig didn't report a good rate. Users will trust it so I'd rather> see this go in with MCS rate figured out as part of the API to avoid> such reports. Would it be possible for you to work on that?>> This might come in handy:>> http://wireless.kernel.org/en/developers/Documentation/ieee80211/802.11n#MCSRates>> What you need then is the guard interval, the MCS rate index and the> number of streams being used for communication.
Also how about we add a last TX rate and last RX rate so we get both?
 Luis��.n��������+%������w��{.n�����{���zW����ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux