NetSim Source Code Help
Loading...
Searching...
No Matches
Minstrel.c File Reference
#include "main.h"
#include "Minstrel.h"
Include dependency graph for Minstrel.c:

Go to the source code of this file.

Macros

#define SEED_r   &NETWORK->ppstruDeviceList[0]->ulSeed[0],&NETWORK->ppstruDeviceList[0]->ulSeed[1]
 
#define rand01()   (fn_NetSim_Utilities_GenerateRandomNo(SEED_r)/NETSIM_RAND_MAX)
 
#define ackTime(phy)   (phy->plmeCharacteristics.aSIFSTime + get_preamble_time(phy) + (getAckSize(phy) * 8)/phy->dControlFrameDataRate)
 
#define tSlot(phy)   (phy->plmeCharacteristics.aSlotTime)
 
#define transmissionTime(phy, byte, rate)   (phy->plmeCharacteristics.aSIFSTime + get_preamble_time(phy)+ byte*8/rate)
 

Functions

static Ptr_MinstrelPerRemoteStation getMinstrelInfo (NETSIM_ID dev, NETSIM_ID ifid, NETSIM_ID recv)
 
void get_data_rate (NETSIM_ID devid, NETSIM_ID ifid, double *rate, unsigned int *len)
 
void Minstrel_Init (NETSIM_ID nDevId, NETSIM_ID nifid)
 
BOOL Minstrel_DoNeedDataSend (NETSIM_ID nDevId, NETSIM_ID nifid, NETSIM_ID recvid)
 
void Minstrel_ReportDataFailed (NETSIM_ID nDevId, NETSIM_ID nifid, NETSIM_ID recvid)
 
void Minstrel_ReportFinalDataFailed (NETSIM_ID nDevId, NETSIM_ID nifid, NETSIM_ID recvid)
 
void InitMinstrel (NETSIM_ID nDevId, NETSIM_ID nifid)
 
static void CheckInit (Ptr_MinstrelPerRemoteStation station, NETSIM_ID nDevId, NETSIM_ID nifid)
 
static void InitSampleTable (Ptr_MinstrelPerRemoteStation station)
 
static void InitMinstrelTable (Ptr_MinstrelPerRemoteStation station, double *rate_arr)
 
void DoReportDataOk (NETSIM_ID dev, NETSIM_ID ifid, NETSIM_ID recv)
 
void DoReportDataFailed (NETSIM_ID dev, NETSIM_ID ifid, NETSIM_ID recv)
 
static void UpdateRate (Ptr_MinstrelPerRemoteStation station)
 
static void UpdatePacketCounter (Ptr_MinstrelPerRemoteStation station)
 
static void UpdateRetry (Ptr_MinstrelPerRemoteStation station)
 
static void UpdateStats (Ptr_MinstrelPerRemoteStation station)
 
static UINT FindRate (Ptr_MinstrelPerRemoteStation station)
 
static UINT GetNextSample (Ptr_MinstrelPerRemoteStation station)
 
void DoReportFinalDataFailed (NETSIM_ID dev, NETSIM_ID ifid, NETSIM_ID recv)
 
BOOL DoNeedDataRetransmission (NETSIM_ID dev, NETSIM_ID ifid, NETSIM_ID recv)
 
static UINT CountRetry (Ptr_MinstrelPerRemoteStation station)
 
static void DoReportRtsFailed (Ptr_MinstrelPerRemoteStation station)
 
static void DoReportFinalRtsFailed (Ptr_MinstrelPerRemoteStation station)
 
void Minstrel_Free (NETSIM_ID nDevId, NETSIM_ID nifid)
 
void FreeMinstrel (NETSIM_ID nDevId, NETSIM_ID nifid)
 
void FreeTables (Ptr_MinstrelPerRemoteStation station)
 
UINT get_minstrel_rate_index (NETSIM_ID dev, NETSIM_ID ifid, NETSIM_ID recv)
 
void print_minstrel_table (PMETRICSWRITER metricsWriter)
 

Variables

static int show =0
 

Macro Definition Documentation

◆ ackTime

#define ackTime (   phy)    (phy->plmeCharacteristics.aSIFSTime + get_preamble_time(phy) + (getAckSize(phy) * 8)/phy->dControlFrameDataRate)

Definition at line 33 of file Minstrel.c.

◆ rand01

Definition at line 32 of file Minstrel.c.

◆ SEED_r

#define SEED_r   &NETWORK->ppstruDeviceList[0]->ulSeed[0],&NETWORK->ppstruDeviceList[0]->ulSeed[1]

Definition at line 31 of file Minstrel.c.

◆ transmissionTime

#define transmissionTime (   phy,
  byte,
  rate 
)    (phy->plmeCharacteristics.aSIFSTime + get_preamble_time(phy)+ byte*8/rate)

Definition at line 35 of file Minstrel.c.

◆ tSlot

#define tSlot (   phy)    (phy->plmeCharacteristics.aSlotTime)

Definition at line 34 of file Minstrel.c.

Function Documentation

◆ CheckInit()

static void CheckInit ( Ptr_MinstrelPerRemoteStation  station,
NETSIM_ID  nDevId,
NETSIM_ID  nifid 
)
static

Definition at line 199 of file Minstrel.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CountRetry()

static UINT CountRetry ( Ptr_MinstrelPerRemoteStation  station)
static

Definition at line 699 of file Minstrel.c.

Here is the caller graph for this function:

◆ DoNeedDataRetransmission()

BOOL DoNeedDataRetransmission ( NETSIM_ID  dev,
NETSIM_ID  ifid,
NETSIM_ID  recv 
)

Definition at line 688 of file Minstrel.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoReportDataFailed()

void DoReportDataFailed ( NETSIM_ID  dev,
NETSIM_ID  ifid,
NETSIM_ID  recv 
)

Definition at line 326 of file Minstrel.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoReportDataOk()

void DoReportDataOk ( NETSIM_ID  dev,
NETSIM_ID  ifid,
NETSIM_ID  recv 
)

Definition at line 310 of file Minstrel.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoReportFinalDataFailed()

void DoReportFinalDataFailed ( NETSIM_ID  dev,
NETSIM_ID  ifid,
NETSIM_ID  recv 
)

Definition at line 674 of file Minstrel.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoReportFinalRtsFailed()

static void DoReportFinalRtsFailed ( Ptr_MinstrelPerRemoteStation  station)
static

Definition at line 719 of file Minstrel.c.

Here is the call graph for this function:

◆ DoReportRtsFailed()

static void DoReportRtsFailed ( Ptr_MinstrelPerRemoteStation  station)
static

Definition at line 715 of file Minstrel.c.

◆ FindRate()

static UINT FindRate ( Ptr_MinstrelPerRemoteStation  station)
static

Definition at line 584 of file Minstrel.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FreeMinstrel()

void FreeMinstrel ( NETSIM_ID  nDevId,
NETSIM_ID  nifid 
)

Definition at line 738 of file Minstrel.c.

Here is the call graph for this function:

◆ FreeTables()

void FreeTables ( Ptr_MinstrelPerRemoteStation  station)

Definition at line 759 of file Minstrel.c.

Here is the caller graph for this function:

◆ get_data_rate()

void get_data_rate ( NETSIM_ID  devid,
NETSIM_ID  ifid,
double *  rate,
unsigned int *  len 
)

Definition at line 59 of file Minstrel.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_minstrel_rate_index()

UINT get_minstrel_rate_index ( NETSIM_ID  dev,
NETSIM_ID  ifid,
NETSIM_ID  recv 
)

Definition at line 768 of file Minstrel.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMinstrelInfo()

static Ptr_MinstrelPerRemoteStation getMinstrelInfo ( NETSIM_ID  dev,
NETSIM_ID  ifid,
NETSIM_ID  recv 
)
static

Definition at line 37 of file Minstrel.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNextSample()

static UINT GetNextSample ( Ptr_MinstrelPerRemoteStation  station)
static

Definition at line 659 of file Minstrel.c.

Here is the caller graph for this function:

◆ InitMinstrel()

void InitMinstrel ( NETSIM_ID  nDevId,
NETSIM_ID  nifid 
)

Definition at line 175 of file Minstrel.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitMinstrelTable()

static void InitMinstrelTable ( Ptr_MinstrelPerRemoteStation  station,
double *  rate_arr 
)
static

Definition at line 265 of file Minstrel.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitSampleTable()

static void InitSampleTable ( Ptr_MinstrelPerRemoteStation  station)
static

Definition at line 236 of file Minstrel.c.

Here is the caller graph for this function:

◆ Minstrel_DoNeedDataSend()

BOOL Minstrel_DoNeedDataSend ( NETSIM_ID  nDevId,
NETSIM_ID  nifid,
NETSIM_ID  recvid 
)

Definition at line 99 of file Minstrel.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Minstrel_Free()

void Minstrel_Free ( NETSIM_ID  nDevId,
NETSIM_ID  nifid 
)

Definition at line 722 of file Minstrel.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Minstrel_Init()

void Minstrel_Init ( NETSIM_ID  nDevId,
NETSIM_ID  nifid 
)

Definition at line 80 of file Minstrel.c.

Here is the call graph for this function:

◆ Minstrel_ReportDataFailed()

void Minstrel_ReportDataFailed ( NETSIM_ID  nDevId,
NETSIM_ID  nifid,
NETSIM_ID  recvid 
)

Definition at line 119 of file Minstrel.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Minstrel_ReportFinalDataFailed()

void Minstrel_ReportFinalDataFailed ( NETSIM_ID  nDevId,
NETSIM_ID  nifid,
NETSIM_ID  recvid 
)

Definition at line 147 of file Minstrel.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_minstrel_table()

void print_minstrel_table ( PMETRICSWRITER  metricsWriter)

Definition at line 775 of file Minstrel.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdatePacketCounter()

static void UpdatePacketCounter ( Ptr_MinstrelPerRemoteStation  station)
static

Definition at line 431 of file Minstrel.c.

Here is the caller graph for this function:

◆ UpdateRate()

static void UpdateRate ( Ptr_MinstrelPerRemoteStation  station)
static

Definition at line 333 of file Minstrel.c.

Here is the caller graph for this function:

◆ UpdateRetry()

static void UpdateRetry ( Ptr_MinstrelPerRemoteStation  station)
static

Definition at line 456 of file Minstrel.c.

Here is the caller graph for this function:

◆ UpdateStats()

static void UpdateStats ( Ptr_MinstrelPerRemoteStation  station)
static

See: http://wireless.kernel.org/en/developers/Documentation/mac80211/RateControl/minstrel/

Analysis of information showed that the system was sampling too hard at some rates. For those rates that never work (54mb, 500m range) there is no point in retrying 10 sample packets (< 6 ms time). Consequently, for the very low probability rates, we try at most twice when fails and not sample more than 4 times.

Definition at line 462 of file Minstrel.c.

Here is the caller graph for this function:

Variable Documentation

◆ show

int show =0
static

Definition at line 28 of file Minstrel.c.