]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Bitrate increased to 22 Mbps, added utilization export for GUI
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 11 Feb 2009 07:57:41 +0000 (08:57 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 11 Feb 2009 07:57:41 +0000 (08:57 +0100)
fwp/mngr/fwp_admctrl.c

index 889f845d1bc757cf5758ff1d8150bef2e3b36804..575a8b4e2dd76bae3ba778e176a547532cb47d94 100644 (file)
 #define CTS_FRAME_SIZE 14
 #define ACK_FRAME_SIZE 14
 
-#define BITRATE_BPS (1000*1000)
 #define ASLOTTIME_USEC 20      /* 802.11g-2003 p. 46 */
 #define ASIFSTIME_USEC 10
 #define ADIFSTIME_USEC (ASIFSTIME_USEC + 2*ASLOTTIME_USEC)
 #define AAIFSTIME_USEC(n) (ASIFSTIME_USEC + (n)*ASLOTTIME_USEC)
 
-#define TXTIME_USEC(bytes) ((int64_t)(bytes) * 8 * SEC_TO_USEC / BITRATE_BPS)
-
-
 /* Default values from 802.11e */
 const int aifsn[FWP_AC_NUM] = { 2, 2, 3, 7 };
 const int cwmin[FWP_AC_NUM] = { 3, 7, 15, 15 };
@@ -149,7 +145,7 @@ int fwp_admctrl_utilization(struct fres_sa_scenario *scenario, void *priv,
 {
        int utilization = 0;
 
-       const int rate = 1*1000*1000;
+       const int rate = 22*1000*1000;
        const bool erp_ofdm = false;
        const bool short_preamble = false;
        struct fres_sa_contract *c, *c_new = NULL;
@@ -217,7 +213,9 @@ int fwp_admctrl_utilization(struct fres_sa_scenario *scenario, void *priv,
        }       
        if (utilization >= 10000 * 96/100) {
                goto not_schedulable;
-       } 
+       }
+
+       scenario->utilization = utilization/100; /* For GUI */
        
        basic = fres_contract_get_basic(c_new->contract);
        /*int d = c->deadline_usec;*/