summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZheng Da <zhengda1936@gmail.com>2010-05-05 14:31:35 +0200
committerZheng Da <zhengda1936@gmail.com>2010-05-05 14:31:35 +0200
commit6579834b6c314d2a40f205769b3047bf12839e88 (patch)
treeb1ae3ebba1c8bd18b95c667c9a097d53b7820489
parent269e296815b7ad2010097a28583f698ad4ce6554 (diff)
fix a bug in searching network devices.
-rw-r--r--libdde_linux26/lib/src/arch/l4/mach_glue.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libdde_linux26/lib/src/arch/l4/mach_glue.c b/libdde_linux26/lib/src/arch/l4/mach_glue.c
index f3f56bda..ae91ef98 100644
--- a/libdde_linux26/lib/src/arch/l4/mach_glue.c
+++ b/libdde_linux26/lib/src/arch/l4/mach_glue.c
@@ -10,19 +10,25 @@ static struct sk_buff_head skb_done_list;
struct net_device *search_netdev (char *name)
{
struct net_device *dev;
+ struct net_device *found = NULL;
struct net *net;
+ printk("search device %s\n", name);
read_lock(&dev_base_lock);
for_each_net(net) {
for_each_netdev(net, dev) {
- if (!strcmp (name, dev->name)
- && dev->base_addr && dev->base_addr != 0xffe0)
+ printk("there is device %s, base addr: %x\n",
+ dev->name, dev->base_addr);
+ if (!strcmp (name, dev->name))
+ {
+ found = dev;
goto end;
+ }
}
}
end:
read_unlock(&dev_base_lock);
- return dev;
+ return found;
}
int linux_pkg_xmit (char *pkg_data, int len, void *del_data,