1 /* Copyright (c) 2016, The Linux Foundation. All rights reserved. 2 * 3 * Redistribution and use in source and binary forms, with or without 4 * modification, are permitted provided that the following conditions are 5 * met: 6 * * Redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer. 8 * * Redistributions in binary form must reproduce the above 9 * copyright notice, this list of conditions and the following 10 * disclaimer in the documentation and/or other materials provided 11 * with the distribution. 12 * * Neither the name of The Linux Foundation nor the names of its 13 * contributors may be used to endorse or promote products derived 14 * from this software without specific prior written permission. 15 * 16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * 28 * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. 29 * 30 * Redistribution and use in source and binary forms, with or without 31 * modification, are permitted (subject to the limitations in the 32 * disclaimer below) provided that the following conditions are met: 33 * 34 * * Redistributions of source code must retain the above copyright 35 * notice, this list of conditions and the following disclaimer. 36 * 37 * * Redistributions in binary form must reproduce the above 38 * copyright notice, this list of conditions and the following 39 * disclaimer in the documentation and/or other materials provided 40 * with the distribution. 41 * 42 * * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its 43 * contributors may be used to endorse or promote products derived 44 * from this software without specific prior written permission. 45 * 46 * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE 47 * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT 48 * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 49 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 50 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 51 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 52 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 54 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 55 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 56 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 57 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 58 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 59 */ 60 61 62 #ifndef __DRIVER_CMD_NL80211_EXTN__ 63 #define __DRIVER_CMD_NL80211_EXTN__ 64 65 #include "qca-vendor_copy.h" 66 #include <stdbool.h> 67 #include <sys/types.h> 68 #include "driver_nl80211.h" 69 70 71 #define IFNAMSIZ 16 72 73 enum wpa_driver_oem_status { 74 WPA_DRIVER_OEM_STATUS_SUCCESS = 0, 75 WPA_DRIVER_OEM_STATUS_FAILURE = -1, 76 WPA_DRIVER_OEM_STATUS_ENOSUPP = -2, 77 }; 78 79 #define FEATURE_TWT_SUPPORT 0x0001 80 81 /* 82 * This structure is a table of function pointers to the functions 83 * used by the wpa_supplicant_lib to interface with oem specific APIs 84 */ 85 typedef struct 86 { 87 int (*wpa_driver_driver_cmd_oem_cb)(void *priv, 88 char *cmd, char *buf, size_t buf_len, int *status); 89 int (*wpa_driver_nl80211_driver_oem_event)(struct wpa_driver_nl80211_data *drv, 90 u32 vendor_id, u32 subcmd, u8 *data, size_t len); 91 void (*wpa_driver_driver_wpa_msg_oem_cb)(void(*)(struct wpa_driver_nl80211_data *drv, 92 char *msg, u32 subcmd)); 93 int (*wpa_driver_oem_feature_check_cb)(u32 feature); 94 } wpa_driver_oem_cb_table_t; 95 96 typedef wpa_driver_oem_cb_table_t* (wpa_driver_oem_get_cb_table_t)(); 97 98 int wpa_driver_oem_initialize(wpa_driver_oem_cb_table_t **oem_lib_params); 99 #endif 100