diff options
Diffstat (limited to 'drivers/net/benet/be_cmds.c')
-rw-r--r-- | drivers/net/benet/be_cmds.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index f2c90997fabd..08e09388789a 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c | |||
@@ -80,10 +80,20 @@ static int be_mcc_compl_process(struct be_adapter *adapter, | |||
80 | if (compl_status == MCC_STATUS_SUCCESS) { | 80 | if (compl_status == MCC_STATUS_SUCCESS) { |
81 | if ((compl->tag0 == OPCODE_ETH_GET_STATISTICS) && | 81 | if ((compl->tag0 == OPCODE_ETH_GET_STATISTICS) && |
82 | (compl->tag1 == CMD_SUBSYSTEM_ETH)) { | 82 | (compl->tag1 == CMD_SUBSYSTEM_ETH)) { |
83 | struct be_cmd_resp_get_stats *resp = | 83 | if (adapter->generation == BE_GEN3) { |
84 | adapter->stats_cmd.va; | 84 | struct be_cmd_resp_get_stats_v1 *resp = |
85 | be_dws_le_to_cpu(&resp->hw_stats, | 85 | adapter->stats_cmd.va; |
86 | sizeof(resp->hw_stats)); | 86 | |
87 | be_dws_le_to_cpu(&resp->hw_stats, | ||
88 | sizeof(resp->hw_stats)); | ||
89 | } else { | ||
90 | struct be_cmd_resp_get_stats_v0 *resp = | ||
91 | adapter->stats_cmd.va; | ||
92 | |||
93 | be_dws_le_to_cpu(&resp->hw_stats, | ||
94 | sizeof(resp->hw_stats)); | ||
95 | } | ||
96 | be_parse_stats(adapter); | ||
87 | netdev_stats_update(adapter); | 97 | netdev_stats_update(adapter); |
88 | adapter->stats_cmd_sent = false; | 98 | adapter->stats_cmd_sent = false; |
89 | } | 99 | } |
@@ -1075,7 +1085,7 @@ int be_cmd_if_destroy(struct be_adapter *adapter, u32 interface_id, u32 domain) | |||
1075 | int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd) | 1085 | int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd) |
1076 | { | 1086 | { |
1077 | struct be_mcc_wrb *wrb; | 1087 | struct be_mcc_wrb *wrb; |
1078 | struct be_cmd_req_get_stats *req; | 1088 | struct be_cmd_req_hdr *hdr; |
1079 | struct be_sge *sge; | 1089 | struct be_sge *sge; |
1080 | int status = 0; | 1090 | int status = 0; |
1081 | 1091 | ||
@@ -1089,14 +1099,18 @@ int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd) | |||
1089 | status = -EBUSY; | 1099 | status = -EBUSY; |
1090 | goto err; | 1100 | goto err; |
1091 | } | 1101 | } |
1092 | req = nonemb_cmd->va; | 1102 | hdr = nonemb_cmd->va; |
1093 | sge = nonembedded_sgl(wrb); | 1103 | sge = nonembedded_sgl(wrb); |
1094 | 1104 | ||
1095 | be_wrb_hdr_prepare(wrb, sizeof(*req), false, 1, | 1105 | be_wrb_hdr_prepare(wrb, nonemb_cmd->size, false, 1, |
1096 | OPCODE_ETH_GET_STATISTICS); | 1106 | OPCODE_ETH_GET_STATISTICS); |
1097 | 1107 | ||
1098 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ETH, | 1108 | be_cmd_hdr_prepare(hdr, CMD_SUBSYSTEM_ETH, |
1099 | OPCODE_ETH_GET_STATISTICS, sizeof(*req)); | 1109 | OPCODE_ETH_GET_STATISTICS, nonemb_cmd->size); |
1110 | |||
1111 | if (adapter->generation == BE_GEN3) | ||
1112 | hdr->version = 1; | ||
1113 | |||
1100 | wrb->tag1 = CMD_SUBSYSTEM_ETH; | 1114 | wrb->tag1 = CMD_SUBSYSTEM_ETH; |
1101 | sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd->dma)); | 1115 | sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd->dma)); |
1102 | sge->pa_lo = cpu_to_le32(nonemb_cmd->dma & 0xFFFFFFFF); | 1116 | sge->pa_lo = cpu_to_le32(nonemb_cmd->dma & 0xFFFFFFFF); |