1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
4 #ifndef _QTN_FMAC_TRANS_H_
5 #define _QTN_FMAC_TRANS_H_
7 #include <linux/kernel.h>
8 #include <linux/module.h>
9 #include <linux/skbuff.h>
10 #include <linux/mutex.h>
14 #define QTNF_CMD_FLAG_RESP_REQ BIT(0)
16 #define QTNF_MAX_CMD_BUF_SIZE 2048
17 #define QTNF_DEF_CMD_HROOM 4
21 struct qtnf_cmd_ctl_node
{
22 struct completion cmd_resp_completion
;
23 struct sk_buff
*resp_skb
;
25 bool waiting_for_resp
;
26 spinlock_t resp_lock
; /* lock for resp_skb & waiting_for_resp changes */
29 struct qtnf_qlink_transport
{
30 struct qtnf_cmd_ctl_node curr_cmd
;
31 struct sk_buff_head event_queue
;
32 size_t event_queue_max_len
;
35 void qtnf_trans_init(struct qtnf_bus
*bus
);
36 void qtnf_trans_free(struct qtnf_bus
*bus
);
38 int qtnf_trans_send_next_cmd(struct qtnf_bus
*bus
);
39 int qtnf_trans_handle_rx_ctl_packet(struct qtnf_bus
*bus
, struct sk_buff
*skb
);
40 int qtnf_trans_send_cmd_with_resp(struct qtnf_bus
*bus
,
41 struct sk_buff
*cmd_skb
,
42 struct sk_buff
**response_skb
);
44 #endif /* _QTN_FMAC_TRANS_H_ */