From: Michael Wu <flamingice@sourmilk.net>
To: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Jiri Benc <jbenc@suse.cz>,
Bcm43xx-dev@lists.berlios.de, linux-wireless@vger.kernel.org
Subject: Re: [PATCH V3] mac80211: Add support for SIOCGIWRATE ioctl to provide rate information
Date: Thu, 10 May 2007 00:16:41 -0400 [thread overview]
Message-ID: <200705100016.45876.flamingice@sourmilk.net> (raw)
In-Reply-To: <463a8a92.jFmmjY4cDnfJeisJ%Larry.Finger@lwfinger.net>
[-- Attachment #1: Type: text/plain, Size: 1087 bytes --]
On Thursday 03 May 2007 21:21, Larry Finger wrote:
> +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;
Eliminate the spaces between * and the variable name.
> +
> + sdata = IEEE80211_DEV_TO_SUB_IF(dev);
> + if (sdata->type == IEEE80211_IF_TYPE_STA ||
> + sdata->type == IEEE80211_IF_TYPE_IBSS)
> + sta = sta_info_get(local, sdata->u.sta.bssid);
> + else
> + return -EOPNOTSUPP;
> + if (!sta)
> + return -ENODEV;
> + rate->value = local->oper_hw_mode->rates[sta->txrate].rate * 100000;
The index from sta->txrate needs to be checked to make sure it is less than
mode->num_rates.
Also, this function is safe in adhoc mode.. but it most likely won't do
anything useful since all the sta entries have different addresses and it is
likely that none of them are the same as the one in sdata->u.sta.bssid.
-Michael Wu
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2007-05-10 4:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-04 1:21 [PATCH V3] mac80211: Add support for SIOCGIWRATE ioctl to provide rate information Larry Finger
2007-05-04 10:58 ` Johannes Berg
2007-05-04 11:00 ` Jiri Benc
2007-05-04 11:07 ` Johannes Berg
2007-05-10 4:16 ` Michael Wu [this message]
2007-05-10 14:56 ` Larry Finger
2007-05-10 15:56 ` Michael Wu
2007-05-10 16:39 ` Larry Finger
2007-05-10 17:32 ` Michael Wu
2007-05-10 17:45 ` Larry Finger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200705100016.45876.flamingice@sourmilk.net \
--to=flamingice@sourmilk.net \
--cc=Bcm43xx-dev@lists.berlios.de \
--cc=Larry.Finger@lwfinger.net \
--cc=jbenc@suse.cz \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.