0001
0002
0003
0004 #ifndef _QTN_FMAC_TRANS_H_
0005 #define _QTN_FMAC_TRANS_H_
0006
0007 #include <linux/kernel.h>
0008 #include <linux/module.h>
0009 #include <linux/skbuff.h>
0010 #include <linux/mutex.h>
0011
0012 #include "qlink.h"
0013
0014 #define QTNF_CMD_FLAG_RESP_REQ BIT(0)
0015
0016 #define QTNF_MAX_CMD_BUF_SIZE 2048
0017 #define QTNF_DEF_CMD_HROOM 4
0018
0019 struct qtnf_bus;
0020
0021 struct qtnf_cmd_ctl_node {
0022 struct completion cmd_resp_completion;
0023 struct sk_buff *resp_skb;
0024 u16 seq_num;
0025 bool waiting_for_resp;
0026 spinlock_t resp_lock;
0027 };
0028
0029 struct qtnf_qlink_transport {
0030 struct qtnf_cmd_ctl_node curr_cmd;
0031 struct sk_buff_head event_queue;
0032 size_t event_queue_max_len;
0033 };
0034
0035 void qtnf_trans_init(struct qtnf_bus *bus);
0036 void qtnf_trans_free(struct qtnf_bus *bus);
0037
0038 int qtnf_trans_send_next_cmd(struct qtnf_bus *bus);
0039 int qtnf_trans_handle_rx_ctl_packet(struct qtnf_bus *bus, struct sk_buff *skb);
0040 int qtnf_trans_send_cmd_with_resp(struct qtnf_bus *bus,
0041 struct sk_buff *cmd_skb,
0042 struct sk_buff **response_skb);
0043
0044 #endif