fm10k/base: add PF Tx timestamp mode handler
authorWang Xiao W <xiao.w.wang@intel.com>
Thu, 10 Sep 2015 04:38:10 +0000 (12:38 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 7 Oct 2015 11:25:07 +0000 (13:25 +0200)
We need a handler function to be able to listen for Tx timestamp mode
responses. Without this, core driver code for PTP can't determine if the
Timestamp mode request was successful. This was overlooked in the
previous commit.

Signed-off-by: Wang Xiao W <xiao.w.wang@intel.com>
drivers/net/fm10k/base/fm10k_pf.c
drivers/net/fm10k/base/fm10k_pf.h

index 7ab322a..cc49235 100644 (file)
@@ -1810,6 +1810,12 @@ const struct fm10k_tlv_attr fm10k_1588_timestamp_msg_attr[] = {
        FM10K_TLV_ATTR_LAST
 };
 
+const struct fm10k_tlv_attr fm10k_tx_timestamp_mode_attr[] = {
+       FM10K_TLV_ATTR_LE_STRUCT(FM10K_PF_ATTR_ID_TIMESTAMP_MODE_RESP,
+                                sizeof(struct fm10k_swapi_tx_timestamp_mode)),
+       FM10K_TLV_ATTR_LAST
+};
+
 /* currently there is no shared 1588 timestamp handler */
 
 /**
index f6c290a..5a40d5b 100644 (file)
@@ -118,6 +118,12 @@ struct fm10k_swapi_1588_timestamp {
        __le16 sglort;
 };
 
+struct fm10k_swapi_tx_timestamp_mode {
+       __le16 glort;
+       __le16 maxmode;
+       __le32 status;
+};
+
 #define FM10K_PF_MSG_LPORT_CREATE_HANDLER(func) \
        FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_LPORT_CREATE, NULL, func)
 #define FM10K_PF_MSG_LPORT_DELETE_HANDLER(func) \
@@ -139,6 +145,11 @@ extern const struct fm10k_tlv_attr fm10k_err_msg_attr[];
 #define FM10K_PF_MSG_ERR_HANDLER(msg, func) \
        FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_##msg, fm10k_err_msg_attr, func)
 
+extern const struct fm10k_tlv_attr fm10k_tx_timestamp_mode_attr[];
+#define FM10K_PF_MSG_TIMESTAMP_MODE_HANDLER(func) \
+       FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_TX_TIMESTAMP_MODE, \
+                         fm10k_tx_timestamp_mode_attr, func)
+
 extern const struct fm10k_tlv_attr fm10k_1588_timestamp_msg_attr[];
 #define FM10K_PF_MSG_1588_TIMESTAMP_HANDLER(func) \
        FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_1588_TIMESTAMP, \