Wi-Fi APIs

[English]

重要

The WiFi API v2.0 is the lastest stable WiFi APIs, it’s used to deprecate the WiFi API v1.0. All new applications should use WiFi API v2.0.

Wi-Fi Interface

The BK WiFi Driver supports following logical WiFi interfaces:

  • BK STA interface

  • BK AP interface

  • BK Monitor interface

  • BK RLK(Raw Link) interface

Each interface can be operated independently, so theretically all interfaces can be started independently. However because of performance and interference consideration, we limit the coexisting of some interfaces.

E.g. if the monitor interface is started, the starting of STA interface will fail, refer to API for detailed limitation of interface coexisting.

Wi-Fi API Categories

Most of WiFi APIs can be categoried as:

  • Common APIs

    The common APIs are prefixed with bk_wifi, the APIs may be common for all interfaces or some interfaces, e.g. bk_wifi_init() etc.

  • Interface specific APIs.

    The API name are prefixed with bk_wifi_interface, the interface can be sta, ap or monitor. e.g. bk_wifi_sta_start() etc.

  • Module specific APIs

    The API name are prefixed with bk_wifi_module, the module can be scan or filter etc, e.g. bk_wifi_scan_start() etc. The API has no direct relationship with the interface, or the API caller don’t nedto care about on which interface the API is operated. E.g. the scan API can be based on STA interface, it can also based on AP interface, but the caller don’t care about it.

  • BK-RLK APIs

    The BK-RLK APIs are prefixed with bk_rlk, the APIs is only common for BK-RLK functional modules. bk_rlk_init() etc.

Common WiFi APIs:
Interface specific WiFi APIs:
Module Specific WiFi APIs:
BK-RLK APIs:

Compitability and Extension

The WiFi APIs are flexible, easy to be extended and backward compatible. For most of the WiFi configurations, we put some reserved fields in the config struct for future extendence. The API users need to make sure the reserved fields are initialized to 0, otherwise the compatibility may be broken as more fields are added.

Programing Principle

重要

Here is some general principle for WiFi API users:
  • Always init the reserved fields of config stuct to 0

  • Use BK_ERR_CHECK to check the return value of the WiFi API

  • If you are not sure how to use WiFi APIs, study the WiFi example code first

  • If you are not sure how to initialize some fields of config struct, use the default configuration macro to use the config first and then set application specific fields, e.g. use WIFI_DEFAULT_INIT_CONFIG() to init wifi_config_t first.

  • Don’t do too much work in WiFi event callback, relay the event to your own application task.

User Development Model

Similar as most popular WiFi driver, the Beken WiFi driver is implemented as event driver. The application call WiFi APIs to operate the WiFi driver and get notified by WiFi event.

API Reference

Header File

Functions

bk_err_t bk_wifi_init(const wifi_init_config_t *init_config)

This API initializes the WiFi driver, e.g. creating task for supplicant, allocating resource for low level WiFi driver etc.

Usage example:

 wifi_init_config_t init_config = WIFI_DEFAULT_INIT_CONFIG();
 BK_LOG_ON_ERR(bk_wifi_init(&init_config);

Attention

1. This API is the 1st API that should be called before any other WiFi API can be called.

Attention

2. Make sure the reserved field in config is zero, otherwise you may encounter compatibility issue in future if more config fields are added.

返回

  • BK_OK: succeed

  • others: other errors.

bk_err_t bk_wifi_deinit(void)

Deinit the BK WiFi driver.

This API free all resources related to WiFi.

Attention

1. This API is not ready yet, will support in future release.

返回

  • BK_OK: succeed

  • BK_ERR_NOT_SUPPORT: The API is not supported yet.

  • others: other errors.

bk_err_t bk_wifi_sta_start(void)

Start the BK STA.

This API init the resoure specific to BK STA, e.g. init STA specific globals, init the supplicant and STA specific WiFi driver etc.

Attention

1. Make sure the bk_wifi_sta_set_config() are succeedful before calling this API.

Attention

2. This API connect the BK STA to the configured AP automatically.

Attention

3. If the BK STA is already started, this API ignores the request and returns BK_OK. if you want to restart the BK STA, call bk_wifi_sta_stop() first and then call this API.

Attention

4. TODO description about fast connection

返回

  • BK_OK: succeed

  • BK_ERR_WIFI_STA_NOT_CONFIG: the BK STA is not configured.

  • BK_ERR_WIFI_MONITOR_IP: the BK STA can’t be started because monitor is started.

  • others: other errors.

bk_err_t bk_wifi_sta_stop(void)

Stop the BK STA.

Attention

This API causes the BK STA disconnect from the AP, it similar as bk_wifi_sta_disconnect(), but this API may free resource.

返回

  • BK_OK: succeed

  • BK_FAIL: fail

bk_err_t bk_wifi_scan_stop(void)

Stop the pure scan operation.

Attention

This API causes the BK STA disconnect from the AP, it similar as bk_wifi_sta_disconnect(), but this API may free resource.

返回

  • BK_OK: succeed

  • BK_FAIL: fail

bk_err_t bk_wifi_sta_set_config(const wifi_sta_config_t *sta_config)

Config the BK STA.

This API configures the basic configurations of the BK STA, it should be called before we call bk_wifi_sta_start() to start the BK STA. It can also be used to update the configuration after the BK STA is started.

Usage example:

wifi_sta_config_t sta_config = WIFI_DEFAULT_STA_CONFIG();

os_strncpy(sta_config.ssid, "ssid", WIFI_SSID_STR_LEN);
os_strncpy(sta_config.password, "password", WIFI_PASSWORD_LEN);
//more initialization here
BK_LOG_ON_ERR(bk_wifi_sta_set_config(&sta_config));

Attention

1. Don’t call this API when the monitor is in-progress

Attention

2. If STA is already connected to AP, this API cases BK STA reconnects the AP.

Attention

3. Make sure the reserved fields in sta_config is zero, otherwise you may encounter compatibility issue in future if more config fields are added.

Attention

4. Auto reconnect max count and timeout can be set. When user app receives EVENT_WIFI_STA_DISCONNECTED event, it’s user app’s responsibility to reconnect to AP manually. Max count and timeout set to zero to let supplicant automatically handles connection without user app’s interaction.

参数

sta_config – the STA configuration

返回

  • BK_OK: succeed

  • BK_ERR_WIFI_NOT_INIT: the STA is not initialized, call bk_wifi_init() first.

  • BK_ERR_NULL_PARAM: parameter config is NULL.

  • BK_ERR_WIFI_RESERVED_FIELD: the reserved field of config is not 0.

  • others: other errors

bk_err_t bk_wifi_sta_get_config(wifi_sta_config_t *sta_config)

Get the configuration of the BK STA.

参数

sta_config – store the BK STA configuration

返回

  • BK_OK: succeed

  • BK_ERR_NULL_PARAM: the parameter config is NULL.

  • BK_ERR_WIFI_STA_NOT_CONFIG: STA is not configured yet.

  • others: other errors

bk_err_t bk_wifi_sta_get_linkstate_with_reason(wifi_linkstate_reason_t *info)

Get the WiFi station state of the BK STA.

  • If sta is idle or connected, reason code will be WIFI_REASON_MAX

Attention

the difference between this API and bk_wifi_sta_get_link_status() is

  • This API gets the actual WiFi STA link status and reason code

参数

state – store the WiFi station state of the BK STA

返回

  • BK_OK: succeed

  • BK_ERR_NULL_PARAM: the parameter config is NULL.

  • others: other errors

Get the WiFi link info of the BK STA.

Get the actual WiFi link status of the BK STA.

Attention

the difference between this API and bk_wifi_sta_get_config() is

  • This API gets the actual STA link info while the later gets the configured value

  • This API can get more info of the link, such as RSSI, WiFi link status, AID etc.

  • The AID is only valid if @link_status->state is WIFI_LINK_CONNECTED.

参数

link_status – store the WiFi link status of the BK STA

返回

  • BK_OK: succeed

  • BK_ERR_NULL_PARAM: the parameter link_info is NULL.

  • BK_ERR_WIFI_DRIVER: WiFi low level driver has failure.

  • BK_ERR_WIFI_NO_MEM: Not enough memory

  • others: other errors

bk_err_t bk_wifi_sta_connect(void)

Connect the BK STA to the AP.

Attention

1. Make sure STA is started by bk_wifi_sta_start() before calling this API.

Attention

2. Don’t call this API when the monitor is in-progress

Attention

3. If STA is already connected to AP, this API reconnects the BK STA.

Attention

4. TODO - multiple same SSID connect???

返回

  • BK_OK: succeed

  • BK_ERR_WIFI_STA_NOT_STARTED: the STA is not started, call bk_wifi_sta_start() first.

  • BK_ERR_WIFI_MONITOR_IP: the API is not allowed because monitor is in-progress.

  • others: other failures.

bk_err_t bk_wifi_sta_disconnect(void)

Disconnect the WiFi connection of the BK STA.

Attention

TODO - add description about disconnect event!

返回

  • BK_OK: succeed

  • others: other failures.

bk_err_t bk_wifi_scan_start(const wifi_scan_config_t *scan_config)

Start a scan.

This API notifies the WiFi driver to start a scan, the event EVENT_WIFI_SCAN_DONE will be raised if the scan is completed. General steps to use this API:

  • prepare the scan done event callback, the callback can call bk_wifi_scan_get_result() to get the scan result and then call bk_wifi_scan_free_result() to free the resource.

  • call bk_event_register_cb(EVENT_MOD_WIFI, EVENT_WIFI_SCAN_DONE, …) to register scan done event callback.

  • call this API to trigger this the scan.

Usage example:

//Define your scan done handler
int scan_done_handler(void *arg, event_module_t event_module, int event_id, void *event_data)
{
    wifi_scan_result_t scan_result = {0};

    BK_LOG_ON_ERR(bk_wifi_scan_get_result(&scan_result));
    bk_wifi_scan_dump_result(&scan_result);
    bk_wifi_scan_free_result(&scan_result);

    return BK_OK;
}

//Start the scan
wifi_scan_config_t config = {0};

BK_LOG_ON_ERR(bk_event_register_cb(EVENT_MOD_WIFI, EVENT_WIFI_SCAN_DONE, scan_done_handler, NULL));
BK_LOG_ON_ERR(bk_wifi_scan_start(&scan_config));

Attention

1. This API triggers an active scan on all channels (TODO double check)

Attention

2. Pass NULL scan_config to scan all APs, otherwise scan the SSID specified in scan_config.ssid

Attention

3. Make sure the reserved fields in scan_config is zero, otherwise you may encounter compatibility issue in future if more config fields are added.

Attention

4. TODO scan result limits???

参数

scan_config – the configuration of scan

返回

  • BK_OK: succeed

  • BK_ERR_WIFI_NOT_INIT: the STA is not initialized, call bk_wifi_init() first.

  • BK_ERR_WIFI_MONITOR_IP: the API is not allowed because monitor is in-progress.

  • others: other failures.

bk_err_t bk_wifi_scan_get_result(wifi_scan_result_t *scan_result)

Get the scan result.

Usage example:

wifi_scan_result_t scan_result = {0};

BK_LOG_ON_ERR(bk_wifi_scan_get_result(&scan_result));
bk_wifi_scan_free_result(&scan_result);

Attention

1. The caller don’t need to allocate memory for scan_result->aps, this API will allocate the memory for scan_result->aps according to the actual found AP number.

Attention

2. Don’t forget to call bk_wifi_scan_free_result(&scan_result) to free the the resource allocated in this API, otherwise memory leak.

参数

scan_result – store the scan result

返回

  • BK_OK: succeed

  • BK_ERR_NULL_PARAM: NULL scan_result

  • BK_ERR_NO_MEM: out of memory

  • others: other failures

bk_err_t bk_wifi_scan_dump_result(const wifi_scan_result_t *scan_result)

Dump the scan result.

参数

scan_result – The scan result to be dumped.

返回

  • BK_OK: succeed

  • BK_ERR_PARAM: invalid scan result

void bk_wifi_scan_free_result(wifi_scan_result_t *scan_result)

Free the scan result.

Attention

This API free scan_result->aps which allocated in bk_wifi_scan_get_result(), it doesn’t free scan_result. So if scan_result is allocated by the caller, the caller need to free it.

参数

scan_result – The scan result to be freed.

返回

  • BK_OK: always succeed

bk_err_t bk_wifi_sta_add_vendor_ie(uint8_t frame, uint8_t *vsie, uint8_t len)

Add/Update/Del STA’s Vendor Specific IE before connect to AP.

Attention

If you want to add vsie when sta starts, just initialize wifi_sta_config_t when call bk_wifi_sta_set_config().

参数
  • buf – vsie buf

  • len – vsie buf len

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_sta_update_vendor_ie(uint8_t frame, uint8_t *vsie, uint8_t len)
bk_err_t bk_wifi_sta_del_vendor_ie(uint8_t frame)
bk_err_t bk_wifi_ap_start(void)

Start the BK AP.

This API init the resoure specific to BK AP, e.g. init BK AP specific globals, init the hostapd and AP specific WiFi driver etc.

If the BK AP is already started, this API ignores the request and returns BK_OK, we can call bk_wifi_ap_stop() to stop BK AP first and then call bk_wifi_ap_start() to restart it.

Restart AP Usage example:

BK_LOG_ON_ERR(bk_wifi_ap_stop());
BK_LOG_ON_ERR(bk_wifi_ap_start());

Attention

1. Don’t call this API when the monitor is in-progress

Attention

2. If bk_wifi_ap_set_config() is not called, this API start the AP with default value, normally you should configure the AP first before calling this API.

返回

  • BK_OK: succeed

  • BK_ERR_WIFI_AP_NOT_CONFIG: the WiFi AP is not configured, call bk_wifi_ap_set_config() first.

  • others: other errors

bk_err_t bk_wifi_ap_stop(void)

Stop the BK AP.

返回

  • BK_OK: succeed

  • BK_WIFI_NOT_INIT: the WiFi is not initialized, call bk_wifi_init() first.

  • others: other errors

bk_err_t bk_wifi_ap_set_config(const wifi_ap_config_t *ap_config)

Config the BK AP.

Usage example:

wifi_ap_config_t ap_config = WIFI_DEFAULT_AP_CONFIG();

os_strncpy(ap_config.ssid, "ssid", WIFI_SSID_STR_LEN);
os_strncpy(ap_config.password, "password", WIFI_PASSWORD_LEN);
BK_LOG_ON_ERR(bk_wifi_ap_set_config(&ap_config));

Attention

1. Make sure the reserved field in config is zero, otherwise you may encounter compatibility issue in future if more config fields are added.

参数

ap_config – the AP configuration

返回

  • BK_OK: succeed

  • BK_ERR_NULL_PARAM: the ap_config is NULL.

  • others: other errors

bk_err_t bk_wifi_ap_get_config(wifi_ap_config_t *ap_config)

Get the configuration of the BK AP.

参数

ap_config – store the configuration of BK AP

返回

  • BK_OK: succeed

  • BK_ERR_NULL_PARAM: the parameter config is NULL.

  • others: other errors

bk_err_t bk_wifi_ap_get_sta_list(wlan_ap_stas_t *stas)

Get the STAs connected to BK AP.

Attention

Free stas->sta after usage.

参数

stas – store the STA list in BK AP

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_calculate_pmk(const char *ssid, const char *pwd, char *pmk)

Calculate softap’s Pmk when softap is starts.

参数
  • ssid – softap’s ssid

  • pwd – softap’s pwd

  • pmk – softap’s pmk

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_ap_add_vendor_ie(void *buf, uint8_t len)

Add softap’s Vendor Specific IE when softap is running.

Attention

If you want to add vsie when softap starts, just initialize wifi_ap_config_t when call bk_wifi_ap_start().

参数
  • buf – vsie buf

  • len – vsie buf len

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_ap_del_vendor_ie(void)

Delete softap’s Vendor Specific IE when softap is running.

Attention

If you want to add vsie when softap starts, just initialize wifi_ap_config_t when call bk_wifi_ap_start().

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_ap_update_hidden_cap(bool flag)

Update softap’s Hidden Ssid Capaility when softap is running.

  • BK_OK: succeed

  • others: other errors

Attention

If you want to update hidden ssid capability when softap starts, just call bk_wifi_ap_update_hidden_cap().

参数

flag – set true for hidden ssid

返回

bk_err_t bk_wifi_monitor_start(void)

Start the monitor.

Attention

1. When monitor mode is enabled, the scan will not work and bk_wifi_scan_start() returns BK_ERR_WIFI_MONITOR_IP.

Attention

2. When monitor mode is enabled, the STA connect will not work and bk_wifi_sta_connect() returns BK_ERR_WIFI_MONITOR_IP.

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_monitor_stop(void)

Stop the monitor.

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_monitor_set_config(const wifi_monitor_config_t *monitor_config)

Configure the monitor.

参数

monitor_config – the configuration of monitor

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_monitor_get_config(wifi_monitor_config_t *monitor_config)

Get the configuration of the monitor.

参数

monitor_config – store the configuration of monitor

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_monitor_register_cb(const wifi_monitor_cb_t monitor_cb)

Register the user callback of monitor.

参数

monitor_cb – monitor callback

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_monitor_set_channel(const wifi_channel_t *chan)

Set monitor channel.

Attention

1. Currently we only support HT20, chan->second should always be 0.

Attention

2. This API is only used for settting monitor channel, NOT for other purpose.

Attention

3. This API directly change the hardware channel, it may impacts BK STA/AP if the STA or AP interface is started. TODO describe details of the impact.

Attention

4. The channel range can be set is from channel 1 to channel 14,

参数

chan – channel of monitor

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_monitor_resume(void)

resume the monitor to wakeup Wi-Fi from sleep mode

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_monitor_suspend(void)

suspend the monitor to allow Wi-Fi can goto sleep mode

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_twt_setup(uint8_t setup_type, uint16_t mantissa, uint8_t min_twt)

twt set up

参数
  • setup_type – suggest/demand

  • mantissa – wake_int_mantissa

  • min_twt – min_twt_wake_dur

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_twt_teardown(void)

twt tear down

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_filter_set_config(const wifi_filter_config_t *filter_config)

Set the filter configuration.

The filter is used to configure what kind of management packets can be received by the filter callback registered by bk_wifi_filter_register_cb().

Per the WiFi receiving data path, the management frames are firstly received by WiFi hardware, then the hardware relays them to WiFi software (WiFi driver). Normally the hardware receives all management frames in the air, however it don’t relay all of them to WiFi driver (WiFi software), it only relays management frames necessary to STA or AP or scan or monitor, depends on which interface or function are enabled. In other word, WiFi driver only receives management frames necessary to them from hardware.

When no filter callback is registered, all management frame processing is ended in WiFi driver unless the filter callback is registered.

If filter callback is register and if filter_config.rx_all_default_mgmt is set to 1, then all the management frames received by WiFi driver are relayed to the filter callback. Notified that the default management frame types can be received depends on whether STA or AP or scan or monitor are enabled or not, e.g. when only STA is enabled, the WiFi driver needs to handle PROBE response, but don’t need to handle PROBE request, so the WiFi driver only receive PROBE response from WiFi hardware.

Here is summary about default management frame received by WiFi:

Condition

Default management frame

STA connected

Management frames sent by the connected AP, such as beacon etc.

AP started

Management frames sent by connected STA and probe request etc.

Scan starting

Probe response and beacon frames of all APs.

Monitor started

All kind of management frames

How about if the filter callback wants to receive more management frame types, e.g. want to receive PROBE request when only STA is enabled. We can set filter_config->rx_probe_req to receive PROBE response no matter whether AP is enabled or NOT.

Usage example:

// Only receive management frame default received by WiFi driver
// Equal to the case when bk_wifi_filter_set_config() is not called
wifi_filter_config_t filter_config = WIFI_DEFAULT_FILTER_CONFIG();
BK_LOG_ON_ERR(bk_wifi_filter_set_config(&filter_config);

// Receive all beacon and management frames default received by WiFi driver
filter_config.rx_all_beacon = 1;
BK_LOG_ON_ERR(bk_wifi_filter_set_config(&filter_config);

// Only receive all beacon
filter_config.rx_all_beacon = 1;
filter_config.rx_all_default_mgmt = 0;
BK_LOG_ON_ERR(bk_wifi_filter_set_config(&filter_config);

Attention

1. If this API is not called, the default filter is to relay all mamangement frames received by WiFi driver to the filter callback.

Attention

2. If STA is enabled, the WiFi driver only receives beacon from the connected AP, if scan is enabled or filter_config->rx_all_beacon is set, the WiFi driver receives beacons of all APs.

参数

filter_config – configuration of filter

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_filter_get_config(wifi_filter_config_t *filter_config)

Get the filter configuration.

参数

filter_config – store configuration of filter

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_filter_register_cb(const wifi_filter_cb_t filter_cb)

Register the filter user callback.

Attention

1. If the monitor is enabled, the management packets received by filter callback can also be received by monitor callback. If this is not what we want, we can disable filter when enabling monitor, or disable monitor when enabling filter.

Attention

2. During WiFi scan, the filter also works.

Attention

3. Pass NULL callback or set all fields of filter_config to 0 to disable the filter.

Attention

4. The memory used to hold the frame buffer and frame_info will be freed immediately when the callback is returned, so don’t relay them to other task. Make a copy of them and then relay to other task if necessary.

Attention

5. Don’t do too much work in the filter callback because it’s called in WiFi driver core thread, otherwise it may impact the WiFi performance.

参数

filter_cb – the filter user callback

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_sta_get_mac(uint8_t *mac)

Get the MAC of BK STA.

Attention

1. The AP’s MAC is derived from the base MAC of the system.

Attention

2. If you want to change the MAC of AP, call bk_set_mac() to set the base MAC of the system.

参数

mac – store the MAC of BK STA

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_ap_get_mac(uint8_t *mac)

Get the MAC of BK AP.

Attention

1. The AP’s MAC is derived from the base MAC of the system.

Attention

2. If you want to change the MAC of AP, call bk_set_mac() to set the base MAC of the system.

参数

mac – store the MAC of BK AP

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_send_raw(uint8_t *buffer, int len)

Send raw 802.11 frame.

Attention

1. This API can be used in WiFi station, softap, or monitor mode.

Attention

2. Only support to send non-QoS frame.

Attention

3. The frame sequence will be overwritten by WiFi driver.

Attention

4. The API doesn’t check the correctness of the raw frame, the caller need to guarantee the correctness of the frame.

参数
  • buffer – raw 802.11 frame

  • len – the length of the 802.11 frame

返回

  • kNoErr: succeed

  • otherwise: fail

bk_err_t bk_wifi_send_raw_ex(wifi_raw_tx_info_t *raw_tx, void *cb, void *param)

Send raw 802.11 frame.

Attention

1. This API can be used in WiFi station, softap, or monitor mode.

Attention

2. Only support to send non-QoS frame.

Attention

3. The frame sequence will be overwritten by WiFi driver.

Attention

4. The API doesn’t check the correctness of the raw frame, the caller need to guarantee the correctness of the frame.

参数
  • raw_tx – raw tx information, refer to struct wifi_raw_tx_info_t

  • cb – send status call back

  • param – send status call back paramter

返回

  • kNoErr: succeed

  • otherwise: fail

bk_err_t bk_wifi_send_tx_raw_ex(wifi_raw_tx_info_t *raw_tx, void *cb, void *param)

Send raw 802.11 tx frame.

Attention

1. This API can be used in WiFi station, softap, or monitor mode.

Attention

2. Only support to send non-QoS frame.

Attention

3. The frame sequence will be overwritten by WiFi driver.

Attention

4. The API doesn’t check the correctness of the raw frame, the caller need to guarantee the correctness of the frame.

参数
  • raw_tx – raw tx information, refer to struct wifi_raw_tx_info_t

  • cb – send status call back

  • param – send status call back paramter

返回

  • kNoErr: succeed

  • otherwise: fail

bk_err_t bk_wifi_set_tx_raw_rate_power(uint32_t rate, uint32_t power)

Update raw 802.11 frame TX rate and power.

参数
  • rate – TX rate control

  • power – TX power control

返回

  • kNoErr: succeed

  • otherwise: fail

bk_err_t bk_wifi_set_tx_raw_ac(uint8_t ac)

Update raw 802.11 frame TX AC.

参数

ac – TX AC

返回

  • kNoErr: succeed

  • otherwise: fail

bk_err_t bk_wifi_set_tx_raw_timeout(uint16_t timeout_ms)

Update raw 802.11 frame TX timeout.

参数

timeout_ms – TX timeout in ms

返回

  • kNoErr: succeed

  • otherwise: fail

bk_err_t bk_wifi_set_wifi_media_mode(bool flag)

Configure wifi multimedia mode when the multimedia is running.

This API is used to configure multimedia mode of Wi-Fi. Multimedia mode can enchance video fluency and make a better experience of video.

Attention

1. If you want to running multimedia mode,please configure this flag when open and close multimedia mode.

Attention

2. Please set this flag before running multimedia and clear this flag after closing multimedia.

Attention

3. If the flag is set when multimedia is turned on and it is not cleared after multimedia is turned off,the Wi-Fi will not be able to enter ps mode.

参数

flag – set true if you want to enable multimedia mode.

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_set_video_quality(uint8_t quality)

Configure video quality when the video is running.

This API is used to configure video quality.There are three mode to choose:

Fluent definition(FD): The video transmission is relatively stable and has strong anti-interference ability,which can ensure the stable video transmission in a complex enviroment;

Standard definition(SD):The video transmission is stable in a clean environment and is slightly stuck in a complex environment,which transmission bandwidth is improved;

High definition(HD):The video transmission gives priority to high speed which can transmit high-bandwidth data in a clean environment, but the video transmission is relatively stuck in a complex environment;

The default value is HD mode when the video is running.

Attention

1. If you want to running video mode,please configure this parameter when open video mode.

Attention

2. Please configure this parameter before running video mode.

Attention

3. Please configure bk_wifi_set_wifi_media_mode(flag) before useing this API.

参数

quality – set the video quality when the video is running. Three mode can be choose: 0-FD,1-SD,2-HD,default is HD.

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_get_video_quality_config(uint8_t *quality)

get video quality configuration

参数

quality – store configuration of video quality

返回

  • BK_OK: succeed

  • BK_ERR_NULL_PARAM: the parameter config is NULL

  • others: other errors

bk_err_t bk_wifi_get_wifi_media_mode_config(bool *flag)

get wifi media mode configuration

参数

flag – store configuration of wifi media mode

返回

  • BK_OK: succeed

  • BK_ERR_NULL_PARAM: the parameter config is NULL

  • others: other errors

bk_err_t bk_wifi_get_tx_raw_ac(uint8_t *ac)

get tx raw ac info

参数

ac – ac info

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_get_tx_raw_timeout(uint16_t *time)

get tx raw timeout info

参数

time – timeout info

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_set_min_rsv_mem(uint16_t mem_bytes)

Update the minimux heap memory size that Wi-Fi should reserve.

Attention

1. An small piece of extra memory will be malloced from heap for each TX packets delivered to Wi-Fi, so if the pending TX packets are too many for some reasons, the heap memory will be occupied too much by TX packets. To ensure the stability of whole system, this interface is provied to limit the memory size for Wi-Fi TX packets.

Attention

2. The maximum valid value of memory size which could update via this API is 30K bytes

Attention

3. The default minimux reserved memory size is 10K bytes

参数

mem_bytes – the expected reserved memory size(bytes)

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_get_min_rsv_mem(uint16_t *mem_bytes)

Get the minimux heap memory size that Wi-Fi currently creserves.

参数

mem_bytes – return currently reserved memory size(bytes)

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_set_tx_max_msdu_cnt(uint16_t max_cnt)

Update the maximum MSDU count that Wi-Fi could handle.

参数

max_cnt – the maxmimum MSDU count

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_get_tx_max_msdu_cnt(uint16_t *max_cnt)

Get the maximum MSDU count configuration that Wi-Fi could handle.

参数

max_cnt – return the maxmimum MSDU count

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_set_data_rty_num(uint8_t rty_num)

Set data frame retry numbers.

参数

rty_num – data frame retry numbers

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_get_data_rty_num(uint32_t *rty_num)

Get data frame retry numbers.

参数

rty_num – data frame retry numbers

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_set_mgmt_rty_num(uint8_t rty_num)

Set management frame retry numbers.

参数

rty_num – management frame retry numbers

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_get_mgmt_rty_num(uint32_t *rty_num)

Get management frame retry numbers.

参数

rty_num – management frame retry numbers

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_capa_config(wifi_capability_t capa_id, uint32_t capa_val)

Update Wi-Fi capability configuration.

This API is used to change some Wi-Fi capability configuration, please refer to wifi_capability_t to get the capability that has been supported.

Attention

1. Please keep in mind that Wi-Fi behavior may change if the capability is changed to different value compared with the default value.

Attention

2. We strongly suggest not using this API except you are very farmiliar with the Wi-Fi specification.

Attention

3. If you want Wi-Fi working on 11b only mode, please set 11b only mode by configurate paramter capa_id with WIFI_CAPA_ID_11B_ONLY_EN and capa_val with TRUE.

参数
  • capa_id – the specific capability you want to change

  • capa_val – new capability value

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_wifi_set_country(const wifi_country_t *country)

configure country info

Attention

1. The default country is {.cc=”CN”, .schan=1, .nchan=13, policy=WIFI_COUNTRY_POLICY_AUTO}

Attention

2. When the country policy is WIFI_COUNTRY_POLICY_AUTO, the country info of the AP to which the station is connected is used. E.g. if the configured country info is {.cc=”USA”, .schan=1, .nchan=11} and the country info of the AP to which the station is connected is {.cc=”JP”, .schan=1, .nchan=14} then the country info that will be used is {.cc=”JP”, .schan=1, .nchan=14}. If the station disconnected from the AP the country info is set back back to the country info of the station automatically, {.cc=”USA”, .schan=1, .nchan=11} in the example.

Attention

3. When the country policy is WIFI_COUNTRY_POLICY_MANUAL, always use the configured country info.

Attention

4. When the country info is changed because of configuration or because the station connects to a different external AP, the country IE in probe response/beacon of the soft-AP is changed also.

Attention

5. The country configuration is not stored into flash

Attention

6. This API doesn’t validate the per-country rules, it’s up to the user to fill in all fields according to local regulations.

参数

country – the configured country info

返回

  • BK_OK: succeed

  • BK_ERR_WIFI_NOT_INIT: WiFi is not initialized

  • BK_ERR_PARAM: invalid argument

bk_err_t bk_wifi_get_country(wifi_country_t *country)

get the current country info

参数

country – country info

返回

  • BK_OK: succeed

  • BK_ERR_WIFI_NOT_INIT: WiFi is not initialized

  • BK_ERR_PARAM: invalid argument

bk_err_t bk_wifi_sta_pm_enable(void)

enable wifi sta power management

返回

  • BK_OK: on succeed

  • others: real error, used for future.

bk_err_t bk_wifi_sta_pm_disable(void)

disable wifi sta power management

返回

  • BK_OK: on succeed

  • others: real error, used for future.

bk_err_t bk_wifi_get_channel(void)

get current channel ID

参数

basically – range from 1~13

返回

  • BK_OK: on succeed

  • others: real error, used for future.

bk_err_t bk_wifi_set_mac_address(char *mac)

Set Wi-Fi MAC addresses.

The given MAC address will become the station MAC address.The AP MAC address (i.e BSSID) will be the same MAC address but with the local bit set.

@usage example: mac c8478cxxyyzz txevm -e 2 //if needed

备注

on some platforms the change of MAC address can only take effect after reboot.

参数

mac – system mac

返回

- BK_OK: on succeed
 - others: real error, used for future.

bk_err_t bk_wifi_manual_cal_rfcali_status(void)

Get Wi-Fi Calibration status.

返回

  • BK_OK: on succeed

  • others: real error, used for future.

bk_err_t bk_wifi_ap_vif_probe_req_frame_cb_register(void *cb)

Register a cb of probe request for ap.

参数

cb – callback function of probe request to register

bk_err_t bk_wifi_send_listen_interval_req(uint8_t interval)

Set listen interval.

参数

any – value is acceptable,but 1, 3, 10 is recommended.

返回

-BK_OK: on success -others:real error, used for future.

bk_err_t bk_wifi_get_listen_interval(uint8_t *listen_interval)

Get listen interval.

参数

return – the configure listen interval

返回

-0: not set listen interval -others:return the configure listen interval value.

bk_err_t bk_wifi_send_arp_set_rate_req(uint16_t arp_tx_rate)

Set arp tx rate.

参数

any – value is acceptable,but 1, 6 is recommended.

返回

-BK_OK: on success -others:real error, used for future.

bk_err_t bk_wifi_send_bcn_loss_int_req(uint8_t interval, uint8_t repeat_num)

When beacon loss occurs,use beacon loss interval.

参数
  • interval – any value is acceptable,it is recommended that this value less than listen interval

  • repeat_num – set beacon loss interval number,the minimum value is 1

返回

-BK_OK: on success -others:real error, used for future.

bk_err_t bk_wifi_set_bcn_loss_time(uint8_t wait_cnt, uint8_t wake_cnt)

When beacon loss occurs,use bcn loss time.

@usage example:(10s no beacon frame received(normal reception for the first 5s,ps off for the next 5s),disconnect from the router) DTIM10:wait_cnt = 5,wake_cnt = 50 DTIM1 :wait_cnt = 50,wake_cnt = 50

参数
  • wait_cnt – failed to receive beacon for wait_cnt consecutive cycles, close ps,wait_cnt corresponds to dtimx(listen_interval)

  • wake_cnt – after ps is turned off,the beacon fails to receive for wake_cnt consecutive cycles, disconnect;wake_cnt corresponds to dtim1

返回

-BK_OK: on success -others:real error, used for future.

bk_err_t bk_wifi_set_bcn_miss_time(uint8_t bcnmiss_time)

configure beacon miss time.

bcnmiss_time: bcnmiss_time not receive the beacon,disconnected from the router;unit: second

@usage example:(30s no beacon frame received,disconnect from the router) bcnmiss_time:30

返回

-BK_OK: on success -others:real error, used for future.

bk_err_t bk_wifi_set_bcn_recv_win(uint8_t default_win, uint8_t max_win, uint8_t step)

set beacon receive window.

参数
  • default_win – default beacon receive window(ms),minimum is 5,less than or equal to max_win.

  • max_win – max beacon receive window(ms),maximum is 20.

  • step – increase the beacon reception time by a step value(ms)

返回

-BK_OK: on success -others:real error, used for future.

bk_err_t bk_wifi_get_statistic_info(wifi_statistics_info_t *wifiinfo)

Get wifi statistic info.

参数

get – wifi info from fw

返回

-BK_OK: on success -others:real error, used for future.

void bk_wifi_ota_dtim(bool is_open)

set wifi ps dtim info.

参数

dtim – 1 open or not

返回

-void.

void bk_wifi_set_td_active_percent(uint8_t active_percent)

Set active_percent.

参数

{10ms-100ms} – *

返回

-void.

void bk_wifi_mask_td_active_percent()

mask active_percent

参数

*

void bk_wifi_ap_power_register_cb(FUNC_1PARAM_PTR cb)

register callback to get wifi ap power

参数

callback – interface *

返回

-void.

void bk_wlan_phy_open_cca(void)
void bk_wlan_phy_close_cca(void)
void bk_wlan_phy_show_cca(void)
bk_err_t bk_wifi_ftm_start(const wifi_ftm_config_t *config, wifi_ftm_results_t *ftm_results)

Start a fine timing measurement (FTM)

This API notifies the WiFi driver to start a fine timing measurement, and get the ftm results.

参数
  • config – the configuration of ftm

  • ftm_results – the results of ftm

返回

  • BK_OK: succeed

  • BK_ERR_WIFI_NOT_INIT: WiFi is not initialized

  • BK_ERR_WIFI_STA_NOT_STARTED: the STA is not started, call bk_wifi_sta_start() first.

  • BK_ERR_WIFI_DRIVER: WiFi low level driver has failure.

  • others: other failures.

bk_err_t bk_wifi_ftm_dump_result(const wifi_ftm_results_t *ftm_results)

Dump the ftm results.

Attention

call bk_wifi_ftm_start() first before call bk_wifi_ftm_dump_result.

参数

ftm_results – The ftm result to be dumped.

返回

  • BK_OK: succeed

  • BK_ERR_PARAM: invalid scan result

void bk_wifi_ftm_free_result(wifi_ftm_results_t *ftm_results)

Free the ftm result.

Attention

This API free ftm_results->rsp which allocated in bk_wifi_ftm_start(), it doesn’t free ftm_results. So if ftm_results is allocated by the caller, the caller need to free it.

参数

ftm_results – The ftm result to be freed.

返回

  • BK_OK: always succeed

void bk_wifi_set_pkt_trx_dbg_cfg(uint32_t cfg_bit)

Set Wi-Fi TX/RX debug log configuration.

This API could enable the TX/RX debug log by setting the corresponding debug bit.

Attention

This API is only used for DEBUG Wi-Fi issues according to frame TX/RX, there will be a lot of logs generated after set debug bit and it will have affect on the performance. To capture the whole logs, you should increase the buadrate of UART.

参数

cfg_bit – Please refer to enum wifi_pkt_dbg_bit to get more detail.

返回

  • void: always succeed

void bk_wifi_set_ap_channel(uint8_t channel)

Set Wi-Fi Softap Channel.

This API could be used to change softap operation channel.

@channel The valid channel ID should range from 1-14.

Attention

This API can only be used when softap is enabled and make sure the internal CSA strategy is disabled by calling API bk_feature_close_coexist_csa.

返回

  • void: always succeed

bk_err_t bk_wifi_set_block_bcmc_en(uint8_t config)

Enable Wi-Fi rx block broadcast and multicast frame.

This API could enable Wi-Fi rx block broadcast and multicast frame.

参数

config – block type. 0:WIFI_BCMC_CLOSE 1:WIFI_MC_ON, 2:WIFI_BC_ON, 3:WIFI_BC_MC_ON,

返回

  • void: always succeed

bool bk_wifi_get_block_bcmc_en(void)

Get Wi-Fi rx block broadcast and multicast frame status.

参数

void.

返回

  • enable status

bk_err_t bk_wifi_set_ani_en(bool enable)

Enable Wi-Fi microwave anti-interference policy.

This API could enable Wi-Fi microwave anti-interference policy.

参数

enable.

返回

  • void: always succeed

bool bk_wifi_get_ani_en(void)

Get Wi-Fi microwave anti-interference policy enable status.

参数

void.

返回

  • enable status

int bk_wifi_set_pwr_limit(wifi_tx_pwr_lmt_t *tx_pwr_lmt)

Set Wi-Fi Power Limit.

This API could be used to change max tx power with regulation,ratesection and channel .

Attention

This API can only be used to modify rf max power limit for specific regulation,rate and channel.

参数

tx_pwr_lmt – wifi tx power limit info

返回

  • void: always succeed

bool bk_wifi_get_cal_2g(void)

Get rf cal 2g information.

This API could be used to check rf 2g calibration .

返回

  • true:if rf 2g is calibrated, false: if rf 2g is not calibrated

void bk_wifi_get_noise_floor(uint8_t *noise_floor)

Get noise floor.

参数

noise_floor – store noise floor

返回

  • void: always succeed

bk_err_t bk_wifi_get_tx_stats(uint8_t mode, struct tx_stats_t *tx_stats)

Get tx stats.

    PER calculation formula:  per = (tx_agg_fail + tx_singel_retry)/(tx_agg_total + tx_singel_total*SINGLE_RETRY_CNT)
    - tx_agg_fail/tx_singel_retry/tx_agg_total/tx_singel_total: get from struct tx_stats,
    - SINGLE_RETRY_CNT: get from function bk_wifi_get_data_rty_num();
参数

config – mode. 0:STATION 1:SOFT AP

返回

  • tx_stats:tx statistics

bk_err_t bk_wifi_get_tx_power(wifi_standard standard, float *powerdBm)

Fetch 802.11 TX power by standards.

参数
  • standard – IEEE 80211 standard

  • power – TX power in dBm

返回

  • kNoErr: succeed

  • otherwise: fail

bk_err_t bk_wifi_set_tx_power(wifi_standard standard, float powerdBm)

Update 802.11 TX power by standards.

参数
  • standard – IEEE 80211 standard

  • power – TX power in dBm

返回

  • kNoErr: succeed

  • otherwise: fail

bk_err_t bk_wifi_get_vendor_ie_cb(void *vsie_cb, uint32_t vendor_type)

get probe response and assoc response vendor IE

参数
  • void* – vsie_cb

  • vendor_type

返回

  • kNoErr: succeed

  • otherwise: fail

Header File

Functions

bk_err_t bk_rlk_init(void)

Initialize Raw Link function.

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_rlk_deinit(void)

De-Initialize Raw Link function.

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_rlk_register_recv_cb(bk_rlk_recv_cb_t cb)

Register callback function of receiving Raw Link data.

参数

cb – callback function of receiving Raw Link data

返回

  • BK_OK: succeed

  • BK_ERR_NOT_INIT: Raw Link is not initialized

  • others : other errors

bk_err_t bk_rlk_ungister_recv_cb(void)

Unregister callback function of receiving Raw Link data.

返回

  • BK_OK : succeed

  • BK_ERR_NOT_INIT : Raw Link is not initialized

  • others : other errors

bk_err_t bk_rlk_register_send_cb(bk_rlk_send_cb_t cb)

Register callback function of sending BK RLK data.

参数

cb – callback function of sending BK RLK data for MAC send status

返回

  • BK_OK : succeed

  • BK_ERR_NOT_INIT : Raw Link is not initialized

bk_err_t bk_rlk_unregister_send_cb(void)

Unregister callback function of sending Raw Link data.

返回

  • BK_OK : succeed

  • BK_ERR_NOT_INIT : Raw Link is not initialized

bk_err_t bk_rlk_set_channel(uint8_t chan)

Set BK Raw Link channel.

Attention

1. Currently we only support HT20, chan->second should always be 0.

Attention

2. This API is only used for settting Raw Link channel, NOT for other purpose.

Attention

3. The channel range can be set is from channel 1 to channel 13,

参数

chan – channel of Raw Link

返回

  • BK_OK: succeed

  • others: other errors

bk_err_t bk_rlk_send(const uint8_t *peer_mac_addr, const void *data, size_t len)

Send BK Raw Links data.

Attention

1. If peer_addr is not NULL, send data to the peer whose MAC address matches peer_addr

Attention

2. If peer_addr is NULL, send data to all of the peers that are added to the peer list

参数
  • peer_mac_addr – peer MAC address

  • data – data to send

  • len – length of data

返回

  • BK_OK : succeed

  • BK_ERR_NOT_INIT : Raw Link is not initialized

  • BK_ERR_NO_MEM : out of memory

  • BK_ERR_NOT_FOUND : peer is not found

bk_err_t bk_rlk_send_ex(const uint8_t *peer_mac_addr, const bk_rlk_config_info_t *rlk_tx)

Send Raw Links data.

Attention

1. If peer_addr is not NULL, send data to the peer whose MAC address matches peer_addr

Attention

2. If peer_addr is NULL, send data to all of the peers that are added to the peer list

Attention

3. if set cb is not NULL,cb prototype void (*)(void *, bool) cb has two arguments, first is args, second is tx success flag

参数
  • peer_mac_addr – peer MAC address

  • rlk_tx – configure BK Raw Link sending data information

返回

  • BK_OK : succeed

  • BK_ERR_NOT_INIT : Raw Link is not initialized

  • BK_ERR_NO_MEM : out of memory

  • BK_ERR_NOT_FOUND : peer is not found

bk_err_t bk_rlk_send_by_oui(const uint8_t *peer_mac_addr, const void *data, size_t len, uint8_t mac_type, uint8_t *oui)

Send BK Raw Links data.

Attention

1. If peer_addr is not NULL, send data to the peer whose MAC address matches peer_addr

Attention

2. If peer_addr is NULL, send data to all of the peers that are added to the peer list

参数
  • peer_mac_addr – peer MAC address

  • data – data to send

  • len – length of data

  • mac_type – frame type

  • oui – vendor oui

返回

  • BK_OK : succeed

  • BK_ERR_NOT_INIT : Raw Link is not initialized

  • BK_ERR_NO_MEM : out of memory

  • BK_ERR_NOT_FOUND : peer is not found

bk_err_t bk_rlk_add_peer(const bk_rlk_peer_info_t *peer)

Add a peer to peer list.

参数

peer – peer information

返回

  • BK_OK : succeed

  • BK_ERR_NOT_INIT : Raw Link is not initialized

  • BK_ERR_IS_FALL : peer list is full

  • BK_ERR_NO_MEM : out of memory

  • BK_ERR_IS_EXIST : peer has existed

bk_err_t bk_rlk_del_peer(const uint8_t *peer_mac_addr)

Delete a peer from peer list.

参数

peer_mac_addr – peer MAC address

返回

  • BK_OK : succeed

  • BK_ERR_NOT_INIT : Raw Link is not initialized

  • BK_ERR_NOT_FOUND : peer is not found

bk_err_t bk_rlk_get_peer(const uint8_t *peer_mac_addr, bk_rlk_peer_info_t *peer)

Get a peer whose MAC address matches peer_addr from peer list.

参数
  • peer_mac_addr – peer MAC address

  • peer – peer information

返回

  • BK_OK : succeed

  • BK_ERR_NOT_INIT : Raw Link is not initialized

  • BK_ERR_NOT_FOUND : peer is not found

bk_err_t bk_rlk_is_peer_exist(const uint8_t *peer_mac_addr)

Peer exists or not.

参数

peer_mac_addr – peer MAC address

返回

  • BK_OK : peer exists

  • others : peer not exists

bk_err_t bk_rlk_get_peer_num(uint32_t *total_num)

Get the number of peers.

参数

num – number of peers

返回

  • BK_OK : succeed

  • BK_ERR_RLK_NOT_INIT : Raw Link is not initialized

bk_err_t bk_rlk_set_tx_ac(uint8_t ac)

Set BK Raw Link TX AC.

参数

ac – sending Raw Link data AC

返回

  • BK_OK : succeed

  • others : Set TX AC error

bk_err_t bk_rlk_set_tx_timeout_ms(uint16_t timeout_ms)

Set BK Raw Link TX timeout.

参数

ac – sending Raw Link data timeout

返回

  • BK_OK : succeed

  • others : Set TX timeout error

bk_err_t bk_rlk_set_tx_power(uint32_t power)

Set BK Raw Link TX power.

参数

power – TX power control

返回

  • BK_OK : succeed

  • others : Set TX power error

bk_err_t bk_rlk_set_tx_rate(uint32_t rate)

Set BK Raw Link TX rate.

参数

rate – TX rate control

返回

  • BK_OK : succeed

  • others : Set TX rate error

bk_err_t bk_rlk_set_tx_retry_cnt(uint32_t retry_cnt)

Set BK Raw Link TX retry count.

参数

rate – TX retry count control

返回

  • BK_OK : succeed

  • others : Set TX rate error

bk_err_t bk_rlk_sleep(void)

Let Raw Link goto sleep mode to reduce power consumption.

参数

void

返回

  • BK_OK : succeed

  • others : Raw Link failed to sleep

bk_err_t bk_rlk_wakeup(void)

wakeup Raw Link

参数

void

返回

  • BK_OK : succeed

  • others : Failed to wakeup raw link

bk_err_t bk_rlk_add_white_list(uint8_t mac_type, uint8_t *oui)

Raw Link add white list.

参数
  • mac_type – frame type

  • oui – vendor oui

返回

  • BK_OK : succeed

  • others : Failed to add white list

bk_err_t bk_rlk_del_white_list(uint8_t mac_type, uint8_t *oui)

Raw Link delete white list.

参数
  • mac_type – frame type

  • oui – vendor oui

返回

  • BK_OK : succeed

  • others : Failed to delete white list

Structures

struct bk_rlk_peer_info

BK Raw Link(RLK) peer list context structure.

struct bk_rlk_config_info

BK Raw Link(RLK) configure tx information.

Public Members

uint16_t len

Rx length of BK RLK packet

uint8_t *data

Rx data address of BK RLK packet

bk_rlk_send_ex_cb_t cb

callback of TX,cb has two arguments, first is args, second is tx success flag

void *args

callback arguments

uint32_t tx_rate

TX rate information

uint32_t tx_power

TX power information

uint32_t tx_retry_cnt

TX retry count

struct bk_rlk_recv_info

BK RLK Receive packet information.

Public Members

uint8_t src_addr[RLK_WIFI_MAC_ADDR_LEN]

Source address of BK RLK packet

uint8_t des_addr[RLK_WIFI_MAC_ADDR_LEN]

Destination address of BK RLK packet

int rssi

Rx RSSI of BK RLK packet

uint16_t len

Rx length of BK RLK packet

uint8_t *data

Rx data address of BK RLK packet

Macros

RLK_WIFI_MAC_ADDR_LEN

Type Definitions

typedef struct bk_rlk_peer_info bk_rlk_peer_info_t

BK Raw Link(RLK) peer list context structure.

typedef void (*bk_rlk_send_ex_cb_t)(void *args, bool status)

Callback function of sending BK Raw Link data.

Param args

callback arguments

Param status

status of sending BK Raw Link data (succeed or fail)

typedef struct bk_rlk_config_info bk_rlk_config_info_t

BK Raw Link(RLK) configure tx information.

typedef struct bk_rlk_recv_info bk_rlk_recv_info_t

BK RLK Receive packet information.

typedef bk_err_t (*bk_rlk_recv_cb_t)(bk_rlk_recv_info_t *rx_info)

Callback function of receiving BK Raw Link data.

Attention

bk_rlk_info is a local variable,it can only be used in the callback.

Param rx_info

received BK Raw Link packet information

typedef bk_err_t (*bk_rlk_send_cb_t)(const uint8_t *peer_mac_addr, bk_rlk_send_status_t status)

Callback function of sending BK Raw Link data.

Param peer_mac_addr

peer MAC address

Param status

status of sending BK Raw Link data (succeed or fail)

Enumerations

enum bk_rlk_wifi_if_t

Values:

enumerator WIFI_IF_STA
enumerator WIFI_IF_MAX
enum bk_rlk_send_status_t

Status of sending BK Raw Link data .

Values:

enumerator BK_RLK_SEND_SUCCESS

Send BK Raw Link data successfully

enumerator BK_RLK_SEND_FAIL

Send BK Raw Link data fail

API Typedefs

Header File

Structures

struct wifi_init_config_t

Public Members

uint64_t features

WiFi feature bitmaps

void *os_funcs

WiFi OS functions

void *os_val

WiFI Values

uint8_t reserved[16]

Reserved

struct wifi_channel_t

Public Members

uint8_t primary

Primary channel

wifi_second_channel_t second

Secondary cahnnel

struct bk_vise
struct wifi_sta_config_t

Public Members

char ssid[WIFI_SSID_STR_LEN]

SSID of AP to be connected

uint8_t bssid[WIFI_BSSID_LEN]

BSSID of AP to be connected, fast connect only

uint8_t channel

Primary channel of AP to be connected, fast connect only

wifi_security_t security

Security of AP to be connected

char password[WIFI_PASSWORD_LEN]

Security key or PMK of the wlan.

uint8_t psk[WIFI_PASSWORD_LEN]

PSK of AP

uint8_t ip_addr[4]

IP address

uint8_t netmask[4]

NET address

uint8_t gw[4]

GW address

uint8_t dns1[4]

DNS address

uint8_t is_not_support_auto_fci

is not support auto fast connect

uint8_t is_user_fast_connect

is use user fast connect

uint8_t pmf

is support pmf

uint8_t tk[16]

WPA3 tk key

int auto_reconnect_count

auto reconnect max count, 0 for always reconnect

int auto_reconnect_timeout

auto reconnect timeout in secs, 0 for no timeout

bool disable_auto_reconnect_after_disconnect

disable auto reconnect if deauth/disassoc by AP when in connected state

uint8_t reserved[32]

reserved, must set to 0

struct wifi_linkstate_reason_t

Public Members

wifi_link_state_t state

Wifi linkstate

wifi_err_reason_t reason_code

Wifi disconnect reason code, success will be WIFI_REASON_MAX

Public Members

The WiFi connection status

STA AID

The RSSI of AP the BK STA is connected

SSID of AP the BK STA is connected

BSSID of AP the BK STA is connected

Primary channel of AP the BK STA is connected

Security of AP the BK STA is connected

Passord of AP the BK STA is connected

struct wifi_scan_config_t

Public Members

char ssid[WIFI_SSID_STR_LEN]

SSID to be scaned

u8 scan_type

0: active scan; 1: passive scan

u8 chan_cnt

scan channel cnt

u8 chan_nb[WIFI_2BAND_MAX_CHAN_NUM]

scan channel number 2.4g+5g

u32 duration

scan duration,ms

struct wifi_scan_ap_info_t

Public Members

char ssid[WIFI_SSID_STR_LEN]

SSID of AP found by scan

uint8_t bssid[WIFI_BSSID_LEN]

BSSID of AP found by scan

int rssi

RSSI of AP found by scan

uint8_t channel

The channel of the AP found by scan

wifi_security_t security

The security type of the AP found by scan

uint8_t reserved[16]

Reserved, must be zero

struct wifi_scan_result_t

Public Members

int ap_num

The number of AP found by scan

wifi_scan_ap_info_t *aps

The APs found by scan

struct wifi_ap_config_t

Public Members

char ssid[WIFI_SSID_STR_LEN]

The SSID of BK AP

char password[WIFI_PASSWORD_LEN]

Password of BK AP, ignored in an open system.

uint8_t channel

The channel of BK AP, 0 indicates default TODO

wifi_security_t security

Security type of BK AP, default value TODO

uint8_t hidden

Whether the BK AP is hidden

uint8_t acs

Whether Auto Channel Selection is enabled

uint8_t vsie_len

Beacon/ProbeResp Vendor Specific IE len

uint8_t vsie[255]

Beacon/ProbeResp Vendor Specific IE

uint8_t max_con

Max number of stations allowed to connect to BK AP, TODO default value?

uint8_t reserved[32]

Reserved, must be zero

struct wlan_ap_sta

Wlan station information definition.

struct wlan_ap_stas

Wlan connected stations information definition.

struct wlan_ap_vsie

softap beacon/probe response’s vendor IEs Dynamic change softap’s vendor specific IEs.

struct wlan_sta_vsie

STA vendor IEs for (re)assoc, scan, p2p, p2p go, etc. Dynamic change STA’s vendor specific IEs.

struct wifi_monitor_config_t

Public Members

uint32_t rx_mcast_frame

Set this bit to enable callback to receive multicast/broadcast

uint32_t rx_dup_frame

Set this bit to enable callback to receive the duplicated

uint32_t reserved

Reserved bits, must set to 0

struct wifi_frame_info_t

Public Members

int rssi

RSSI of the received frame in monitor mode

struct wifi_filter_config_t

Public Members

uint32_t rx_all_default_mgmt

Set the bit to enable the callback to receive all management frame recived by WiFi driver

uint32_t rx_probe_req

Set the bit to enable the callback to receive probe request

uint32_t rx_probe_rsp

Set the bit to enable the callback to receive probe response

uint32_t rx_all_beacon

Set the bit to enable the callback to receive all beacon

uint32_t rx_action

Set the bit to enable the callback to receive action frame

uint32_t reserved

Reserved bits, must set to 0

struct wifi_country_t

Public Members

char cc[3]

country code string

uint8_t schan

start channel

uint8_t nchan

total channel number

int8_t max_tx_power

maximum tx power

wifi_country_policy_t policy

country policy

struct wifi_event_scan_done_t

Public Members

uint32_t scan_id

Scan ID

uint32_t scan_use_time

scan time. us

struct wifi_event_network_found_t

Public Members

char ssid[WIFI_SSID_STR_LEN]

SSID found to be connected

uint8_t bssid[WIFI_BSSID_LEN]

BSSID found to be connected

struct wifi_event_sta_connected_t

Public Members

char ssid[WIFI_SSID_STR_LEN]

SSID of connected AP

uint8_t bssid[WIFI_BSSID_LEN]

BSSID of connected AP

struct wifi_event_sta_disconnected_t

Public Members

int disconnect_reason

Disconnect reason of BK STA

bool local_generated

if disconnect is request by local

struct wifi_event_ap_connected_t

Public Members

uint8_t mac[WIFI_MAC_LEN]

MAC of the STA connected to the BK AP

struct wifi_event_ap_disconnected_t

Public Members

uint8_t mac[WIFI_MAC_LEN]

MAC of the STA disconnected from the BK AP

struct wifi_statistics_info_t

Wi-Fi Statistic info.

Public Members

uint32_t tx_success_count

Number of TX successes, 0 if unavailable

uint32_t tx_retry_count

Number of TX retries, 0 if unavailable

uint32_t tx_fail_count

Number of TX failures, 0 if unavailable

uint32_t rx_success_count

Number of RX successes, 0 if unavailable

uint32_t rx_crcerror_count

Number of RX FCS errors, 0 if unavailable

uint32_t mic_error_count

Number of MIC errors, 0 if unavailable

int8_t noise

Average noise level in dBm, -128 if unavailable

uint16_t phyrate

Maximum used PHY rate, 0 if unavailable

uint16_t txrate

Average used TX rate, 0 if unavailable

uint16_t rxrate

Average used RX rate, 0 if unavailable

int8_t rssi

Average beacon RSSI in dBm, -128 if unavailable

uint8_t bandwidth

Average used bandwidth, 0 if unavailable

uint8_t idle_time_per

Percent of idle time, 0 if unavailable

struct raw_tx_cntrl_t

Wi-Fi RAW TX control.

Public Members

uint32_t tx_rate

RAW Data TX rate information

uint32_t tx_power

RAW Data TX power information

uint32_t tx_retry_cnt

RAW Data TX retry count

struct wifi_raw_tx_info_t

Wi-Fi RAW TX control.

Public Members

uint8_t *pkt

RAW data tx packet address

int len

RAW data tx packet length

int type

Raw data tx packet type length

raw_tx_cntrl_t tx_cntrl

RAW data tx control information

struct wifi_ftm_config_t

FTM configuration and results.

Wi-Fi fine timing measurement configuration.

Public Members

uint8_t ftm_per_burst

Number of FTMs per Burst

uint8_t nb_ftm_rsp

Number of FTM responders on which we do the measurements

struct wifi_ftm_rsp_info_t

Wi-Fi fine timing measurement results.

Public Members

uint8_t bssid[WIFI_BSSID_LEN]

MAC Address of the FTM responder

uint32_t rtt

Round Trip Time (in ns)

float distance

Distance (in m)

struct wifi_ftm_results_t

Public Members

uint8_t nb_ftm_rsp

Number of FTM responders for which we have a measurement

wifi_ftm_rsp_info_t *rsp

Per-responder measurements

struct wifi_pkt_rx_ctrl_t

CSI configuration and results.

Wi-Fi Channel State Information configuration and results.

Public Members

uint32_t tsfhi

TSF High.

uint32_t tsflo

TSF Low.

struct wifi_csi_info_t

Public Members

wifi_pkt_rx_ctrl_t rx_ctrl

rx packet ctrl

uint8_t mac[WIFI_MAC_LEN]

MAC Address of the CSI info receive

uint16_t len

The length of CSI info

uint32_t buf[240]

CSI info

struct tx_stats_t

Wi-Fi tx statistics.

Public Members

uint32_t tx_singel_total

tx single mpdu total count

uint32_t tx_singel_retry

tx single mpdu retry count

uint32_t tx_agg_total

tx mpdu of ampdu total count

uint32_t tx_agg_fail

tx mpdu of ampdu fail count

struct wifi_tx_pwr_lmt_t

Public Members

wifi_regulation_t regulation

region regulation 0 REGUALTION_NULL 1 REGUALTION_FCC 2 REGUALTION_ETSI 3 REGUALTION_JP 4 REGUALTION_EXT

wifi_ratesection_t ratesection

ratesection 0 RATE_NULL 1 RATE_CCK 2 RATE_OFDM 3 RATE_HT 4 RATE_VHT 5 RATE_HE

uint8_t channel

channel range from 1-14

uint8_t value

value max tx power

Macros

BK_ERR_WIFI_NOT_INIT

WiFi is not initialized, call bk_wifi_init() to init the WiFi

BK_ERR_WIFI_STA_NOT_STARTED

STA is not started, call bk_wifi_sta_start() to start the STA

BK_ERR_WIFI_AP_NOT_STARTED

AP is not initialized, call bk_wifi_ap_start() to start the AP

BK_ERR_WIFI_CHAN_RANGE

Invalid channel range

BK_ERR_WIFI_COUNTRY_POLICY

Invalid country policy

BK_ERR_WIFI_RESERVED_FIELD

Reserved fields not 0

BK_ERR_WIFI_MONITOR_IP

Monitor is in progress

BK_ERR_WIFI_STA_NOT_CONFIG

STA is not configured, call bk_wifi_sta_config() to configure it

BK_ERR_WIFI_AP_NOT_CONFIG

AP is not configured, call bk_wifi_ap_config() to configure it

BK_ERR_WIFI_DRIVER

Internal WiFi driver error

BK_ERR_WIFI_MONITOR_ENTER

WiFi failed to enter monitor mode

BK_ERR_WIFI_DRIVER_DEL_VIF

WiFi driver failed to delete WiFi virtual interface

BK_ERR_WIFI_DRIVER_AP_START

WiFi driver failed to start BK AP

BK_ERR_WIFI_CHAN_NUMBER

Invalid channel number

WIFI_MIN_CHAN_NUM

Minimum supported channel number

WIFI_MAX_CHAN_NUM

Maximum supported channel number

WIFI_MAX_SCAN_CHAN_DUR

scan duration param, need less than 200ms

WIFI_CHANNEL_NUM_2G4

Maximum supported 2.4G channel number

WIFI_CHANNEL_NUM_5G

Maximum supported 5G channel numbe

WIFI_2BAND_MAX_CHAN_NUM
WIFI_SSID_STR_LEN

Maximum NULL-terminated WiFi SSID length

WIFI_BSSID_LEN

Length of BSSID

WIFI_MAC_LEN

Length of MAC

WIFI_PASSWORD_LEN

Maximum NULL-terminated WiFi password length

WIFI_DEFAULT_INIT_CONFIG()

default init configuration

WIFI_DEFAULT_STA_CONFIG()

default STA configuration

WIFI_DEFAULT_AP_CONFIG()

default AP configuration

WIFI_DEFAULT_SCAN_CONFIG()

default Scan configuration

WIFI_DEFAULT_FILTER_CONFIG()

default Filter configuration

WIFI_DEFAULT_FTM_CONFIG()

default FTM configuration

BK_MAX_STA_TYPE
OUI_BEKEN
WLAN_EID_VENDOR_SPECIFIC

Type Definitions

typedef enum sta_type BK_STA_TYPE
typedef struct wlan_ap_sta wlan_ap_sta_t

Wlan station information definition.

typedef struct wlan_ap_stas wlan_ap_stas_t

Wlan connected stations information definition.

typedef struct wlan_ap_vsie wlan_ap_vsie_t

softap beacon/probe response’s vendor IEs Dynamic change softap’s vendor specific IEs.

typedef struct wlan_sta_vsie wlan_sta_vsie_t

STA vendor IEs for (re)assoc, scan, p2p, p2p go, etc. Dynamic change STA’s vendor specific IEs.

typedef bk_err_t (*wifi_monitor_cb_t)(const uint8_t *frame, uint32_t len, const wifi_frame_info_t *frame_info)

Monitor callback to receive frames relayed by WiFi driver.

Attention

1. The memory of frame and frame_info will be freed immediately when the callback is returned. If we want to use the frame or frame_info in other task, make a copy of them and handle them accordingly.

Attention

2. Don’t do too much work in the callback because the callback is called in context of WiFi core thread, too much work may impact the performance of WiFi.

typedef bk_err_t (*wifi_filter_cb_t)(const uint8_t *frame, uint32_t len, const wifi_frame_info_t *frame_info)

Filter callback to receive frames relayed by WiFi driver.

Attention

1. The memory of frame and frame_info will be freed immediately when the callback is returned. If we want to use the frame or frame_info in other task, make a copy of them and handle them accordingly.

Attention

2. Don’t do too much work in the callback because the callback is called in context of WiFi core thread, too much work may impact the performance of WiFi.

typedef void (*wifi_csi_cb_t)(wifi_csi_info_t **info, uint8_t flag)
typedef bk_err_t (*wifi_get_vsie_cb_t)(void *vendor_ie, uint8_t frame_type)

wifi get vsie cb interface

Param void*

vendor_ie

Param frame

type 1: probe response(or beacon) 2: assoc response

Enumerations

enum wifi_band_t

enum ieee80211_band - supported frequency bands

The bands are assigned this way because the supported bitrates differ in these bands.

@IEEE80211_BAND_2GHZ: 2.4GHz ISM band @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7) @IEEE80211_BAND_6GHZ: around 6GHz band (5.925-7.125) @IEEE80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz) @IEEE80211_NUM_BANDS: number of defined bands

Values:

enumerator IEEE80211_BAND_2GHZ
enumerator IEEE80211_BAND_5GHZ
enumerator IEEE80211_BAND_6GHZ
enumerator IEEE80211_BAND_60GHZ
enumerator IEEE80211_NUM_BANDS
enum wifi_event_t

WiFi public event type.

Values:

enumerator EVENT_WIFI_SCAN_DONE

WiFi scan done event

enumerator EVENT_WIFI_STA_CONNECTED

The BK STA is connected

enumerator EVENT_WIFI_STA_DISCONNECTED

The BK STA is disconnected

enumerator EVENT_WIFI_AP_CONNECTED

A STA is connected to the BK AP

enumerator EVENT_WIFI_AP_DISCONNECTED

A STA is disconnected from the BK AP

enumerator EVENT_WIFI_NETWORK_FOUND

The BK STA find target AP

enumerator EVENT_WIFI_COUNT

WiFi event count

enum wifi_err_reason_t

Values:

enumerator WIFI_REASON_RESERVED
enumerator WIFI_REASON_UNSPECIFIED
enumerator WIFI_REASON_PREV_AUTH_NOT_VALID
enumerator WIFI_REASON_DEAUTH_LEAVING
enumerator WIFI_REASON_DISASSOC_DUE_TO_INACTIVITY
enumerator WIFI_REASON_DISASSOC_AP_BUSY
enumerator WIFI_REASON_CLASS2_FRAME_FROM_NONAUTH_STA
enumerator WIFI_REASON_CLASS3_FRAME_FROM_NONASSOC_STA
enumerator WIFI_REASON_DISASSOC_STA_HAS_LEFT
enumerator WIFI_REASON_STA_REQ_ASSOC_WITHOUT_AUTH
enumerator WIFI_REASON_PWR_CAPABILITY_NOT_VALID
enumerator WIFI_REASON_SUPPORTED_CHANNEL_NOT_VALID
enumerator WIFI_REASON_BSS_TRANSITION_DISASSOC
enumerator WIFI_REASON_INVALID_IE
enumerator WIFI_REASON_MICHAEL_MIC_FAILURE
enumerator WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT
enumerator WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT
enumerator WIFI_REASON_IE_IN_4WAY_DIFFERS
enumerator WIFI_REASON_GROUP_CIPHER_NOT_VALID
enumerator WIFI_REASON_PAIRWISE_CIPHER_NOT_VALID
enumerator WIFI_REASON_AKMP_NOT_VALID
enumerator WIFI_REASON_UNSUPPORTED_RSN_IE_VERSION
enumerator WIFI_REASON_INVALID_RSN_IE_CAPAB
enumerator WIFI_REASON_IEEE_802_1X_AUTH_FAILED
enumerator WIFI_REASON_CIPHER_SUITE_REJECTED
enumerator WIFI_REASON_TDLS_TEARDOWN_UNREACHABLE
enumerator WIFI_REASON_TDLS_TEARDOWN_UNSPECIFIED
enumerator WIFI_REASON_SSP_REQUESTED_DISASSOC
enumerator WIFI_REASON_NO_SSP_ROAMING_AGREEMENT
enumerator WIFI_REASON_BAD_CIPHER_OR_AKM
enumerator WIFI_REASON_NOT_AUTHORIZED_THIS_LOCATION
enumerator WIFI_REASON_SERVICE_CHANGE_PRECLUDES_TS
enumerator WIFI_REASON_UNSPECIFIED_QOS_REASON
enumerator WIFI_REASON_NOT_ENOUGH_BANDWIDTH
enumerator WIFI_REASON_DISASSOC_LOW_ACK
enumerator WIFI_REASON_EXCEEDED_TXOP
enumerator WIFI_REASON_STA_LEAVING
enumerator WIFI_REASON_END_TS_BA_DLS
enumerator WIFI_REASON_UNKNOWN_TS_BA
enumerator WIFI_REASON_TIMEOUT
enumerator WIFI_REASON_PEERKEY_MISMATCH
enumerator WIFI_REASON_AUTHORIZED_ACCESS_LIMIT_REACHED
enumerator WIFI_REASON_EXTERNAL_SERVICE_REQUIREMENTS
enumerator WIFI_REASON_INVALID_FT_ACTION_FRAME_COUNT
enumerator WIFI_REASON_INVALID_PMKID
enumerator WIFI_REASON_INVALID_MDE
enumerator WIFI_REASON_INVALID_FTE
enumerator WIFI_REASON_MESH_PEERING_CANCELLED
enumerator WIFI_REASON_MESH_MAX_PEERS
enumerator WIFI_REASON_MESH_CONFIG_POLICY_VIOLATION
enumerator WIFI_REASON_MESH_CLOSE_RCVD
enumerator WIFI_REASON_MESH_MAX_RETRIES
enumerator WIFI_REASON_MESH_CONFIRM_TIMEOUT
enumerator WIFI_REASON_MESH_INVALID_GTK
enumerator WIFI_REASON_MESH_INCONSISTENT_PARAMS
enumerator WIFI_REASON_MESH_INVALID_SECURITY_CAP
enumerator WIFI_REASON_MESH_PATH_ERROR_NO_PROXY_INFO
enumerator WIFI_REASON_MESH_PATH_ERROR_NO_FORWARDING_INFO
enumerator WIFI_REASON_MESH_PATH_ERROR_DEST_UNREACHABLE
enumerator WIFI_REASON_MAC_ADDRESS_ALREADY_EXISTS_IN_MBSS
enumerator WIFI_REASON_MESH_CHANNEL_SWITCH_REGULATORY_REQ
enumerator WIFI_REASON_MESH_CHANNEL_SWITCH_UNSPECIFIED
enumerator WIFI_REASON_BEACON_LOST

The BK STA can’t detect the beacon of the connected AP

enumerator WIFI_REASON_NO_AP_FOUND

Can’t find the target AP

enumerator WIFI_REASON_WRONG_PASSWORD

The password is wrong

enumerator WIFI_REASON_DISCONNECT_BY_APP

The BK STA disconnected by application

enumerator WIFI_REASON_DHCP_TIMEOUT

The BK STA dhcp timeout, 20s

enumerator WIFI_REASON_MAX

The BK STA connect success

enum wifi_security_t

Values:

enumerator WIFI_SECURITY_NONE

Open system.

enumerator WIFI_SECURITY_WEP

WEP security, it’s unsafe security, please don’t use it

enumerator WIFI_SECURITY_WPA_TKIP

WPA TKIP

enumerator WIFI_SECURITY_WPA_AES

WPA AES

enumerator WIFI_SECURITY_WPA_MIXED

WPA AES or TKIP

enumerator WIFI_SECURITY_WPA2_TKIP

WPA2 TKIP

enumerator WIFI_SECURITY_WPA2_AES

WPA2 AES

enumerator WIFI_SECURITY_WPA2_MIXED

WPA2 AES or TKIP

enumerator WIFI_SECURITY_WPA3_SAE

WPA3 SAE

enumerator WIFI_SECURITY_WPA3_WPA2_MIXED

WPA3 SAE or WPA2 AES

enumerator WIFI_SECURITY_EAP

EAP

enumerator WIFI_SECURITY_OWE

OWE

enumerator WIFI_SECURITY_AUTO

WiFi automatically detect the security type

enumerator WIFI_SECURITY_TYPE_WAPI_PSK
enumerator WIFI_SECURITY_TYPE_WAPI_CERT
enumerator WIFI_SECURITY_TYPE_WAPI_UNKNOWN

Values:

sta mode is idle

sta mode is connecting

sta mode is disconnected

sta mode is connected

sta mode is connec fail

sta mode got ip

softap mode, a client association success

softap mode, a client disconnect

softap mode, a client association failed

reserved

enum wifi_country_policy_t

Values:

enumerator WIFI_COUNTRY_POLICY_AUTO

Country policy is auto, use the country info of AP to which the station is connected

enumerator WIFI_COUNTRY_POLICY_MANUAL

Country policy is manual, always use the configured country info

enum wifi_second_channel_t

Values:

enumerator WIFI_SECOND_CHANNEL_NONE

HT20 mode, no secondary channel

enumerator WIFI_SECOND_CHANNEL_ABOVE

Second channel is above the primary channel

enumerator WIFI_SECOND_CHANNEL_BELOW

Second channel is below the primary channel

enum wifi_regulation_t

Values:

enumerator WIFI_REGU_NULL
enumerator WIFI_REGU_FCC
enumerator WIFI_REGU_ETSI
enumerator WIFI_REGU_MKK
enumerator WIFI_REGU_EXT
enum wifi_ratesection_t

Values:

enumerator WIFI_RS_NULL
enumerator WIFI_RS_CCK
enumerator WIFI_RS_OFDM
enumerator WIFI_RS_HT
enumerator WIFI_RS_VHT
enumerator WIFI_RS_HE
enum wifi_tx_raw_pkt_t

Values:

enumerator WIFI_TX_RAW_DATA

Wi-Fi tx raw data

enumerator WIFI_TX_RAW_SPECIAL_DATTA

Wi-Fi tx raw speacial data

enum wifi_capability_t

WiFi capability interface ID.

Values:

enumerator WIFI_CAPA_ID_ERP_EN

Update Wi-Fi 11g support capability

enumerator WIFI_CAPA_ID_HT_EN

Update Wi-Fi 11n support capability

enumerator WIFI_CAPA_ID_VHT_EN

Update Wi-Fi 11ac support capability

enumerator WIFI_CAPA_ID_HE_EN

Update Wi-Fi 11ax support capability

enumerator WIFI_CAPA_ID_TX_AMPDU_EN

Update Wi-Fi TX AMPDU support capability

enumerator WIFI_CAPA_ID_RX_AMPDU_EN

Update Wi-Fi RX AMPDU support capability

enumerator WIFI_CAPA_ID_TX_AMPDU_NUM

Update Wi-Fi TX AMPDU maximum number

enumerator WIFI_CAPA_ID_RX_AMPDU_NUM

Update Wi-Fi RX AMPDU maximum number

enumerator WIFI_CAPA_ID_VHT_MCS

Update Wi-Fi VHT MCS

enumerator WIFI_CAPA_ID_HE_MCS

Update Wi-Fi HE MCS

enumerator WIFI_CAPA_ID_B40_EN

Update Wi-Fi 40M bandwidth support capability

enumerator WIFI_CAPA_ID_STBC_EN

Update Wi-Fi STBC support capability

enumerator WIFI_CAPA_ID_SGI_EN

Update Wi-Fi Short GI support capability

enumerator WIFI_CAPA_ID_LDPC_EN

Update Wi-Fi LDPC support capability

enumerator WIFI_CAPA_ID_BEAMFORMEE_EN

Update Wi-Fi Beamforming support capability

enumerator WIFI_CAPA_ID_11B_ONLY_EN

Update Wi-Fi 11b support capability

enumerator WIFI_CAPA_ID_MAX
enum wifi_vht_mcs_support_t

enum wifi_vht_mcs_support_t - VHT MCS support definitions @WIFI_VHT_MCS_SUPPORT_0_7: MCSes 0-7 are supported for the number of streams @WIFI_VHT_MCS_SUPPORT_0_8: MCSes 0-8 are supported @WIFI_VHT_MCS_SUPPORT_0_9: MCSes 0-9 are supported @WIFI_VHT_MCS_NOT_SUPPORTED: This number of streams isn’t supported

Values:

enumerator WIFI_VHT_MCS_SUPPORT_0_7
enumerator WIFI_VHT_MCS_SUPPORT_0_8
enumerator WIFI_VHT_MCS_SUPPORT_0_9
enumerator WIFI_VHT_MCS_NOT_SUPPORTED
enum wifi_he_mcs_support_t

enum wifi_he_mcs_support_t - HE MCS support definitions @WIFI_HE_MCS_SUPPORT_0_7: MCSes 0-7 are supported for the number of streams @WIFI_HE_MCS_SUPPORT_0_9: MCSes 0-9 are supported @WIFI_HE_MCS_SUPPORT_0_11: MCSes 0-11 are supported @WIFI_HE_MCS_NOT_SUPPORTED: This number of streams isn’t supported

Values:

enumerator WIFI_HE_MCS_SUPPORT_0_7
enumerator WIFI_HE_MCS_SUPPORT_0_9
enumerator WIFI_HE_MCS_SUPPORT_0_11
enumerator WIFI_HE_MCS_NOT_SUPPORTED
enum wifi_video_quality_t

enum wifi_video_quality_t - video quality definitions @WIFI_VIDEO_QUALITY_FD: video quality choose Fluent definition(FD) @WIFI_VIDEO_QUALITY_SD: video quality choose Standard definition(SD) @WIFI_VIDEO_QUALITY_HD: video quality choose High definition(HD)

Values:

enumerator WIFI_VIDEO_QUALITY_FD
enumerator WIFI_VIDEO_QUALITY_SD
enumerator WIFI_VIDEO_QUALITY_HD
enum wifi_sta_vsie

Values:

enumerator WIFI_VENDOR_ELEM_ASSOC_REQ
enumerator WIFI_VENDOR_ELEM_PROBE_REQ
enumerator NUM_WIFI_VENDOR_ELEM_FRAMES
enum wifi_pkt_dbg_bit

Values:

enumerator WIFI_TX_DBG_LOG_DATA_PKT
enumerator WIFI_TX_DBG_LOG_MGMT_PKT
enumerator WIFI_TX_DBG_LOG_PUSH_PKT
enumerator WIFI_RX_DBG_LOG_DATA_PKT
enumerator WIFI_RX_DBG_LOG_MGMT_PKT
enum sta_type

Values:

enumerator STA_TYPE1
enumerator STA_TYPE2
enumerator STA_TYPE3
enumerator STA_TYPE4
enumerator MAX_STA_TYPE
enum [anonymous]

BC/MC Filter.

Values:

enumerator WIFI_BCMC_CLOSE
enumerator WIFI_MC_ON
enumerator WIFI_BC_ON
enumerator WIFI_BC_MC_ON
enum wifi_standard

IEEE 802.11 Standards.

Values:

enumerator WIFI_STANDARD_NONE
enumerator WIFI_STANDARD_11A
enumerator WIFI_STANDARD_11B
enumerator WIFI_STANDARD_11G
enumerator WIFI_STANDARD_11N
enumerator WIFI_STANDARD_11AC
enumerator WIFI_STANDARD_11AX
enumerator WIFI_STANDARD_MAX