[Prism54-devel] [patch 6/6] [prism54 svn trunk] various fixes for prism54 svn

jean-baptiste.note at wanadoo.fr jean-baptiste.note at wanadoo.fr
Sun May 15 11:44:15 UTC 2005


Index: trunk/ksrc/islpci_mgt.c
===================================================================
--- trunk.orig/ksrc/islpci_mgt.c	2005-05-15 12:23:26.000000000 +0200
+++ trunk/ksrc/islpci_mgt.c	2005-05-15 12:32:45.000000000 +0200
@@ -319,21 +319,23 @@
 		pimfor_header_t *header;
 		u32 index = priv->index_mgmt_rx % ISL38XX_CB_MGMT_QSIZE;
 		struct islpci_membuf *buf = &priv->mgmt_rx[index];
+		isl38xx_fragment *frag = &cb->rx_data_mgmt[index];
 		u16 frag_len;
+		u32 addr_offset;
 		int size;
 		struct islpci_mgmtframe *frame;
 
 		/* I have no idea (and no documentation) if flags != 0
 		 * is possible.  Drop the frame, reuse the buffer. */
-		if (le16_to_cpu(cb->rx_data_mgmt[index].flags) != 0) {
+		if (le16_to_cpu(frag->flags) != 0) {
 			printk(KERN_WARNING "%s: unknown flags 0x%04x\n",
 			       ndev->name,
-			       le16_to_cpu(cb->rx_data_mgmt[index].flags));
+			       le16_to_cpu(frag->flags));
 			continue;
 		}
 
 		/* The device only returns the size of the header(s) here. */
-		frag_len = le16_to_cpu(cb->rx_data_mgmt[index].size);
+		frag_len = le16_to_cpu(frag->size);
 
 		/*
 		 * We appear to have no way to tell the device the
@@ -346,6 +348,18 @@
 			frag_len = MGMT_FRAME_SIZE;
 		}
 
+		/*
+		 * Check if the LMAC has updated the host address pointer
+		 * This leads to an offset which has to be reflected.
+		 */
+		addr_offset = le32_to_cpu(frag->address) - buf->pci_addr;
+		if (addr_offset)
+		{
+			printk(KERN_WARNING "%s: mgmt frame was offset by %i\n",
+			       ndev->name,addr_offset);
+			skb_reserve(buf->skb,addr_offset);
+		}
+
 		/* Ensure the results of device DMA are visible to the CPU. */
 		/* frag_len not being the whole buffer, we need to
 		 * synchronize the whole buffer */

--
Jean-Baptiste Note
+33 (0)6 83 03 42 38
jean-baptiste.note at wanadoo.fr


More information about the Prism54-devel mailing list