Posts Tagged ‘rate’

per packet rate

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

In the ath_rx_tastket funcion, the real rate KMbps can be obtained by the following value:

sc->sc_hwmap[ds->ds_rxstat.rs_rate].ieeerate/2;

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