hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
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
/** @file */
/******************************************************************************
 *
 * Copyright(c) 2019 Realtek Corporation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 ******************************************************************************/
 
#ifndef _MAC_AX_TCPIP_CHECKSUM_OFFLOAD_H_
#define _MAC_AX_TCPIP_CHECKSUM_OFFLOAD_H_
 
#include "../type.h"
#include "../mac_ax.h"
 
/**
 * @struct mac_ax_en_tcpipchksum
 * @brief mac_ax_en_tcpipchksum
 *
 * @var mac_ax_en_tcpipchksum::en_tx_chksum_ofd
 * Please Place Description here.
 * @var mac_ax_en_tcpipchksum::en_rx_chksum_ofd
 * Please Place Description here.
 * @var mac_ax_en_tcpipchksum::rsvd0
 * Please Place Description here.
 */
struct mac_ax_en_tcpipchksum {
   /* dword0 */
   u32 en_tx_chksum_ofd: 1;
   u32 en_rx_chksum_ofd: 1;
   u32 rsvd0: 30;
};
 
/**
 * @addtogroup Basic_TRX
 * @{
 * @addtogroup TX_ShortCut
 * @{
 */
/**
 * @brief mac_tcpip_chksum_ofd
 *
 * @param *adapter
 * @param en_tx_chksum_ofd
 * @param en_rx_chksum_ofd
 * @return Please Place Description here.
 * @retval u32
 */
u32 mac_tcpip_chksum_ofd(struct mac_ax_adapter *adapter,
            u8 en_tx_chksum_ofd,
            u8 en_rx_chksum_ofd);
/**
 * @}
 * @}
 */
 
/**
 * @addtogroup Basic_TRX
 * @{
 * @addtogroup TX_ShortCut
 * @{
 */
 
/**
 * @brief mac_chk_rx_tcpip_chksum_ofd
 *
 * @param *adapter
 * @param chksum_status
 * @return Please Place Description here.
 * @retval u32
 */
u32 mac_chk_rx_tcpip_chksum_ofd(struct mac_ax_adapter *adapter,
               u8 chksum_status);
/**
 * @}
 * @}
 */
 
#define MAC_AX_CHKSUM_OFD_TX    0x1
#define MAC_AX_CHKSUM_OFD_RX    0x2
 
#define MAC_AX_CHKOFD_TCP_CHKSUM_ERR    BIT(4)
#define MAC_AX_CHKOFD_RX_IS_TCP_UDP        BIT(6)
#define MAC_AX_CHKOFD_RX_IPV            BIT(5)
#define MAC_AX_CHKOFD_TCP_CHKSUM_VLD    BIT(7)
 
#endif