| 65 | ''' Different Channels on RF A/B ''': the reference code tunes all RF interfaces to the same center frequency any time the MAC application requests a new channel. The RF interfaces are tuned in the {{{wlan_mac_low_set_radio_channel(u32 channel)}}} function in {{{wlan_mac_low.c}}}. The {{{channel}}} argument is an 802.11 channel index. This function also enables/disables the Rx PHY DSSS receiver when tuned to a 5 GHz channel, as DSSS transmissions only occur in 2.4 GHz channels. |
| 66 | |
| 67 | A fully-general FDD implementation would modify this function to support a channel argument per RF interface. However this app note adopts the simpler scheme of: |
| 68 | * Always disable DSSS Rx |
| 69 | * Tune RF A to the channel requested by the MAC |
| 70 | * Tune RF B to channel 36 (5180 MHz) |
| 71 | |
| 72 | The modified {{{wlan_mac_low_set_radio_channel()}}} function is: |
| 73 | |
| 74 | {{{#!c |
| 75 | void wlan_mac_low_set_radio_channel(u32 channel) { |
| 76 | |
| 77 | // Always disable DSSS Rx |
| 78 | wlan_phy_DSSS_rx_disable(); |
| 79 | |
| 80 | if (wlan_verify_channel(mac_param_chan) == XST_SUCCESS) { |
| 81 | |
| 82 | // Update the framework's global variables for channel/band |
| 83 | mac_param_chan = channel; |
| 84 | |
| 85 | if(mac_param_chan <= 14) mac_param_band = RC_24GHZ; |
| 86 | else mac_param_band = RC_5GHZ; |
| 87 | |
| 88 | // Adjust Tx baseband gain when switching to 5GHz channels; this adjustment makes |
| 89 | // the actual Tx power set via the Tx VGA more accurate |
| 90 | if(channel >= 36) radio_controller_setRadioParam(RC_BASEADDR, RC_RF_A, RC_PARAMID_TXGAIN_BB, 3); |
| 91 | else radio_controller_setRadioParam(RC_BASEADDR, RC_RF_A, RC_PARAMID_TXGAIN_BB, 1); |
| 92 | |
| 93 | // Tune the RF A interface to the requested channel |
| 94 | radio_controller_setCenterFrequency(RC_BASEADDR, RC_RF_A, mac_param_band, wlan_mac_low_wlan_chan_to_rc_chan(mac_param_chan)); |
| 95 | |
| 96 | // Tune the RF B interface to channel 36 |
| 97 | radio_controller_setRadioParam(RC_BASEADDR, RC_RF_B, RC_PARAMID_TXGAIN_BB, 3); |
| 98 | radio_controller_setCenterFrequency(RC_BASEADDR, RC_RF_B, mac_param_band, wlan_mac_low_wlan_chan_to_rc_chan(36)); |
| 99 | } else { |
| 100 | xil_printf("Invalid channel selection %d\n", mac_param_chan); |
| 101 | } |
| 102 | } |
| 103 | }}} |
| 104 | |
| 105 | |
| 106 | |