tech-net archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: IEEE80211_IOC_STA_STATS broken?
On Fri, Nov 07, 2008 at 09:26:04AM +0000, Roy Marples wrote:
> David Young wrote:
> >>>If someone could tell me what I'm doing wrong or it's it's a
> >>>NetBSD-4.99.73 bug I'd appreciate it.
> >>Apparently, i_data has to point at a STA's MAC address:
> >>
> >> error = copyin(ireq->i_data, macaddr, IEEE80211_ADDR_LEN);
> >> if (error != 0)
> >> return error;
> >> ni = ieee80211_find_node(&ic->ic_sta, macaddr);
> >> if (ni == NULL)
> >> return EINVAL; /* XXX */
> >>
> >>Instead of EINVAL, it should return ENOENT, IMO.
> >
> >Also, I suggest pointing i_data at an ieee80211req_sta_stats.
>
> OK, it works a little better now.
> It things it works, but from the looks of it the data returned is
> garbage. Attached is the program, here is the output.
>
> $ ./x
> ok
> 00:13:49:a0:1d:48
> 00:13:49:a0:1d:48
> 1024
> SIOCG80211: Operation not permitted
> $ sudo ./x
> ok
> 00:13:49:a0:1d:48
> 00:13:49:a0:1d:48
> 1024
> ok
> 00:00:00:00:00:00
> 0 0 0
>
> The last 3 numbers are data length, frequency and rssi.
> Questions
>
> 1) Why is superuser required to obtain such simple information such as
> rssi of the AP associated to?
> 2) What is going wrong? It's quite hard as I can find no sample code for
> this ioctl and I don't understand much kernel code.
> 3) Is there an easier way to do this?
You can use the sysctl interface that I use in wlanctl. Apparently,
it is more full-featured.
I think that the problem you see is that the AP (aka "BSS") node is
not in the list of stations, ic_sta, but the only link to it is ic_bss,
and net80211 does not visit ic_bss when it iterates over the 802.11 nodes.
Dave
--
David Young OJC Technologies
dyoung%ojctech.com@localhost Urbana, IL * (217) 278-3933 ext 24
Home |
Main Index |
Thread Index |
Old Index