aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2007-12-21 03:40:35 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:09:06 -0500
commit184a3b2c517531faac80b0d74c423dd26038cfd2 (patch)
treeb7437116a56c7b992cf52e5f1154eec85ddd5df6 /drivers
parent8a9faf3cd08b91aca1502dbe18e3b5063fda2e87 (diff)
hostap: don't mess with mixed-endian even for internal skb queues
Just leave hfa384x_info_frame as-is, don't convert in place. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/hostap/hostap_hw.c14
-rw-r--r--drivers/net/wireless/hostap/hostap_info.c5
2 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
index 77237bb3b2f9..7be68db6f300 100644
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -2448,18 +2448,16 @@ static void prism2_info(local_info_t *local)
2448 goto out; 2448 goto out;
2449 } 2449 }
2450 2450
2451 le16_to_cpus(&info.len); 2451 left = (le16_to_cpu(info.len) - 1) * 2;
2452 le16_to_cpus(&info.type);
2453 left = (info.len - 1) * 2;
2454 2452
2455 if (info.len & 0x8000 || info.len == 0 || left > 2060) { 2453 if (info.len & cpu_to_le16(0x8000) || info.len == 0 || left > 2060) {
2456 /* data register seems to give 0x8000 in some error cases even 2454 /* data register seems to give 0x8000 in some error cases even
2457 * though busy bit is not set in offset register; 2455 * though busy bit is not set in offset register;
2458 * in addition, length must be at least 1 due to type field */ 2456 * in addition, length must be at least 1 due to type field */
2459 spin_unlock(&local->baplock); 2457 spin_unlock(&local->baplock);
2460 printk(KERN_DEBUG "%s: Received info frame with invalid " 2458 printk(KERN_DEBUG "%s: Received info frame with invalid "
2461 "length 0x%04x (type 0x%04x)\n", dev->name, info.len, 2459 "length 0x%04x (type 0x%04x)\n", dev->name,
2462 info.type); 2460 le16_to_cpu(info.len), le16_to_cpu(info.type));
2463 goto out; 2461 goto out;
2464 } 2462 }
2465 2463
@@ -2476,8 +2474,8 @@ static void prism2_info(local_info_t *local)
2476 { 2474 {
2477 spin_unlock(&local->baplock); 2475 spin_unlock(&local->baplock);
2478 printk(KERN_WARNING "%s: Info frame read failed (fid=0x%04x, " 2476 printk(KERN_WARNING "%s: Info frame read failed (fid=0x%04x, "
2479 "len=0x%04x, type=0x%04x\n", 2477 "len=0x%04x, type=0x%04x\n", dev->name, fid,
2480 dev->name, fid, info.len, info.type); 2478 le16_to_cpu(info.len), le16_to_cpu(info.type));
2481 dev_kfree_skb(skb); 2479 dev_kfree_skb(skb);
2482 goto out; 2480 goto out;
2483 } 2481 }
diff --git a/drivers/net/wireless/hostap/hostap_info.c b/drivers/net/wireless/hostap/hostap_info.c
index e559b8d9fca6..7cd3fb79230e 100644
--- a/drivers/net/wireless/hostap/hostap_info.c
+++ b/drivers/net/wireless/hostap/hostap_info.c
@@ -373,7 +373,7 @@ void hostap_info_process(local_info_t *local, struct sk_buff *skb)
373 buf = skb->data + sizeof(*info); 373 buf = skb->data + sizeof(*info);
374 left = skb->len - sizeof(*info); 374 left = skb->len - sizeof(*info);
375 375
376 switch (info->type) { 376 switch (le16_to_cpu(info->type)) {
377 case HFA384X_INFO_COMMTALLIES: 377 case HFA384X_INFO_COMMTALLIES:
378 prism2_info_commtallies(local, buf, left); 378 prism2_info_commtallies(local, buf, left);
379 break; 379 break;
@@ -395,7 +395,8 @@ void hostap_info_process(local_info_t *local, struct sk_buff *skb)
395#ifndef PRISM2_NO_DEBUG 395#ifndef PRISM2_NO_DEBUG
396 default: 396 default:
397 PDEBUG(DEBUG_EXTRA, "%s: INFO - len=%d type=0x%04x\n", 397 PDEBUG(DEBUG_EXTRA, "%s: INFO - len=%d type=0x%04x\n",
398 local->dev->name, info->len, info->type); 398 local->dev->name, le16_to_cpu(info->len),
399 le16_to_cpu(info->type));
399 PDEBUG(DEBUG_EXTRA, "Unknown info frame:"); 400 PDEBUG(DEBUG_EXTRA, "Unknown info frame:");
400 for (i = 0; i < (left < 100 ? left : 100); i++) 401 for (i = 0; i < (left < 100 ? left : 100); i++)
401 PDEBUG2(DEBUG_EXTRA, " %02x", buf[i]); 402 PDEBUG2(DEBUG_EXTRA, " %02x", buf[i]);