xref: /wlan-dirver/qca-wifi-host-cmn/hif/src/sdio/hif_sdio_dev.h (revision a175314c51a4ce5cec2835cc8a8c7dc0c1810915)
1 /*
2  * Copyright (c) 2013-2016, 2018 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 #ifndef HIF_SDIO_DEV_H_
20 #define HIF_SDIO_DEV_H_
21 
22 #include "qdf_net_types.h"
23 #include "a_types.h"
24 #include "athdefs.h"
25 #include "a_osapi.h"
26 #include <hif.h>
27 #include "athstartpack.h"
28 #include "hif_internal.h"
29 
30 struct hif_sdio_device *hif_dev_from_hif(struct hif_sdio_dev *hif_device);
31 
32 struct hif_sdio_device *hif_dev_create(struct hif_sdio_dev *hif_device,
33 				struct hif_msg_callbacks *callbacks,
34 				void *target);
35 
36 void hif_dev_destroy(struct hif_sdio_device *htc_sdio_device);
37 
38 QDF_STATUS hif_dev_setup(struct hif_sdio_device *htc_sdio_device);
39 
40 QDF_STATUS hif_dev_enable_interrupts(struct hif_sdio_device *htc_sdio_device);
41 
42 QDF_STATUS hif_dev_disable_interrupts(struct hif_sdio_device *htc_sdio_device);
43 
44 QDF_STATUS hif_dev_send_buffer(struct hif_sdio_device *htc_sdio_device,
45 			     unsigned int transfer_id, uint8_t pipe,
46 			     unsigned int nbytes, qdf_nbuf_t buf);
47 
48 QDF_STATUS hif_dev_process_pending_irqs(struct hif_sdio_device *pdev,
49 					bool *done,
50 					      bool *async_processing);
51 
52 void hif_dev_mask_interrupts(struct hif_sdio_device *pdev);
53 
54 QDF_STATUS hif_dev_map_service_to_pipe(struct hif_sdio_dev *pdev,
55 				       uint16_t service_id,
56 				       uint8_t *ul_pipe,
57 				       uint8_t *dl_pipe);
58 
59 void hif_dev_unmask_interrupts(struct hif_sdio_device *pdev);
60 
61 int hif_dev_setup_device(struct hif_sdio_device *pdev);
62 
63 QDF_STATUS hif_dev_get_fifo_address(struct hif_sdio_dev *pdev,
64 				    struct hif_device_mbox_info *config,
65 				    uint32_t config_len);
66 
67 void hif_dev_get_block_size(void *config);
68 
69 void hif_dev_set_mailbox_swap(struct hif_sdio_dev *pdev);
70 
71 bool hif_dev_get_mailbox_swap(struct hif_sdio_dev *pdev);
72 
73 int hif_sdio_set_drvdata(struct sdio_func *func,
74 			 struct hif_sdio_dev *hifdevice);
75 
76 struct hif_sdio_dev *get_hif_device(struct sdio_func *func);
77 #endif /* HIF_SDIO_DEV_H_ */
78