Posts Tagged ‘iperf’

Pass per packet Rssi and Rate to user space

Posted in Uncategorized on May 5th, 2009 by admin – Comments Off

global value store the per packet Rssi and Rate value. Then use the ath_stats to store the value when ath_rx_tasklet is called. Use ioctl to retrieve the stats information.

In iperf Server.cpp (received side), do the following:
1) copy header file from madwifi to the current directory

  • wireless.h
  • ath_desc.h
  •  if_athioctl.h

2) include all 3 files in (1) and the following in Server.cpp

  • <fcnt.h>
  • <unistd.h>
  • <sys/ioctl.h>
  • <linux/ioctl.h>

3) add a function in Server.cpp to get the rssi and rate values using ioctl called, detail:

const char *infname = "wifi0"; struct ifreq ifr ; struct ath_stats cur,total; strncpy(ifr.ifr_name,ifname,sizeof(ifr.ifname)); ifr.ifr_data = (caddr_t) &total;  ioctl(sock_id, SIOCGATHSTATS, &ifr) return total.ast_rx_rssi;

4) output data in a file

iperf server and client setup

Posted in Uncategorized on May 3rd, 2009 by admin – 1 Comment

Server:
iperf -s -u -i5
Client:
iperf -c [ip address] -u -t [x second] -b [user rate in Mbps]