Changes between Version 4 and Version 5 of 802.11/wlan_exp/app_notes/tutorial_token_mac/extensions


Ignore:
Timestamp:
Jul 13, 2015, 3:24:16 PM (9 years ago)
Author:
chunter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • 802.11/wlan_exp/app_notes/tutorial_token_mac/extensions

    v4 v5  
    5959                case IPC_MBOX_TOKEN_NEW_RESERVATION:
    6060                        token_stats_start_callback( ((ipc_token_new_reservation*)msg->payload_ptr)->addr,
    61                                                                    ((ipc_token_new_reservation*)msg->payload_ptr)->res_duration );
     61                                                                                ((ipc_token_new_reservation*)msg->payload_ptr)->res_duration );
    6262                break;
     63}}}
     64
     65----
     66
     67Next, we need to make a small addition to an existing struct definition that tracks details about each associated device to an AP. The reasons behind this addition will be clear once we make our changes to the AP code. In the meantime, find the definition of {{{station_info}}} in [browser:ReferenceDesigns/w3_802.11/c/wlan_mac_high_framework/include/wlan_mac_high.h wlan_mac_high.h]. Simply add the following element somewhere after the {{{MY_STATION_INFO_COMMON_FIELDS}}}:
     68
     69{{{
     70#!c
     71u8      token_res_mult_factor;
     72}}}
     73
     74Next, let us add a few new definitions that will act as parameters for our new TokenMAC extensions. The easiest place to add these is to the top of {{{[browser:ReferenceDesigns/w3_802.11/c/wlan_mac_high_framework/include/wlan_mac_high.h wlan_mac_high.h]}}}. This will ensure that both the MAC High Framework as well as the AP has visibility of these definitions.
     75
     76{{{
     77#!c
     78
     79#define TOKEN_RES_MULT_FACTOR_MIN 1
     80#define TOKEN_RES_MULT_FACTOR_MAX 50
     81
     82#define DEFAULT_RESERVATION_DURATION_USEC 2000
     83
     84//Ignoring all overhead, a 6 Mbps PHY rate
     85//could theoretically deliver (6e6*2000e-6) = 12 kBytes
     86//in 2ms. Let's define our "success" threshold at (an arbitrary) 1/6 of that: 2000 bytes.
     87//Delivering more than this threshold in 2ms will grant access to the larger
     88//token reservation period
     89#define TOKEN_RES_BYTES_EFFICIENCY_THRESH 2000
     90}}}
     91
     92Note that we moved the {{{DEFAULT_RESERVATION_DURATION_USEC}}} definition to the above code snippet. We will remove it from the AP code in the next section.
     93
     94Finally, we should set this new {{{token_res_mult_factor}}} field to {{{TOKEN_RES_MULT_FACTOR_MIN}}} whenever a {{{station_info}}} is created. To do this, add the following line to {{{wlan_mac_high_add_association()}}} just prior to the {{{entry->data = (void*)station;}}} line.
     95{{{
     96#!c
     97
     98station->token_res_mult_factor = TOKEN_RES_MULT_FACTOR_MIN;
    6399}}}
    64100