Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90584
b: refs/heads/master
c: 380a942
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Apr 8, 2008
1 parent 695ce72 commit 3aa20f2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bebb8a5e2cd30adcc5e9a14c3366a231da728aee
refs/heads/master: 380a942b9177dcae1429fdd0f3639f92d9ab139d
18 changes: 12 additions & 6 deletions trunk/net/mac80211/ieee80211_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,19 +586,25 @@ static int ieee80211_ioctl_giwrate(struct net_device *dev,

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

if (sdata->vif.type == IEEE80211_IF_TYPE_STA)
sta = sta_info_get(local, sdata->u.sta.bssid);
else
if (sdata->vif.type != IEEE80211_IF_TYPE_STA)
return -EOPNOTSUPP;
if (!sta)
return -ENODEV;

sband = local->hw.wiphy->bands[local->hw.conf.channel->band];

if (sta->txrate_idx < sband->n_bitrates)
rcu_read_lock();

sta = sta_info_get(local, sdata->u.sta.bssid);

if (sta && sta->txrate_idx < sband->n_bitrates)
rate->value = sband->bitrates[sta->txrate_idx].bitrate;
else
rate->value = 0;

rcu_read_unlock();

if (!sta)
return -ENODEV;

rate->value *= 100000;

return 0;
Expand Down

0 comments on commit 3aa20f2

Please sign in to comment.