blob: aa0b60555d667afa807082c61931475af858c802 [file] [log] [blame]
Prakash Dhavalid5c9f1c2015-11-08 19:04:44 -08001/*
2 * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved.
3 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28#ifndef _HIF_H_
29#define _HIF_H_
30
31#ifdef __cplusplus
32extern "C" {
33#endif /* __cplusplus */
34
35/* Header files */
36#include "athdefs.h"
37#include "a_types.h"
38#include "osapi_linux.h"
39#include "cdf_status.h"
40#include "cdf_nbuf.h"
41#include "ol_if_athvar.h"
42#include <linux/platform_device.h>
43#ifdef HIF_PCI
44#include <linux/pci.h>
45#endif /* HIF_PCI */
46
47#define ENABLE_MBOX_DUMMY_SPACE_FEATURE 1
48
49typedef struct htc_callbacks HTC_CALLBACKS;
50typedef void __iomem *A_target_id_t;
51
52#define HIF_TYPE_AR6002 2
53#define HIF_TYPE_AR6003 3
54#define HIF_TYPE_AR6004 5
55#define HIF_TYPE_AR9888 6
56#define HIF_TYPE_AR6320 7
57#define HIF_TYPE_AR6320V2 8
58/* For attaching Peregrine 2.0 board host_reg_tbl only */
59#define HIF_TYPE_AR9888V2 8
60#define HIF_TYPE_QCA6180 9
61#define HIF_TYPE_ADRASTEA 10
62
63#define TARGET_TYPE_UNKNOWN 0
64#define TARGET_TYPE_AR6001 1
65#define TARGET_TYPE_AR6002 2
66#define TARGET_TYPE_AR6003 3
67#define TARGET_TYPE_AR6004 5
68#define TARGET_TYPE_AR6006 6
69#define TARGET_TYPE_AR9888 7
70#define TARGET_TYPE_AR6320 8
71#define TARGET_TYPE_AR900B 9
72/* For attach Peregrine 2.0 board target_reg_tbl only */
73#define TARGET_TYPE_AR9888V2 10
74/* For attach Rome1.0 target_reg_tbl only*/
75#define TARGET_TYPE_AR6320V1 11
76/* For Rome2.0/2.1 target_reg_tbl ID*/
77#define TARGET_TYPE_AR6320V2 12
78/* For Rome3.0 target_reg_tbl ID*/
79#define TARGET_TYPE_AR6320V3 13
80/* For Tufello1.0 target_reg_tbl ID*/
81#define TARGET_TYPE_QCA9377V1 14
82/* For QCA6180 target */
83#define TARGET_TYPE_QCA6180 15
84/* For Adrastea target */
85#define TARGET_TYPE_ADRASTEA 16
86
87struct CE_state;
88#define CE_COUNT_MAX 8
89
90/* These numbers are selected so that the product is close to current
91 higher limit of packets HIF services at one shot (1000) */
92#define QCA_NAPI_BUDGET 64
93#define QCA_NAPI_DEF_SCALE 16
94/* NOTE: This is to adapt non-NAPI solution to use
95 the same "budget" as NAPI. Will be removed
96 `once decision about NAPI is made */
97#define HIF_NAPI_MAX_RECEIVES (QCA_NAPI_BUDGET * QCA_NAPI_DEF_SCALE)
98
99/* NOTE: "napi->scale" can be changed,
100 but this does not change the number of buckets */
101#define QCA_NAPI_NUM_BUCKETS (QCA_NAPI_BUDGET / QCA_NAPI_DEF_SCALE)
102struct qca_napi_stat {
103 uint32_t napi_schedules;
104 uint32_t napi_polls;
105 uint32_t napi_completes;
106 uint32_t napi_workdone;
107 uint32_t napi_budget_uses[QCA_NAPI_NUM_BUCKETS];
108};
109
110/**
111 * per NAPI instance data structure
112 * This data structure holds stuff per NAPI instance.
113 * Note that, in the current implementation, though scale is
114 * an instance variable, it is set to the same value for all
115 * instances.
116 */
117struct qca_napi_info {
118 struct napi_struct napi; /* one NAPI Instance per CE in phase I */
119 uint8_t scale; /* currently same on all instances */
120 uint8_t id;
121 struct qca_napi_stat stats[NR_CPUS];
122};
123
124/**
125 * NAPI data-sructure common to all NAPI instances.
126 *
127 * A variable of this type will be stored in hif module context.
128 */
129
130struct qca_napi_data {
131 /* NOTE: make sure the mutex is inited only at the very beginning
132 once for the lifetime of the driver. For now, granularity of one
133 is OK, but we might want to have a better granularity later */
134 struct mutex mutex;
135 uint32_t state;
136 uint32_t ce_map; /* bitmap of created/registered NAPI
137 instances, indexed by pipe_id,
138 not used by clients (clients use an
139 id returned by create) */
140 struct net_device netdev; /* dummy net_dev */
141 struct qca_napi_info napis[CE_COUNT_MAX];
142};
143
144struct ol_softc {
145 void __iomem *mem; /* IO mapped memory base address */
146 cdf_dma_addr_t mem_pa;
147 uint32_t soc_version;
148 /*
149 * handle for code that uses the osdep.h version of OS
150 * abstraction primitives
151 */
152 struct _NIC_DEV aps_osdev;
153 enum ath_hal_bus_type bus_type;
154 uint32_t lcr_val;
155 bool pkt_log_init;
156 bool request_irq_done;
157 /*
158 * handle for code that uses cdf version of OS
159 * abstraction primitives
160 */
161 cdf_device_t cdf_dev;
162
163 struct ol_version version;
164
165 /* Packet statistics */
166 struct ol_ath_stats pkt_stats;
167
168 /* A_TARGET_TYPE_* */
169 uint32_t target_type;
170 uint32_t target_fw_version;
171 uint32_t target_version;
172 uint32_t target_revision;
173 uint8_t crm_version_string[64];
174 uint8_t wlan_version_string[64];
175 ol_target_status target_status;
176 bool is_sim;
177 /* calibration data is stored in flash */
178 uint8_t *cal_in_flash;
179 /* virtual address for the calibration data on the flash */
180 void *cal_mem;
181 /* status of target init */
182 WLAN_INIT_STATUS wlan_init_status;
183
184 /* BMI info */
185 /* OS-dependent private info for BMI */
186 void *bmi_ol_priv;
187 bool bmi_done;
188 bool bmi_ua_done;
189 uint8_t *bmi_cmd_buff;
190 dma_addr_t bmi_cmd_da;
191 OS_DMA_MEM_CONTEXT(bmicmd_dmacontext)
192
193 uint8_t *bmi_rsp_buff;
194 dma_addr_t bmi_rsp_da;
195 /* length of last response */
196 uint32_t last_rxlen;
197 OS_DMA_MEM_CONTEXT(bmirsp_dmacontext)
198
199 void *msi_magic;
200 dma_addr_t msi_magic_da;
201 OS_DMA_MEM_CONTEXT(msi_dmacontext)
202
203 /* Handles for Lower Layers : filled in at init time */
204 hif_handle_t hif_hdl;
205#ifdef HIF_PCI
206 struct hif_pci_softc *hif_sc;
207#endif
208
209#ifdef WLAN_FEATURE_FASTPATH
210 int fastpath_mode_on; /* Duplicating this for data path efficiency */
211#endif /* WLAN_FEATURE_FASTPATH */
212
213 /* HTC handles */
214 void *htc_handle;
215
216 bool fEnableBeaconEarlyTermination;
217 uint8_t bcnEarlyTermWakeInterval;
218
219 /* UTF event information */
220 struct {
221 uint8_t *data;
222 uint32_t length;
223 cdf_size_t offset;
224 uint8_t currentSeq;
225 uint8_t expectedSeq;
226 } utf_event_info;
227
228 struct ol_wow_info *scn_wowInfo;
229 /* enable uart/serial prints from target */
230 bool enableuartprint;
231 /* enable fwlog */
232 bool enablefwlog;
233
234 HAL_REG_CAPABILITIES hal_reg_capabilities;
235 struct ol_regdmn *ol_regdmn_handle;
236 uint8_t bcn_mode;
237 uint8_t arp_override;
238 /*
239 * Includes host side stack level stats +
240 * radio level athstats
241 */
242 struct wlan_dbg_stats ath_stats;
243 /* noise_floor */
244 int16_t chan_nf;
245 uint32_t min_tx_power;
246 uint32_t max_tx_power;
247 uint32_t txpowlimit2G;
248 uint32_t txpowlimit5G;
249 uint32_t txpower_scale;
250 uint32_t chan_tx_pwr;
251 uint32_t vdev_count;
252 uint32_t max_bcn_ie_size;
253 cdf_spinlock_t scn_lock;
254 uint8_t vow_extstats;
255 /* if dcs enabled or not */
256 uint8_t scn_dcs;
257 wdi_event_subscribe scn_rx_peer_invalid_subscriber;
258 uint8_t proxy_sta;
259 uint8_t bcn_enabled;
260 /* Dynamic Tx Chainmask Selection enabled/disabled */
261 uint8_t dtcs;
262 /* true if vht ies are set on target */
263 uint32_t set_ht_vht_ies:1;
264 /*CWM enable/disable state */
265 bool scn_cwmenable;
266 uint8_t max_no_of_peers;
267#ifdef CONFIG_CNSS
268 struct cnss_fw_files fw_files;
269#endif
270#if defined(CONFIG_CNSS)
271 void *ramdump_base;
272 unsigned long ramdump_address;
273 unsigned long ramdump_size;
274#endif
275 bool enable_self_recovery;
276#ifdef WLAN_FEATURE_LPSS
277 bool enablelpasssupport;
278#endif
279 bool enable_ramdump_collection;
280 struct targetdef_s *targetdef;
281 struct ce_reg_def *target_ce_def;
282 struct hostdef_s *hostdef;
283 struct host_shadow_regs_s *host_shadow_regs;
284 bool athdiag_procfs_inited;
285 /*
286 * Guard changes to Target HW state and to software
287 * structures that track hardware state.
288 */
289 cdf_spinlock_t target_lock;
290 unsigned int ce_count; /* Number of Copy Engines supported */
291 bool force_break; /* Flag to indicate whether to
292 * break out the DPC context */
293 unsigned int receive_count; /* count Num Of Receive Buffers
294 * handled for one interrupt
295 * DPC routine */
296 struct CE_state *ce_id_to_state[CE_COUNT_MAX]; /* CE id to CE_state */
297#ifdef FEATURE_NAPI
298 struct qca_napi_data napi_data;
299#endif /* FEATURE_NAPI */
300 int htc_endpoint;
301 bool recovery;
302 bool hif_init_done;
303 int linkstate_vote;
304 atomic_t link_suspended;
305 atomic_t wow_done;
306 atomic_t tasklet_from_intr;
307 atomic_t active_tasklet_cnt;
308 bool notice_send;
309#ifdef HIF_PCI
310 cdf_spinlock_t irq_lock;
311 uint32_t ce_irq_summary;
312#endif
313};
314
315typedef enum {
316 HIF_DEVICE_POWER_UP, /* HIF layer should power up interface
317 * and/or module */
318 HIF_DEVICE_POWER_DOWN, /* HIF layer should initiate bus-specific
319 * measures to minimize power */
320 HIF_DEVICE_POWER_CUT /* HIF layer should initiate bus-specific
321 * AND/OR platform-specific measures
322 * to completely power-off the module and
323 * associated hardware (i.e. cut power
324 * supplies) */
325} HIF_DEVICE_POWER_CHANGE_TYPE;
326
327/**
328 * enum hif_enable_type: what triggered the enabling of hif
329 *
330 * @HIF_ENABLE_TYPE_PROBE: probe triggered enable
331 * @HIF_ENABLE_TYPE_REINIT: reinit triggered enable
332 */
333enum hif_enable_type {
334 HIF_ENABLE_TYPE_PROBE,
335 HIF_ENABLE_TYPE_REINIT,
336 HIF_ENABLE_TYPE_MAX
337};
338
339/**
340 * enum hif_disable_type: what triggered the disabling of hif
341 *
342 * @HIF_DISABLE_TYPE_PROBE_ERROR: probe error triggered disable
343 * @HIF_DISABLE_TYPE_REINIT_ERROR: reinit error triggered
344 * disable
345 * @HIF_DISABLE_TYPE_REMOVE: remove triggered disable
346 * @HIF_DISABLE_TYPE_SHUTDOWN: shutdown triggered disable
347 */
348enum hif_disable_type {
349 HIF_DISABLE_TYPE_PROBE_ERROR,
350 HIF_DISABLE_TYPE_REINIT_ERROR,
351 HIF_DISABLE_TYPE_REMOVE,
352 HIF_DISABLE_TYPE_SHUTDOWN,
353 HIF_DISABLE_TYPE_MAX
354};
355
356#ifdef CONFIG_ATH_PCIE_ACCESS_DEBUG
357typedef struct _HID_ACCESS_LOG {
358 uint32_t seqnum;
359 bool is_write;
360 void *addr;
361 uint32_t value;
362} HIF_ACCESS_LOG;
363#endif
364
365#define HIF_MAX_DEVICES 1
366
367struct htc_callbacks {
368 void *context; /* context to pass to the dsrhandler
369 * note : rwCompletionHandler is provided
370 * the context passed to hif_read_write */
371 int (*rwCompletionHandler)(void *rwContext, int status);
372 int (*dsrHandler)(void *context);
373};
374
375typedef struct osdrv_callbacks {
376 void *context; /* context to pass for all callbacks
377 * except deviceRemovedHandler
378 * the deviceRemovedHandler is only
379 * called if the device is claimed */
380 int (*deviceInsertedHandler)(void *context, void *hif_handle);
381 int (*deviceRemovedHandler)(void *claimedContext,
382 void *hif_handle);
383 int (*deviceSuspendHandler)(void *context);
384 int (*deviceResumeHandler)(void *context);
385 int (*deviceWakeupHandler)(void *context);
386 int (*devicePowerChangeHandler)(void *context,
387 HIF_DEVICE_POWER_CHANGE_TYPE
388 config);
389} OSDRV_CALLBACKS;
390
391/*
392 * This API is used to perform any global initialization of the HIF layer
393 * and to set OS driver callbacks (i.e. insertion/removal) to the HIF layer
394 *
395 */
396int hif_init(OSDRV_CALLBACKS *callbacks);
397
398/*
399 * This API claims the HIF device and provides a context for handling removal.
400 * The device removal callback is only called when the OSDRV layer claims
401 * a device. The claimed context must be non-NULL */
402void hif_claim_device(struct ol_softc *scn, void *claimedContext);
403/* release the claimed device */
404void hif_release_device(struct ol_softc *scn);
405
406/* This API detaches the HTC layer from the HIF device */
407void hif_detach_htc(struct ol_softc *scn);
408
409/****************************************************************/
410/* BMI and Diag window abstraction */
411/****************************************************************/
412
413#define HIF_BMI_EXCHANGE_NO_TIMEOUT ((uint32_t)(0))
414
415#define DIAG_TRANSFER_LIMIT 2048U /* maximum number of bytes that can be
416 * handled atomically by
417 * DiagRead/DiagWrite */
418
419/*
420 * API to handle HIF-specific BMI message exchanges, this API is synchronous
421 * and only allowed to be called from a context that can block (sleep) */
422CDF_STATUS hif_exchange_bmi_msg(struct ol_softc *scn,
423 uint8_t *pSendMessage,
424 uint32_t Length,
425 uint8_t *pResponseMessage,
426 uint32_t *pResponseLength, uint32_t TimeoutMS);
427
428/*
429 * APIs to handle HIF specific diagnostic read accesses. These APIs are
430 * synchronous and only allowed to be called from a context that
431 * can block (sleep). They are not high performance APIs.
432 *
433 * hif_diag_read_access reads a 4 Byte aligned/length value from a
434 * Target register or memory word.
435 *
436 * hif_diag_read_mem reads an arbitrary length of arbitrarily aligned memory.
437 */
438CDF_STATUS hif_diag_read_access(struct ol_softc *scn, uint32_t address,
439 uint32_t *data);
440CDF_STATUS hif_diag_read_mem(struct ol_softc *scn, uint32_t address,
441 uint8_t *data, int nbytes);
442void hif_dump_target_memory(struct ol_softc *scn, void *ramdump_base,
443 uint32_t address, uint32_t size);
444/*
445 * APIs to handle HIF specific diagnostic write accesses. These APIs are
446 * synchronous and only allowed to be called from a context that
447 * can block (sleep).
448 * They are not high performance APIs.
449 *
450 * hif_diag_write_access writes a 4 Byte aligned/length value to a
451 * Target register or memory word.
452 *
453 * hif_diag_write_mem writes an arbitrary length of arbitrarily aligned memory.
454 */
455CDF_STATUS hif_diag_write_access(struct ol_softc *scn, uint32_t address,
456 uint32_t data);
457CDF_STATUS hif_diag_write_mem(struct ol_softc *scn, uint32_t address,
458 uint8_t *data, int nbytes);
459
460/*
461 * Set the FASTPATH_mode_on flag in sc, for use by data path
462 */
463#ifdef WLAN_FEATURE_FASTPATH
464void hif_enable_fastpath(struct ol_softc *hif_dev);
465#endif
466
467#if defined(HIF_PCI) && !defined(A_SIMOS_DEVHOST)
468/*
469 * This API allows the Host to access Target registers of a given
470 * A_target_id_t directly and relatively efficiently over PCIe.
471 * This allows the Host to avoid extra overhead associated with
472 * sending a message to firmware and waiting for a response message
473 * from firmware, as is done on other interconnects.
474 *
475 * Yet there is some complexity with direct accesses because the
476 * Target's power state is not known a priori. The Host must issue
477 * special PCIe reads/writes in order to explicitly wake the Target
478 * and to verify that it is awake and will remain awake.
479 *
480 * NB: Host endianness conversion is left for the caller to handle.
481 * These interfaces handle access; not interpretation.
482 *
483 * Usage:
484 * During initialization, use A_TARGET_ID to obtain an 'target ID'
485 * for use with these interfaces.
486 *
487 * Use A_TARGET_READ and A_TARGET_WRITE to access Target space.
488 * These calls must be bracketed by A_TARGET_ACCESS_BEGIN and
489 * A_TARGET_ACCESS_END. A single BEGIN/END pair is adequate for
490 * multiple READ/WRITE operations.
491 *
492 * Use A_TARGET_ACCESS_BEGIN to put the Target in a state in
493 * which it is legal for the Host to directly access it. This
494 * may involve waking the Target from a low power state, which
495 * may take up to 2Ms!
496 *
497 * Use A_TARGET_ACCESS_END to tell the Target that as far as
498 * this code path is concerned, it no longer needs to remain
499 * directly accessible. BEGIN/END is under a reference counter;
500 * multiple code paths may issue BEGIN/END on a single targid.
501 *
502 * For added efficiency, the Host may use A_TARGET_ACCESS_LIKELY.
503 * The LIKELY interface works just like A_TARGET_ACCESS_BEGIN,
504 * except that it may return before the Target is actually
505 * available. It's a vague indication that some Target accesses
506 * are expected "soon". When the LIKELY API is used,
507 * A_TARGET_ACCESS_BEGIN must be used before any access.
508 *
509 * There are several uses for the LIKELY/UNLIKELY API:
510 * -If there is some potential time before Target accesses
511 * and we want to get a head start on waking the Target
512 * (e.g. to overlap Target wake with Host-side malloc)
513 * -High-level code knows that it will call low-level
514 * functions that will use BEGIN/END, and we don't want
515 * to allow the Target to sleep until the entire sequence
516 * has completed.
517 *
518 * A_TARGET_ACCESS_OK verifies that the Target can be
519 * accessed. In general, this should not be needed, but it
520 * may be useful for debugging or for special uses.
521 *
522 * Note that there must be a matching END for each BEGIN
523 * AND there must be a matching UNLIKELY for each LIKELY!
524 *
525 * NB: This API is designed to allow some flexibility in tradeoffs
526 * between Target power utilization and Host efficiency and
527 * system performance.
528 */
529
530/*
531 * Enable/disable CDC max performance workaround
532 * For max-performace set this to 0
533 * To allow SoC to enter sleep set this to 1
534 */
535#define CONFIG_DISABLE_CDC_MAX_PERF_WAR 0
536#endif
537
538#ifdef IPA_OFFLOAD
539/*
540 * IPA micro controller data path offload feature enabled,
541 * HIF should release copy engine related resource information to IPA UC
542 * IPA UC will access hardware resource with released information
543 */
544void hif_ipa_get_ce_resource(struct ol_softc *scn,
545 uint32_t *ce_sr_base_paddr,
546 uint32_t *ce_sr_ring_size,
547 cdf_dma_addr_t *ce_reg_paddr);
548#else
549static inline void hif_ipa_get_ce_resource(struct ol_softc *scn,
550 uint32_t *ce_sr_base_paddr,
551 uint32_t *ce_sr_ring_size,
552 cdf_dma_addr_t *ce_reg_paddr)
553{
554 return;
555}
556#endif /* IPA_OFFLOAD */
557
558
559void hif_read_phy_mem_base(struct ol_softc *scn,
560 cdf_dma_addr_t *bar_value);
561
562/**
563 * @brief List of callbacks - filled in by HTC.
564 */
565struct hif_msg_callbacks {
566 void *Context;
567 /**< context meaningful to HTC */
568 CDF_STATUS (*txCompletionHandler)(void *Context, cdf_nbuf_t wbuf,
569 uint32_t transferID,
570 uint32_t toeplitz_hash_result);
571 CDF_STATUS (*rxCompletionHandler)(void *Context, cdf_nbuf_t wbuf,
572 uint8_t pipeID);
573 void (*txResourceAvailHandler)(void *context, uint8_t pipe);
574 void (*fwEventHandler)(void *context, CDF_STATUS status);
575};
576
577#define HIF_DATA_ATTR_SET_TX_CLASSIFY(attr, v) \
578 (attr |= (v & 0x01) << 5)
579#define HIF_DATA_ATTR_SET_ENCAPSULATION_TYPE(attr, v) \
580 (attr |= (v & 0x03) << 6)
581#define HIF_DATA_ATTR_SET_ADDR_X_SEARCH_DISABLE(attr, v) \
582 (attr |= (v & 0x01) << 13)
583#define HIF_DATA_ATTR_SET_ADDR_Y_SEARCH_DISABLE(attr, v) \
584 (attr |= (v & 0x01) << 14)
585#define HIF_DATA_ATTR_SET_TOEPLITZ_HASH_ENABLE(attr, v) \
586 (attr |= (v & 0x01) << 15)
587#define HIF_DATA_ATTR_SET_PACKET_OR_RESULT_OFFSET(attr, v) \
588 (attr |= (v & 0x0FFF) << 16)
589#define HIF_DATA_ATTR_SET_ENABLE_11H(attr, v) \
590 (attr |= (v & 0x01) << 30)
591
592#ifdef HIF_PCI
593typedef struct pci_device_id hif_bus_id;
594#else
595typedef struct device hif_bus_id;
596#endif
597
598void hif_post_init(struct ol_softc *scn, void *hHTC,
599 struct hif_msg_callbacks *callbacks);
600CDF_STATUS hif_start(struct ol_softc *scn);
601void hif_stop(struct ol_softc *scn);
602void hif_flush_surprise_remove(struct ol_softc *scn);
603void hif_dump(struct ol_softc *scn, uint8_t CmdId, bool start);
604CDF_STATUS hif_send_head(struct ol_softc *scn, uint8_t PipeID,
605 uint32_t transferID, uint32_t nbytes,
606 cdf_nbuf_t wbuf, uint32_t data_attr);
607void hif_send_complete_check(struct ol_softc *scn, uint8_t PipeID,
608 int force);
609void hif_cancel_deferred_target_sleep(struct ol_softc *scn);
610void hif_get_default_pipe(struct ol_softc *scn, uint8_t *ULPipe,
611 uint8_t *DLPipe);
Sanjay Devnanic319c822015-11-06 16:44:28 -0800612int hif_map_service_to_pipe(struct ol_softc *scn, uint16_t svc_id,
613 uint8_t *ul_pipe, uint8_t *dl_pipe, int *ul_is_polled,
614 int *dl_is_polled);
Prakash Dhavalid5c9f1c2015-11-08 19:04:44 -0800615uint16_t hif_get_free_queue_number(struct ol_softc *scn, uint8_t PipeID);
616void *hif_get_targetdef(struct ol_softc *scn);
617void hi_fsuspendwow(struct ol_softc *scn);
618uint32_t hif_hia_item_address(uint32_t target_type, uint32_t item_offset);
619void hif_set_target_sleep(struct ol_softc *scn, bool sleep_ok,
620 bool wait_for_it);
621int hif_check_fw_reg(struct ol_softc *scn);
622int hif_check_soc_status(struct ol_softc *scn);
623void dump_ce_debug_register(struct ol_softc *scn);
624void hif_get_hw_info(void *scn, u32 *version, u32 *revision,
625 const char **target_name);
626void hif_set_fw_info(void *scn, u32 target_fw_version);
627void hif_disable_isr(void *scn);
628void hif_reset_soc(void *scn);
629void hif_disable_aspm(void);
630void hif_save_htc_htt_config_endpoint(int htc_endpoint);
631CDF_STATUS hif_open(void);
632void hif_close(void *hif_ctx);
633CDF_STATUS hif_enable(void *hif_ctx, struct device *dev, void *bdev,
634 const hif_bus_id *bid, enum ath_hal_bus_type bus_type,
635 enum hif_enable_type type);
636void hif_disable(void *hif_ctx, enum hif_disable_type type);
637void hif_enable_power_gating(void *hif_ctx);
638int hif_bus_resume(void);
639int hif_bus_suspend(void);
640void hif_vote_link_down(void);
641void hif_vote_link_up(void);
642bool hif_can_suspend_link(void);
643int dump_ce_register(struct ol_softc *scn);
644int ol_copy_ramdump(struct ol_softc *scn);
645void hif_pktlogmod_exit(void *hif_ctx);
646void hif_crash_shutdown(void *hif_ctx);
647#ifdef __cplusplus
648}
649#endif
650#endif /* _HIF_H_ */