1 /* 2 * Copyright (c) 2019 The Linux Foundation. All rights reserved. 3 * 4 * Permission to use, copy, modify, and/or distribute this software for 5 * any purpose with or without fee is hereby granted, provided that the 6 * above copyright notice and this permission notice appear in all 7 * copies. 8 * 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 10 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 11 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 12 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 13 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 14 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 15 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 16 * PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 /** 20 * DOC: wlan_vdev_mgr_tgt_if_rx_defs.h 21 * 22 * This header file provides definitions to data structures for 23 * corresponding vdev mgmt operation 24 */ 25 26 #ifndef __WLAN_VDEV_MGR_TGT_IF_RX_DEFS_H__ 27 #define __WLAN_VDEV_MGR_TGT_IF_RX_DEFS_H__ 28 29 #include <qdf_timer.h> 30 #include <qdf_atomic.h> 31 #ifdef FEATURE_RUNTIME_PM 32 #include <wlan_pmo_common_public_struct.h> 33 #endif 34 35 /** 36 * enum wlan_vdev_mgr_tgt_if_rsp_bit - response status bit 37 * START_RESPONSE_BIT: vdev start response bit 38 * RESTART_RESPONSE_BIT: vdev restart response bit 39 * STOP_RESPONSE_BIT: vdev stop response bit 40 * DELETE_RESPONSE_BIT: vdev delete response bit 41 * PEER_DELETE_ALL_RESPONSE_BIT: vdev peer delete all response bit 42 */ 43 enum wlan_vdev_mgr_tgt_if_rsp_bit { 44 START_RESPONSE_BIT = 0, 45 RESTART_RESPONSE_BIT = 1, 46 STOP_RESPONSE_BIT = 2, 47 DELETE_RESPONSE_BIT = 3, 48 PEER_DELETE_ALL_RESPONSE_BIT = 4, 49 RESPONSE_BIT_MAX, 50 }; 51 52 /** 53 * string_from_rsp_bit() - Convert response bit to string 54 * @bit - response bit as in wlan_vdev_mgr_tgt_if_rsp_bit 55 * 56 * Please note to add new string in the array at index equal to 57 * its enum value in wlan_vdev_mgr_tgt_if_rsp_bit. 58 */ 59 static inline char *string_from_rsp_bit(enum wlan_vdev_mgr_tgt_if_rsp_bit bit) 60 { 61 static const char *strings[] = { "START", 62 "RESTART", 63 "STOP", 64 "DELETE", 65 "PEER DELETE ALL", 66 "RESPONE MAX"}; 67 return (char *)strings[bit]; 68 } 69 70 #ifdef FEATURE_RUNTIME_PM 71 /* Add extra PMO_RESUME_TIMEOUT for runtime PM resume timeout */ 72 #define START_RESPONSE_TIMER (6000 + PMO_RESUME_TIMEOUT) 73 #define STOP_RESPONSE_TIMER (4000 + PMO_RESUME_TIMEOUT) 74 #define DELETE_RESPONSE_TIMER (4000 + PMO_RESUME_TIMEOUT) 75 #define PEER_DELETE_ALL_RESPONSE_TIMER (6000 + PMO_RESUME_TIMEOUT) 76 #else 77 #define START_RESPONSE_TIMER 6000 78 #define STOP_RESPONSE_TIMER 4000 79 #define DELETE_RESPONSE_TIMER 4000 80 #define PEER_DELETE_ALL_RESPONSE_TIMER 6000 81 #endif 82 83 /** 84 * struct vdev_response_timer - vdev mgmt response ops timer 85 * @psoc: Object manager psoc 86 * @rsp_timer: VDEV MLME mgmt response timer 87 * @rsp_status: variable to check response status 88 * @expire_time: time to expire timer 89 * @timer_status: status of timer 90 * @rsp_timer_inuse: Status bit to inform whether the rsp timer is inuse 91 * @vdev_id: vdev object id 92 */ 93 struct vdev_response_timer { 94 struct wlan_objmgr_psoc *psoc; 95 qdf_timer_t rsp_timer; 96 unsigned long rsp_status; 97 uint32_t expire_time; 98 QDF_STATUS timer_status; 99 qdf_atomic_t rsp_timer_inuse; 100 uint8_t vdev_id; 101 }; 102 103 /** 104 * struct vdev_start_response - start response structure 105 * @vdev_id: vdev id 106 * @requestor_id: requester id 107 * @status: status of start request 108 * @resp_type: response of event type START/RESTART 109 * @chain_mask: chain mask 110 * @smps_mode: smps mode 111 * @mac_id: mac id 112 * @cfgd_tx_streams: configured tx streams 113 * @cfgd_rx_streams: configured rx streams 114 */ 115 struct vdev_start_response { 116 uint8_t vdev_id; 117 uint32_t requestor_id; 118 uint32_t status; 119 uint32_t resp_type; 120 uint32_t chain_mask; 121 uint32_t smps_mode; 122 uint32_t mac_id; 123 uint32_t cfgd_tx_streams; 124 uint32_t cfgd_rx_streams; 125 }; 126 127 /** 128 * struct vdev_stop_response - stop response structure 129 * @vdev_id: vdev id 130 */ 131 struct vdev_stop_response { 132 uint8_t vdev_id; 133 }; 134 135 /** 136 * struct vdev_delete_response - delete response structure 137 * @vdev_id: vdev id 138 */ 139 struct vdev_delete_response { 140 uint8_t vdev_id; 141 }; 142 143 /** 144 * struct peer_delete_all_response - peer delete all response structure 145 * @vdev_id: vdev id 146 * @status: FW status for vdev delete all peer request 147 */ 148 struct peer_delete_all_response { 149 uint8_t vdev_id; 150 uint8_t status; 151 }; 152 153 #endif /* __WLAN_VDEV_MGR_TGT_IF_RX_DEFS_H__ */ 154