nl80211: Add build option for QCA vendor extensions

This allows the binary sizes to be reduced if no support for nl80211
vendor extensions are needed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2015-09-29 17:11:21 +03:00 committed by Jouni Malinen
parent e903d32d41
commit b658547dd5
10 changed files with 54 additions and 0 deletions

View file

@ -25,6 +25,9 @@
#LIBS += -L$(LIBNL)/lib #LIBS += -L$(LIBNL)/lib
CONFIG_LIBNL20=y CONFIG_LIBNL20=y
# QCA vendor extensions to nl80211
CONFIG_DRIVER_NL80211_QCA=y
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
#CONFIG_DRIVER_BSD=y #CONFIG_DRIVER_BSD=y
#CFLAGS += -I/usr/local/include #CFLAGS += -I/usr/local/include

View file

@ -18,6 +18,9 @@ CONFIG_DRIVER_HOSTAP=y
# Driver interface for drivers using the nl80211 kernel interface # Driver interface for drivers using the nl80211 kernel interface
CONFIG_DRIVER_NL80211=y CONFIG_DRIVER_NL80211=y
# QCA vendor extensions to nl80211
#CONFIG_DRIVER_NL80211_QCA=y
# driver_nl80211.c requires libnl. If you are compiling it yourself # driver_nl80211.c requires libnl. If you are compiling it yourself
# you may need to point hostapd to your version of libnl. # you may need to point hostapd to your version of libnl.
# #

View file

@ -2468,6 +2468,7 @@ static int wpa_cipher_to_cipher_suites(unsigned int ciphers, u32 suites[],
} }
#ifdef CONFIG_DRIVER_NL80211_QCA
static int issue_key_mgmt_set_key(struct wpa_driver_nl80211_data *drv, static int issue_key_mgmt_set_key(struct wpa_driver_nl80211_data *drv,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)
{ {
@ -2495,6 +2496,7 @@ static int issue_key_mgmt_set_key(struct wpa_driver_nl80211_data *drv,
return ret; return ret;
} }
#endif /* CONFIG_DRIVER_NL80211_QCA */
static int wpa_driver_nl80211_set_key(const char *ifname, struct i802_bss *bss, static int wpa_driver_nl80211_set_key(const char *ifname, struct i802_bss *bss,
@ -2525,6 +2527,7 @@ static int wpa_driver_nl80211_set_key(const char *ifname, struct i802_bss *bss,
} }
#endif /* CONFIG_TDLS */ #endif /* CONFIG_TDLS */
#ifdef CONFIG_DRIVER_NL80211_QCA
if (alg == WPA_ALG_PMK && if (alg == WPA_ALG_PMK &&
(drv->capa.flags & WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD)) { (drv->capa.flags & WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD)) {
wpa_printf(MSG_DEBUG, "%s: calling issue_key_mgmt_set_key", wpa_printf(MSG_DEBUG, "%s: calling issue_key_mgmt_set_key",
@ -2532,6 +2535,7 @@ static int wpa_driver_nl80211_set_key(const char *ifname, struct i802_bss *bss,
ret = issue_key_mgmt_set_key(drv, key, key_len); ret = issue_key_mgmt_set_key(drv, key, key_len);
return ret; return ret;
} }
#endif /* CONFIG_DRIVER_NL80211_QCA */
if (alg == WPA_ALG_NONE) { if (alg == WPA_ALG_NONE) {
msg = nl80211_ifindex_msg(drv, ifindex, 0, NL80211_CMD_DEL_KEY); msg = nl80211_ifindex_msg(drv, ifindex, 0, NL80211_CMD_DEL_KEY);
@ -4680,6 +4684,7 @@ static int wpa_driver_nl80211_try_connect(
int ret; int ret;
int algs; int algs;
#ifdef CONFIG_DRIVER_NL80211_QCA
if (params->req_key_mgmt_offload && params->psk && if (params->req_key_mgmt_offload && params->psk &&
(params->key_mgmt_suite == WPA_KEY_MGMT_PSK || (params->key_mgmt_suite == WPA_KEY_MGMT_PSK ||
params->key_mgmt_suite == WPA_KEY_MGMT_PSK_SHA256 || params->key_mgmt_suite == WPA_KEY_MGMT_PSK_SHA256 ||
@ -4689,6 +4694,7 @@ static int wpa_driver_nl80211_try_connect(
if (ret) if (ret)
return ret; return ret;
} }
#endif /* CONFIG_DRIVER_NL80211_QCA */
wpa_printf(MSG_DEBUG, "nl80211: Connect (ifindex=%d)", drv->ifindex); wpa_printf(MSG_DEBUG, "nl80211: Connect (ifindex=%d)", drv->ifindex);
msg = nl80211_drv_msg(drv, 0, NL80211_CMD_CONNECT); msg = nl80211_drv_msg(drv, 0, NL80211_CMD_CONNECT);
@ -7224,6 +7230,7 @@ static int driver_nl80211_scan2(void *priv,
struct wpa_driver_scan_params *params) struct wpa_driver_scan_params *params)
{ {
struct i802_bss *bss = priv; struct i802_bss *bss = priv;
#ifdef CONFIG_DRIVER_NL80211_QCA
struct wpa_driver_nl80211_data *drv = bss->drv; struct wpa_driver_nl80211_data *drv = bss->drv;
/* /*
@ -7235,6 +7242,7 @@ static int driver_nl80211_scan2(void *priv,
*/ */
if (drv->scan_vendor_cmd_avail && !params->only_new_results) if (drv->scan_vendor_cmd_avail && !params->only_new_results)
return wpa_driver_nl80211_vendor_scan(bss, params); return wpa_driver_nl80211_vendor_scan(bss, params);
#endif /* CONFIG_DRIVER_NL80211_QCA */
return wpa_driver_nl80211_scan(bss, params); return wpa_driver_nl80211_scan(bss, params);
} }
@ -7871,6 +7879,7 @@ static int nl80211_set_wowlan(void *priv,
} }
#ifdef CONFIG_DRIVER_NL80211_QCA
static int nl80211_roaming(void *priv, int allowed, const u8 *bssid) static int nl80211_roaming(void *priv, int allowed, const u8 *bssid)
{ {
struct i802_bss *bss = priv; struct i802_bss *bss = priv;
@ -7903,6 +7912,7 @@ static int nl80211_roaming(void *priv, int allowed, const u8 *bssid)
return send_and_recv_msgs(drv, msg, NULL, NULL); return send_and_recv_msgs(drv, msg, NULL, NULL);
} }
#endif /* CONFIG_DRIVER_NL80211_QCA */
static int nl80211_set_mac_addr(void *priv, const u8 *addr) static int nl80211_set_mac_addr(void *priv, const u8 *addr)
@ -8387,6 +8397,8 @@ set_val:
} }
#ifdef CONFIG_DRIVER_NL80211_QCA
static int hw_mode_to_qca_acs(enum hostapd_hw_mode hw_mode) static int hw_mode_to_qca_acs(enum hostapd_hw_mode hw_mode)
{ {
switch (hw_mode) { switch (hw_mode) {
@ -8710,6 +8722,8 @@ static int nl80211_set_prob_oper_freq(void *priv, unsigned int freq)
return 0; return 0;
} }
#endif /* CONFIG_DRIVER_NL80211_QCA */
const struct wpa_driver_ops wpa_driver_nl80211_ops = { const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.name = "nl80211", .name = "nl80211",
@ -8804,7 +8818,9 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.vendor_cmd = nl80211_vendor_cmd, .vendor_cmd = nl80211_vendor_cmd,
.set_qos_map = nl80211_set_qos_map, .set_qos_map = nl80211_set_qos_map,
.set_wowlan = nl80211_set_wowlan, .set_wowlan = nl80211_set_wowlan,
#ifdef CONFIG_DRIVER_NL80211_QCA
.roaming = nl80211_roaming, .roaming = nl80211_roaming,
#endif /* CONFIG_DRIVER_NL80211_QCA */
.set_mac_addr = nl80211_set_mac_addr, .set_mac_addr = nl80211_set_mac_addr,
#ifdef CONFIG_MESH #ifdef CONFIG_MESH
.init_mesh = wpa_driver_nl80211_init_mesh, .init_mesh = wpa_driver_nl80211_init_mesh,
@ -8817,8 +8833,10 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.br_set_net_param = wpa_driver_br_set_net_param, .br_set_net_param = wpa_driver_br_set_net_param,
.add_tx_ts = nl80211_add_ts, .add_tx_ts = nl80211_add_ts,
.del_tx_ts = nl80211_del_ts, .del_tx_ts = nl80211_del_ts,
#ifdef CONFIG_DRIVER_NL80211_QCA
.do_acs = wpa_driver_do_acs, .do_acs = wpa_driver_do_acs,
.set_band = nl80211_set_band, .set_band = nl80211_set_band,
.get_pref_freq_list = nl80211_get_pref_freq_list, .get_pref_freq_list = nl80211_get_pref_freq_list,
.set_prob_oper_freq = nl80211_set_prob_oper_freq, .set_prob_oper_freq = nl80211_set_prob_oper_freq,
#endif /* CONFIG_DRIVER_NL80211_QCA */
}; };

View file

@ -580,6 +580,7 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
case QCA_NL80211_VENDOR_SUBCMD_TEST: case QCA_NL80211_VENDOR_SUBCMD_TEST:
drv->vendor_cmd_test_avail = 1; drv->vendor_cmd_test_avail = 1;
break; break;
#ifdef CONFIG_DRIVER_NL80211_QCA
case QCA_NL80211_VENDOR_SUBCMD_ROAMING: case QCA_NL80211_VENDOR_SUBCMD_ROAMING:
drv->roaming_vendor_cmd_avail = 1; drv->roaming_vendor_cmd_avail = 1;
break; break;
@ -605,6 +606,7 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
case QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN: case QCA_NL80211_VENDOR_SUBCMD_TRIGGER_SCAN:
drv->scan_vendor_cmd_avail = 1; drv->scan_vendor_cmd_avail = 1;
break; break;
#endif /* CONFIG_DRIVER_NL80211_QCA */
} }
} }
@ -705,6 +707,8 @@ static int wpa_driver_nl80211_get_info(struct wpa_driver_nl80211_data *drv,
} }
#ifdef CONFIG_DRIVER_NL80211_QCA
static int dfs_info_handler(struct nl_msg *msg, void *arg) static int dfs_info_handler(struct nl_msg *msg, void *arg)
{ {
struct nlattr *tb[NL80211_ATTR_MAX + 1]; struct nlattr *tb[NL80211_ATTR_MAX + 1];
@ -849,6 +853,8 @@ static void qca_nl80211_get_features(struct wpa_driver_nl80211_data *drv)
drv->capa.flags |= WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS; drv->capa.flags |= WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS;
} }
#endif /* CONFIG_DRIVER_NL80211_QCA */
int wpa_driver_nl80211_capa(struct wpa_driver_nl80211_data *drv) int wpa_driver_nl80211_capa(struct wpa_driver_nl80211_data *drv)
{ {
@ -929,6 +935,7 @@ int wpa_driver_nl80211_capa(struct wpa_driver_nl80211_data *drv)
if (!drv->use_monitor && !info.data_tx_status) if (!drv->use_monitor && !info.data_tx_status)
drv->capa.flags &= ~WPA_DRIVER_FLAGS_EAPOL_TX_STATUS; drv->capa.flags &= ~WPA_DRIVER_FLAGS_EAPOL_TX_STATUS;
#ifdef CONFIG_DRIVER_NL80211_QCA
qca_nl80211_check_dfs_capa(drv); qca_nl80211_check_dfs_capa(drv);
qca_nl80211_get_features(drv); qca_nl80211_get_features(drv);
@ -941,6 +948,7 @@ int wpa_driver_nl80211_capa(struct wpa_driver_nl80211_data *drv)
*/ */
if (!(drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX)) if (!(drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX))
drv->capa.flags &= ~WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS; drv->capa.flags &= ~WPA_DRIVER_FLAGS_OFFCHANNEL_SIMULTANEOUS;
#endif /* CONFIG_DRIVER_NL80211_QCA */
return 0; return 0;
} }

View file

@ -1446,6 +1446,8 @@ static void nl80211_spurious_frame(struct i802_bss *bss, struct nlattr **tb,
} }
#ifdef CONFIG_DRIVER_NL80211_QCA
static void qca_nl80211_avoid_freq(struct wpa_driver_nl80211_data *drv, static void qca_nl80211_avoid_freq(struct wpa_driver_nl80211_data *drv,
const u8 *data, size_t len) const u8 *data, size_t len)
{ {
@ -1819,6 +1821,8 @@ static void qca_nl80211_scan_done_event(struct wpa_driver_nl80211_data *drv,
external_scan); external_scan);
} }
#endif /* CONFIG_DRIVER_NL80211_QCA */
static void nl80211_vendor_event_qca(struct wpa_driver_nl80211_data *drv, static void nl80211_vendor_event_qca(struct wpa_driver_nl80211_data *drv,
u32 subcmd, u8 *data, size_t len) u32 subcmd, u8 *data, size_t len)
@ -1827,6 +1831,7 @@ static void nl80211_vendor_event_qca(struct wpa_driver_nl80211_data *drv,
case QCA_NL80211_VENDOR_SUBCMD_TEST: case QCA_NL80211_VENDOR_SUBCMD_TEST:
wpa_hexdump(MSG_DEBUG, "nl80211: QCA test event", data, len); wpa_hexdump(MSG_DEBUG, "nl80211: QCA test event", data, len);
break; break;
#ifdef CONFIG_DRIVER_NL80211_QCA
case QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY: case QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY:
qca_nl80211_avoid_freq(drv, data, len); qca_nl80211_avoid_freq(drv, data, len);
break; break;
@ -1849,6 +1854,7 @@ static void nl80211_vendor_event_qca(struct wpa_driver_nl80211_data *drv,
case QCA_NL80211_VENDOR_SUBCMD_SCAN_DONE: case QCA_NL80211_VENDOR_SUBCMD_SCAN_DONE:
qca_nl80211_scan_done_event(drv, data, len); qca_nl80211_scan_done_event(drv, data, len);
break; break;
#endif /* CONFIG_DRIVER_NL80211_QCA */
default: default:
wpa_printf(MSG_DEBUG, wpa_printf(MSG_DEBUG,
"nl80211: Ignore unsupported QCA vendor event %u", "nl80211: Ignore unsupported QCA vendor event %u",

View file

@ -785,6 +785,8 @@ void nl80211_dump_scan(struct wpa_driver_nl80211_data *drv)
} }
#ifdef CONFIG_DRIVER_NL80211_QCA
static int scan_cookie_handler(struct nl_msg *msg, void *arg) static int scan_cookie_handler(struct nl_msg *msg, void *arg)
{ {
struct nlattr *tb[NL80211_ATTR_MAX + 1]; struct nlattr *tb[NL80211_ATTR_MAX + 1];
@ -970,3 +972,5 @@ fail:
nlmsg_free(msg); nlmsg_free(msg);
return ret; return ret;
} }
#endif /* CONFIG_DRIVER_NL80211_QCA */

View file

@ -30,6 +30,9 @@ DRV_OBJS += ../src/drivers/driver_nl80211_event.o
DRV_OBJS += ../src/drivers/driver_nl80211_monitor.o DRV_OBJS += ../src/drivers/driver_nl80211_monitor.o
DRV_OBJS += ../src/drivers/driver_nl80211_scan.o DRV_OBJS += ../src/drivers/driver_nl80211_scan.o
DRV_OBJS += ../src/utils/radiotap.o DRV_OBJS += ../src/utils/radiotap.o
ifdef CONFIG_DRIVER_NL80211_QCA
DRV_CFLAGS += -DCONFIG_DRIVER_NL80211_QCA
endif
NEED_SME=y NEED_SME=y
NEED_AP_MLME=y NEED_AP_MLME=y
NEED_NETLINK=y NEED_NETLINK=y

View file

@ -26,6 +26,9 @@ DRV_OBJS += src/drivers/driver_nl80211_event.c
DRV_OBJS += src/drivers/driver_nl80211_monitor.c DRV_OBJS += src/drivers/driver_nl80211_monitor.c
DRV_OBJS += src/drivers/driver_nl80211_scan.c DRV_OBJS += src/drivers/driver_nl80211_scan.c
DRV_OBJS += src/utils/radiotap.c DRV_OBJS += src/utils/radiotap.c
ifdef CONFIG_DRIVER_NL80211_QCA
DRV_CFLAGS += -DCONFIG_DRIVER_NL80211_QCA
endif
NEED_SME=y NEED_SME=y
NEED_AP_MLME=y NEED_AP_MLME=y
NEED_NETLINK=y NEED_NETLINK=y

View file

@ -32,6 +32,9 @@
#CONFIG_DRIVER_NL80211=y #CONFIG_DRIVER_NL80211=y
CONFIG_LIBNL20=y CONFIG_LIBNL20=y
# QCA vendor extensions to nl80211
CONFIG_DRIVER_NL80211_QCA=y
# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
#CONFIG_DRIVER_BSD=y #CONFIG_DRIVER_BSD=y
#CFLAGS += -I/usr/local/include #CFLAGS += -I/usr/local/include

View file

@ -31,6 +31,9 @@ CONFIG_DRIVER_WEXT=y
# Driver interface for Linux drivers using the nl80211 kernel interface # Driver interface for Linux drivers using the nl80211 kernel interface
CONFIG_DRIVER_NL80211=y CONFIG_DRIVER_NL80211=y
# QCA vendor extensions to nl80211
#CONFIG_DRIVER_NL80211_QCA=y
# driver_nl80211.c requires libnl. If you are compiling it yourself # driver_nl80211.c requires libnl. If you are compiling it yourself
# you may need to point hostapd to your version of libnl. # you may need to point hostapd to your version of libnl.
# #