nl80211: Use the new nl80211_cmd_msg() helper
This removes duplicated code for building nl80211 commands for a BSS. This commit handles the functions that were already using nl80211_set_iface_id(). Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
07c7757cb1
commit
56f77852e5
3 changed files with 31 additions and 111 deletions
|
@ -368,7 +368,7 @@ struct family_data {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
int nl80211_set_iface_id(struct nl_msg *msg, struct i802_bss *bss)
|
static int nl80211_set_iface_id(struct nl_msg *msg, struct i802_bss *bss)
|
||||||
{
|
{
|
||||||
if (bss->wdev_id_set)
|
if (bss->wdev_id_set)
|
||||||
return nla_put_u64(msg, NL80211_ATTR_WDEV, bss->wdev_id);
|
return nla_put_u64(msg, NL80211_ATTR_WDEV, bss->wdev_id);
|
||||||
|
@ -528,15 +528,8 @@ int nl80211_get_wiphy_index(struct i802_bss *bss)
|
||||||
.macaddr = NULL,
|
.macaddr = NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
msg = nlmsg_alloc();
|
if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_GET_INTERFACE)))
|
||||||
if (!msg)
|
|
||||||
return NL80211_IFTYPE_UNSPECIFIED;
|
|
||||||
|
|
||||||
if (!nl80211_cmd(bss->drv, msg, 0, NL80211_CMD_GET_INTERFACE) ||
|
|
||||||
nl80211_set_iface_id(msg, bss) < 0) {
|
|
||||||
nlmsg_free(msg);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
if (send_and_recv_msgs(bss->drv, msg, netdev_info_handler, &data) == 0)
|
if (send_and_recv_msgs(bss->drv, msg, netdev_info_handler, &data) == 0)
|
||||||
return data.wiphy_idx;
|
return data.wiphy_idx;
|
||||||
|
@ -552,15 +545,8 @@ static enum nl80211_iftype nl80211_get_ifmode(struct i802_bss *bss)
|
||||||
.macaddr = NULL,
|
.macaddr = NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
msg = nlmsg_alloc();
|
if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_GET_INTERFACE)))
|
||||||
if (!msg)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (!nl80211_cmd(bss->drv, msg, 0, NL80211_CMD_GET_INTERFACE) ||
|
|
||||||
nl80211_set_iface_id(msg, bss) < 0) {
|
|
||||||
nlmsg_free(msg);
|
|
||||||
return NL80211_IFTYPE_UNSPECIFIED;
|
return NL80211_IFTYPE_UNSPECIFIED;
|
||||||
}
|
|
||||||
|
|
||||||
if (send_and_recv_msgs(bss->drv, msg, netdev_info_handler, &data) == 0)
|
if (send_and_recv_msgs(bss->drv, msg, netdev_info_handler, &data) == 0)
|
||||||
return data.nlmode;
|
return data.nlmode;
|
||||||
|
@ -575,16 +561,9 @@ static int nl80211_get_macaddr(struct i802_bss *bss)
|
||||||
.macaddr = bss->addr,
|
.macaddr = bss->addr,
|
||||||
};
|
};
|
||||||
|
|
||||||
msg = nlmsg_alloc();
|
if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_GET_INTERFACE)))
|
||||||
if (!msg)
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!nl80211_cmd(bss->drv, msg, 0, NL80211_CMD_GET_INTERFACE) ||
|
|
||||||
nl80211_set_iface_id(msg, bss) < 0) {
|
|
||||||
nlmsg_free(msg);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return send_and_recv_msgs(bss->drv, msg, netdev_info_handler, &data);
|
return send_and_recv_msgs(bss->drv, msg, netdev_info_handler, &data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1814,17 +1793,12 @@ static int nl80211_register_frame(struct i802_bss *bss,
|
||||||
int ret;
|
int ret;
|
||||||
char buf[30];
|
char buf[30];
|
||||||
|
|
||||||
msg = nlmsg_alloc();
|
|
||||||
if (!msg)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
wpa_snprintf_hex(buf, sizeof(buf), match, match_len);
|
wpa_snprintf_hex(buf, sizeof(buf), match, match_len);
|
||||||
wpa_printf(MSG_DEBUG, "nl80211: Register frame type=0x%x (%s) nl_handle=%p match=%s",
|
wpa_printf(MSG_DEBUG, "nl80211: Register frame type=0x%x (%s) nl_handle=%p match=%s",
|
||||||
type, fc2str(type), nl_handle, buf);
|
type, fc2str(type), nl_handle, buf);
|
||||||
|
|
||||||
if (!nl80211_cmd(drv, msg, 0, NL80211_CMD_REGISTER_ACTION) ||
|
if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_REGISTER_ACTION)) ||
|
||||||
nl80211_set_iface_id(msg, bss) < 0 ||
|
|
||||||
nla_put_u16(msg, NL80211_ATTR_FRAME_TYPE, type) ||
|
nla_put_u16(msg, NL80211_ATTR_FRAME_TYPE, type) ||
|
||||||
nla_put(msg, NL80211_ATTR_FRAME_MATCH, match_len, match)) {
|
nla_put(msg, NL80211_ATTR_FRAME_MATCH, match_len, match)) {
|
||||||
nlmsg_free(msg);
|
nlmsg_free(msg);
|
||||||
|
@ -3068,18 +3042,15 @@ nl80211_get_scan_results(struct wpa_driver_nl80211_data *drv)
|
||||||
res = os_zalloc(sizeof(*res));
|
res = os_zalloc(sizeof(*res));
|
||||||
if (res == NULL)
|
if (res == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
msg = nlmsg_alloc();
|
if (!(msg = nl80211_cmd_msg(drv->first_bss, NLM_F_DUMP,
|
||||||
if (!msg)
|
NL80211_CMD_GET_SCAN))) {
|
||||||
goto fail;
|
wpa_scan_results_free(res);
|
||||||
|
return NULL;
|
||||||
if (!nl80211_cmd(drv, msg, NLM_F_DUMP, NL80211_CMD_GET_SCAN) ||
|
}
|
||||||
nl80211_set_iface_id(msg, drv->first_bss) < 0)
|
|
||||||
goto fail;
|
|
||||||
|
|
||||||
arg.drv = drv;
|
arg.drv = drv;
|
||||||
arg.res = res;
|
arg.res = res;
|
||||||
ret = send_and_recv_msgs(drv, msg, bss_info_handler, &arg);
|
ret = send_and_recv_msgs(drv, msg, bss_info_handler, &arg);
|
||||||
msg = NULL;
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
wpa_printf(MSG_DEBUG, "nl80211: Received scan results (%lu "
|
wpa_printf(MSG_DEBUG, "nl80211: Received scan results (%lu "
|
||||||
"BSSes)", (unsigned long) res->num);
|
"BSSes)", (unsigned long) res->num);
|
||||||
|
@ -3088,8 +3059,6 @@ nl80211_get_scan_results(struct wpa_driver_nl80211_data *drv)
|
||||||
}
|
}
|
||||||
wpa_printf(MSG_DEBUG, "nl80211: Scan result fetch failed: ret=%d "
|
wpa_printf(MSG_DEBUG, "nl80211: Scan result fetch failed: ret=%d "
|
||||||
"(%s)", ret, strerror(-ret));
|
"(%s)", ret, strerror(-ret));
|
||||||
fail:
|
|
||||||
nlmsg_free(msg);
|
|
||||||
wpa_scan_results_free(res);
|
wpa_scan_results_free(res);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -4731,12 +4700,8 @@ static int nl80211_create_iface_once(struct wpa_driver_nl80211_data *drv,
|
||||||
wpa_printf(MSG_DEBUG, "nl80211: Create interface iftype %d (%s)",
|
wpa_printf(MSG_DEBUG, "nl80211: Create interface iftype %d (%s)",
|
||||||
iftype, nl80211_iftype_str(iftype));
|
iftype, nl80211_iftype_str(iftype));
|
||||||
|
|
||||||
msg = nlmsg_alloc();
|
msg = nl80211_cmd_msg(drv->first_bss, 0, NL80211_CMD_NEW_INTERFACE);
|
||||||
if (!msg)
|
if (!msg ||
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (!nl80211_cmd(drv, msg, 0, NL80211_CMD_NEW_INTERFACE) ||
|
|
||||||
nl80211_set_iface_id(msg, drv->first_bss) < 0 ||
|
|
||||||
nla_put_string(msg, NL80211_ATTR_IFNAME, ifname) ||
|
nla_put_string(msg, NL80211_ATTR_IFNAME, ifname) ||
|
||||||
nla_put_u32(msg, NL80211_ATTR_IFTYPE, iftype))
|
nla_put_u32(msg, NL80211_ATTR_IFTYPE, iftype))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@ -5614,13 +5579,8 @@ static int nl80211_set_mode(struct wpa_driver_nl80211_data *drv,
|
||||||
wpa_printf(MSG_DEBUG, "nl80211: Set mode ifindex %d iftype %d (%s)",
|
wpa_printf(MSG_DEBUG, "nl80211: Set mode ifindex %d iftype %d (%s)",
|
||||||
ifindex, mode, nl80211_iftype_str(mode));
|
ifindex, mode, nl80211_iftype_str(mode));
|
||||||
|
|
||||||
msg = nlmsg_alloc();
|
msg = nl80211_cmd_msg(drv->first_bss, 0, NL80211_CMD_SET_INTERFACE);
|
||||||
if (!msg)
|
if (!msg || nla_put_u32(msg, NL80211_ATTR_IFTYPE, mode))
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
if (!nl80211_cmd(drv, msg, 0, NL80211_CMD_SET_INTERFACE) ||
|
|
||||||
nl80211_set_iface_id(msg, drv->first_bss) < 0 ||
|
|
||||||
nla_put_u32(msg, NL80211_ATTR_IFTYPE, mode))
|
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
ret = send_and_recv_msgs(drv, msg, NULL, NULL);
|
ret = send_and_recv_msgs(drv, msg, NULL, NULL);
|
||||||
|
@ -6922,17 +6882,12 @@ static int nl80211_send_frame_cmd(struct i802_bss *bss,
|
||||||
u64 cookie;
|
u64 cookie;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
msg = nlmsg_alloc();
|
|
||||||
if (!msg)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
wpa_printf(MSG_MSGDUMP, "nl80211: CMD_FRAME freq=%u wait=%u no_cck=%d "
|
wpa_printf(MSG_MSGDUMP, "nl80211: CMD_FRAME freq=%u wait=%u no_cck=%d "
|
||||||
"no_ack=%d offchanok=%d",
|
"no_ack=%d offchanok=%d",
|
||||||
freq, wait, no_cck, no_ack, offchanok);
|
freq, wait, no_cck, no_ack, offchanok);
|
||||||
wpa_hexdump(MSG_MSGDUMP, "CMD_FRAME", buf, buf_len);
|
wpa_hexdump(MSG_MSGDUMP, "CMD_FRAME", buf, buf_len);
|
||||||
|
|
||||||
if (!nl80211_cmd(drv, msg, 0, NL80211_CMD_FRAME) ||
|
if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_FRAME)) ||
|
||||||
nl80211_set_iface_id(msg, bss) < 0 ||
|
|
||||||
(freq && nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, freq)) ||
|
(freq && nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, freq)) ||
|
||||||
(wait && nla_put_u32(msg, NL80211_ATTR_DURATION, wait)) ||
|
(wait && nla_put_u32(msg, NL80211_ATTR_DURATION, wait)) ||
|
||||||
(offchanok && ((drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) ||
|
(offchanok && ((drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) ||
|
||||||
|
@ -7018,14 +6973,9 @@ static void wpa_driver_nl80211_send_action_cancel_wait(void *priv)
|
||||||
struct nl_msg *msg;
|
struct nl_msg *msg;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
msg = nlmsg_alloc();
|
|
||||||
if (!msg)
|
|
||||||
return;
|
|
||||||
|
|
||||||
wpa_printf(MSG_DEBUG, "nl80211: Cancel TX frame wait: cookie=0x%llx",
|
wpa_printf(MSG_DEBUG, "nl80211: Cancel TX frame wait: cookie=0x%llx",
|
||||||
(long long unsigned int) drv->send_action_cookie);
|
(long long unsigned int) drv->send_action_cookie);
|
||||||
if (!nl80211_cmd(drv, msg, 0, NL80211_CMD_FRAME_WAIT_CANCEL) ||
|
if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_FRAME_WAIT_CANCEL)) ||
|
||||||
nl80211_set_iface_id(msg, bss) < 0 ||
|
|
||||||
nla_put_u64(msg, NL80211_ATTR_COOKIE, drv->send_action_cookie)) {
|
nla_put_u64(msg, NL80211_ATTR_COOKIE, drv->send_action_cookie)) {
|
||||||
nlmsg_free(msg);
|
nlmsg_free(msg);
|
||||||
return;
|
return;
|
||||||
|
@ -7047,12 +6997,7 @@ static int wpa_driver_nl80211_remain_on_channel(void *priv, unsigned int freq,
|
||||||
int ret;
|
int ret;
|
||||||
u64 cookie;
|
u64 cookie;
|
||||||
|
|
||||||
msg = nlmsg_alloc();
|
if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_REMAIN_ON_CHANNEL)) ||
|
||||||
if (!msg)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (!nl80211_cmd(drv, msg, 0, NL80211_CMD_REMAIN_ON_CHANNEL) ||
|
|
||||||
nl80211_set_iface_id(msg, bss) < 0 ||
|
|
||||||
nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, freq) ||
|
nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, freq) ||
|
||||||
nla_put_u32(msg, NL80211_ATTR_DURATION, duration)) {
|
nla_put_u32(msg, NL80211_ATTR_DURATION, duration)) {
|
||||||
nlmsg_free(msg);
|
nlmsg_free(msg);
|
||||||
|
@ -7093,12 +7038,8 @@ static int wpa_driver_nl80211_cancel_remain_on_channel(void *priv)
|
||||||
"0x%llx",
|
"0x%llx",
|
||||||
(long long unsigned int) drv->remain_on_chan_cookie);
|
(long long unsigned int) drv->remain_on_chan_cookie);
|
||||||
|
|
||||||
msg = nlmsg_alloc();
|
msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL);
|
||||||
if (!msg)
|
if (!msg ||
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (!nl80211_cmd(drv, msg, 0, NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL) ||
|
|
||||||
nl80211_set_iface_id(msg, bss) < 0 ||
|
|
||||||
nla_put_u64(msg, NL80211_ATTR_COOKIE, drv->remain_on_chan_cookie)) {
|
nla_put_u64(msg, NL80211_ATTR_COOKIE, drv->remain_on_chan_cookie)) {
|
||||||
nlmsg_free(msg);
|
nlmsg_free(msg);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -8529,12 +8470,8 @@ static int nl80211_add_ts(void *priv, u8 tsid, const u8 *addr,
|
||||||
if (!is_sta_interface(drv->nlmode))
|
if (!is_sta_interface(drv->nlmode))
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
|
|
||||||
msg = nlmsg_alloc();
|
msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_ADD_TX_TS);
|
||||||
if (!msg)
|
if (!msg ||
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
if (!nl80211_cmd(drv, msg, 0, NL80211_CMD_ADD_TX_TS) ||
|
|
||||||
nl80211_set_iface_id(msg, bss) < 0 ||
|
|
||||||
nla_put_u8(msg, NL80211_ATTR_TSID, tsid) ||
|
nla_put_u8(msg, NL80211_ATTR_TSID, tsid) ||
|
||||||
nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr) ||
|
nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr) ||
|
||||||
nla_put_u8(msg, NL80211_ATTR_USER_PRIO, user_priority) ||
|
nla_put_u8(msg, NL80211_ATTR_USER_PRIO, user_priority) ||
|
||||||
|
@ -8563,12 +8500,7 @@ static int nl80211_del_ts(void *priv, u8 tsid, const u8 *addr)
|
||||||
if (!is_sta_interface(drv->nlmode))
|
if (!is_sta_interface(drv->nlmode))
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
|
|
||||||
msg = nlmsg_alloc();
|
if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_DEL_TX_TS)) ||
|
||||||
if (!msg)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
if (!nl80211_cmd(drv, msg, 0, NL80211_CMD_DEL_TX_TS) ||
|
|
||||||
nl80211_set_iface_id(msg, bss) < 0 ||
|
|
||||||
nla_put_u8(msg, NL80211_ATTR_TSID, tsid) ||
|
nla_put_u8(msg, NL80211_ATTR_TSID, tsid) ||
|
||||||
nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr)) {
|
nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr)) {
|
||||||
nlmsg_free(msg);
|
nlmsg_free(msg);
|
||||||
|
@ -8645,12 +8577,12 @@ static int nl80211_vendor_cmd(void *priv, unsigned int vendor_id,
|
||||||
struct nl_msg *msg;
|
struct nl_msg *msg;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
#ifdef CONFIG_TESTING_OPTIONS
|
||||||
|
if (vendor_id == 0xffffffff) {
|
||||||
msg = nlmsg_alloc();
|
msg = nlmsg_alloc();
|
||||||
if (!msg)
|
if (!msg)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
#ifdef CONFIG_TESTING_OPTIONS
|
|
||||||
if (vendor_id == 0xffffffff) {
|
|
||||||
nl80211_cmd(drv, msg, 0, subcmd);
|
nl80211_cmd(drv, msg, 0, subcmd);
|
||||||
if (nlmsg_append(msg, (void *) data, data_len, NLMSG_ALIGNTO) <
|
if (nlmsg_append(msg, (void *) data, data_len, NLMSG_ALIGNTO) <
|
||||||
0)
|
0)
|
||||||
|
@ -8663,8 +8595,7 @@ static int nl80211_vendor_cmd(void *priv, unsigned int vendor_id,
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_TESTING_OPTIONS */
|
#endif /* CONFIG_TESTING_OPTIONS */
|
||||||
|
|
||||||
if (!nl80211_cmd(drv, msg, 0, NL80211_CMD_VENDOR) ||
|
if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_VENDOR)) ||
|
||||||
nl80211_set_iface_id(msg, bss) < 0 ||
|
|
||||||
nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, vendor_id) ||
|
nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, vendor_id) ||
|
||||||
nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD, subcmd) ||
|
nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD, subcmd) ||
|
||||||
(data &&
|
(data &&
|
||||||
|
|
|
@ -183,7 +183,6 @@ struct wpa_driver_nl80211_data {
|
||||||
|
|
||||||
struct nl_msg;
|
struct nl_msg;
|
||||||
|
|
||||||
int nl80211_set_iface_id(struct nl_msg *msg, struct i802_bss *bss);
|
|
||||||
void * nl80211_cmd(struct wpa_driver_nl80211_data *drv,
|
void * nl80211_cmd(struct wpa_driver_nl80211_data *drv,
|
||||||
struct nl_msg *msg, int flags, uint8_t cmd);
|
struct nl_msg *msg, int flags, uint8_t cmd);
|
||||||
struct nl_msg * nl80211_cmd_msg(struct i802_bss *bss, int flags, uint8_t cmd);
|
struct nl_msg * nl80211_cmd_msg(struct i802_bss *bss, int flags, uint8_t cmd);
|
||||||
|
|
|
@ -588,16 +588,11 @@ static int wpa_driver_nl80211_get_info(struct wpa_driver_nl80211_data *drv,
|
||||||
info->capa = &drv->capa;
|
info->capa = &drv->capa;
|
||||||
info->drv = drv;
|
info->drv = drv;
|
||||||
|
|
||||||
msg = nlmsg_alloc();
|
|
||||||
if (!msg)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
feat = get_nl80211_protocol_features(drv);
|
feat = get_nl80211_protocol_features(drv);
|
||||||
if (feat & NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP)
|
if (feat & NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP)
|
||||||
flags = NLM_F_DUMP;
|
flags = NLM_F_DUMP;
|
||||||
if (!nl80211_cmd(drv, msg, flags, NL80211_CMD_GET_WIPHY) ||
|
msg = nl80211_cmd_msg(drv->first_bss, flags, NL80211_CMD_GET_WIPHY);
|
||||||
nla_put_flag(msg, NL80211_ATTR_SPLIT_WIPHY_DUMP) ||
|
if (!msg || nla_put_flag(msg, NL80211_ATTR_SPLIT_WIPHY_DUMP)) {
|
||||||
nl80211_set_iface_id(msg, drv->first_bss) < 0) {
|
|
||||||
nlmsg_free(msg);
|
nlmsg_free(msg);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -1424,16 +1419,11 @@ nl80211_get_hw_feature_data(void *priv, u16 *num_modes, u16 *flags)
|
||||||
*num_modes = 0;
|
*num_modes = 0;
|
||||||
*flags = 0;
|
*flags = 0;
|
||||||
|
|
||||||
msg = nlmsg_alloc();
|
|
||||||
if (!msg)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
feat = get_nl80211_protocol_features(drv);
|
feat = get_nl80211_protocol_features(drv);
|
||||||
if (feat & NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP)
|
if (feat & NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP)
|
||||||
nl_flags = NLM_F_DUMP;
|
nl_flags = NLM_F_DUMP;
|
||||||
if (!nl80211_cmd(drv, msg, nl_flags, NL80211_CMD_GET_WIPHY) ||
|
if (!(msg = nl80211_cmd_msg(bss, nl_flags, NL80211_CMD_GET_WIPHY)) ||
|
||||||
nla_put_flag(msg, NL80211_ATTR_SPLIT_WIPHY_DUMP) ||
|
nla_put_flag(msg, NL80211_ATTR_SPLIT_WIPHY_DUMP)) {
|
||||||
nl80211_set_iface_id(msg, bss) < 0) {
|
|
||||||
nlmsg_free(msg);
|
nlmsg_free(msg);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue