netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 20/32] rt2x00: byte ordering correctness
@ 2006-04-27 22:03 Ivo van Doorn
  2006-04-27 22:13 ` Christoph Hellwig
  0 siblings, 1 reply; 10+ messages in thread
From: Ivo van Doorn @ 2006-04-27 22:03 UTC (permalink / raw)
  To: netdev; +Cc: rt2x00-devel

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

From: Ivo van Doorn <IvDoorn@gmail.com>

Fix various little/big endian conversions.
rt2500pci should use cpu_to_le32 and rt2500usb should not.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>

diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-27 21:50:36.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-27 21:51:11.000000000 +0200
@@ -441,7 +441,7 @@ rt2500pci_config_channel(struct rt2x00_p
 	txpower = (txpower > 31) ? 31 : txpower;
 
 	if (rt2x00_rf(&rt2x00pci->chip, RF2525E) && channel == 14)
-		rf4 |= 0x00000010;
+		rf4 |= cpu_to_le32(0x00000010);
 
 	if (rt2x00_rf(&rt2x00pci->chip, RF5222)) {
 		if (channel < 14) {
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-27 21:50:36.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-27 21:51:11.000000000 +0200
@@ -324,20 +324,20 @@ rt2500usb_config_channel(struct rt2x00_u
 
 	if (rt2x00_rf(&rt2x00usb->chip, RF5222)) {
 		if (channel < 14) {
-			rf1 = cpu_to_le32(0x00022020);
-			rf4 = cpu_to_le32(0x00000a0b);
+			rf1 = 0x00022020;
+			rf4 = 0x00000a0b;
 		} else if (channel == 14) {
-			rf1 = cpu_to_le32(0x00022010);
-			rf4 = cpu_to_le32(0x00000a1b);
+			rf1 = 0x00022010;
+			rf4 = 0x00000a1b;
 		} else if (channel < 64) {
-			rf1 = cpu_to_le32(0x00022010);
-			rf4 = cpu_to_le32(0x00000a1f);
+			rf1 = 0x00022010;
+			rf4 = 0x00000a1f;
 		} else if (channel < 140) {
-			rf1 = cpu_to_le32(0x00022010);
-			rf4 = cpu_to_le32(0x00000a0f);
+			rf1 = 0x00022010;
+			rf4 = 0x00000a0f;
 		} else if (channel < 161) {
-			rf1 = cpu_to_le32(0x00022020);
-			rf4 = cpu_to_le32(0x00000a07);
+			rf1 = 0x00022020;
+			rf4 = 0x00000a07;
 		}
 	}
 
@@ -1829,7 +1829,7 @@ rt2500usb_init_hw_channels(struct rt2x00
 		};
 
 		for (counter = 0; counter < ARRAY_SIZE(vals); counter++)
-			channels[counter].val = cpu_to_le32(vals[counter]);
+			channels[counter].val = vals[counter];
 	} else if (rt2x00_rf(&rt2x00usb->chip, RF2523)
 	|| rt2x00_rf(&rt2x00usb->chip, RF2524)
 	|| rt2x00_rf(&rt2x00usb->chip, RF2525)) {
@@ -1841,8 +1841,7 @@ rt2500usb_init_hw_channels(struct rt2x00
 		};
 
 		for (counter = 0; counter < ARRAY_SIZE(vals); counter++)
-				channels[counter].val =
-				cpu_to_le32(vals[counter] | rf2_base);
+			channels[counter].val = vals[counter] | rf2_base;
 	} else if (rt2x00_rf(&rt2x00usb->chip, RF2525E)) {
 		u32 vals[] = {
 			0x0000089a, 0x0000089e, 0x0000089e, 0x000008a2,
@@ -1852,7 +1851,7 @@ rt2500usb_init_hw_channels(struct rt2x00
 		};
 
 		for (counter = 0; counter < ARRAY_SIZE(vals); counter++)
-			channels[counter].val = cpu_to_le32(vals[counter]);
+			channels[counter].val = vals[counter];
 	} else if (rt2x00_rf(&rt2x00usb->chip, RF5222)) {
 		static u32 vals[] = {
 			0x00001136, 0x0000113a, 0x0000113e, 0x00001182,
@@ -1868,7 +1867,7 @@ rt2500usb_init_hw_channels(struct rt2x00
 		};
 
 		for (counter = 0; counter < ARRAY_SIZE(vals); counter++)
-			channels[counter].val = cpu_to_le32(vals[counter]);
+			channels[counter].val = vals[counter];
 		}
 
 		/*
@@ -1895,9 +1894,9 @@ rt2500usb_init_hw_channels(struct rt2x00
 	 */
 	for (counter = 0; counter < ARRAY_SIZE(rf); counter++) {
 		if (rt2x00_rf(&rt2x00usb->chip, rf[counter].chip)) {
-			rt2x00usb->rf1 = cpu_to_le32(rf[counter].val[0]);
-			rt2x00usb->rf3 = cpu_to_le32(rf[counter].val[1]);
-			rt2x00usb->rf4 = cpu_to_le32(rf[counter].val[2]);
+			rt2x00usb->rf1 = rf[counter].val[0];
+			rt2x00usb->rf3 = rf[counter].val[1];
+			rt2x00usb->rf4 = rf[counter].val[2];
 		}
 	}
 }

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2006-04-28 15:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-27 22:03 [PATCH 20/32] rt2x00: byte ordering correctness Ivo van Doorn
2006-04-27 22:13 ` Christoph Hellwig
2006-04-28 12:59   ` Ivo van Doorn
2006-04-28 13:14     ` Christoph Hellwig
2006-04-28 13:31       ` Ivo van Doorn
2006-04-28 13:42         ` Michael Buesch
2006-04-28 13:45           ` Ivo van Doorn
2006-04-28 13:46           ` Christoph Hellwig
2006-04-28 13:56             ` Michael Buesch
2006-04-28 15:01             ` Ivo van Doorn

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).