aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/stmicro/stmmac/descs.h
diff options
context:
space:
mode:
authorGiuseppe CAVALLARO <peppe.cavallaro@st.com>2013-03-26 00:43:06 -0400
committerDavid S. Miller <davem@davemloft.net>2013-03-26 12:53:36 -0400
commitc24602ef86649376e9d71ea808cd877e414d340b (patch)
tree3bf58e08f64c7a01b191eab5927886ccce77045c /drivers/net/ethernet/stmicro/stmmac/descs.h
parent4a7d666a7202744af32d4da31fb52857b7d86850 (diff)
stmmac: support extend descriptors
This patch is to support the extend descriptors available in the chips newer than the 3.50. In case of the extend descriptors cannot be supported, at runtime, the driver will continue to work using the old style. In detail, this support extends the main descriptor structure adding new descriptors: 4, 5, 6, 7. The desc4 gives us extra information about the received ethernet payload when it is carrying PTP packets or TCP/UDP/ICMP over IP packets. The descriptors 6 and 7 are used for saving HW L/H timestamps (PTP). V2: this new version removes the Koption added in the first implementation because all the checks now to verify if the extended descriptors are actually supported happen at probe time. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/descs.h')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/descs.h51
1 files changed, 48 insertions, 3 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/descs.h b/drivers/net/ethernet/stmicro/stmmac/descs.h
index 223adf95fd03..2eca0c033038 100644
--- a/drivers/net/ethernet/stmicro/stmmac/descs.h
+++ b/drivers/net/ethernet/stmicro/stmmac/descs.h
@@ -24,6 +24,7 @@
24#ifndef __DESCS_H__ 24#ifndef __DESCS_H__
25#define __DESCS_H__ 25#define __DESCS_H__
26 26
27/* Basic descriptor structure for normal and alternate descriptors */
27struct dma_desc { 28struct dma_desc {
28 /* Receive descriptor */ 29 /* Receive descriptor */
29 union { 30 union {
@@ -60,7 +61,7 @@ struct dma_desc {
60 } rx; 61 } rx;
61 struct { 62 struct {
62 /* RDES0 */ 63 /* RDES0 */
63 u32 payload_csum_error:1; 64 u32 rx_mac_addr:1;
64 u32 crc_error:1; 65 u32 crc_error:1;
65 u32 dribbling:1; 66 u32 dribbling:1;
66 u32 error_gmii:1; 67 u32 error_gmii:1;
@@ -162,13 +163,57 @@ struct dma_desc {
162 unsigned int des3; 163 unsigned int des3;
163}; 164};
164 165
166/* Extended descriptor structure (supported by new SYNP GMAC generations) */
167struct dma_extended_desc {
168 struct dma_desc basic;
169 union {
170 struct {
171 u32 ip_payload_type:3;
172 u32 ip_hdr_err:1;
173 u32 ip_payload_err:1;
174 u32 ip_csum_bypassed:1;
175 u32 ipv4_pkt_rcvd:1;
176 u32 ipv6_pkt_rcvd:1;
177 u32 msg_type:4;
178 u32 ptp_frame_type:1;
179 u32 ptp_ver:1;
180 u32 timestamp_dropped:1;
181 u32 reserved:1;
182 u32 av_pkt_rcvd:1;
183 u32 av_tagged_pkt_rcvd:1;
184 u32 vlan_tag_priority_val:3;
185 u32 reserved3:3;
186 u32 l3_filter_match:1;
187 u32 l4_filter_match:1;
188 u32 l3_l4_filter_no_match:2;
189 u32 reserved4:4;
190 } erx;
191 struct {
192 u32 reserved;
193 } etx;
194 } des4;
195 unsigned int des5; /* Reserved */
196 unsigned int des6; /* Tx/Rx Timestamp Low */
197 unsigned int des7; /* Tx/Rx Timestamp High */
198};
199
165/* Transmit checksum insertion control */ 200/* Transmit checksum insertion control */
166enum tdes_csum_insertion { 201enum tdes_csum_insertion {
167 cic_disabled = 0, /* Checksum Insertion Control */ 202 cic_disabled = 0, /* Checksum Insertion Control */
168 cic_only_ip = 1, /* Only IP header */ 203 cic_only_ip = 1, /* Only IP header */
169 cic_no_pseudoheader = 2, /* IP header but pseudoheader 204 /* IP header but pseudoheader is not calculated */
170 * is not calculated */ 205 cic_no_pseudoheader = 2,
171 cic_full = 3, /* IP header and pseudoheader */ 206 cic_full = 3, /* IP header and pseudoheader */
172}; 207};
173 208
209/* Extended RDES4 definitions */
210#define RDES_EXT_NO_PTP 0
211#define RDES_EXT_SYNC 0x1
212#define RDES_EXT_FOLLOW_UP 0x2
213#define RDES_EXT_DELAY_REQ 0x3
214#define RDES_EXT_DELAY_RESP 0x4
215#define RDES_EXT_PDELAY_REQ 0x5
216#define RDES_EXT_PDELAY_RESP 0x6
217#define RDES_EXT_PDELAY_FOLLOW_UP 0x7
218
174#endif /* __DESCS_H__ */ 219#endif /* __DESCS_H__ */