summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/eswin/usb/ecrnx_usb.h
blob: 98178a788360e8cd2e5626c7616f335fec50f44b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/**
******************************************************************************
*
* @file ecrnx_usb.h
*
* @brief ecrnx usb header file
*
* Copyright (C) ESWIN 2015-2020
*
******************************************************************************
*/

#ifndef _ECRNX_USB_H_
#define _ECRNX_USB_H_

#include "ecrnx_rx.h"
#include "eswin_utils.h"

enum{
    USB_FRM_TYPE_RXDESC =1,
    USB_FRM_TYPE_MSG,
    USB_FRM_TYPE_DBG,
    USB_FRM_TYPE_UNSUP_RX_VEC,
    USB_FRM_TYPE_RADAR,
    USB_FRM_TYPE_TBTT_SEC,
    USB_FRM_TYPE_TBTT_PRIM,
    USB_FRM_TYPE_MSG_ACK,
    USB_FRM_TYPE_TXCFM,
    USB_FRM_TYPE_IWPRIV,
    USB_FRM_DEBUG_FS,
};


#define SKB_DATA_COM_HD_OFFSET      sizeof(dispatch_hdr_t)

/// Element in the pool of RX header descriptor.
struct rx_hd
{
    /// Total length of the received MPDU
    uint16_t            frmlen;
    /// AMPDU status information
    uint16_t            ampdu_stat_info;
    /// TSF Low
    uint32_t            tsflo;
    /// TSF High
    uint32_t            tsfhi;
    /// Rx Vector 1
    struct rx_vector_1  rx_vec_1;
    /// Rx Vector 2
    struct rx_vector_2  rx_vec_2;
    /// MPDU status information
    uint32_t            statinfo;
};

/*adjust phy info,pattern, these infomation should be put to another buffer to trnasfer*/
struct rxu_stat_mm
{
	/*type of msg/dbg/frm etc.*/
	dispatch_hdr_t  frm_type;
    uint32_t fragment_flag     : 1;
    uint32_t is_qos            : 1;
    uint32_t need_reord        : 1;
    uint32_t need_pn_check     : 1;
    uint32_t is_ga             : 1;
    uint32_t flags_rsvd0       : 3;
    uint32_t tid               : 8;
    uint16_t sn;
    /// Length
    uint16_t frame_len;
    /// Status (@ref rx_status_bits)
    uint16_t status;
    uint16_t real_offset; /* dma address align 4, real data - real_offset  */
};



/**
 * @brief: ecrnx_usb_init  Initialize usb interface.
 * @param {ecrnx_hw} Main driver data
 * @return: u8
 */
u8 ecrnx_usb_init(struct ecrnx_hw *ecrnx_hw);

/**
 * @brief: ecrnx_usb_deinit  DeInitialize usb interface.
 * @param {ecrnx_hw} Main driver data
 * @return: none
 */
void ecrnx_usb_deinit(struct ecrnx_hw *ecrnx_hw);

#ifdef CONFIG_ECRNX_WIFO_CAIL
/**
 * @brief: usb_host_rx_handler  Handle the reception of rx frame
 * @param {frm_type} received frame type
 * @param {skb} received skb data
 * @return: none
 */
void usb_host_amt_rx_handler(uint32_t frm_type, struct sk_buff *skb);
#endif /* CONFIG_ECRNX_WIFO_CAIL */

/**
 * @brief: usb_host_rx_handler  Handle the reception of rx frame
 * @param {frm_type} received frame type
 * @param {env} pointer to the usb Host environment
 * @param {skb} received skb data
 * @return: none
 */
void usb_host_rx_handler(uint32_t frm_type, struct ipc_host_env_tag *env, struct sk_buff *skb);

#endif /* __ECRNX_USB_H */