Skip to content

Commit c070395

Browse files
Amit Kumar Salechadavem330
authored andcommitted
netxen: fix endianness intr coalesce
Before sending Interrupt coalesce parameters to device, convert them in little endian. Signed-off-by: Amit Kumar Salecha <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a03d245 commit c070395

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

drivers/net/netxen/netxen_nic_hw.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -777,17 +777,20 @@ int netxen_p3_nic_set_mac_addr(struct netxen_adapter *adapter, u8 *addr)
777777
int netxen_config_intr_coalesce(struct netxen_adapter *adapter)
778778
{
779779
nx_nic_req_t req;
780-
u64 word;
781-
int rv;
780+
u64 word[6];
781+
int rv, i;
782782

783783
memset(&req, 0, sizeof(nx_nic_req_t));
784+
memset(word, 0, sizeof(word));
784785

785786
req.qhdr = cpu_to_le64(NX_HOST_REQUEST << 23);
786787

787-
word = NETXEN_CONFIG_INTR_COALESCE | ((u64)adapter->portnum << 16);
788-
req.req_hdr = cpu_to_le64(word);
788+
word[0] = NETXEN_CONFIG_INTR_COALESCE | ((u64)adapter->portnum << 16);
789+
req.req_hdr = cpu_to_le64(word[0]);
789790

790-
memcpy(&req.words[0], &adapter->coal, sizeof(adapter->coal));
791+
memcpy(&word[0], &adapter->coal, sizeof(adapter->coal));
792+
for (i = 0; i < 6; i++)
793+
req.words[i] = cpu_to_le64(word[i]);
791794

792795
rv = netxen_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1);
793796
if (rv != 0) {

0 commit comments

Comments
 (0)