1 /* 2 * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved. 3 * 4 * 5 * Permission to use, copy, modify, and/or distribute this software for 6 * any purpose with or without fee is hereby granted, provided that the 7 * above copyright notice and this permission notice appear in all 8 * copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20 #include <target_if_son.h> 21 #include <target_if.h> 22 #include <wlan_lmac_if_def.h> 23 #include <wmi_unified_api.h> 24 #include <cdp_txrx_ctrl.h> 25 26 #if QCA_SUPPORT_SON 27 28 u_int32_t son_ol_get_peer_rate(struct wlan_objmgr_peer *peer, u_int8_t type) 29 { 30 return ol_if_peer_get_rate(peer, type); 31 } 32 33 34 bool son_ol_enable(struct wlan_objmgr_pdev *pdev, bool enable) 35 { 36 return true; 37 } 38 39 int8_t son_ol_sanitize_util_invtl(struct wlan_objmgr_pdev *pdev, 40 u_int32_t *sample_period, 41 u_int32_t *num_of_sample) 42 { 43 return 0; 44 } 45 46 QDF_STATUS son_ol_send_null(struct wlan_objmgr_pdev *pdev, 47 u_int8_t *macaddr, 48 struct wlan_objmgr_vdev *vdev) 49 { 50 struct stats_request_params param = {0}; 51 struct wlan_objmgr_psoc *psoc = NULL; 52 wmi_unified_t wmi_handle; 53 54 psoc = wlan_pdev_get_psoc(pdev); 55 if (!psoc) 56 return QDF_STATUS_E_FAILURE; 57 58 param.vdev_id = wlan_vdev_get_id(vdev); 59 param.stats_id = WMI_HOST_REQUEST_INST_STAT; 60 61 wmi_handle = get_wmi_unified_hdl_from_psoc(psoc); 62 if (!wmi_handle) 63 return QDF_STATUS_E_FAILURE; 64 65 return wmi_unified_stats_request_send(wmi_handle, macaddr, ¶m); 66 } 67 68 int son_ol_lmac_create(struct wlan_objmgr_pdev *pdev) 69 { 70 return 0; 71 } 72 73 int son_ol_lmac_destroy(struct wlan_objmgr_pdev *pdev) 74 { 75 return 0; 76 77 } 78 79 void son_ol_rx_rssi_update(struct wlan_objmgr_pdev *pdev, u_int8_t *macaddres, 80 u_int8_t status, int8_t rssi, u_int8_t subtype) 81 { 82 return; 83 84 } 85 86 void son_ol_rx_rate_update(struct wlan_objmgr_pdev *pdev, u_int8_t *macaddres, 87 u_int8_t status, u_int32_t rateKbps) 88 { 89 return; 90 } 91 92 void target_if_son_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) 93 { 94 /* wlan son related function handler */ 95 tx_ops->son_tx_ops.son_enable = son_ol_enable; 96 tx_ops->son_tx_ops.lmac_create = son_ol_lmac_create; 97 tx_ops->son_tx_ops.lmac_destroy = son_ol_lmac_destroy; 98 tx_ops->son_tx_ops.son_send_null = son_ol_send_null; 99 tx_ops->son_tx_ops.son_rssi_update = son_ol_rx_rssi_update; 100 tx_ops->son_tx_ops.son_rate_update = son_ol_rx_rate_update; 101 tx_ops->son_tx_ops.son_sanity_util_intvl = son_ol_sanitize_util_invtl; 102 tx_ops->son_tx_ops.get_peer_rate = son_ol_get_peer_rate; 103 return; 104 } 105 #else 106 void target_if_son_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) 107 { 108 return; 109 } 110 int8_t son_ol_sanitize_util_intvl(struct wlan_objmgr_pdev *pdev, 111 u_int32_t *sample_period, 112 u_int32_t *num_of_sample) 113 { 114 return -EINVAL; 115 116 } 117 118 u_int32_t son_ol_get_peer_rate(struct wlan_objmgr_peer *peer, u_int8_t type) 119 { 120 return 0; 121 } 122 123 124 bool son_ol_enable(struct wlan_objmgr_pdev *pdev, bool enable) 125 { 126 return -EINVAL; 127 128 } 129 130 QDF_STATUS son_ol_send_null(struct wlan_objmgr_pdev *pdev, 131 u_int8_t *macaddr, 132 struct wlan_objmgr_vdev *vdev) 133 { 134 return QDF_STATUS_SUCCESS; 135 } 136 int8_t son_ol_sanitize_util_invtl(struct wlan_objmgr_pdev *pdev, 137 u_int32_t *sample_period, 138 u_int32_t *num_of_sample) 139 { 140 return 0; 141 } 142 143 int son_ol_lmac_create(struct wlan_objmgr_pdev *pdev) 144 { 145 return 0; 146 } 147 148 149 int son_ol_lmac_destroy(struct wlan_objmgr_pdev *pdev) 150 { 151 return 0; 152 153 } 154 155 156 void son_ol_rx_rssi_update(struct wlan_objmgr_pdev *pdev, u_int8_t *macaddres, 157 u_int8_t status, int8_t rssi, u_int8_t subtype) 158 { 159 return; 160 161 } 162 163 void son_ol_rx_rate_update(struct wlan_objmgr_pdev *pdev, u_int8_t *macaddres, 164 u_int8_t status, u_int32_t rateKbps) 165 { 166 return; 167 } 168 169 #endif 170