"P2P-client",
"P2P-GO",
"P2P-device",
+ "outside context of a BSS",
};
static char modebuf[100];
static const char *commands[NL80211_CMD_MAX + 1] = {
/*
- * sed 's/^\tNL80211_CMD_//;t n;d;:n s%^\([^=]*\),.*%\t[NL80211_CMD_\1] = \"\L\1\",%;t;d' nl80211.h
+ * sed 's%^\tNL80211_CMD_%%;t n;d;:n s%^\([^=]*\),.*%\t[NL80211_CMD_\1] = \"\L\1\",%;t;d' nl80211.h | grep -v "reserved"
*/
[NL80211_CMD_UNSPEC] = "unspec",
[NL80211_CMD_GET_WIPHY] = "get_wiphy",
[NL80211_CMD_JOIN_OCB] = "join_ocb",
[NL80211_CMD_LEAVE_OCB] = "leave_ocb",
[NL80211_CMD_CH_SWITCH_STARTED_NOTIFY] = "ch_switch_started_notify",
+ [NL80211_CMD_TDLS_CHANNEL_SWITCH] = "tdls_channel_switch",
+ [NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH] = "tdls_cancel_channel_switch",
+ [NL80211_CMD_WIPHY_REG_CHANGE] = "wiphy_reg_change",
+ [NL80211_CMD_ABORT_SCAN] = "abort_scan",
};
static char cmdbuf[100];
void iw_hexdump(const char *prefix, const __u8 *buf, size_t size)
{
- int i;
+ size_t i;
printf("%s: ", prefix);
for (i = 0; i < size; i++) {
}
printf("\n\n");
}
+
+int get_cf1(const struct chanmode *chanmode, unsigned long freq)
+{
+ unsigned int cf1 = freq, j;
+ unsigned int vht80[] = { 5180, 5260, 5500, 5580, 5660, 5745 };
+
+ switch (chanmode->width) {
+ case NL80211_CHAN_WIDTH_80:
+ /* setup center_freq1 */
+ for (j = 0; j < ARRAY_SIZE(vht80); j++) {
+ if (freq >= vht80[j] && freq < vht80[j] + 80)
+ break;
+ }
+
+ if (j == ARRAY_SIZE(vht80))
+ break;
+
+ cf1 = vht80[j] + 30;
+ break;
+ default:
+ cf1 = freq + chanmode->freq1_diff;
+ break;
+ }
+
+ return cf1;
+}