]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From ccac18563cb9ba20a4afc722878804bcf2936170 Mon Sep 17 00:00:00 2001 |
2 | From: Andrew Vasquez <andrew.vasquez@qlogic.com> | |
3 | Date: Mon, 16 Feb 2009 08:19:31 -0800 | |
4 | Subject: qla2xxx: Correct endianness issue during flash manipulation. | |
5 | References: bnc#476206 | |
6 | ||
7 | The flash data was incorrectly being converted (cpu_to_le32()) | |
8 | when using the bulk-flash-write mailbox command (ISP25xx and | |
9 | above). | |
10 | ||
11 | Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> | |
12 | Signed-off-by: Hannes Reinecke <hare@suse.de> | |
13 | --- | |
14 | drivers/scsi/qla2xxx/qla_sup.c | 7 ++----- | |
15 | 1 files changed, 2 insertions(+), 5 deletions(-) | |
16 | ||
17 | diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c | |
18 | index 6729a39..a0b5ece 100644 | |
19 | --- a/drivers/scsi/qla2xxx/qla_sup.c | |
20 | +++ b/drivers/scsi/qla2xxx/qla_sup.c | |
21 | @@ -957,12 +957,11 @@ qla24xx_write_flash_data(scsi_qla_host_t *ha, uint32_t *dwptr, uint32_t faddr, | |
22 | uint32_t dwords) | |
23 | { | |
24 | int ret; | |
25 | - uint32_t liter, miter; | |
26 | + uint32_t liter; | |
27 | uint32_t sec_mask, rest_addr; | |
28 | uint32_t fdata, findex; | |
29 | dma_addr_t optrom_dma; | |
30 | void *optrom = NULL; | |
31 | - uint32_t *s, *d; | |
32 | ||
33 | ret = QLA_SUCCESS; | |
34 | ||
35 | @@ -1010,9 +1009,7 @@ qla24xx_write_flash_data(scsi_qla_host_t *ha, uint32_t *dwptr, uint32_t faddr, | |
36 | /* Go with burst-write. */ | |
37 | if (optrom && (liter + OPTROM_BURST_DWORDS) <= dwords) { | |
38 | /* Copy data to DMA'ble buffer. */ | |
39 | - for (miter = 0, s = optrom, d = dwptr; | |
40 | - miter < OPTROM_BURST_DWORDS; miter++, s++, d++) | |
41 | - *s = cpu_to_le32(*d); | |
42 | + memcpy(optrom, dwptr, OPTROM_BURST_SIZE); | |
43 | ||
44 | ret = qla2x00_load_ram(ha, optrom_dma, | |
45 | flash_data_to_access_addr(faddr), | |
46 | -- | |
47 | 1.6.0.4.781.gf2070 | |
48 |