aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic
diff options
context:
space:
mode:
authorAmit Kumar Salecha <amit.salecha@qlogic.com>2010-08-19 01:08:30 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-19 19:52:41 -0400
commit63e74e9cb7944b073c49159db934f69ca98a4ae6 (patch)
tree6c08fd51c396e53dac72e645d0d1d43237400de4 /drivers/net/qlcnic
parent21854f029da525b5bef1dbd63c622e16a2eb2f90 (diff)
qlcnic: fix endiness in eswitch statistics
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic')
-rw-r--r--drivers/net/qlcnic/qlcnic_ctx.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/net/qlcnic/qlcnic_ctx.c b/drivers/net/qlcnic/qlcnic_ctx.c
index 74ae3b0a5ea8..315705b22be2 100644
--- a/drivers/net/qlcnic/qlcnic_ctx.c
+++ b/drivers/net/qlcnic/qlcnic_ctx.c
@@ -946,6 +946,7 @@ int qlcnic_get_port_stats(struct qlcnic_adapter *adapter, const u8 func,
946 const u8 rx_tx, struct __qlcnic_esw_statistics *esw_stats) { 946 const u8 rx_tx, struct __qlcnic_esw_statistics *esw_stats) {
947 947
948 size_t stats_size = sizeof(struct __qlcnic_esw_statistics); 948 size_t stats_size = sizeof(struct __qlcnic_esw_statistics);
949 struct __qlcnic_esw_statistics *stats;
949 dma_addr_t stats_dma_t; 950 dma_addr_t stats_dma_t;
950 void *stats_addr; 951 void *stats_addr;
951 u32 arg1; 952 u32 arg1;
@@ -980,8 +981,21 @@ int qlcnic_get_port_stats(struct qlcnic_adapter *adapter, const u8 func,
980 LSD(stats_dma_t), 981 LSD(stats_dma_t),
981 QLCNIC_CDRP_CMD_GET_ESWITCH_STATS); 982 QLCNIC_CDRP_CMD_GET_ESWITCH_STATS);
982 983
983 if (!err) 984 if (!err) {
984 memcpy(esw_stats, stats_addr, stats_size); 985 stats = (struct __qlcnic_esw_statistics *)stats_addr;
986 esw_stats->context_id = le16_to_cpu(stats->context_id);
987 esw_stats->version = le16_to_cpu(stats->version);
988 esw_stats->size = le16_to_cpu(stats->size);
989 esw_stats->multicast_frames =
990 le64_to_cpu(stats->multicast_frames);
991 esw_stats->broadcast_frames =
992 le64_to_cpu(stats->broadcast_frames);
993 esw_stats->unicast_frames = le64_to_cpu(stats->unicast_frames);
994 esw_stats->dropped_frames = le64_to_cpu(stats->dropped_frames);
995 esw_stats->local_frames = le64_to_cpu(stats->local_frames);
996 esw_stats->errors = le64_to_cpu(stats->errors);
997 esw_stats->numbytes = le64_to_cpu(stats->numbytes);
998 }
985 999
986 pci_free_consistent(adapter->pdev, stats_size, stats_addr, 1000 pci_free_consistent(adapter->pdev, stats_size, stats_addr,
987 stats_dma_t); 1001 stats_dma_t);