| 292 | |
| 293 | == MAC Tx Controller C == |
| 294 | |
| 295 | Tx Controller C is a simpler state machine designed to support transmission of Beacon frames. Beacon transmissions are unique in that they can occur in between re-transmissions of other MPDUs. The reference DCF implementation uses Tx Controller A for MPDU transmissions, so a separate controller (Controller C) is required to support Beacon transmissions. |
| 296 | |
| 297 | The Tx Controller C logic includes a dedicated backoff counter, independet of the backoff counter implemented for Tx Controller A. This dedicated backoff counter is required to allow beacon transmissions which defer to medium activity without overriding the state of primary backoff counter. This behavior is especially important in ad hoc (IBSS) networks where very node transmits beacons after random delays, with each node canceling its own beacon Tx if it receives a beacon from a peer in the same beacon interval. |
| 298 | |
| 299 | === Implementation Details === |
| 300 | The Tx Controller C state machine is illustrated below. Each box is a state. Each arrow is a state transition, with the arrow's label specifying the input conditions that trigger the transition. The conditions for the color-coded arrows from the {{{IDLE}}} state are described in the table below. |
| 301 | |
| 302 | [[Image(tx_fsm_c.png)]] |
| 303 | |
| 304 | {{{#!th colspan=2 align=center |
| 305 | '''Tx Controller C FSM - Transitions from {{{IDLE}}}''' |
| 306 | }}} |
| 307 | |----------------------------------- |
| 308 | {{{#!td |
| 309 | }}} |
| 310 | {{{#!td align=left |
| 311 | |
| 312 | {{{#!c |
| 313 | if(new_tx) { |
| 314 | }}} |
| 315 | |
| 316 | }}} |
| 317 | |----------------------------------- |
| 318 | {{{#!td |
| 319 | [[Image(tx_fsm_transition_1.png)]] |
| 320 | }}} |
| 321 | {{{#!td |
| 322 | {{{#!c |
| 323 | if(idle_for_difs & !require_backoff) { |
| 324 | //Medium idle, no backoff required |
| 325 | // Transmit immediately |
| 326 | st_next = ST_DO_TX; |
| 327 | }}} |
| 328 | }}} |
| 329 | |----------------------------------- |
| 330 | {{{#!td |
| 331 | [[Image(tx_fsm_transition_2.png)]] |
| 332 | }}} |
| 333 | {{{#!td |
| 334 | |
| 335 | {{{#!c |
| 336 | } else { |
| 337 | // Transmit immediately |
| 338 | st_next = ST_DO_TX; |
| 339 | }}} |
| 340 | }}} |
| 341 | |----------------------------------- |
| 342 | {{{#!td |
| 343 | |
| 344 | }}} |
| 345 | {{{#!td |
| 346 | |
| 347 | {{{#!c |
| 348 | } else { |
| 349 | //No new Tx this cycle; keep waiting in IDLE |
| 350 | st_next = ST_IDLE; |
| 351 | } |
| 352 | }}} |
| 353 | |
| 354 | }}} |
| 355 | |
| 356 | Inputs from software: |
| 357 | * reset: Forces FSM back to {{{IDLE}}} state |
| 358 | * new_tx: Triggers new execution of FSM |
| 359 | * require_backoff: Always start backoff pre-Tx |
| 360 | |
| 361 | Inputs from MAC hardware: |
| 362 | * backoff_C_done: Previously started backoff has completed |
| 363 | * idle_for_difs: Medium as been idle >= T_DIFS |
| 364 | * phy_tx_done: PHY Tx has completed |
| 365 | |
| 366 | The lower MAC framework provides macros for configuring the software parameters above: |
| 367 | {{{#!c |
| 368 | // Configure Tx Controller C |
| 369 | // pktBuf: Tx packet buffer index (passed directly to PHY at TX_START) |
| 370 | // antMask: antenna selection mask (passed directly to PHY at TX_START) |
| 371 | // req_backoff: require a backoff before this Tx, must be 0 or 1 |
| 372 | // phy_mode: Tx PHY mode (1 for NONHT, 2 for HTMF) |
| 373 | // num_slots: number of backoff slots, if this FSM starts the C backoff counter |
| 374 | wlan_mac_tx_ctrl_C_params(pktBuf, antMask, req_backoff, phy_mode, num_slots); |
| 375 | }}} |
| 376 | |
| 377 | The Tx Controller C state machine is started by toggling its enable bit in the MAC support core's register bank: |
| 378 | {{{#!c |
| 379 | // Start Tx Controller C |
| 380 | wlan_mac_tx_ctrl_C_start(1); |
| 381 | wlan_mac_tx_ctrl_C_start(0); |
| 382 | }}} |
| 383 | |
| 384 | The Tx Controller C state machine is implemented as an m-code block in the {{{wlan_mac_hw}}} core. The m source code is in the repository at [browser:/ReferenceDesigns/w3_802.11/sysgen/wlan_mac_hw/mcode_blocks/mac_tx_ctrl_c_fsm.m mac_tx_ctrl_c_fsm.m] |
| 385 | |