xref: /wlan-driver/qcacld-3.0/core/dp/txrx/ol_cfg.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1*5113495bSYour Name /*
2*5113495bSYour Name  * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
3*5113495bSYour Name  *
4*5113495bSYour Name  * Permission to use, copy, modify, and/or distribute this software for
5*5113495bSYour Name  * any purpose with or without fee is hereby granted, provided that the
6*5113495bSYour Name  * above copyright notice and this permission notice appear in all
7*5113495bSYour Name  * copies.
8*5113495bSYour Name  *
9*5113495bSYour Name  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10*5113495bSYour Name  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11*5113495bSYour Name  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12*5113495bSYour Name  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13*5113495bSYour Name  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14*5113495bSYour Name  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15*5113495bSYour Name  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16*5113495bSYour Name  * PERFORMANCE OF THIS SOFTWARE.
17*5113495bSYour Name  */
18*5113495bSYour Name 
19*5113495bSYour Name #include <ol_cfg.h>
20*5113495bSYour Name #include <ol_if_athvar.h>
21*5113495bSYour Name #include <cdp_txrx_cfg.h>
22*5113495bSYour Name #include <cdp_txrx_handle.h>
23*5113495bSYour Name 
24*5113495bSYour Name unsigned int vow_config;
25*5113495bSYour Name 
26*5113495bSYour Name #if defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(QCA_LL_PDEV_TX_FLOW_CONTROL)
27*5113495bSYour Name /**
28*5113495bSYour Name  * ol_tx_set_flow_control_parameters() - set flow control parameters
29*5113495bSYour Name  * @cfg_ctx: cfg context
30*5113495bSYour Name  * @cfg_param: cfg parameters
31*5113495bSYour Name  *
32*5113495bSYour Name  * Return: none
33*5113495bSYour Name  */
ol_tx_set_flow_control_parameters(struct cdp_cfg * cfg_pdev,struct txrx_pdev_cfg_param_t * cfg_param)34*5113495bSYour Name void ol_tx_set_flow_control_parameters(struct cdp_cfg *cfg_pdev,
35*5113495bSYour Name 	struct txrx_pdev_cfg_param_t *cfg_param)
36*5113495bSYour Name {
37*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg_ctx = (struct txrx_pdev_cfg_t *)cfg_pdev;
38*5113495bSYour Name 
39*5113495bSYour Name 	cfg_ctx->tx_flow_start_queue_offset =
40*5113495bSYour Name 					cfg_param->tx_flow_start_queue_offset;
41*5113495bSYour Name 	cfg_ctx->tx_flow_stop_queue_th =
42*5113495bSYour Name 					cfg_param->tx_flow_stop_queue_th;
43*5113495bSYour Name }
44*5113495bSYour Name #endif
45*5113495bSYour Name 
46*5113495bSYour Name #ifdef CONFIG_HL_SUPPORT
47*5113495bSYour Name 
48*5113495bSYour Name #ifdef CONFIG_CREDIT_REP_THROUGH_CREDIT_UPDATE
49*5113495bSYour Name static inline
ol_pdev_cfg_credit_update(struct txrx_pdev_cfg_t * cfg_ctx)50*5113495bSYour Name void ol_pdev_cfg_credit_update(struct txrx_pdev_cfg_t *cfg_ctx)
51*5113495bSYour Name {
52*5113495bSYour Name 	cfg_ctx->tx_free_at_download = 1;
53*5113495bSYour Name 	cfg_ctx->credit_update_enabled = 1;
54*5113495bSYour Name }
55*5113495bSYour Name #else
56*5113495bSYour Name static inline
ol_pdev_cfg_credit_update(struct txrx_pdev_cfg_t * cfg_ctx)57*5113495bSYour Name void ol_pdev_cfg_credit_update(struct txrx_pdev_cfg_t *cfg_ctx)
58*5113495bSYour Name {
59*5113495bSYour Name 	cfg_ctx->tx_free_at_download = 0;
60*5113495bSYour Name 	cfg_ctx->credit_update_enabled = 0;
61*5113495bSYour Name }
62*5113495bSYour Name #endif /* CONFIG_CREDIT_REP_THROUGH_CREDIT_UPDATE */
63*5113495bSYour Name 
64*5113495bSYour Name /**
65*5113495bSYour Name  * ol_pdev_cfg_param_update() - assign download size of tx frame for txrx
66*5113495bSYour Name  *				    pdev that will be used across datapath
67*5113495bSYour Name  * @cfg_ctx: ptr to config parameter for txrx pdev
68*5113495bSYour Name  *
69*5113495bSYour Name  * Return: None
70*5113495bSYour Name  */
71*5113495bSYour Name static inline
ol_pdev_cfg_param_update(struct txrx_pdev_cfg_t * cfg_ctx)72*5113495bSYour Name void ol_pdev_cfg_param_update(struct txrx_pdev_cfg_t *cfg_ctx)
73*5113495bSYour Name {
74*5113495bSYour Name 	cfg_ctx->is_high_latency = 1;
75*5113495bSYour Name 	/* 802.1Q and SNAP / LLC headers are accounted for elsewhere */
76*5113495bSYour Name 	cfg_ctx->tx_download_size = 1500;
77*5113495bSYour Name 	ol_pdev_cfg_credit_update(cfg_ctx);
78*5113495bSYour Name }
79*5113495bSYour Name 
80*5113495bSYour Name #else /* CONFIG_HL_SUPPORT */
81*5113495bSYour Name static inline
ol_pdev_cfg_param_update(struct txrx_pdev_cfg_t * cfg_ctx)82*5113495bSYour Name void ol_pdev_cfg_param_update(struct txrx_pdev_cfg_t *cfg_ctx)
83*5113495bSYour Name {
84*5113495bSYour Name 	/*
85*5113495bSYour Name 	 * Need to change HTT_LL_TX_HDR_SIZE_IP accordingly.
86*5113495bSYour Name 	 * Include payload, up to the end of UDP header for IPv4 case
87*5113495bSYour Name 	 */
88*5113495bSYour Name 	cfg_ctx->tx_download_size = 16;
89*5113495bSYour Name }
90*5113495bSYour Name #endif
91*5113495bSYour Name 
92*5113495bSYour Name #ifdef CONFIG_RX_PN_CHECK_OFFLOAD
93*5113495bSYour Name static inline
ol_pdev_cfg_rx_pn_check(struct txrx_pdev_cfg_t * cfg_ctx)94*5113495bSYour Name void ol_pdev_cfg_rx_pn_check(struct txrx_pdev_cfg_t *cfg_ctx)
95*5113495bSYour Name {
96*5113495bSYour Name 	/* Do not do pn check on host */
97*5113495bSYour Name 	cfg_ctx->rx_pn_check = 0;
98*5113495bSYour Name }
99*5113495bSYour Name #else
100*5113495bSYour Name static inline
ol_pdev_cfg_rx_pn_check(struct txrx_pdev_cfg_t * cfg_ctx)101*5113495bSYour Name void ol_pdev_cfg_rx_pn_check(struct txrx_pdev_cfg_t *cfg_ctx)
102*5113495bSYour Name {
103*5113495bSYour Name 	/* Do pn check on host */
104*5113495bSYour Name 	cfg_ctx->rx_pn_check = 1;
105*5113495bSYour Name }
106*5113495bSYour Name #endif /* CONFIG_RX_PN_CHECK_OFFLOAD */
107*5113495bSYour Name 
108*5113495bSYour Name #if CFG_TGT_DEFAULT_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK
109*5113495bSYour Name static inline
ol_defrag_timeout_check(void)110*5113495bSYour Name uint8_t ol_defrag_timeout_check(void)
111*5113495bSYour Name {
112*5113495bSYour Name 	return 1;
113*5113495bSYour Name }
114*5113495bSYour Name #else
115*5113495bSYour Name static inline
ol_defrag_timeout_check(void)116*5113495bSYour Name uint8_t ol_defrag_timeout_check(void)
117*5113495bSYour Name {
118*5113495bSYour Name 	return 0;
119*5113495bSYour Name }
120*5113495bSYour Name #endif
121*5113495bSYour Name 
122*5113495bSYour Name #ifdef QCA_SUPPORT_TXRX_DRIVER_TCP_DEL_ACK
123*5113495bSYour Name /**
124*5113495bSYour Name  * ol_cfg_update_del_ack_params() - update delayed ack params
125*5113495bSYour Name  * @cfg_ctx: cfg context
126*5113495bSYour Name  * @cfg_param: parameters
127*5113495bSYour Name  *
128*5113495bSYour Name  * Return: none
129*5113495bSYour Name  */
ol_cfg_update_del_ack_params(struct txrx_pdev_cfg_t * cfg_ctx,struct txrx_pdev_cfg_param_t * cfg_param)130*5113495bSYour Name void ol_cfg_update_del_ack_params(struct txrx_pdev_cfg_t *cfg_ctx,
131*5113495bSYour Name 				  struct txrx_pdev_cfg_param_t *cfg_param)
132*5113495bSYour Name {
133*5113495bSYour Name 	cfg_ctx->del_ack_enable = cfg_param->del_ack_enable;
134*5113495bSYour Name 	cfg_ctx->del_ack_timer_value = cfg_param->del_ack_timer_value;
135*5113495bSYour Name 	cfg_ctx->del_ack_pkt_count = cfg_param->del_ack_pkt_count;
136*5113495bSYour Name }
137*5113495bSYour Name #endif
138*5113495bSYour Name 
139*5113495bSYour Name #ifdef WLAN_SUPPORT_TXRX_HL_BUNDLE
140*5113495bSYour Name static inline
ol_cfg_update_bundle_params(struct txrx_pdev_cfg_t * cfg_ctx,struct txrx_pdev_cfg_param_t * cfg_param)141*5113495bSYour Name void ol_cfg_update_bundle_params(struct txrx_pdev_cfg_t *cfg_ctx,
142*5113495bSYour Name 				 struct txrx_pdev_cfg_param_t *cfg_param)
143*5113495bSYour Name {
144*5113495bSYour Name 	cfg_ctx->bundle_timer_value = cfg_param->bundle_timer_value;
145*5113495bSYour Name 	cfg_ctx->bundle_size = cfg_param->bundle_size;
146*5113495bSYour Name }
147*5113495bSYour Name #else
148*5113495bSYour Name static inline
ol_cfg_update_bundle_params(struct txrx_pdev_cfg_t * cfg_ctx,struct txrx_pdev_cfg_param_t * cfg_param)149*5113495bSYour Name void ol_cfg_update_bundle_params(struct txrx_pdev_cfg_t *cfg_ctx,
150*5113495bSYour Name 				 struct txrx_pdev_cfg_param_t *cfg_param)
151*5113495bSYour Name {
152*5113495bSYour Name }
153*5113495bSYour Name #endif
154*5113495bSYour Name 
155*5113495bSYour Name /* FIX THIS -
156*5113495bSYour Name  * For now, all these configuration parameters are hardcoded.
157*5113495bSYour Name  * Many of these should actually be determined dynamically instead.
158*5113495bSYour Name  */
159*5113495bSYour Name 
ol_pdev_cfg_attach(qdf_device_t osdev,void * pcfg_param)160*5113495bSYour Name struct cdp_cfg *ol_pdev_cfg_attach(qdf_device_t osdev, void *pcfg_param)
161*5113495bSYour Name {
162*5113495bSYour Name 	struct txrx_pdev_cfg_param_t *cfg_param = pcfg_param;
163*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg_ctx;
164*5113495bSYour Name 	int i;
165*5113495bSYour Name 
166*5113495bSYour Name 	cfg_ctx = qdf_mem_malloc(sizeof(*cfg_ctx));
167*5113495bSYour Name 	if (!cfg_ctx)
168*5113495bSYour Name 		return NULL;
169*5113495bSYour Name 
170*5113495bSYour Name 	ol_pdev_cfg_param_update(cfg_ctx);
171*5113495bSYour Name 	ol_pdev_cfg_rx_pn_check(cfg_ctx);
172*5113495bSYour Name 
173*5113495bSYour Name 	cfg_ctx->defrag_timeout_check = ol_defrag_timeout_check();
174*5113495bSYour Name 	cfg_ctx->max_peer_id = 511;
175*5113495bSYour Name 	cfg_ctx->max_vdev = CFG_TGT_NUM_VDEV;
176*5113495bSYour Name 	cfg_ctx->pn_rx_fwd_check = 1;
177*5113495bSYour Name 	cfg_ctx->frame_type = wlan_frm_fmt_802_3;
178*5113495bSYour Name 	cfg_ctx->max_thruput_mbps = MAX_THROUGHPUT;
179*5113495bSYour Name 	cfg_ctx->max_nbuf_frags = 1;
180*5113495bSYour Name 	cfg_ctx->vow_config = vow_config;
181*5113495bSYour Name 	cfg_ctx->target_tx_credit = CFG_TGT_NUM_MSDU_DESC;
182*5113495bSYour Name 	cfg_ctx->throttle_period_ms = 40;
183*5113495bSYour Name 	cfg_ctx->dutycycle_level[0] = THROTTLE_DUTY_CYCLE_LEVEL0;
184*5113495bSYour Name 	cfg_ctx->dutycycle_level[1] = THROTTLE_DUTY_CYCLE_LEVEL1;
185*5113495bSYour Name 	cfg_ctx->dutycycle_level[2] = THROTTLE_DUTY_CYCLE_LEVEL2;
186*5113495bSYour Name 	cfg_ctx->dutycycle_level[3] = THROTTLE_DUTY_CYCLE_LEVEL3;
187*5113495bSYour Name 	cfg_ctx->rx_fwd_disabled = 0;
188*5113495bSYour Name 	cfg_ctx->is_packet_log_enabled = 0;
189*5113495bSYour Name 	cfg_ctx->is_full_reorder_offload = cfg_param->is_full_reorder_offload;
190*5113495bSYour Name #ifdef WLAN_FEATURE_TSF_PLUS
191*5113495bSYour Name 	cfg_ctx->is_ptp_rx_opt_enabled = 0;
192*5113495bSYour Name #endif
193*5113495bSYour Name 	cfg_ctx->ipa_uc_rsc.uc_offload_enabled =
194*5113495bSYour Name 		cfg_param->is_uc_offload_enabled;
195*5113495bSYour Name 	cfg_ctx->ipa_uc_rsc.tx_max_buf_cnt = cfg_param->uc_tx_buffer_count;
196*5113495bSYour Name 	cfg_ctx->ipa_uc_rsc.tx_buf_size = cfg_param->uc_tx_buffer_size;
197*5113495bSYour Name 	cfg_ctx->ipa_uc_rsc.rx_ind_ring_size =
198*5113495bSYour Name 		cfg_param->uc_rx_indication_ring_count;
199*5113495bSYour Name 	cfg_ctx->ipa_uc_rsc.tx_partition_base = cfg_param->uc_tx_partition_base;
200*5113495bSYour Name 	cfg_ctx->enable_rxthread = cfg_param->enable_rxthread;
201*5113495bSYour Name 	cfg_ctx->ip_tcp_udp_checksum_offload =
202*5113495bSYour Name 		cfg_param->ip_tcp_udp_checksum_offload;
203*5113495bSYour Name 	cfg_ctx->p2p_ip_tcp_udp_checksum_offload =
204*5113495bSYour Name 		cfg_param->p2p_ip_tcp_udp_checksum_offload;
205*5113495bSYour Name 	cfg_ctx->nan_tcp_udp_checksumoffload =
206*5113495bSYour Name 		cfg_param->nan_ip_tcp_udp_checksum_offload;
207*5113495bSYour Name 	cfg_ctx->ce_classify_enabled = cfg_param->ce_classify_enabled;
208*5113495bSYour Name 	cfg_ctx->gro_enable = cfg_param->gro_enable;
209*5113495bSYour Name 	cfg_ctx->tso_enable = cfg_param->tso_enable;
210*5113495bSYour Name 	cfg_ctx->lro_enable = cfg_param->lro_enable;
211*5113495bSYour Name 	cfg_ctx->sg_enable = cfg_param->sg_enable;
212*5113495bSYour Name 	cfg_ctx->enable_data_stall_detection =
213*5113495bSYour Name 		cfg_param->enable_data_stall_detection;
214*5113495bSYour Name 	cfg_ctx->enable_flow_steering = cfg_param->enable_flow_steering;
215*5113495bSYour Name 	cfg_ctx->disable_intra_bss_fwd = cfg_param->disable_intra_bss_fwd;
216*5113495bSYour Name 	cfg_ctx->pktlog_buffer_size = cfg_param->pktlog_buffer_size;
217*5113495bSYour Name 
218*5113495bSYour Name 	ol_cfg_update_del_ack_params(cfg_ctx, cfg_param);
219*5113495bSYour Name 
220*5113495bSYour Name 	ol_cfg_update_bundle_params(cfg_ctx, cfg_param);
221*5113495bSYour Name 
222*5113495bSYour Name 	ol_tx_set_flow_control_parameters((struct cdp_cfg *)cfg_ctx, cfg_param);
223*5113495bSYour Name 
224*5113495bSYour Name 	for (i = 0; i < QCA_WLAN_AC_ALL; i++) {
225*5113495bSYour Name 		cfg_ctx->ac_specs[i].wrr_skip_weight =
226*5113495bSYour Name 			cfg_param->ac_specs[i].wrr_skip_weight;
227*5113495bSYour Name 		cfg_ctx->ac_specs[i].credit_threshold =
228*5113495bSYour Name 			cfg_param->ac_specs[i].credit_threshold;
229*5113495bSYour Name 		cfg_ctx->ac_specs[i].send_limit =
230*5113495bSYour Name 			cfg_param->ac_specs[i].send_limit;
231*5113495bSYour Name 		cfg_ctx->ac_specs[i].credit_reserve =
232*5113495bSYour Name 			cfg_param->ac_specs[i].credit_reserve;
233*5113495bSYour Name 		cfg_ctx->ac_specs[i].discard_weight =
234*5113495bSYour Name 			cfg_param->ac_specs[i].discard_weight;
235*5113495bSYour Name 	}
236*5113495bSYour Name 
237*5113495bSYour Name 	return (struct cdp_cfg *)cfg_ctx;
238*5113495bSYour Name }
239*5113495bSYour Name 
240*5113495bSYour Name #ifdef WLAN_SUPPORT_TXRX_HL_BUNDLE
241*5113495bSYour Name 
ol_cfg_get_bundle_timer_value(struct cdp_cfg * cfg_pdev)242*5113495bSYour Name int ol_cfg_get_bundle_timer_value(struct cdp_cfg *cfg_pdev)
243*5113495bSYour Name {
244*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
245*5113495bSYour Name 
246*5113495bSYour Name 	return cfg->bundle_timer_value;
247*5113495bSYour Name }
248*5113495bSYour Name 
ol_cfg_get_bundle_size(struct cdp_cfg * cfg_pdev)249*5113495bSYour Name int ol_cfg_get_bundle_size(struct cdp_cfg *cfg_pdev)
250*5113495bSYour Name {
251*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
252*5113495bSYour Name 
253*5113495bSYour Name 	return cfg->bundle_size;
254*5113495bSYour Name }
255*5113495bSYour Name #endif
256*5113495bSYour Name 
257*5113495bSYour Name #ifdef QCA_SUPPORT_TXRX_DRIVER_TCP_DEL_ACK
258*5113495bSYour Name /**
259*5113495bSYour Name  * ol_cfg_get_del_ack_timer_value() - get delayed ack timer value
260*5113495bSYour Name  * @cfg_pdev: pdev handle
261*5113495bSYour Name  *
262*5113495bSYour Name  * Return: timer value
263*5113495bSYour Name  */
ol_cfg_get_del_ack_timer_value(struct cdp_cfg * cfg_pdev)264*5113495bSYour Name int ol_cfg_get_del_ack_timer_value(struct cdp_cfg *cfg_pdev)
265*5113495bSYour Name {
266*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
267*5113495bSYour Name 
268*5113495bSYour Name 	return cfg->del_ack_timer_value;
269*5113495bSYour Name }
270*5113495bSYour Name 
271*5113495bSYour Name /**
272*5113495bSYour Name  * ol_cfg_get_del_ack_enable_value() - get delayed ack enable value
273*5113495bSYour Name  * @cfg_pdev: pdev handle
274*5113495bSYour Name  *
275*5113495bSYour Name  * Return: enable/disable
276*5113495bSYour Name  */
ol_cfg_get_del_ack_enable_value(struct cdp_cfg * cfg_pdev)277*5113495bSYour Name bool ol_cfg_get_del_ack_enable_value(struct cdp_cfg *cfg_pdev)
278*5113495bSYour Name {
279*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
280*5113495bSYour Name 
281*5113495bSYour Name 	return cfg->del_ack_enable;
282*5113495bSYour Name }
283*5113495bSYour Name 
284*5113495bSYour Name /**
285*5113495bSYour Name  * ol_cfg_get_del_ack_count_value() - get delayed ack count value
286*5113495bSYour Name  * @pdev: cfg_pdev handle
287*5113495bSYour Name  *
288*5113495bSYour Name  * Return: count value
289*5113495bSYour Name  */
ol_cfg_get_del_ack_count_value(struct cdp_cfg * cfg_pdev)290*5113495bSYour Name int ol_cfg_get_del_ack_count_value(struct cdp_cfg *cfg_pdev)
291*5113495bSYour Name {
292*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
293*5113495bSYour Name 
294*5113495bSYour Name 	return cfg->del_ack_pkt_count;
295*5113495bSYour Name }
296*5113495bSYour Name #endif
297*5113495bSYour Name 
ol_cfg_is_high_latency(struct cdp_cfg * cfg_pdev)298*5113495bSYour Name int ol_cfg_is_high_latency(struct cdp_cfg *cfg_pdev)
299*5113495bSYour Name {
300*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
301*5113495bSYour Name 
302*5113495bSYour Name 	return cfg->is_high_latency;
303*5113495bSYour Name }
304*5113495bSYour Name 
ol_cfg_is_credit_update_enabled(struct cdp_cfg * cfg_pdev)305*5113495bSYour Name int ol_cfg_is_credit_update_enabled(struct cdp_cfg *cfg_pdev)
306*5113495bSYour Name {
307*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
308*5113495bSYour Name 
309*5113495bSYour Name 	return cfg->credit_update_enabled;
310*5113495bSYour Name }
311*5113495bSYour Name 
ol_cfg_max_peer_id(struct cdp_cfg * cfg_pdev)312*5113495bSYour Name int ol_cfg_max_peer_id(struct cdp_cfg *cfg_pdev)
313*5113495bSYour Name {
314*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
315*5113495bSYour Name 	/*
316*5113495bSYour Name 	 * TBDXXX - this value must match the peer table
317*5113495bSYour Name 	 * size allocated in FW
318*5113495bSYour Name 	 */
319*5113495bSYour Name 	return cfg->max_peer_id;
320*5113495bSYour Name }
321*5113495bSYour Name 
ol_cfg_max_vdevs(struct cdp_cfg * cfg_pdev)322*5113495bSYour Name int ol_cfg_max_vdevs(struct cdp_cfg *cfg_pdev)
323*5113495bSYour Name {
324*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
325*5113495bSYour Name 
326*5113495bSYour Name 	return cfg->max_vdev;
327*5113495bSYour Name }
328*5113495bSYour Name 
ol_cfg_rx_pn_check(struct cdp_cfg * cfg_pdev)329*5113495bSYour Name int ol_cfg_rx_pn_check(struct cdp_cfg *cfg_pdev)
330*5113495bSYour Name {
331*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
332*5113495bSYour Name 
333*5113495bSYour Name 	return cfg->rx_pn_check;
334*5113495bSYour Name }
335*5113495bSYour Name 
ol_cfg_rx_fwd_check(struct cdp_cfg * cfg_pdev)336*5113495bSYour Name int ol_cfg_rx_fwd_check(struct cdp_cfg *cfg_pdev)
337*5113495bSYour Name {
338*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
339*5113495bSYour Name 
340*5113495bSYour Name 	return cfg->pn_rx_fwd_check;
341*5113495bSYour Name }
342*5113495bSYour Name 
ol_set_cfg_rx_fwd_disabled(struct cdp_cfg * cfg_pdev,uint8_t disable_rx_fwd)343*5113495bSYour Name void ol_set_cfg_rx_fwd_disabled(struct cdp_cfg *cfg_pdev,
344*5113495bSYour Name 		uint8_t disable_rx_fwd)
345*5113495bSYour Name {
346*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
347*5113495bSYour Name 
348*5113495bSYour Name 	cfg->rx_fwd_disabled = disable_rx_fwd;
349*5113495bSYour Name }
350*5113495bSYour Name 
ol_set_cfg_packet_log_enabled(struct cdp_cfg * cfg_pdev,uint8_t val)351*5113495bSYour Name void ol_set_cfg_packet_log_enabled(struct cdp_cfg *cfg_pdev, uint8_t val)
352*5113495bSYour Name {
353*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
354*5113495bSYour Name 
355*5113495bSYour Name 	cfg->is_packet_log_enabled = val;
356*5113495bSYour Name }
357*5113495bSYour Name 
ol_cfg_is_packet_log_enabled(struct cdp_cfg * cfg_pdev)358*5113495bSYour Name uint8_t ol_cfg_is_packet_log_enabled(struct cdp_cfg *cfg_pdev)
359*5113495bSYour Name {
360*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
361*5113495bSYour Name 
362*5113495bSYour Name 	return cfg->is_packet_log_enabled;
363*5113495bSYour Name }
364*5113495bSYour Name 
ol_cfg_rx_fwd_disabled(struct cdp_cfg * cfg_pdev)365*5113495bSYour Name int ol_cfg_rx_fwd_disabled(struct cdp_cfg *cfg_pdev)
366*5113495bSYour Name {
367*5113495bSYour Name #if defined(ATHR_WIN_NWF)
368*5113495bSYour Name 	/* for Windows, let the OS handle the forwarding */
369*5113495bSYour Name 	return 1;
370*5113495bSYour Name #else
371*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
372*5113495bSYour Name 
373*5113495bSYour Name 	return cfg->rx_fwd_disabled;
374*5113495bSYour Name #endif
375*5113495bSYour Name }
376*5113495bSYour Name 
ol_cfg_rx_fwd_inter_bss(struct cdp_cfg * cfg_pdev)377*5113495bSYour Name int ol_cfg_rx_fwd_inter_bss(struct cdp_cfg *cfg_pdev)
378*5113495bSYour Name {
379*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
380*5113495bSYour Name 
381*5113495bSYour Name 	return cfg->rx_fwd_inter_bss;
382*5113495bSYour Name }
383*5113495bSYour Name 
ol_cfg_frame_type(struct cdp_cfg * cfg_pdev)384*5113495bSYour Name enum wlan_frm_fmt ol_cfg_frame_type(struct cdp_cfg *cfg_pdev)
385*5113495bSYour Name {
386*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
387*5113495bSYour Name 
388*5113495bSYour Name 	return cfg->frame_type;
389*5113495bSYour Name }
390*5113495bSYour Name 
ol_cfg_max_thruput_mbps(struct cdp_cfg * cfg_pdev)391*5113495bSYour Name int ol_cfg_max_thruput_mbps(struct cdp_cfg *cfg_pdev)
392*5113495bSYour Name {
393*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
394*5113495bSYour Name 
395*5113495bSYour Name 	return cfg->max_thruput_mbps;
396*5113495bSYour Name }
397*5113495bSYour Name 
ol_cfg_netbuf_frags_max(struct cdp_cfg * cfg_pdev)398*5113495bSYour Name int ol_cfg_netbuf_frags_max(struct cdp_cfg *cfg_pdev)
399*5113495bSYour Name {
400*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
401*5113495bSYour Name 
402*5113495bSYour Name 	return cfg->max_nbuf_frags;
403*5113495bSYour Name }
404*5113495bSYour Name 
ol_cfg_tx_free_at_download(struct cdp_cfg * cfg_pdev)405*5113495bSYour Name int ol_cfg_tx_free_at_download(struct cdp_cfg *cfg_pdev)
406*5113495bSYour Name {
407*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
408*5113495bSYour Name 
409*5113495bSYour Name 	return cfg->tx_free_at_download;
410*5113495bSYour Name }
411*5113495bSYour Name 
ol_cfg_set_tx_free_at_download(struct cdp_cfg * cfg_pdev)412*5113495bSYour Name void ol_cfg_set_tx_free_at_download(struct cdp_cfg *cfg_pdev)
413*5113495bSYour Name {
414*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
415*5113495bSYour Name 
416*5113495bSYour Name 	cfg->tx_free_at_download = 1;
417*5113495bSYour Name }
418*5113495bSYour Name 
419*5113495bSYour Name 
420*5113495bSYour Name #ifdef CONFIG_HL_SUPPORT
ol_cfg_target_tx_credit(struct cdp_cfg * cfg_pdev)421*5113495bSYour Name uint16_t ol_cfg_target_tx_credit(struct cdp_cfg *cfg_pdev)
422*5113495bSYour Name {
423*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
424*5113495bSYour Name 
425*5113495bSYour Name 	return cfg->target_tx_credit;
426*5113495bSYour Name }
427*5113495bSYour Name #else
428*5113495bSYour Name 
ol_cfg_target_tx_credit(struct cdp_cfg * cfg_pdev)429*5113495bSYour Name uint16_t ol_cfg_target_tx_credit(struct cdp_cfg *cfg_pdev)
430*5113495bSYour Name {
431*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
432*5113495bSYour Name 	uint16_t rc;
433*5113495bSYour Name 	uint16_t vow_max_sta = (cfg->vow_config & 0xffff0000) >> 16;
434*5113495bSYour Name 	uint16_t vow_max_desc_persta = cfg->vow_config & 0x0000ffff;
435*5113495bSYour Name 
436*5113495bSYour Name 	rc =  (cfg->target_tx_credit + (vow_max_sta * vow_max_desc_persta));
437*5113495bSYour Name 
438*5113495bSYour Name 	return rc;
439*5113495bSYour Name }
440*5113495bSYour Name #endif
441*5113495bSYour Name 
ol_cfg_tx_download_size(struct cdp_cfg * cfg_pdev)442*5113495bSYour Name int ol_cfg_tx_download_size(struct cdp_cfg *cfg_pdev)
443*5113495bSYour Name {
444*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
445*5113495bSYour Name 
446*5113495bSYour Name 	return cfg->tx_download_size;
447*5113495bSYour Name }
448*5113495bSYour Name 
ol_cfg_rx_host_defrag_timeout_duplicate_check(struct cdp_cfg * cfg_pdev)449*5113495bSYour Name int ol_cfg_rx_host_defrag_timeout_duplicate_check(struct cdp_cfg *cfg_pdev)
450*5113495bSYour Name {
451*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
452*5113495bSYour Name 
453*5113495bSYour Name 	return cfg->defrag_timeout_check;
454*5113495bSYour Name }
455*5113495bSYour Name 
ol_cfg_throttle_period_ms(struct cdp_cfg * cfg_pdev)456*5113495bSYour Name int ol_cfg_throttle_period_ms(struct cdp_cfg *cfg_pdev)
457*5113495bSYour Name {
458*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
459*5113495bSYour Name 
460*5113495bSYour Name 	return cfg->throttle_period_ms;
461*5113495bSYour Name }
462*5113495bSYour Name 
ol_cfg_throttle_duty_cycle_level(struct cdp_cfg * cfg_pdev,int level)463*5113495bSYour Name int ol_cfg_throttle_duty_cycle_level(struct cdp_cfg *cfg_pdev, int level)
464*5113495bSYour Name {
465*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
466*5113495bSYour Name 
467*5113495bSYour Name 	return cfg->dutycycle_level[level];
468*5113495bSYour Name }
469*5113495bSYour Name 
470*5113495bSYour Name #ifdef CONFIG_HL_SUPPORT
ol_cfg_is_full_reorder_offload(struct cdp_cfg * cfg_pdev)471*5113495bSYour Name int ol_cfg_is_full_reorder_offload(struct cdp_cfg *cfg_pdev)
472*5113495bSYour Name {
473*5113495bSYour Name 	return 0;
474*5113495bSYour Name }
475*5113495bSYour Name #else
ol_cfg_is_full_reorder_offload(struct cdp_cfg * cfg_pdev)476*5113495bSYour Name int ol_cfg_is_full_reorder_offload(struct cdp_cfg *cfg_pdev)
477*5113495bSYour Name {
478*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
479*5113495bSYour Name 
480*5113495bSYour Name 	return cfg->is_full_reorder_offload;
481*5113495bSYour Name }
482*5113495bSYour Name #endif
483*5113495bSYour Name 
484*5113495bSYour Name #ifdef WLAN_FEATURE_TSF_PLUS
ol_set_cfg_ptp_rx_opt_enabled(struct cdp_cfg * cfg_pdev,u_int8_t val)485*5113495bSYour Name void ol_set_cfg_ptp_rx_opt_enabled(struct cdp_cfg *cfg_pdev, u_int8_t val)
486*5113495bSYour Name {
487*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
488*5113495bSYour Name 
489*5113495bSYour Name 	cfg->is_ptp_rx_opt_enabled = val;
490*5113495bSYour Name }
491*5113495bSYour Name 
ol_cfg_is_ptp_rx_opt_enabled(struct cdp_cfg * cfg_pdev)492*5113495bSYour Name u_int8_t ol_cfg_is_ptp_rx_opt_enabled(struct cdp_cfg *cfg_pdev)
493*5113495bSYour Name {
494*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
495*5113495bSYour Name 
496*5113495bSYour Name 	return cfg->is_ptp_rx_opt_enabled;
497*5113495bSYour Name }
498*5113495bSYour Name #endif
499*5113495bSYour Name 
500*5113495bSYour Name /**
501*5113495bSYour Name  * ol_cfg_is_rx_thread_enabled() - return rx_thread is enable/disable
502*5113495bSYour Name  * @pdev : handle to the physical device
503*5113495bSYour Name  *
504*5113495bSYour Name  * Return: 1 - enable, 0 - disable
505*5113495bSYour Name  */
ol_cfg_is_rx_thread_enabled(struct cdp_cfg * cfg_pdev)506*5113495bSYour Name int ol_cfg_is_rx_thread_enabled(struct cdp_cfg *cfg_pdev)
507*5113495bSYour Name {
508*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
509*5113495bSYour Name 
510*5113495bSYour Name 	return cfg->enable_rxthread;
511*5113495bSYour Name }
512*5113495bSYour Name 
513*5113495bSYour Name #if defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(QCA_LL_PDEV_TX_FLOW_CONTROL)
514*5113495bSYour Name /**
515*5113495bSYour Name  * ol_cfg_get_tx_flow_stop_queue_th() - return stop queue threshold
516*5113495bSYour Name  * @pdev : handle to the physical device
517*5113495bSYour Name  *
518*5113495bSYour Name  * Return: stop queue threshold
519*5113495bSYour Name  */
ol_cfg_get_tx_flow_stop_queue_th(struct cdp_cfg * cfg_pdev)520*5113495bSYour Name int ol_cfg_get_tx_flow_stop_queue_th(struct cdp_cfg *cfg_pdev)
521*5113495bSYour Name {
522*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
523*5113495bSYour Name 
524*5113495bSYour Name 	return cfg->tx_flow_stop_queue_th;
525*5113495bSYour Name }
526*5113495bSYour Name 
527*5113495bSYour Name /**
528*5113495bSYour Name  * ol_cfg_get_tx_flow_start_queue_offset() - return start queue offset
529*5113495bSYour Name  * @pdev : handle to the physical device
530*5113495bSYour Name  *
531*5113495bSYour Name  * Return: start queue offset
532*5113495bSYour Name  */
ol_cfg_get_tx_flow_start_queue_offset(struct cdp_cfg * cfg_pdev)533*5113495bSYour Name int ol_cfg_get_tx_flow_start_queue_offset(struct cdp_cfg *cfg_pdev)
534*5113495bSYour Name {
535*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
536*5113495bSYour Name 
537*5113495bSYour Name 	return cfg->tx_flow_start_queue_offset;
538*5113495bSYour Name }
539*5113495bSYour Name #endif
540*5113495bSYour Name 
541*5113495bSYour Name #ifdef IPA_OFFLOAD
ol_cfg_ipa_uc_offload_enabled(struct cdp_cfg * cfg_pdev)542*5113495bSYour Name unsigned int ol_cfg_ipa_uc_offload_enabled(struct cdp_cfg *cfg_pdev)
543*5113495bSYour Name {
544*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
545*5113495bSYour Name 
546*5113495bSYour Name 	return (unsigned int)cfg->ipa_uc_rsc.uc_offload_enabled;
547*5113495bSYour Name }
548*5113495bSYour Name 
ol_cfg_ipa_uc_tx_buf_size(struct cdp_cfg * cfg_pdev)549*5113495bSYour Name unsigned int ol_cfg_ipa_uc_tx_buf_size(struct cdp_cfg *cfg_pdev)
550*5113495bSYour Name {
551*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
552*5113495bSYour Name 
553*5113495bSYour Name 	return cfg->ipa_uc_rsc.tx_buf_size;
554*5113495bSYour Name }
555*5113495bSYour Name 
ol_cfg_ipa_uc_tx_max_buf_cnt(struct cdp_cfg * cfg_pdev)556*5113495bSYour Name unsigned int ol_cfg_ipa_uc_tx_max_buf_cnt(struct cdp_cfg *cfg_pdev)
557*5113495bSYour Name {
558*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
559*5113495bSYour Name 
560*5113495bSYour Name 	return cfg->ipa_uc_rsc.tx_max_buf_cnt;
561*5113495bSYour Name }
562*5113495bSYour Name 
ol_cfg_ipa_uc_rx_ind_ring_size(struct cdp_cfg * cfg_pdev)563*5113495bSYour Name unsigned int ol_cfg_ipa_uc_rx_ind_ring_size(struct cdp_cfg *cfg_pdev)
564*5113495bSYour Name {
565*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
566*5113495bSYour Name 
567*5113495bSYour Name 	return cfg->ipa_uc_rsc.rx_ind_ring_size;
568*5113495bSYour Name }
569*5113495bSYour Name 
ol_cfg_ipa_uc_tx_partition_base(struct cdp_cfg * cfg_pdev)570*5113495bSYour Name unsigned int ol_cfg_ipa_uc_tx_partition_base(struct cdp_cfg *cfg_pdev)
571*5113495bSYour Name {
572*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
573*5113495bSYour Name 
574*5113495bSYour Name 	return cfg->ipa_uc_rsc.tx_partition_base;
575*5113495bSYour Name }
576*5113495bSYour Name 
ol_cfg_set_ipa_uc_tx_partition_base(struct cdp_cfg * cfg_pdev,uint32_t val)577*5113495bSYour Name void ol_cfg_set_ipa_uc_tx_partition_base(struct cdp_cfg *cfg_pdev, uint32_t val)
578*5113495bSYour Name {
579*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
580*5113495bSYour Name 
581*5113495bSYour Name 	cfg->ipa_uc_rsc.tx_partition_base = val;
582*5113495bSYour Name }
583*5113495bSYour Name #endif /* IPA_OFFLOAD */
584*5113495bSYour Name 
585*5113495bSYour Name /**
586*5113495bSYour Name  * ol_cfg_is_ce_classify_enabled() - Return if CE classification is enabled
587*5113495bSYour Name  *				     or disabled
588*5113495bSYour Name  * @pdev : handle to the physical device
589*5113495bSYour Name  *
590*5113495bSYour Name  * Return: 1 - enabled, 0 - disabled
591*5113495bSYour Name  */
ol_cfg_is_ce_classify_enabled(struct cdp_cfg * cfg_pdev)592*5113495bSYour Name bool ol_cfg_is_ce_classify_enabled(struct cdp_cfg *cfg_pdev)
593*5113495bSYour Name {
594*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)cfg_pdev;
595*5113495bSYour Name 
596*5113495bSYour Name 	return cfg->ce_classify_enabled;
597*5113495bSYour Name }
598*5113495bSYour Name 
599*5113495bSYour Name /**
600*5113495bSYour Name  * ol_cfg_get_wrr_skip_weight() - brief Query for the param of wrr_skip_weight
601*5113495bSYour Name  * @pdev: handle to the physical device.
602*5113495bSYour Name  * @ac: access control, it will be BE, BK, VI, VO
603*5113495bSYour Name  *
604*5113495bSYour Name  * Return: wrr_skip_weight for specified ac.
605*5113495bSYour Name  */
ol_cfg_get_wrr_skip_weight(struct cdp_cfg * pdev,int ac)606*5113495bSYour Name int ol_cfg_get_wrr_skip_weight(struct cdp_cfg *pdev, int ac)
607*5113495bSYour Name {
608*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)pdev;
609*5113495bSYour Name 
610*5113495bSYour Name 	if (ac >= QCA_WLAN_AC_BE && ac <= QCA_WLAN_AC_VO)
611*5113495bSYour Name 		return cfg->ac_specs[ac].wrr_skip_weight;
612*5113495bSYour Name 
613*5113495bSYour Name 	return 0;
614*5113495bSYour Name }
615*5113495bSYour Name 
616*5113495bSYour Name /**
617*5113495bSYour Name  * ol_cfg_get_credit_threshold() - Query for the param of credit_threshold
618*5113495bSYour Name  * @pdev: handle to the physical device.
619*5113495bSYour Name  * @ac: access control, it will be BE, BK, VI, VO
620*5113495bSYour Name  *
621*5113495bSYour Name  * Return: credit_threshold for specified ac.
622*5113495bSYour Name  */
ol_cfg_get_credit_threshold(struct cdp_cfg * pdev,int ac)623*5113495bSYour Name uint32_t ol_cfg_get_credit_threshold(struct cdp_cfg *pdev, int ac)
624*5113495bSYour Name {
625*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)pdev;
626*5113495bSYour Name 
627*5113495bSYour Name 	if (ac >= QCA_WLAN_AC_BE && ac <= QCA_WLAN_AC_VO)
628*5113495bSYour Name 		return cfg->ac_specs[ac].credit_threshold;
629*5113495bSYour Name 
630*5113495bSYour Name 	return 0;
631*5113495bSYour Name }
632*5113495bSYour Name 
633*5113495bSYour Name /**
634*5113495bSYour Name  * ol_cfg_get_send_limit() - Query for the param of send_limit
635*5113495bSYour Name  * @pdev: handle to the physical device.
636*5113495bSYour Name  * @ac: access control, it will be BE, BK, VI, VO
637*5113495bSYour Name  *
638*5113495bSYour Name  * Return: send_limit for specified ac.
639*5113495bSYour Name  */
ol_cfg_get_send_limit(struct cdp_cfg * pdev,int ac)640*5113495bSYour Name uint16_t ol_cfg_get_send_limit(struct cdp_cfg *pdev, int ac)
641*5113495bSYour Name {
642*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)pdev;
643*5113495bSYour Name 
644*5113495bSYour Name 	if (ac >= QCA_WLAN_AC_BE && ac <= QCA_WLAN_AC_VO)
645*5113495bSYour Name 		return cfg->ac_specs[ac].send_limit;
646*5113495bSYour Name 
647*5113495bSYour Name 	return 0;
648*5113495bSYour Name }
649*5113495bSYour Name 
650*5113495bSYour Name /**
651*5113495bSYour Name  * ol_cfg_get_credit_reserve() - Query for the param of credit_reserve
652*5113495bSYour Name  * @pdev: handle to the physical device.
653*5113495bSYour Name  * @ac: access control, it will be BE, BK, VI, VO
654*5113495bSYour Name  *
655*5113495bSYour Name  * Return: credit_reserve for specified ac.
656*5113495bSYour Name  */
ol_cfg_get_credit_reserve(struct cdp_cfg * pdev,int ac)657*5113495bSYour Name int ol_cfg_get_credit_reserve(struct cdp_cfg *pdev, int ac)
658*5113495bSYour Name {
659*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)pdev;
660*5113495bSYour Name 
661*5113495bSYour Name 	if (ac >= QCA_WLAN_AC_BE && ac <= QCA_WLAN_AC_VO)
662*5113495bSYour Name 		return cfg->ac_specs[ac].credit_reserve;
663*5113495bSYour Name 
664*5113495bSYour Name 	return 0;
665*5113495bSYour Name }
666*5113495bSYour Name 
667*5113495bSYour Name /**
668*5113495bSYour Name  * ol_cfg_get_discard_weight() - Query for the param of discard_weight
669*5113495bSYour Name  * @pdev: handle to the physical device.
670*5113495bSYour Name  * @ac: access control, it will be BE, BK, VI, VO
671*5113495bSYour Name  *
672*5113495bSYour Name  * Return: discard_weight for specified ac.
673*5113495bSYour Name  */
ol_cfg_get_discard_weight(struct cdp_cfg * pdev,int ac)674*5113495bSYour Name int ol_cfg_get_discard_weight(struct cdp_cfg *pdev, int ac)
675*5113495bSYour Name {
676*5113495bSYour Name 	struct txrx_pdev_cfg_t *cfg = (struct txrx_pdev_cfg_t *)pdev;
677*5113495bSYour Name 
678*5113495bSYour Name 	if (ac >= QCA_WLAN_AC_BE && ac <= QCA_WLAN_AC_VO)
679*5113495bSYour Name 		return cfg->ac_specs[ac].discard_weight;
680*5113495bSYour Name 
681*5113495bSYour Name 	return 0;
682*5113495bSYour Name }
683