return eid;
}
-
-static void punct_update_legacy_bw_80(u8 bitmap, u8 pri_chan, u8 *seg0)
-{
- u8 first_chan = *seg0 - 6, sec_chan;
-
- switch (bitmap) {
- case 0x6:
- *seg0 = 0;
- return;
- case 0x8:
- case 0x4:
- case 0x2:
- case 0x1:
- case 0xC:
- case 0x3:
- if (pri_chan < *seg0)
- *seg0 -= 4;
- else
- *seg0 += 4;
- break;
- }
-
- if (pri_chan < *seg0)
- sec_chan = pri_chan + 4;
- else
- sec_chan = pri_chan - 4;
-
- if (bitmap & BIT((sec_chan - first_chan) / 4))
- *seg0 = 0;
-}
-
-
-static void punct_update_legacy_bw_160(u8 bitmap, u8 pri,
- enum oper_chan_width *width, u8 *seg0)
-{
- if (pri < *seg0) {
- *seg0 -= 8;
- if (bitmap & 0x0F) {
- *width = 0;
- punct_update_legacy_bw_80(bitmap & 0xF, pri, seg0);
- }
- } else {
- *seg0 += 8;
- if (bitmap & 0xF0) {
- *width = 0;
- punct_update_legacy_bw_80((bitmap & 0xF0) >> 4, pri,
- seg0);
- }
- }
-}
-
-
-void punct_update_legacy_bw(u16 bitmap, u8 pri, enum oper_chan_width *width,
- u8 *seg0, u8 *seg1)
-{
- if (*width == CONF_OPER_CHWIDTH_80MHZ && (bitmap & 0xF)) {
- *width = CONF_OPER_CHWIDTH_USE_HT;
- punct_update_legacy_bw_80(bitmap & 0xF, pri, seg0);
- }
-
- if (*width == CONF_OPER_CHWIDTH_160MHZ && (bitmap & 0xFF)) {
- *width = CONF_OPER_CHWIDTH_80MHZ;
- *seg1 = 0;
- punct_update_legacy_bw_160(bitmap & 0xFF, pri, width, seg0);
- }
-
- /* TODO: 320 MHz */
-}
-
#endif /* CONFIG_NATIVE_WINDOWS */
u8 **elem_offset,
const u8 *known_bss, size_t known_bss_len, u8 *rnr_eid,
u8 *rnr_count, u8 **rnr_offset, size_t rnr_len);
-void punct_update_legacy_bw(u16 bitmap, u8 pri_chan,
- enum oper_chan_width *width, u8 *seg0, u8 *seg1);
bool hostapd_is_mld_ap(struct hostapd_data *hapd);
const char * sae_get_password(struct hostapd_data *hapd,
struct sta_info *sta, const char *rx_id,
#include "utils/common.h"
#include "common/ieee802_11_defs.h"
#include "common/ieee802_11_common.h"
+#include "common/hw_features_common.h"
#include "hostapd.h"
#include "ap_config.h"
#include "beacon.h"
#include "utils/common.h"
#include "common/ieee802_11_defs.h"
+#include "common/hw_features_common.h"
#include "hostapd.h"
#include "ap_config.h"
#include "sta_info.h"
}
+static void punct_update_legacy_bw_80(u8 bitmap, u8 pri_chan, u8 *seg0)
+{
+ u8 first_chan = *seg0 - 6, sec_chan;
+
+ switch (bitmap) {
+ case 0x6:
+ *seg0 = 0;
+ return;
+ case 0x8:
+ case 0x4:
+ case 0x2:
+ case 0x1:
+ case 0xC:
+ case 0x3:
+ if (pri_chan < *seg0)
+ *seg0 -= 4;
+ else
+ *seg0 += 4;
+ break;
+ }
+
+ if (pri_chan < *seg0)
+ sec_chan = pri_chan + 4;
+ else
+ sec_chan = pri_chan - 4;
+
+ if (bitmap & BIT((sec_chan - first_chan) / 4))
+ *seg0 = 0;
+}
+
+
+static void punct_update_legacy_bw_160(u8 bitmap, u8 pri,
+ enum oper_chan_width *width, u8 *seg0)
+{
+ if (pri < *seg0) {
+ *seg0 -= 8;
+ if (bitmap & 0x0F) {
+ *width = 0;
+ punct_update_legacy_bw_80(bitmap & 0xF, pri, seg0);
+ }
+ } else {
+ *seg0 += 8;
+ if (bitmap & 0xF0) {
+ *width = 0;
+ punct_update_legacy_bw_80((bitmap & 0xF0) >> 4, pri,
+ seg0);
+ }
+ }
+}
+
+
+void punct_update_legacy_bw(u16 bitmap, u8 pri, enum oper_chan_width *width,
+ u8 *seg0, u8 *seg1)
+{
+ if (*width == CONF_OPER_CHWIDTH_80MHZ && (bitmap & 0xF)) {
+ *width = CONF_OPER_CHWIDTH_USE_HT;
+ punct_update_legacy_bw_80(bitmap & 0xF, pri, seg0);
+ }
+
+ if (*width == CONF_OPER_CHWIDTH_160MHZ && (bitmap & 0xFF)) {
+ *width = CONF_OPER_CHWIDTH_80MHZ;
+ *seg1 = 0;
+ punct_update_legacy_bw_160(bitmap & 0xFF, pri, width, seg0);
+ }
+
+ /* TODO: 320 MHz */
+}
+
+
int hostapd_set_freq_params(struct hostapd_freq_params *data,
enum hostapd_hw_mode mode,
int freq, int channel, int enable_edmg,
int check_40mhz_2g4(struct hostapd_hw_modes *mode,
struct wpa_scan_results *scan_res, int pri_chan,
int sec_chan);
+void punct_update_legacy_bw(u16 bitmap, u8 pri_chan,
+ enum oper_chan_width *width, u8 *seg0, u8 *seg1);
int hostapd_set_freq_params(struct hostapd_freq_params *data,
enum hostapd_hw_mode mode,
int freq, int channel, int edmg, u8 edmg_channel,