hostap: Add channel set support

This set of changes introduces an API to set the channel when
the device is working in independent Monitor or TX injection mode

Signed-off-by: Vivekananda Uppunda <vivekananda.uppunda@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
Vivekananda Uppunda 2023-09-13 08:13:37 +05:30 committed by Alberto Escolar
parent 5ffecde140
commit c8d0e5f5fc
3 changed files with 22 additions and 0 deletions

View File

@ -657,3 +657,15 @@ int supplicant_filter(const struct device *dev, struct wifi_filter_info *filter)
return wifi_mgmt_api->filter(dev, filter);
}
int supplicant_channel(const struct device *dev, struct wifi_channel_info *channel)
{
const struct wifi_mgmt_ops *const wifi_mgmt_api = get_wifi_mgmt_api(dev);
if (!wifi_mgmt_api || !wifi_mgmt_api->channel) {
wpa_printf(MSG_ERROR, "Setting channel not supported");
return -ENOTSUP;
}
return wifi_mgmt_api->channel(dev, channel);
}

View File

@ -125,4 +125,13 @@ int supplicant_mode(const struct device *dev, struct wifi_mode_info *mode);
*/
int supplicant_filter(const struct device *dev, struct wifi_filter_info *filter);
/**
* @brief Set Wi-Fi channel for monitor or TX injection mode
*
* @param dev Wi-Fi interface name to use
* @param channel Channel settings to set
* @return 0 for OK; -1 for ERROR
*/
int supplicant_channel(const struct device *dev, struct wifi_channel_info *channel);
#endif /* ZEPHYR_SUPP_MGMT_H */

View File

@ -51,6 +51,7 @@ static const struct wifi_mgmt_ops mgmt_ops = {
.reg_domain = supplicant_reg_domain,
.mode = supplicant_mode,
.filter = supplicant_filter,
.channel = supplicant_channel,
};
DEFINE_WIFI_NM_INSTANCE(wifi_supplicant, &mgmt_ops);