blob: 85ac064ba3b38a3c54249d733183bc330c47c955 [file] [log] [blame]
Mukul Sharmad75a6672017-06-22 15:40:53 +05301/*
Jeff Johnsonb4c29962017-10-07 19:35:14 -07002 * Copyright (c) 2017 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 * DOC: Declare various struct, macros which shall be used in
20 * pmo lphb offload feature.
21 *
22 * Note: This file shall not contain public API's prototype/declarations.
23 *
24 */
Mukul Sharmad75a6672017-06-22 15:40:53 +053025
26#ifndef _WLAN_PMO_LPHB_PUBLIC_STRUCT_H_
27#define _WLAN_PMO_LPHB_PUBLIC_STRUCT_H_
28
29#include "wlan_pmo_common_public_struct.h"
30
31#ifdef FEATURE_WLAN_LPHB
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 */
43enum 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 */
58struct 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 */
76struct 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 */
95struct 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 * @timeout: tcp timeout value
109 * @session: session on which lphb needs to be configured
110 * @gateway_mac: gateway mac address
111 * @time_period_sec: time period in seconds
112 */
113struct 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 */
131struct 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 */
144struct 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 */
162struct pmo_lphb_rsp {
163 uint8_t session_idx;
164 uint8_t protocol_type; /*TCP or UDP */
165 uint8_t event_reason;
166};
167#endif /* FEATURE_WLAN_LPHB */
168
169/*
170 * Define typedef for lphb callback when fwr send response
171 */
172typedef
173void (*pmo_lphb_callback)(void *cb_ctx, struct pmo_lphb_rsp *ind_param);
174
175#endif /* end of _WLAN_PMO_LPHB_PUBLIC_STRUCT_H_ */
176