1 /* 2 * Copyright (c) 2017-2018 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 EOK; 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 53 psoc = wlan_pdev_get_psoc(pdev); 54 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 return wmi_unified_stats_request_send(GET_WMI_HDL_FROM_PSOC(psoc), 62 macaddr, ¶m); 63 } 64 65 int son_ol_lmac_create(struct wlan_objmgr_pdev *pdev) 66 { 67 return EOK; 68 } 69 70 int son_ol_lmac_destroy(struct wlan_objmgr_pdev *pdev) 71 { 72 return EOK; 73 74 } 75 76 void son_ol_rx_rssi_update(struct wlan_objmgr_pdev *pdev, u_int8_t *macaddres, 77 u_int8_t status, int8_t rssi, u_int8_t subtype) 78 { 79 return; 80 81 } 82 83 void son_ol_rx_rate_update(struct wlan_objmgr_pdev *pdev, u_int8_t *macaddres, 84 u_int8_t status, u_int32_t rateKbps) 85 { 86 return; 87 } 88 89 void target_if_son_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) 90 { 91 /* wlan son related function handler */ 92 tx_ops->son_tx_ops.son_enable = son_ol_enable; 93 tx_ops->son_tx_ops.lmac_create = son_ol_lmac_create; 94 tx_ops->son_tx_ops.lmac_destroy = son_ol_lmac_destroy; 95 tx_ops->son_tx_ops.son_send_null = son_ol_send_null; 96 tx_ops->son_tx_ops.son_rssi_update = son_ol_rx_rssi_update; 97 tx_ops->son_tx_ops.son_rate_update = son_ol_rx_rate_update; 98 tx_ops->son_tx_ops.son_sanity_util_intvl = son_ol_sanitize_util_invtl; 99 tx_ops->son_tx_ops.get_peer_rate = son_ol_get_peer_rate; 100 return; 101 } 102 #else 103 void target_if_son_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) 104 { 105 return; 106 } 107 int8_t son_ol_sanitize_util_intvl(struct wlan_objmgr_pdev *pdev, 108 u_int32_t *sample_period, 109 u_int32_t *num_of_sample) 110 { 111 return -EINVAL; 112 113 } 114 115 u_int32_t son_ol_get_peer_rate(struct wlan_objmgr_peer *peer, u_int8_t type) 116 { 117 return 0; 118 } 119 120 121 bool son_ol_enable(struct wlan_objmgr_pdev *pdev, bool enable) 122 { 123 return -EINVAL; 124 125 } 126 127 QDF_STATUS son_ol_send_null(struct wlan_objmgr_pdev *pdev, 128 u_int8_t *macaddr, 129 struct wlan_objmgr_vdev *vdev) 130 { 131 return EOK; 132 } 133 int8_t son_ol_sanitize_util_invtl(struct wlan_objmgr_pdev *pdev, 134 u_int32_t *sample_period, 135 u_int32_t *num_of_sample) 136 { 137 return EOK; 138 } 139 140 int son_ol_lmac_create(struct wlan_objmgr_pdev *pdev) 141 { 142 return EOK; 143 } 144 145 146 int son_ol_lmac_destroy(struct wlan_objmgr_pdev *pdev) 147 { 148 return EOK; 149 150 } 151 152 153 void son_ol_rx_rssi_update(struct wlan_objmgr_pdev *pdev, u_int8_t *macaddres, 154 u_int8_t status, int8_t rssi, u_int8_t subtype) 155 { 156 return; 157 158 } 159 160 void son_ol_rx_rate_update(struct wlan_objmgr_pdev *pdev, u_int8_t *macaddres, 161 u_int8_t status, u_int32_t rateKbps) 162 { 163 return; 164 } 165 166 #endif 167