From: Ivo van Doorn <ivdoorn@gmail.com>
To: netdev@vger.kernel.org
Cc: rt2x00-devel@lfcorreia.dyndns.org
Subject: [PATCH 20/32] rt2x00: byte ordering correctness
Date: Fri, 28 Apr 2006 00:03:12 +0200 [thread overview]
Message-ID: <200604280003.12743.IvDoorn@gmail.com> (raw)
[-- 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 --]
next reply other threads:[~2006-04-27 22:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-27 22:03 Ivo van Doorn [this message]
2006-04-27 22:13 ` [PATCH 20/32] rt2x00: byte ordering correctness 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200604280003.12743.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=rt2x00-devel@lfcorreia.dyndns.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).