From: santosh nayak <santoshprasadnayak@gmail.com>
To: sony.chacko@qlogic.com
Cc: rajesh.borundia@qlogic.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
Santosh Nayak <santoshprasadnayak@gmail.com>
Subject: [PATCH 3/3] netxen: qlogic ethernet : Fix Endian Bug.
Date: Fri, 2 Mar 2012 20:41:39 +0530 [thread overview]
Message-ID: <1330701099-18281-1-git-send-email-santoshprasadnayak@gmail.com> (raw)
From: Santosh Nayak <santoshprasadnayak@gmail.com>
Fix endian bug.
Add a default case in 'netxen_list_config_vlan_ip'
Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
---
.../net/ethernet/qlogic/netxen/netxen_nic_main.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index 8dc4a134..971b286 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -818,7 +818,7 @@ netxen_check_options(struct netxen_adapter *adapter)
adapter->driver_mismatch = 1;
return;
}
- ptr32[i] = cpu_to_le32(val);
+ ptr32[i] = val;
offset += sizeof(u32);
}
@@ -3028,7 +3028,7 @@ netxen_list_config_vlan_ip(struct netxen_adapter *adapter,
list_for_each(head, &adapter->vlan_ip_list) {
cur = list_entry(head, struct nx_vlan_ip_list, list);
- if (cur->ip_addr == ifa->ifa_address)
+ if (cur->ip_addr == be32_to_cpu(ifa->ifa_address))
return;
}
@@ -3039,18 +3039,22 @@ netxen_list_config_vlan_ip(struct netxen_adapter *adapter,
return;
}
- cur->ip_addr = ifa->ifa_address;
+ cur->ip_addr = be32_to_cpu(ifa->ifa_address);
list_add_tail(&cur->list, &adapter->vlan_ip_list);
break;
case NX_IP_DOWN:
list_for_each_entry_safe(cur, tmp_cur,
&adapter->vlan_ip_list, list) {
- if (cur->ip_addr == ifa->ifa_address) {
+ if (cur->ip_addr == be32_to_cpu(ifa->ifa_address)) {
list_del(&cur->list);
kfree(cur);
break;
}
}
+ break;
+ default:
+ printk(KERN_ERR "%ld: Wrong event id \n", event);
+ break;
}
}
static void
@@ -3070,12 +3074,12 @@ netxen_config_indev_addr(struct netxen_adapter *adapter,
switch (event) {
case NETDEV_UP:
netxen_config_ipaddr(adapter,
- ifa->ifa_address, NX_IP_UP);
+ be32_to_cpu(ifa->ifa_address), NX_IP_UP);
netxen_list_config_vlan_ip(adapter, ifa, NX_IP_UP);
break;
case NETDEV_DOWN:
netxen_config_ipaddr(adapter,
- ifa->ifa_address, NX_IP_DOWN);
+ be32_to_cpu(ifa->ifa_address), NX_IP_DOWN);
netxen_list_config_vlan_ip(adapter, ifa, NX_IP_DOWN);
break;
default:
@@ -3167,11 +3171,11 @@ recheck:
switch (event) {
case NETDEV_UP:
- netxen_config_ipaddr(adapter, ifa->ifa_address, NX_IP_UP);
+ netxen_config_ipaddr(adapter, be32_to_cpu(ifa->ifa_address), NX_IP_UP);
netxen_list_config_vlan_ip(adapter, ifa, NX_IP_UP);
break;
case NETDEV_DOWN:
- netxen_config_ipaddr(adapter, ifa->ifa_address, NX_IP_DOWN);
+ netxen_config_ipaddr(adapter, be32_to_cpu(ifa->ifa_address), NX_IP_DOWN);
netxen_list_config_vlan_ip(adapter, ifa, NX_IP_DOWN);
break;
default:
--
1.7.4.4
next reply other threads:[~2012-03-02 15:12 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-02 15:11 santosh nayak [this message]
2012-03-02 17:22 ` Rajesh Borundia
2012-03-05 21:49 ` [PATCH 0001/001] xen: multi page ring support for block devices Santosh Jodh
2012-03-06 2:42 ` Rusty Russell
2012-03-06 6:21 ` Santosh Jodh
2012-03-06 8:34 ` Jan Beulich
[not found] ` <CAPbh3rsExLtohBwVd_scYuO=GN1iZE5egQQ3x5M59YUno5Rtyw@mail.gmail.com>
2012-03-07 9:33 ` [Xen-devel] " Jan Beulich
2012-03-03 15:47 [PATCH 3/3] netxen: qlogic ethernet : Fix Endian Bug santosh nayak
2012-03-05 11:43 ` Rajesh Borundia
2012-03-05 20:35 ` David Miller
2012-03-07 19:41 ` Rajesh Borundia
2012-03-09 16:34 ` Rajesh Borundia
2012-03-09 18:50 ` santosh prasad nayak
2012-03-10 19:01 ` Rajesh Borundia
2012-03-11 9:16 ` santosh prasad nayak
2012-03-12 6:19 ` Rajesh Borundia
2012-03-12 9:37 ` David Laight
2012-03-12 9:47 ` santosh prasad nayak
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=1330701099-18281-1-git-send-email-santoshprasadnayak@gmail.com \
--to=santoshprasadnayak@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rajesh.borundia@qlogic.com \
--cc=sony.chacko@qlogic.com \
/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
all inboxes | Powered by JetHome®