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:
pgpjllBoxQ9HL.pgp
Description: PGP signature