[PATCH NEXT 4/5] netxen: fix fw load from file

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Amit Kumar Salecha
Date: Monday, March 29, 2010 - 5:43 am

Rarely: Fw file size can be unaligned to 8.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
 drivers/net/netxen/netxen_nic_init.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index 141bc43..439f3e8 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -1019,6 +1019,16 @@ netxen_load_firmware(struct netxen_adapter *adapter)
 
 			flashaddr += 8;
 		}
+
+		size = (__force u32)nx_get_fw_size(adapter) % 8;
+		if (size) {
+			data = cpu_to_le64(ptr64[i]);
+
+			if (adapter->pci_mem_write(adapter,
+						flashaddr, data))
+				return -EIO;
+		}
+
 	} else {
 		u64 data;
 		u32 hi, lo;
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH NEXT 0/5]netxen: fw file validation and fixes, Amit Kumar Salecha, (Mon Mar 29, 5:43 am)
[PATCH NEXT 1/5] netxen: fix tx csum status, Amit Kumar Salecha, (Mon Mar 29, 5:43 am)
[PATCH NEXT 2/5] netxen: fix corner cases of firmware recovery, Amit Kumar Salecha, (Mon Mar 29, 5:43 am)
[PATCH NEXT 3/5] netxen: validate unified romimage, Amit Kumar Salecha, (Mon Mar 29, 5:43 am)
[PATCH NEXT 4/5] netxen: fix fw load from file, Amit Kumar Salecha, (Mon Mar 29, 5:43 am)
[PATCH NEXT 5/5] netxen: fix interrupt for NX2031, Amit Kumar Salecha, (Mon Mar 29, 5:43 am)