libertas: endianness fixes

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c2df2efe96742b78454acdffe6d278ae334fc838
Commit: c2df2efe96742b78454acdffe6d278ae334fc838
Parent: 1723047d6742cc172d5c0f1a5245deaee67ff331
Author: Holger Schurig [EMAIL PROTECTED]
AuthorDate: Fri Dec 7 15:30:44 2007 +
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:06:13 2008 -0800

libertas: endianness fixes

Recently I found that that sparse by default doesn't endianness
checks. So I changed my compilation habit to be

make modules C=1 SUBDIRS=drivers/net/wireless/libertas
CHECKFLAGS=-D__CHECK_ENDIAN__

so that I get the little-endian checks from sparse as well. That
showed up a good bunch of problems.

Signed-off-by: Holger Schurig [EMAIL PROTECTED]
Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/11d.c |2 +-
 drivers/net/wireless/libertas/cmd.c |   28 ++--
 drivers/net/wireless/libertas/cmdresp.c |2 +-
 drivers/net/wireless/libertas/hostcmd.h |8 
 drivers/net/wireless/libertas/if_sdio.c |2 +-
 drivers/net/wireless/libertas/if_usb.c  |4 ++--
 6 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/net/wireless/libertas/11d.c 
b/drivers/net/wireless/libertas/11d.c
index 377dcb5..013965d 100644
--- a/drivers/net/wireless/libertas/11d.c
+++ b/drivers/net/wireless/libertas/11d.c
@@ -518,7 +518,7 @@ int lbs_cmd_802_11d_domain_info(struct lbs_private *priv,
cmd-size =
cpu_to_le16(sizeof(pdomaininfo-action) + S_DS_GEN);
lbs_deb_hex(LBS_DEB_11D, 802_11D_DOMAIN_INFO, (u8 *) cmd,
-   (int)(cmd-size));
+   le16_to_cpu(cmd-size));
goto done;
}
 
diff --git a/drivers/net/wireless/libertas/cmd.c 
b/drivers/net/wireless/libertas/cmd.c
index ebfcb7b..cf1ab8a 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -431,7 +431,7 @@ static int lbs_cmd_802_11_snmp_mib(struct lbs_private *priv,
u8 mode = (u8) (size_t) pdata_buf;
pSNMPMIB-querytype = cpu_to_le16(CMD_ACT_SET);
pSNMPMIB-oid = cpu_to_le16((u16) DESIRED_BSSTYPE_I);
-   pSNMPMIB-bufsize = sizeof(u8);
+   pSNMPMIB-bufsize = cpu_to_le16(sizeof(u8));
if (mode == IW_MODE_ADHOC) {
ucTemp = SNMP_MIB_VALUE_ADHOC;
} else {
@@ -451,8 +451,8 @@ static int lbs_cmd_802_11_snmp_mib(struct lbs_private *priv,
pSNMPMIB-oid = cpu_to_le16((u16) DOT11D_I);
 
if (cmd_action == CMD_ACT_SET) {
-   pSNMPMIB-querytype = CMD_ACT_SET;
-   pSNMPMIB-bufsize = sizeof(u16);
+   pSNMPMIB-querytype = cpu_to_le16(CMD_ACT_SET);
+   pSNMPMIB-bufsize = cpu_to_le16(sizeof(u16));
ulTemp = *(u32 *)pdata_buf;
*((__le16 *)(pSNMPMIB-value)) =
cpu_to_le16((u16) ulTemp);
@@ -484,7 +484,7 @@ static int lbs_cmd_802_11_snmp_mib(struct lbs_private *priv,
{
 
u32 ulTemp;
-   pSNMPMIB-oid = le16_to_cpu((u16) RTSTHRESH_I);
+   pSNMPMIB-oid = cpu_to_le16(RTSTHRESH_I);
 
if (cmd_action == CMD_ACT_GET) {
pSNMPMIB-querytype = cpu_to_le16(CMD_ACT_GET);
@@ -759,7 +759,7 @@ static int lbs_cmd_reg_access(struct lbs_private *priv,
 
offval = (struct lbs_offset_value *)pdata_buf;
 
-   switch (cmdptr-command) {
+   switch (le16_to_cpu(cmdptr-command)) {
case CMD_MAC_REG_ACCESS:
{
struct cmd_ds_mac_reg_access *macreg;
@@ -999,7 +999,7 @@ void lbs_queue_cmd(struct lbs_adapter *adapter,
}
 
/* Exit_PS command needs to be queued in the header always. */
-   if (cmdptr-command == CMD_802_11_PS_MODE) {
+   if (le16_to_cpu(cmdptr-command) == CMD_802_11_PS_MODE) {
struct cmd_ds_802_11_ps_mode *psm = cmdptr-params.psmode;
if (psm-action == cpu_to_le16(CMD_SUBCMD_EXIT_PS)) {
if (adapter-psstate != PS_STATE_FULL_POWER)
@@ -1062,15 +1062,14 @@ static int DownloadcommandToStation(struct lbs_private 
*priv,
adapter-cur_cmd_retcode = 0;
spin_unlock_irqrestore(adapter-driver_lock, flags);
 
-   cmdsize = cmdptr-size;
-   command = cpu_to_le16(cmdptr-command);
+   cmdsize = le16_to_cpu(cmdptr-size);
+   command = le16_to_cpu(cmdptr-command);
 
lbs_deb_host(DNLD_CMD: command 0x%04x, size %d, jiffies %lu\n,
-   command, le16_to_cpu

libertas: endianness fixes for get_channel/set_channel

2008-01-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cb182a602802b36ff992afe238e1a3eafc0956b2
Commit: cb182a602802b36ff992afe238e1a3eafc0956b2
Parent: 2dd4b26264d48f10e802cc9f2d75542be5a3c7fa
Author: Dan Williams [EMAIL PROTECTED]
AuthorDate: Tue Dec 11 17:35:51 2007 -0500
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Mon Jan 28 15:06:50 2008 -0800

libertas: endianness fixes for get_channel/set_channel

Signed-off-by: Dan Williams [EMAIL PROTECTED]
Signed-off-by: David Woodhouse [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/libertas/cmd.c |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/libertas/cmd.c 
b/drivers/net/wireless/libertas/cmd.c
index 32f9f88..0f07c2a 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -831,8 +831,8 @@ int lbs_get_channel(struct lbs_private *priv)
if (ret)
goto out;
 
-   lbs_deb_cmd(current radio channel is %d\n, cmd.channel);
-   ret = (int) cmd.channel;
+   ret = le16_to_cpu(cmd.channel);
+   lbs_deb_cmd(current radio channel is %d\n, ret);
 
 out:
lbs_deb_leave_args(LBS_DEB_CMD, ret %d, ret);
@@ -863,8 +863,9 @@ int lbs_set_channel(struct lbs_private *priv, u8 channel)
if (ret)
goto out;
 
-   priv-curbssparams.channel = cmd.channel;
-   lbs_deb_cmd(channel switch from %d to %d\n, old_channel, cmd.channel);
+   priv-curbssparams.channel = (uint8_t) le16_to_cpu(cmd.channel);
+   lbs_deb_cmd(channel switch from %d to %d\n, old_channel,
+   priv-curbssparams.channel);
 
 out:
lbs_deb_leave_args(LBS_DEB_CMD, ret %d, ret);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html