qcacld-3.0: Add support for action OUI extensions
Add support for action OUI extensions which can be used by station to control mode of connection, connected AP's in-activity time and Tx rate etc., Change-Id: Ie85e29c4b0ed7ac2815709d7a4e607c4ba46c6ca CRs-Fixed: 2254502
このコミットが含まれているのは:
@@ -0,0 +1,197 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: Declare structs and macros which can be accessed by various
|
||||
* components and modules.
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_ACTION_OUI_PUBLIC_STRUCT_H_
|
||||
#define _WLAN_ACTION_OUI_PUBLIC_STRUCT_H_
|
||||
|
||||
#include <wlan_cmn.h>
|
||||
#include <qdf_status.h>
|
||||
#include <qdf_types.h>
|
||||
|
||||
/*
|
||||
* Maximum ini string length of actions oui extensions,
|
||||
* (n * 83) + (n - 1) spaces + 1 (terminating character),
|
||||
* where n is the no of oui extensions
|
||||
* currently, max no of oui extensions is 10
|
||||
*/
|
||||
#define ACTION_OUI_MAX_STR_LEN 840
|
||||
|
||||
/*
|
||||
* Maximum number of action oui extensions supported in
|
||||
* each action oui category
|
||||
*/
|
||||
#define ACTION_OUI_MAX_EXTENSIONS 10
|
||||
|
||||
#define ACTION_OUI_MAX_OUI_LENGTH 5
|
||||
#define ACTION_OUI_MAX_DATA_LENGTH 20
|
||||
#define ACTION_OUI_MAX_DATA_MASK_LENGTH 3
|
||||
#define ACTION_OUI_MAC_MASK_LENGTH 1
|
||||
#define ACTION_OUI_MAX_CAPABILITY_LENGTH 1
|
||||
|
||||
/*
|
||||
* NSS Mask and NSS Offset to extract NSS info from
|
||||
* capability field of action oui extension
|
||||
*/
|
||||
#define ACTION_OUI_CAPABILITY_NSS_MASK 0x0f
|
||||
#define ACTION_OUI_CAPABILITY_NSS_OFFSET 0
|
||||
#define ACTION_OUI_CAPABILITY_NSS_MASK_1X1 1
|
||||
#define ACTION_OUI_CAPABILITY_NSS_MASK_2X2 2
|
||||
#define ACTION_OUI_CAPABILITY_NSS_MASK_3X3 4
|
||||
#define ACTION_OUI_CAPABILITY_NSS_MASK_4X4 8
|
||||
|
||||
/*
|
||||
* Mask and offset to extract HT and VHT info from
|
||||
* capability field of action oui extension
|
||||
*/
|
||||
#define ACTION_OUI_CAPABILITY_HT_ENABLE_MASK 0x10
|
||||
#define ACTION_OUI_CAPABILITY_HT_ENABLE_OFFSET 4
|
||||
#define ACTION_OUI_CAPABILITY_VHT_ENABLE_MASK 0x20
|
||||
#define ACTION_OUI_CAPABILITY_VHT_ENABLE_OFFSET 5
|
||||
|
||||
/*
|
||||
* Mask and offset to extract Band (2G and 5G) info from
|
||||
* capability field of action oui extension
|
||||
*/
|
||||
#define ACTION_OUI_CAPABILITY_BAND_MASK 0xC0
|
||||
#define ACTION_OUI_CAPABILITY_BAND_OFFSET 6
|
||||
#define ACTION_OUI_CAPABILITY_2G_BAND_MASK 0x40
|
||||
#define ACTION_OUI_CAPABILITY_2G_BAND_OFFSET 6
|
||||
#define ACTION_CAPABILITY_5G_BAND_MASK 0x80
|
||||
#define ACTION_CAPABILITY_5G_BAND_OFFSET 7
|
||||
|
||||
/**
|
||||
* enum action_oui_id - to identify type of action oui
|
||||
* @ACTION_OUI_CONNECT_1X1: for 1x1 connection only
|
||||
* @ACTION_OUI_ITO_EXTENSION: for extending inactivity time of station
|
||||
* @ACTION_OUI_CCKM_1X1: for TX with CCKM 1x1 only
|
||||
* @ACTION_OUI_MAXIMUM_ID: maximun number of action oui types
|
||||
*/
|
||||
enum action_oui_id {
|
||||
ACTION_OUI_CONNECT_1X1 = 0,
|
||||
ACTION_OUI_ITO_EXTENSION = 1,
|
||||
ACTION_OUI_CCKM_1X1 = 2,
|
||||
ACTION_OUI_ITO_ALTERNATE = 3,
|
||||
ACTION_OUI_SWITCH_TO_11N_MODE = 4,
|
||||
ACTION_OUI_MAXIMUM_ID
|
||||
};
|
||||
|
||||
/**
|
||||
* enum action_oui_info - to indicate presence of various action OUI
|
||||
* fields in action oui extension, following identifiers are to be set in
|
||||
* the info mask field of action oui extension
|
||||
* @ACTION_OUI_INFO_OUI: to indicate presence of OUI string
|
||||
* @ACTION_OUI_INFO_MAC_ADDRESS: to indicate presence of mac address
|
||||
* @ACTION_OUI_INFO_AP_CAPABILITY_NSS: to indicate presence of nss info
|
||||
* @ACTION_OUI_INFO_AP_CAPABILITY_HT: to indicate presence of HT cap
|
||||
* @ACTION_OUI_INFO_AP_CAPABILITY_VHT: to indicate presence of VHT cap
|
||||
* @ACTION_OUI_INFO_AP_CAPABILITY_BAND: to indicate presence of band info
|
||||
*/
|
||||
enum action_oui_info {
|
||||
/*
|
||||
* OUI centric parsing, expect OUI in each action OUI extension,
|
||||
* hence, ACTION_OUI_INFO_OUI is dummy
|
||||
*/
|
||||
ACTION_OUI_INFO_OUI = 1 << 0,
|
||||
ACTION_OUI_INFO_MAC_ADDRESS = 1 << 1,
|
||||
ACTION_OUI_INFO_AP_CAPABILITY_NSS = 1 << 2,
|
||||
ACTION_OUI_INFO_AP_CAPABILITY_HT = 1 << 3,
|
||||
ACTION_OUI_INFO_AP_CAPABILITY_VHT = 1 << 4,
|
||||
ACTION_OUI_INFO_AP_CAPABILITY_BAND = 1 << 5,
|
||||
};
|
||||
|
||||
/* Total mask of all enum action_oui_info IDs */
|
||||
#define ACTION_OUI_INFO_MASK 0x3F
|
||||
|
||||
/**
|
||||
* struct action_oui_extension - action oui extension contents
|
||||
* @info_mask: info mask
|
||||
* @oui_length: length of the oui, either 3 or 5 bytes
|
||||
* @data_length: length of the oui data
|
||||
* @data_mask_length: length of the data mask
|
||||
* @mac_addr_length: length of the mac addr
|
||||
* @mac_mask_length: length of the mac mask
|
||||
* @capability_length: length of the capability
|
||||
* @oui: oui value
|
||||
* @data: data buffer
|
||||
* @data_mask: data mask buffer
|
||||
* @mac_addr: mac addr
|
||||
* @mac_mask: mac mask
|
||||
* @capability: capability buffer
|
||||
*/
|
||||
struct action_oui_extension {
|
||||
uint32_t info_mask;
|
||||
uint32_t oui_length;
|
||||
uint32_t data_length;
|
||||
uint32_t data_mask_length;
|
||||
uint32_t mac_addr_length;
|
||||
uint32_t mac_mask_length;
|
||||
uint32_t capability_length;
|
||||
uint8_t oui[ACTION_OUI_MAX_OUI_LENGTH];
|
||||
uint8_t data[ACTION_OUI_MAX_DATA_LENGTH];
|
||||
uint8_t data_mask[ACTION_OUI_MAX_DATA_MASK_LENGTH];
|
||||
uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
|
||||
uint8_t mac_mask[ACTION_OUI_MAC_MASK_LENGTH];
|
||||
uint8_t capability[ACTION_OUI_MAX_CAPABILITY_LENGTH];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct action_oui_request - Contains specific action oui information
|
||||
* @action_id: type of action from enum action_oui_info
|
||||
* @no_oui_extensions: number of action oui extensions of type @action_id
|
||||
* @total_no_oui_extensions: total no of oui extensions from all
|
||||
* action oui types, this is just a total count needed by firmware
|
||||
* @extension: pointer to zero length array, to indicate this structure is
|
||||
* followed by a array of @no_oui_extensions structures of
|
||||
* type struct action_oui_extension
|
||||
*/
|
||||
struct action_oui_request {
|
||||
enum action_oui_id action_id;
|
||||
uint32_t no_oui_extensions;
|
||||
uint32_t total_no_oui_extensions;
|
||||
struct action_oui_extension extension[0];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct action_oui_search_attr - Used to check against action_oui ini input
|
||||
*
|
||||
* @ie_data: beacon ie data
|
||||
* @ie_length: length of ie data
|
||||
* @mac_addr: bssid of access point
|
||||
* @nss: AP spatial stream info
|
||||
* @ht_cap: Whether AP is HT capable
|
||||
* @vht_cap: Whether AP is VHT capable
|
||||
* @enable_2g: Whether 2.4GHz band is enabled in AP
|
||||
* @enable_5g: Whether 5GHz band is enabled in AP
|
||||
*/
|
||||
struct action_oui_search_attr {
|
||||
uint8_t *ie_data;
|
||||
uint32_t ie_length;
|
||||
uint8_t *mac_addr;
|
||||
uint32_t nss;
|
||||
bool ht_cap;
|
||||
bool vht_cap;
|
||||
bool enable_2g;
|
||||
bool enable_5g;
|
||||
};
|
||||
|
||||
#endif /* _WLAN_ACTION_OUI_PUBLIC_STRUCT_H_ */
|
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright (c) 2018 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: Declare public API for action_oui to interact with target/WMI
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_ACTION_OUI_TGT_API_H_
|
||||
#define _WLAN_ACTION_OUI_TGT_API_H_
|
||||
|
||||
#include "wlan_action_oui_public_struct.h"
|
||||
#include "wlan_action_oui_objmgr.h"
|
||||
|
||||
#define GET_ACTION_OUI_TX_OPS_FROM_PSOC(psoc) \
|
||||
(&action_oui_psoc_get_priv(psoc)->tx_ops)
|
||||
|
||||
/**
|
||||
* tgt_action_oui_send() - Send request to target if
|
||||
* @psoc: objmgr psoc object
|
||||
* @req: action_oui request to be send
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS tgt_action_oui_send(struct wlan_objmgr_psoc *psoc,
|
||||
struct action_oui_request *req);
|
||||
|
||||
/**
|
||||
* struct action_oui_tx_ops - structure of tx operations
|
||||
* @send_req: Pointer to hold target_if send function
|
||||
*/
|
||||
struct action_oui_tx_ops {
|
||||
QDF_STATUS (*send_req)(struct wlan_objmgr_psoc *psoc,
|
||||
struct action_oui_request *req);
|
||||
};
|
||||
|
||||
#endif /* _WLAN_ACTION_OUI_TGT_API_H_ */
|
210
action_oui/dispatcher/inc/wlan_action_oui_ucfg_api.h
ノーマルファイル
210
action_oui/dispatcher/inc/wlan_action_oui_ucfg_api.h
ノーマルファイル
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: Declare public API related to the action_oui called by north bound
|
||||
* HDD/OSIF/LIM
|
||||
*/
|
||||
|
||||
#ifndef _WLAN_ACTION_OUI_UCFG_API_H_
|
||||
#define _WLAN_ACTION_OUI_UCFG_API_H_
|
||||
|
||||
#include <qdf_status.h>
|
||||
#include <qdf_types.h>
|
||||
#include "wlan_action_oui_public_struct.h"
|
||||
#include "wlan_action_oui_objmgr.h"
|
||||
|
||||
#ifdef WLAN_FEATURE_ACTION_OUI
|
||||
|
||||
/**
|
||||
* ucfg_action_oui_init() - Register notification handlers.
|
||||
*
|
||||
* This function registers action_oui notification handlers which are
|
||||
* invoked from psoc create/destroy handlers.
|
||||
*
|
||||
* Return: For successful registration - QDF_STATUS_SUCCESS,
|
||||
* else QDF_STATUS error codes.
|
||||
*/
|
||||
QDF_STATUS ucfg_action_oui_init(void);
|
||||
|
||||
/**
|
||||
* ucfg_action_oui_deinit() - Unregister notification handlers.
|
||||
*
|
||||
* This function Unregisters action_oui notification handlers which are
|
||||
* invoked from psoc create/destroy handlers.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void ucfg_action_oui_deinit(void);
|
||||
|
||||
/**
|
||||
* ucfg_action_oui_parse() - Parse input string and extract extensions.
|
||||
* @psoc: objmgr psoc object
|
||||
* @in_str: input string to be parsed
|
||||
* @action_id: action to which given string corresponds
|
||||
*
|
||||
* This is a wrapper function which invokes internal function
|
||||
* action_oui_extract() to extract OUIs and related attributes.
|
||||
*
|
||||
* Return: For successful parse - QDF_STATUS_SUCCESS,
|
||||
* else QDF_STATUS error codes.
|
||||
*/
|
||||
QDF_STATUS
|
||||
ucfg_action_oui_parse(struct wlan_objmgr_psoc *psoc,
|
||||
const uint8_t *in_str,
|
||||
enum action_oui_id action_id);
|
||||
|
||||
/**
|
||||
* ucfg_action_oui_send() - Send action_oui and related attributes to Fw.
|
||||
* @psoc: objmgr psoc object
|
||||
*
|
||||
* This is a wrapper function which invokes internal function
|
||||
* action_oui_send() to send OUIs and related attributes to firmware.
|
||||
*
|
||||
* Return: For successful send - QDF_STATUS_SUCCESS,
|
||||
* else QDF_STATUS error codes.
|
||||
*/
|
||||
QDF_STATUS ucfg_action_oui_send(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* ucfg_action_oui_enabled() - State of action_oui component
|
||||
*
|
||||
* Return: When action_oui component is present return true
|
||||
* else return false.
|
||||
*/
|
||||
static inline bool ucfg_action_oui_enabled(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* ucfg_action_oui_search() - Check for OUIs and related info in IE data.
|
||||
* @psoc: objmgr psoc object
|
||||
* @attr: pointer to structure containing type of action, beacon IE data etc.,
|
||||
* @action_id: type of action to be checked
|
||||
*
|
||||
* This is a wrapper function which invokes internal function to search
|
||||
* for OUIs and related info (specified from ini file) in vendor specific
|
||||
* data of beacon IE for given action.
|
||||
*
|
||||
* Return: If search is successful return true else false.
|
||||
*/
|
||||
bool ucfg_action_oui_search(struct wlan_objmgr_psoc *psoc,
|
||||
struct action_oui_search_attr *attr,
|
||||
enum action_oui_id action_id);
|
||||
|
||||
#else
|
||||
|
||||
/**
|
||||
* ucfg_action_oui_init() - Register notification handlers.
|
||||
*
|
||||
* This function registers action_oui notification handlers which are
|
||||
* invoked from psoc create/destroy handlers.
|
||||
*
|
||||
* Return: For successful registration - QDF_STATUS_SUCCESS,
|
||||
* else QDF_STATUS error codes.
|
||||
*/
|
||||
static inline
|
||||
QDF_STATUS ucfg_action_oui_init(void)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* ucfg_action_oui_deinit() - Unregister notification handlers.
|
||||
*
|
||||
* This function Unregisters action_oui notification handlers which are
|
||||
* invoked from psoc create/destroy handlers.
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
static inline
|
||||
void ucfg_action_oui_deinit(void)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* ucfg_action_oui_parse() - Parse input string of action_id specified.
|
||||
* @psoc: objmgr psoc object
|
||||
* @in_str: input string to be parsed
|
||||
* @action_id: action to which given string corresponds
|
||||
*
|
||||
* This is a wrapper function which invokes internal function
|
||||
* action_oui_extract() to extract OUIs and related attributes.
|
||||
*
|
||||
* Return: For successful parse - QDF_STATUS_SUCCESS,
|
||||
* else QDF_STATUS error codes.
|
||||
*/
|
||||
static inline QDF_STATUS
|
||||
ucfg_action_oui_parse(struct wlan_objmgr_psoc *psoc,
|
||||
const uint8_t *in_str,
|
||||
enum action_oui_id action_id)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* ucfg_action_oui_send() - Send action_oui and related attributes to Fw.
|
||||
* @psoc: objmgr psoc object
|
||||
*
|
||||
* This is a wrapper function which invokes internal function
|
||||
* action_oui_send() to send OUIs and related attributes to firmware.
|
||||
*
|
||||
* Return: For successful send - QDF_STATUS_SUCCESS,
|
||||
* else QDF_STATUS error codes.
|
||||
*/
|
||||
static inline
|
||||
QDF_STATUS ucfg_action_oui_send(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* ucfg_action_oui_enabled() - State of action_oui component
|
||||
*
|
||||
* Return: When action_oui component is present return true
|
||||
* else return false.
|
||||
*/
|
||||
static inline bool ucfg_action_oui_enabled(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* ucfg_action_oui_search() - Check for OUIs and related info in IE data.
|
||||
* @psoc: objmgr psoc object
|
||||
* @attr: pointer to structure containing type of action, beacon IE data etc.,
|
||||
* @action_id: type of action to be checked
|
||||
*
|
||||
* This is a wrapper function which invokes internal function to search
|
||||
* for OUIs and related info (specified from ini file) in vendor specific
|
||||
* data of beacon IE for given action.
|
||||
*
|
||||
* Return: If search is successful return true else false.
|
||||
*/
|
||||
static inline
|
||||
bool ucfg_action_oui_search(struct wlan_objmgr_psoc *psoc,
|
||||
struct action_oui_search_attr *attr,
|
||||
enum action_oui_id action_id)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif /* WLAN_FEATURE_ACTION_OUI */
|
||||
|
||||
#endif /* _WLAN_ACTION_OUI_UCFG_API_H_ */
|
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (c) 2018 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: Implements public API for action_oui to interact with target/WMI
|
||||
*/
|
||||
|
||||
#include "wlan_action_oui_tgt_api.h"
|
||||
#include "wlan_action_oui_main.h"
|
||||
#include "wlan_action_oui_public_struct.h"
|
||||
|
||||
QDF_STATUS tgt_action_oui_send(struct wlan_objmgr_psoc *psoc,
|
||||
struct action_oui_request *req)
|
||||
{
|
||||
struct action_oui_tx_ops *tx_ops;
|
||||
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||
|
||||
ACTION_OUI_ENTER();
|
||||
|
||||
tx_ops = GET_ACTION_OUI_TX_OPS_FROM_PSOC(psoc);
|
||||
QDF_ASSERT(tx_ops->send_req);
|
||||
if (tx_ops->send_req)
|
||||
status = tx_ops->send_req(psoc, req);
|
||||
|
||||
ACTION_OUI_EXIT();
|
||||
|
||||
return status;
|
||||
}
|
201
action_oui/dispatcher/src/wlan_action_oui_ucfg_api.c
ノーマルファイル
201
action_oui/dispatcher/src/wlan_action_oui_ucfg_api.c
ノーマルファイル
@@ -0,0 +1,201 @@
|
||||
/*
|
||||
* Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DOC: Public API implementation of action_oui called by north bound HDD/OSIF.
|
||||
*/
|
||||
|
||||
#include "wlan_action_oui_ucfg_api.h"
|
||||
#include "wlan_action_oui_main.h"
|
||||
#include "wlan_action_oui_main.h"
|
||||
#include "target_if_action_oui.h"
|
||||
#include "wlan_action_oui_tgt_api.h"
|
||||
#include <qdf_str.h>
|
||||
|
||||
QDF_STATUS ucfg_action_oui_init(void)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
|
||||
ACTION_OUI_ENTER();
|
||||
|
||||
status = wlan_objmgr_register_psoc_create_handler(
|
||||
WLAN_UMAC_COMP_ACTION_OUI,
|
||||
action_oui_psoc_create_notification, NULL);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status)) {
|
||||
action_oui_err("Failed to register psoc create handler");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
status = wlan_objmgr_register_psoc_destroy_handler(
|
||||
WLAN_UMAC_COMP_ACTION_OUI,
|
||||
action_oui_psoc_destroy_notification, NULL);
|
||||
if (QDF_IS_STATUS_SUCCESS(status)) {
|
||||
action_oui_debug("psoc create/delete notifications registered");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
action_oui_err("Failed to register psoc delete handler");
|
||||
wlan_objmgr_unregister_psoc_create_handler(WLAN_UMAC_COMP_ACTION_OUI,
|
||||
action_oui_psoc_create_notification, NULL);
|
||||
|
||||
exit:
|
||||
ACTION_OUI_EXIT();
|
||||
return status;
|
||||
}
|
||||
|
||||
void ucfg_action_oui_deinit(void)
|
||||
{
|
||||
QDF_STATUS status;
|
||||
|
||||
ACTION_OUI_ENTER();
|
||||
|
||||
status = wlan_objmgr_unregister_psoc_create_handler(
|
||||
WLAN_UMAC_COMP_ACTION_OUI,
|
||||
action_oui_psoc_create_notification, NULL);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status))
|
||||
action_oui_err("Failed to unregister psoc create handler");
|
||||
|
||||
status = wlan_objmgr_unregister_psoc_destroy_handler(
|
||||
WLAN_UMAC_COMP_ACTION_OUI,
|
||||
action_oui_psoc_destroy_notification,
|
||||
NULL);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status))
|
||||
action_oui_err("Failed to unregister psoc delete handler");
|
||||
|
||||
ACTION_OUI_EXIT();
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
ucfg_action_oui_parse(struct wlan_objmgr_psoc *psoc,
|
||||
const uint8_t *in_str,
|
||||
enum action_oui_id action_id)
|
||||
{
|
||||
struct action_oui_psoc_priv *psoc_priv;
|
||||
QDF_STATUS status = QDF_STATUS_E_INVAL;
|
||||
uint8_t *oui_str;
|
||||
int len;
|
||||
|
||||
ACTION_OUI_ENTER();
|
||||
|
||||
if (!psoc) {
|
||||
action_oui_err("psoc is NULL");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (action_id >= ACTION_OUI_MAXIMUM_ID) {
|
||||
action_oui_err("Invalid action_oui id: %u", action_id);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
psoc_priv = action_oui_psoc_get_priv(psoc);
|
||||
if (!psoc_priv) {
|
||||
action_oui_err("psoc priv is NULL");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
len = qdf_str_len(in_str);
|
||||
if (len <= 0 || len > ACTION_OUI_MAX_STR_LEN - 1) {
|
||||
action_oui_err("Invalid string length: %u", action_id);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
oui_str = qdf_mem_malloc(len + 1);
|
||||
if (!oui_str) {
|
||||
action_oui_err("Mem alloc failed for string: %u", action_id);
|
||||
status = QDF_STATUS_E_NOMEM;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
qdf_mem_copy(oui_str, in_str, len);
|
||||
oui_str[len] = '\0';
|
||||
|
||||
status = action_oui_parse(psoc_priv, oui_str, action_id);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status))
|
||||
action_oui_err("Failed to parse: %u", action_id);
|
||||
|
||||
qdf_mem_free(oui_str);
|
||||
|
||||
exit:
|
||||
ACTION_OUI_EXIT();
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_action_oui_send(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct action_oui_psoc_priv *psoc_priv;
|
||||
QDF_STATUS status = QDF_STATUS_E_INVAL;
|
||||
uint32_t id;
|
||||
|
||||
ACTION_OUI_ENTER();
|
||||
|
||||
if (!psoc) {
|
||||
action_oui_err("psoc is NULL");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
psoc_priv = action_oui_psoc_get_priv(psoc);
|
||||
if (!psoc_priv) {
|
||||
action_oui_err("psoc priv is NULL");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
for (id = 0; id < ACTION_OUI_MAXIMUM_ID; id++) {
|
||||
status = action_oui_send(psoc_priv, id);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status))
|
||||
action_oui_err("Failed to send: %u", id);
|
||||
}
|
||||
|
||||
exit:
|
||||
ACTION_OUI_EXIT();
|
||||
return status;
|
||||
}
|
||||
|
||||
bool ucfg_action_oui_search(struct wlan_objmgr_psoc *psoc,
|
||||
struct action_oui_search_attr *attr,
|
||||
enum action_oui_id action_id)
|
||||
{
|
||||
struct action_oui_psoc_priv *psoc_priv;
|
||||
bool found = false;
|
||||
|
||||
ACTION_OUI_ENTER();
|
||||
|
||||
if (!psoc || !attr) {
|
||||
action_oui_err("Invalid psoc or search attrs");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (action_id >= ACTION_OUI_MAXIMUM_ID ||
|
||||
!attr->ie_data || !attr->ie_length) {
|
||||
action_oui_err("Invalid action_oui id: %u", action_id);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
psoc_priv = action_oui_psoc_get_priv(psoc);
|
||||
if (!psoc_priv) {
|
||||
action_oui_err("psoc priv is NULL");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
found = action_oui_search(psoc_priv, attr, action_id);
|
||||
if (found)
|
||||
action_oui_debug("Search Successful");
|
||||
|
||||
exit:
|
||||
ACTION_OUI_EXIT();
|
||||
return found;
|
||||
}
|
新しいイシューから参照
ユーザーをブロックする