Move hostapd_eid_wb_chsw_wrapper() to non-VHT-specific file
Move hostapd_eid_wb_chsw_wrapper() from VHT specific ieee802_11_vht.c to ieee802_11.c since this can be used for both HE and VHT. This commit does not change any functionality to enable the HE use case, i.e., the function is just moved as-is. Signed-off-by: Muna Sinada <msinada@codeaurora.org>
This commit is contained in:
parent
1f72bbbefb
commit
d51b1b7a66
2 changed files with 52 additions and 53 deletions
|
@ -5564,4 +5564,56 @@ void ieee802_11_rx_from_unknown(struct hostapd_data *hapd, const u8 *src,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid)
|
||||||
|
{
|
||||||
|
u8 bw, chan1, chan2 = 0;
|
||||||
|
int freq1;
|
||||||
|
|
||||||
|
if (!hapd->cs_freq_params.channel ||
|
||||||
|
!hapd->cs_freq_params.vht_enabled)
|
||||||
|
return eid;
|
||||||
|
|
||||||
|
/* bandwidth: 0: 40, 1: 80, 2: 160, 3: 80+80 */
|
||||||
|
switch (hapd->cs_freq_params.bandwidth) {
|
||||||
|
case 40:
|
||||||
|
bw = 0;
|
||||||
|
break;
|
||||||
|
case 80:
|
||||||
|
/* check if it's 80+80 */
|
||||||
|
if (!hapd->cs_freq_params.center_freq2)
|
||||||
|
bw = 1;
|
||||||
|
else
|
||||||
|
bw = 3;
|
||||||
|
break;
|
||||||
|
case 160:
|
||||||
|
bw = 2;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* not valid VHT bandwidth or not in CSA */
|
||||||
|
return eid;
|
||||||
|
}
|
||||||
|
|
||||||
|
freq1 = hapd->cs_freq_params.center_freq1 ?
|
||||||
|
hapd->cs_freq_params.center_freq1 :
|
||||||
|
hapd->cs_freq_params.freq;
|
||||||
|
if (ieee80211_freq_to_chan(freq1, &chan1) !=
|
||||||
|
HOSTAPD_MODE_IEEE80211A)
|
||||||
|
return eid;
|
||||||
|
|
||||||
|
if (hapd->cs_freq_params.center_freq2 &&
|
||||||
|
ieee80211_freq_to_chan(hapd->cs_freq_params.center_freq2,
|
||||||
|
&chan2) != HOSTAPD_MODE_IEEE80211A)
|
||||||
|
return eid;
|
||||||
|
|
||||||
|
*eid++ = WLAN_EID_VHT_CHANNEL_SWITCH_WRAPPER;
|
||||||
|
*eid++ = 5; /* Length of Channel Switch Wrapper */
|
||||||
|
*eid++ = WLAN_EID_VHT_WIDE_BW_CHSWITCH;
|
||||||
|
*eid++ = 3; /* Length of Wide Bandwidth Channel Switch element */
|
||||||
|
*eid++ = bw; /* New Channel Width */
|
||||||
|
*eid++ = chan1; /* New Channel Center Frequency Segment 0 */
|
||||||
|
*eid++ = chan2; /* New Channel Center Frequency Segment 1 */
|
||||||
|
|
||||||
|
return eid;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_NATIVE_WINDOWS */
|
#endif /* CONFIG_NATIVE_WINDOWS */
|
||||||
|
|
|
@ -167,59 +167,6 @@ static int check_valid_vht_mcs(struct hostapd_hw_modes *mode,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
u8 * hostapd_eid_wb_chsw_wrapper(struct hostapd_data *hapd, u8 *eid)
|
|
||||||
{
|
|
||||||
u8 bw, chan1, chan2 = 0;
|
|
||||||
int freq1;
|
|
||||||
|
|
||||||
if (!hapd->cs_freq_params.channel ||
|
|
||||||
!hapd->cs_freq_params.vht_enabled)
|
|
||||||
return eid;
|
|
||||||
|
|
||||||
/* bandwidth: 0: 40, 1: 80, 2: 160, 3: 80+80 */
|
|
||||||
switch (hapd->cs_freq_params.bandwidth) {
|
|
||||||
case 40:
|
|
||||||
bw = 0;
|
|
||||||
break;
|
|
||||||
case 80:
|
|
||||||
/* check if it's 80+80 */
|
|
||||||
if (!hapd->cs_freq_params.center_freq2)
|
|
||||||
bw = 1;
|
|
||||||
else
|
|
||||||
bw = 3;
|
|
||||||
break;
|
|
||||||
case 160:
|
|
||||||
bw = 2;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
/* not valid VHT bandwidth or not in CSA */
|
|
||||||
return eid;
|
|
||||||
}
|
|
||||||
|
|
||||||
freq1 = hapd->cs_freq_params.center_freq1 ?
|
|
||||||
hapd->cs_freq_params.center_freq1 :
|
|
||||||
hapd->cs_freq_params.freq;
|
|
||||||
if (ieee80211_freq_to_chan(freq1, &chan1) !=
|
|
||||||
HOSTAPD_MODE_IEEE80211A)
|
|
||||||
return eid;
|
|
||||||
|
|
||||||
if (hapd->cs_freq_params.center_freq2 &&
|
|
||||||
ieee80211_freq_to_chan(hapd->cs_freq_params.center_freq2,
|
|
||||||
&chan2) != HOSTAPD_MODE_IEEE80211A)
|
|
||||||
return eid;
|
|
||||||
|
|
||||||
*eid++ = WLAN_EID_VHT_CHANNEL_SWITCH_WRAPPER;
|
|
||||||
*eid++ = 5; /* Length of Channel Switch Wrapper */
|
|
||||||
*eid++ = WLAN_EID_VHT_WIDE_BW_CHSWITCH;
|
|
||||||
*eid++ = 3; /* Length of Wide Bandwidth Channel Switch element */
|
|
||||||
*eid++ = bw; /* New Channel Width */
|
|
||||||
*eid++ = chan1; /* New Channel Center Frequency Segment 0 */
|
|
||||||
*eid++ = chan2; /* New Channel Center Frequency Segment 1 */
|
|
||||||
|
|
||||||
return eid;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
|
u8 * hostapd_eid_txpower_envelope(struct hostapd_data *hapd, u8 *eid)
|
||||||
{
|
{
|
||||||
struct hostapd_iface *iface = hapd->iface;
|
struct hostapd_iface *iface = hapd->iface;
|
||||||
|
|
Loading…
Reference in a new issue