* [PATCH V6] mac80211: Add support for SIOCGIWRATE ioctl to provide rate information
@ 2007-05-23 3:14 Larry Finger
2007-05-26 19:00 ` Michael Wu
0 siblings, 1 reply; 4+ messages in thread
From: Larry Finger @ 2007-05-23 3:14 UTC (permalink / raw)
To: Jiri Benc; +Cc: linux-wireless
At present, transmission rate information for mac80211 is available only
if verbose debugging is turned on, and then only in the logs. This patch
implements the SIOCGIWRATE ioctl, which adds the current transmission rate to
the output of iwconfig.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
Index: wireless-dev/net/mac80211/ieee80211_ioctl.c
===================================================================
--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c
@@ -2013,6 +2013,29 @@ static int ieee80211_ioctl_giwscan(struc
}
+static int ieee80211_ioctl_giwrate(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *rate, char *extra)
+{
+ struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
+ struct sta_info *sta;
+ struct ieee80211_sub_if_data *sdata;
+
+ sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ if (sdata->type == IEEE80211_IF_TYPE_STA)
+ sta = sta_info_get(local, sdata->u.sta.bssid);
+ else
+ return -EOPNOTSUPP;
+ if (!sta)
+ return -ENODEV;
+ if (sta->txrate < local->oper_hw_mode->num_rates)
+ rate->value = local->oper_hw_mode->rates[sta->txrate].rate * 100000;
+ else
+ rate->value = 0;
+ sta_info_put(sta);
+ return 0;
+}
+
static int ieee80211_ioctl_siwrts(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *rts, char *extra)
@@ -3137,7 +3160,7 @@ static const iw_handler ieee80211_handle
(iw_handler) NULL, /* -- hole -- */
(iw_handler) NULL, /* -- hole -- */
(iw_handler) NULL, /* SIOCSIWRATE */
- (iw_handler) NULL, /* SIOCGIWRATE */
+ (iw_handler) ieee80211_ioctl_giwrate, /* SIOCGIWRATE */
(iw_handler) ieee80211_ioctl_siwrts, /* SIOCSIWRTS */
(iw_handler) ieee80211_ioctl_giwrts, /* SIOCGIWRTS */
(iw_handler) ieee80211_ioctl_siwfrag, /* SIOCSIWFRAG */
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH V6] mac80211: Add support for SIOCGIWRATE ioctl to provide rate information
2007-05-23 3:14 [PATCH V6] mac80211: Add support for SIOCGIWRATE ioctl to provide rate information Larry Finger
@ 2007-05-26 19:00 ` Michael Wu
0 siblings, 0 replies; 4+ messages in thread
From: Michael Wu @ 2007-05-26 19:00 UTC (permalink / raw)
To: Larry Finger; +Cc: Jiri Benc, linux-wireless, John Linville
[-- Attachment #1: Type: text/plain, Size: 400 bytes --]
On Tuesday 22 May 2007 20:14, Larry Finger wrote:
> At present, transmission rate information for mac80211 is available only
> if verbose debugging is turned on, and then only in the logs. This patch
> implements the SIOCGIWRATE ioctl, which adds the current transmission rate
> to the output of iwconfig.
>
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
> ---
>
ACK.
Thanks,
-Michael Wu
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH V6] mac80211: Add support for SIOCGIWRATE ioctl to provide rate information
@ 2007-05-23 9:49 Joerg Pommnitz
2007-05-23 10:18 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Joerg Pommnitz @ 2007-05-23 9:49 UTC (permalink / raw)
To: linux-wireless
Hello all,
what does SIOCGIWRATE do for IBSS networks? In this case you might have a different rate for every node in your network. Looking up just "sdata->u.sta.bssid" is insufficient because the BSSID of an IBSS network is not a real MAC address (after all, there is no AP).
I would very much like an official way to enumerate the current rates for all known stations in an IBSS network. This information would be useful for AdHoc routing: Currently most approaches use packet loss to weight different links. In this case a link might look better than it actually is, because rate control already lowered the current rate to a level where no packet loss occured whereas another link with higher data rate looks bad because it drops a packet now and than.
Is there a way to get this information?
--
Regards
Joerg
__________________________________ Yahoo! Clever - Der einfachste Weg, Fragen zu stellen und Wissenswertes mit Anderen zu teilen. www.yahoo.de/clever
^ permalink raw reply [flat|nested] 4+ messages in thread* RE: [PATCH V6] mac80211: Add support for SIOCGIWRATE ioctl to provide rate information
2007-05-23 9:49 Joerg Pommnitz
@ 2007-05-23 10:18 ` Johannes Berg
0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2007-05-23 10:18 UTC (permalink / raw)
To: Joerg Pommnitz; +Cc: linux-wireless, Larry Finger
[-- Attachment #1: Type: text/plain, Size: 1142 bytes --]
Joerg,
it is recommended practice to never remove people from CC, that applies
to From: too, so you should have sent a copy of your mail directly to
Larry as well.
> what does SIOCGIWRATE do for IBSS networks? In this case you might
> have a different rate for every node in your network. Looking up just
> "sdata->u.sta.bssid" is insufficient because the BSSID of an IBSS
> network is not a real MAC address (after all, there is no AP).
Nothing. It returns -EOPNOTSUPP, read the code.
> I would very much like an official way to enumerate the current rates
> for all known stations in an IBSS network. This information would be
> useful for AdHoc routing: Currently most approaches use packet loss to
> weight different links. In this case a link might look better than it
> actually is, because rate control already lowered the current rate to
> a level where no packet loss occured whereas another link with higher
> data rate looks bad because it drops a packet now and than.
>
> Is there a way to get this information?
No. Feel free to come up with a spec and implement it for
cfg80211/nl80211
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-05-26 19:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-23 3:14 [PATCH V6] mac80211: Add support for SIOCGIWRATE ioctl to provide rate information Larry Finger
2007-05-26 19:00 ` Michael Wu
-- strict thread matches above, loose matches on Subject: below --
2007-05-23 9:49 Joerg Pommnitz
2007-05-23 10:18 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox