1 /* 2 * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. 3 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. 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 * DOC: Declare various struct, macros which shall be used in 21 * pmo lphb offload feature. 22 * 23 * Note: This file shall not contain public API's prototype/declarations. 24 * 25 */ 26 27 #ifndef _WLAN_PMO_LPHB_PUBLIC_STRUCT_H_ 28 #define _WLAN_PMO_LPHB_PUBLIC_STRUCT_H_ 29 30 #include "wlan_pmo_common_public_struct.h" 31 32 #define PMO_SIR_LPHB_FILTER_LEN 64 33 34 /** 35 * enum lphb_ind_type -Low power heart beat indication type 36 * @pmo_lphb_set_en_param_indid: lphb enable indication 37 * @pmo_lphb_set_tcp_pararm_indid: lphb tcp param indication 38 * @pmo_lphb_set_tcp_pkt_filter_indid: lphb tcp packet filter indication 39 * @pmo_lphb_set_udp_pararm_indid: lphb udp param indication 40 * @pmo_lphb_set_udp_pkt_filter_indid: lphb udp packet filter indication 41 * @pmo_lphb_set_network_info_indid: lphb network information indication 42 */ 43 enum lphb_ind_type { 44 pmo_lphb_set_en_param_indid, 45 pmo_lphb_set_tcp_pararm_indid, 46 pmo_lphb_set_tcp_pkt_filter_indid, 47 pmo_lphb_set_udp_pararm_indid, 48 pmo_lphb_set_udp_pkt_filter_indid, 49 pmo_lphb_set_network_info_indid, 50 }; 51 52 /** 53 * struct pmo_lphb_enable_req -Low power heart beat enable request 54 * @enable: lphb enable request 55 * @item: request item 56 * @session: lphb session 57 */ 58 struct pmo_lphb_enable_req { 59 uint8_t enable; 60 uint8_t item; 61 uint8_t session; 62 }; 63 64 /** 65 * struct pmo_lphb_tcp_params - Low power heart beat tcp params 66 * @srv_ip: source ip address 67 * @dev_ip: destination ip address 68 * @src_port: source port 69 * @dst_port: destination port 70 * @timeout: tcp timeout value 71 * @session: session on which lphb needs to be configured 72 * @gateway_mac: gateway mac address 73 * @time_period_sec: time period in seconds 74 * @tcp_sn: tcp sequence number 75 */ 76 struct pmo_lphb_tcp_params { 77 uint32_t srv_ip; 78 uint32_t dev_ip; 79 uint16_t src_port; 80 uint16_t dst_port; 81 uint16_t timeout; 82 uint8_t session; 83 struct qdf_mac_addr gateway_mac; 84 uint16_t time_period_sec; 85 uint32_t tcp_sn; 86 }; 87 88 /** 89 * struct pmo_lphb_tcp_filter_req - Low power heart beat tcp filter request 90 * @length: length of filter 91 * @offset: offset of filter 92 * @session: session on which lphb needs to be configured 93 * @filter: filter buffer 94 */ 95 struct pmo_lphb_tcp_filter_req { 96 uint16_t length; 97 uint8_t offset; 98 uint8_t session; 99 uint8_t filter[PMO_SIR_LPHB_FILTER_LEN]; 100 }; 101 102 /** 103 * struct pmo_lphb_udp_params - Low power heart beat udp params 104 * @srv_ip: source ip address 105 * @dev_ip: destination ip address 106 * @src_port: source port 107 * @dst_port: destination port 108 * @interval: time period in seconds 109 * @timeout: tcp timeout value 110 * @session: session on which lphb needs to be configured 111 * @gateway_mac: gateway mac address 112 */ 113 struct pmo_lphb_udp_params { 114 uint32_t srv_ip; 115 uint32_t dev_ip; 116 uint16_t src_port; 117 uint16_t dst_port; 118 uint16_t interval; 119 uint16_t timeout; 120 uint8_t session; 121 struct qdf_mac_addr gateway_mac; 122 }; 123 124 /** 125 * struct pmo_lphb_udp_filter_req - Low power heart beat udp filter request 126 * @length: length of filter 127 * @offset: offset of filter 128 * @session: session on which lphb needs to be configured 129 * @filter: filter buffer 130 */ 131 struct pmo_lphb_udp_filter_req { 132 uint16_t length; 133 uint8_t offset; 134 uint8_t session; 135 uint8_t filter[PMO_SIR_LPHB_FILTER_LEN]; 136 }; 137 138 /** 139 * struct pmo_lphb_req - Low power heart beat request 140 * @cmd: lphb command type 141 * @dummy: whether dummy or not 142 * @params: based on command lphb request buffer 143 */ 144 struct pmo_lphb_req { 145 uint16_t cmd; 146 uint16_t dummy; 147 union { 148 struct pmo_lphb_enable_req lphb_enable_req; 149 struct pmo_lphb_tcp_params lphb_tcp_params; 150 struct pmo_lphb_tcp_filter_req lphb_tcp_filter_req; 151 struct pmo_lphb_udp_params lphb_udp_params; 152 struct pmo_lphb_udp_filter_req lphb_udp_filter_req; 153 } params; 154 }; 155 156 /** 157 * struct pmo_lphb_rsp - Low power heart beat response 158 * @session_idx: session id 159 * @protocol_type: tell protocol type 160 * @event_reason: carry reason of lphb event 161 */ 162 struct pmo_lphb_rsp { 163 uint8_t session_idx; 164 uint8_t protocol_type; /*TCP or UDP */ 165 uint8_t event_reason; 166 }; 167 168 /* 169 * Define typedef for lphb callback when fwr send response 170 */ 171 typedef 172 void (*pmo_lphb_callback)(void *cb_ctx, struct pmo_lphb_rsp *ind_param); 173 174 #endif /* end of _WLAN_PMO_LPHB_PUBLIC_STRUCT_H_ */ 175 176