Search Linux Wireless

Re: [RFC 5/5] cfg80211: implement cfg80211_get_station

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21/01/14 17:03, Johannes Berg wrote:
> On Tue, 2014-01-21 at 12:09 +0100, Antonio Quartulli wrote:
> 
>> +++ b/net/wireless/nl80211.c
>> @@ -3780,6 +3780,28 @@ static int nl80211_get_station(struct sk_buff *skb, struct genl_info *info)
>>  	return genlmsg_reply(msg, info);
>>  }
>>  
>> +int cfg80211_get_station(struct net_device *dev, const u8 *mac_addr,
>> +			 struct station_info *sinfo)
> 
> Not sure nl80211.c is the best place for this?

mh true, I saw other cfg80211_* function in there..but they are all
NL80211 related. :)

I think util.c is a better place.

> 
>> +{
>> +	struct cfg80211_registered_device *rdev;
>> +	struct wireless_dev *wdev;
>> +	int err;
>> +
>> +	wdev = dev->ieee80211_ptr;
>> +	if (!wdev)
>> +		return -EOPNOTSUPP;
>> +
>> +	rdev = wiphy_to_dev(wdev->wiphy);
>> +	if (!rdev->ops->get_station)
>> +		return -EOPNOTSUPP;
>> +
>> +	err = rdev_get_station(rdev, dev, mac_addr, sinfo);
>> +	if (err)
>> +		return err;
>> +
>> +	return 0;
> 
> Those "err" variable checks and whatever are just pointless -- this is
> really just
> return rdev_get_station(...)

agreed!

> 
>> +}
> 
> Consider exporting it if you actually want to use your new function. :)

agreed²!!


Thanks!


-- 
Antonio Quartulli

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux