diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2007-06-10 20:57:33 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-11 01:14:07 -0400 |
commit | b3d88ad49a0623d09efcf998beb26288c8029f75 (patch) | |
tree | 4ac9aa2462ebac150698f71f900772f14e911c87 /net/mac80211 | |
parent | 8c7b7faaa630fef7f68d8728cee1cce398cc9697 (diff) |
[MAC80211]: Add support for SIOCGIWRATE ioctl
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/ieee80211_ioctl.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index 352f03bd8a3a..66e8a976b311 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c | |||
@@ -838,6 +838,29 @@ static int ieee80211_ioctl_giwscan(struct net_device *dev, | |||
838 | } | 838 | } |
839 | 839 | ||
840 | 840 | ||
841 | static int ieee80211_ioctl_giwrate(struct net_device *dev, | ||
842 | struct iw_request_info *info, | ||
843 | struct iw_param *rate, char *extra) | ||
844 | { | ||
845 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | ||
846 | struct sta_info *sta; | ||
847 | struct ieee80211_sub_if_data *sdata; | ||
848 | |||
849 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
850 | if (sdata->type == IEEE80211_IF_TYPE_STA) | ||
851 | sta = sta_info_get(local, sdata->u.sta.bssid); | ||
852 | else | ||
853 | return -EOPNOTSUPP; | ||
854 | if (!sta) | ||
855 | return -ENODEV; | ||
856 | if (sta->txrate < local->oper_hw_mode->num_rates) | ||
857 | rate->value = local->oper_hw_mode->rates[sta->txrate].rate * 100000; | ||
858 | else | ||
859 | rate->value = 0; | ||
860 | sta_info_put(sta); | ||
861 | return 0; | ||
862 | } | ||
863 | |||
841 | static int ieee80211_ioctl_siwrts(struct net_device *dev, | 864 | static int ieee80211_ioctl_siwrts(struct net_device *dev, |
842 | struct iw_request_info *info, | 865 | struct iw_request_info *info, |
843 | struct iw_param *rts, char *extra) | 866 | struct iw_param *rts, char *extra) |
@@ -1779,7 +1802,7 @@ static const iw_handler ieee80211_handler[] = | |||
1779 | (iw_handler) NULL, /* -- hole -- */ | 1802 | (iw_handler) NULL, /* -- hole -- */ |
1780 | (iw_handler) NULL, /* -- hole -- */ | 1803 | (iw_handler) NULL, /* -- hole -- */ |
1781 | (iw_handler) NULL, /* SIOCSIWRATE */ | 1804 | (iw_handler) NULL, /* SIOCSIWRATE */ |
1782 | (iw_handler) NULL, /* SIOCGIWRATE */ | 1805 | (iw_handler) ieee80211_ioctl_giwrate, /* SIOCGIWRATE */ |
1783 | (iw_handler) ieee80211_ioctl_siwrts, /* SIOCSIWRTS */ | 1806 | (iw_handler) ieee80211_ioctl_siwrts, /* SIOCSIWRTS */ |
1784 | (iw_handler) ieee80211_ioctl_giwrts, /* SIOCGIWRTS */ | 1807 | (iw_handler) ieee80211_ioctl_giwrts, /* SIOCGIWRTS */ |
1785 | (iw_handler) ieee80211_ioctl_siwfrag, /* SIOCSIWFRAG */ | 1808 | (iw_handler) ieee80211_ioctl_siwfrag, /* SIOCSIWFRAG */ |