linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* First patch to mrv8k driver?
@ 2008-05-14  0:59 John Daiker
  2008-05-14  4:37 ` Pavel Roskin
  0 siblings, 1 reply; 5+ messages in thread
From: John Daiker @ 2008-05-14  0:59 UTC (permalink / raw)
  To: Dan Williams; +Cc: Markus Becker, hs4233, David, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 167 bytes --]

Hey All,

My first patch for the mrv8k driver.  My machine locks up when I try to 
load a firmware, so I'm not sure if this patch helps anybody or not.

John Daiker



[-- Attachment #2: formatting.diff --]
[-- Type: text/x-diff, Size: 2194 bytes --]

Some formatting fixes, as well as a fwe mrv_reg_read32 returnvalue changes

Signed-off-by: John Daiker <daikerjohn@gmail.com>
---
 drivers/net/wireless/mrv8k/mrv8k.c |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/mrv8k/mrv8k.c b/drivers/net/wireless/mrv8k/mrv8k.c
index a86ea9f..88497a1 100644
--- a/drivers/net/wireless/mrv8k/mrv8k.c
+++ b/drivers/net/wireless/mrv8k/mrv8k.c
@@ -241,8 +241,9 @@ static int mrv_upload_fw(struct mrv_priv *priv)
 
 	_mrv_send_cmd(priv, MRV_HWMEM_CMD_BOOT);
 
-	/* the boot code is stupid enought that it does not report any status when it
-	 * loads correctly and become alive. Wait 1 second..*/
+	/* The boot code is stupid enough that it does not report any status
+	 * when it loads correctly and become alive. Wait 1 second...
+	 */
 	msleep(1000);
 
 	err = request_firmware(&img, FW_FIRMWARE_FILENAME, &priv->pdev->dev);
@@ -260,12 +261,15 @@ static int mrv_upload_fw(struct mrv_priv *priv)
 		memcpy(cmd_data, img->data + i, 256);
 		mrv_send_cmd(priv);
 		for (j = 0; j < 500; j++) {
-			if (mrv_reg_read32(priv, MRV_REG_STATUS) == 5)
-			  break;
+			if (mrv_reg_read32(priv, MRV_REG_STATUS) == 0x5)
+				break;
 			mdelay(1);
 		}
+		/* We waited for 500 msecs and the card never went to the
+		 * magical 'Loading firmware' state
+		 */
 		if (j == 500) {
-			printk(KERN_ERR"Boot FW has failed to transfer real FW\n");
+			printk(KERN_ERR"Boot Firmware has failed to transfer a real Firmware\n");
 			return -2;
 		}
 	}
@@ -278,12 +282,15 @@ static int mrv_upload_fw(struct mrv_priv *priv)
 		memcpy(cmd_data, img->data + i, img->size - i);
 		mrv_send_cmd(priv);
 		for (j = 0; j < 500; j++) {
-			if (mrv_reg_read32(priv, MRV_REG_STATUS) == 5)
-			  break;
+			if (mrv_reg_read32(priv, MRV_REG_STATUS) == 0x5)
+				break;
 			mdelay(1);
 		}
+		/* We waited for 500 msecs and the card never transfered the
+		 * last portion of the firmware... return an error
+		 */
 		if (j == 500) {
-			printk(KERN_ERR"Boot FW has failed to transfer last real FW chunk\n");
+			printk(KERN_ERR"Boot Firmware has failed to transfer the last real Firmware chunk\n");
 			return -2;
 		}
 	}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-05-14 17:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-14  0:59 First patch to mrv8k driver? John Daiker
2008-05-14  4:37 ` Pavel Roskin
2008-05-14 13:08   ` Markus Becker
2008-05-14 13:21     ` Johannes Berg
2008-05-14 17:56     ` John Daiker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).