Skip to contentSkip to conversation

be2net: fix mccq create for big endian architectures

PATCH Applied Ajit Khaparde 2 participants 2 messages Mar 11, 2010 – Mar 15, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 be2net: fix mccq create for big endian architectures

The request to create an mccq was being dispatched without doing a byte swap of num_pages. This byte swap is necessary for Big Endian systems like PPC. Not having this fix leads mccq create to fail on BE ASICs running newer version of firmware, thereby causing driver initialization failure.

---
 drivers/net/benet/be_cmds.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/benet/be_cmds.c +1 -1
index c592153..50e6259 100644
@@ -673,7 +673,7 @@ int be_cmd_mccq_create(struct be_adapter *adapter,
 	be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
 			OPCODE_COMMON_MCC_CREATE, sizeof(*req));
 
-	req->num_pages = PAGES_4K_SPANNED(q_mem->va, q_mem->size);
+	req->num_pages = cpu_to_le16(PAGES_4K_SPANNED(q_mem->va, q_mem->size));
 
 	AMAP_SET_BITS(struct amap_mcc_context, valid, ctxt, 1);
 	AMAP_SET_BITS(struct amap_mcc_context, ring_size, ctxt,
Signature · 1 line
1.6.3.3
maintainer Applied
#1 lore raw

From: Ajit Khaparde <[email protected]>
Date: Thu, 11 Mar 2010 17:05:59 +0530

Quoted 7 lines

The request to create an mccq was being dispatched without doing a byte swap of num_pages. This byte swap is necessary for Big Endian systems like PPC. Not having this fix leads mccq create to fail on BE ASICs running newer version of firmware, thereby causing driver initialization failure.

Applied.