Commit be6b7ca3 authored by Michael Chan's avatar Michael Chan Committed by David S. Miller
Browse files

bnxt_en: Add new TX timestamp completion definitions



The new BCM5760X chips will generate this new TX timestamp completion
when a TX packet's timestamp has been taken right before transmission.
The driver logic to retrieve the timestamp will be added in the next
few patches.

Reviewed-by: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: default avatarAndy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 42c45ac1
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -181,6 +181,32 @@ struct tx_cmp {
#define TX_CMP_SQ_CONS_IDX(txcmp)					\
	(le32_to_cpu((txcmp)->sq_cons_idx) & TX_CMP_SQ_CONS_IDX_MASK)

struct tx_ts_cmp {
	__le32 tx_ts_cmp_flags_type;
	#define TX_TS_CMP_FLAGS_ERROR				(1 << 6)
	#define TX_TS_CMP_FLAGS_TS_TYPE				(1 << 7)
	 #define TX_TS_CMP_FLAGS_TS_TYPE_PM			 (0 << 7)
	 #define TX_TS_CMP_FLAGS_TS_TYPE_PA			 (1 << 7)
	#define TX_TS_CMP_FLAGS_TS_FALLBACK			(1 << 8)
	#define TX_TS_CMP_TS_SUB_NS				(0xf << 12)
	#define TX_TS_CMP_TS_NS_MID				(0xffff << 16)
	#define TX_TS_CMP_TS_NS_MID_SFT				16
	u32 tx_ts_cmp_opaque;
	__le32 tx_ts_cmp_errors_v;
	#define TX_TS_CMP_V					(1 << 0)
	#define TX_TS_CMP_TS_INVALID_ERR			(1 << 10)
	__le32 tx_ts_cmp_ts_ns_lo;
};

#define BNXT_GET_TX_TS_48B_NS(tscmp)					\
	(le32_to_cpu((tscmp)->tx_ts_cmp_ts_ns_lo) |			\
	 ((u64)(le32_to_cpu((tscmp)->tx_ts_cmp_flags_type) &		\
	  TX_TS_CMP_TS_NS_MID) << TX_TS_CMP_TS_NS_MID_SFT))

#define BNXT_TX_TS_ERR(tscmp)						\
	(((tscmp)->tx_ts_cmp_flags_type & cpu_to_le32(TX_TS_CMP_FLAGS_ERROR)) &&\
	 ((tscmp)->tx_ts_cmp_errors_v & cpu_to_le32(TX_TS_CMP_TS_INVALID_ERR)))

struct rx_cmp {
	__le32 rx_cmp_len_flags_type;
	#define RX_CMP_CMP_TYPE					(0x3f << 0)