Commit 843a763d authored by David S. Miller's avatar David S. Miller

Merge davem@nuts.ninka.net:/disk1/davem/BK/net-2.5

into kernel.bkbits.net:/home/davem/net-2.5
parents 0873a5d6 9ca399c5
......@@ -2860,8 +2860,10 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void *arg)
if (!capable(CAP_NET_ADMIN))
return -EPERM;
copy_from_user(&reg, (struct he_ioctl_reg *) arg,
sizeof(struct he_ioctl_reg));
if (copy_from_user(&reg, (struct he_ioctl_reg *) arg,
sizeof(struct he_ioctl_reg)))
return -EFAULT;
spin_lock_irqsave(&he_dev->global_lock, flags);
switch (reg.type) {
case HE_REGTYPE_PCI:
......@@ -2885,8 +2887,9 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void *arg)
}
spin_unlock_irqrestore(&he_dev->global_lock, flags);
if (err == 0)
copy_to_user((struct he_ioctl_reg *) arg, &reg,
sizeof(struct he_ioctl_reg));
if (copy_to_user((struct he_ioctl_reg *) arg, &reg,
sizeof(struct he_ioctl_reg)))
return -EFAULT;
break;
default:
#ifdef CONFIG_ATM_HE_USE_SUNI
......
......@@ -12,19 +12,16 @@
* Donald J. Becker, <becker@scyld.com>
*
* Changelog:
* Stephen Hemminger (09/2003)
* - get rid of pre-linked dev list, dynamic device allocation
* Paul Gortmaker (03/2002)
- struct init cleanup, enable multiple ISA autoprobes.
* - struct init cleanup, enable multiple ISA autoprobes.
* Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 09/1999
* - fix sbni: s/device/net_device/
* Paul Gortmaker (06/98):
* - sort probes in a sane way, make sure all (safe) probes
* get run once & failed autoprobes don't autoprobe again.
*
* FIXME:
* Phase out placeholder dev entries put in the linked list
* here in favour of drivers using init_etherdev(NULL, ...)
* combined with a single find_all_devs() function (for 2.3)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
......@@ -106,7 +103,7 @@ extern int de620_probe(struct net_device *);
extern int iph5526_probe(struct net_device *dev);
/* SBNI adapters */
extern int sbni_probe(void);
extern int sbni_probe(int unit);
struct devprobe
{
......@@ -125,22 +122,14 @@ static int __init probe_list(struct net_device *dev, struct devprobe *plist)
{
struct devprobe *p = plist;
unsigned long base_addr = dev->base_addr;
int ret;
while (p->probe != NULL) {
if (base_addr && p->probe(dev) == 0) { /* probe given addr */
ret = alloc_divert_blk(dev);
if (ret)
return ret;
if (base_addr && p->probe(dev) == 0) /* probe given addr */
return 0;
} else if (p->status == 0) { /* has autoprobe failed yet? */
else if (p->status == 0) { /* has autoprobe failed yet? */
p->status = p->probe(dev); /* no, try autoprobe */
if (p->status == 0) {
ret = alloc_divert_blk(dev);
if (ret)
return ret;
if (p->status == 0)
return 0;
}
}
p++;
}
......@@ -349,7 +338,7 @@ static struct devprobe mips_probes[] __initdata = {
* per bus interface. This drives the legacy devices only for now.
*/
static int __init ethif_probe(void)
static int __init ethif_probe(int unit)
{
struct net_device *dev;
int err = -ENODEV;
......@@ -358,6 +347,7 @@ static int __init ethif_probe(void)
if (!dev)
return -ENOMEM;
sprintf(dev->name, "eth%d", unit);
netdev_boot_setup_check(dev);
/*
......@@ -394,7 +384,7 @@ extern int sk_isa_probe(struct net_device *);
extern int proteon_probe(struct net_device *);
extern int smctr_probe(struct net_device *);
static __init int trif_probe(void)
static __init int trif_probe(int unit)
{
struct net_device *dev;
int err = -ENODEV;
......@@ -403,6 +393,7 @@ static __init int trif_probe(void)
if (!dev)
return -ENOMEM;
sprintf(dev->name, "tr%d", unit);
netdev_boot_setup_check(dev);
if (
#ifdef CONFIG_IBMTR
......@@ -446,16 +437,16 @@ void __init probe_old_netdevs(void)
#ifdef CONFIG_SBNI
for (num = 0; num < 8; ++num)
if (sbni_probe())
if (sbni_probe(num))
break;
#endif
#ifdef CONFIG_TR
for (num = 0; num < 8; ++num)
if (trif_probe())
if (trif_probe(num))
break;
#endif
for (num = 0; num < 8; ++num)
if (ethif_probe())
if (ethif_probe(num))
break;
#ifdef CONFIG_COPS
cops_probe(0);
......
......@@ -221,24 +221,26 @@ static void __init sbni_devsetup(struct net_device *dev)
SET_MODULE_OWNER( dev );
}
int __init sbni_probe(void)
int __init sbni_probe(int unit)
{
struct net_device *dev;
static unsigned version_printed __initdata = 0;
int err;
if( version_printed++ == 0 )
printk( KERN_INFO "%s", version );
dev = alloc_netdev(sizeof(struct net_local), "sbni%d", sbni_devsetup);
dev = alloc_netdev(sizeof(struct net_local), "sbni", sbni_devsetup);
if (!dev)
return -ENOMEM;
sprintf(dev->name, "sbni%d", unit);
netdev_boot_setup_check(dev);
if (register_netdev(dev)) {
kfree(dev);
return -ENODEV;
err = register_netdev(dev);
if (err) {
free_netdev(dev);
return err;
}
if( version_printed++ == 0 )
printk( KERN_INFO "%s", version );
return 0;
}
......
......@@ -618,7 +618,7 @@ enum
#include <linux/config.h>
static __inline__ int rtattr_strcmp(struct rtattr *rta, char *str)
static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str)
{
int len = strlen(str) + 1;
return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len);
......@@ -642,8 +642,9 @@ extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics);
extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data);
#define RTA_PUT(skb, attrtype, attrlen, data) \
({ if (skb_tailroom(skb) < (int)RTA_SPACE(attrlen)) goto rtattr_failure; \
__rta_fill(skb, attrtype, attrlen, data); })
({ if (unlikely(skb_tailroom(skb) < (int)RTA_SPACE(attrlen))) \
goto rtattr_failure; \
__rta_fill(skb, attrtype, attrlen, data); })
static inline struct rtattr *
__rta_reserve(struct sk_buff *skb, int attrtype, int attrlen)
......@@ -658,8 +659,9 @@ __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen)
}
#define __RTA_PUT(skb, attrtype, attrlen) \
({ if (skb_tailroom(skb) < (int)RTA_SPACE(attrlen)) goto rtattr_failure; \
__rta_reserve(skb, attrtype, attrlen); })
({ if (unlikely(skb_tailroom(skb) < (int)RTA_SPACE(attrlen))) \
goto rtattr_failure; \
__rta_reserve(skb, attrtype, attrlen); })
extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change);
......@@ -681,11 +683,21 @@ extern void rtnl_lock(void);
extern void rtnl_unlock(void);
extern void rtnetlink_init(void);
#define ASSERT_RTNL() do { if (down_trylock(&rtnl_sem) == 0) { up(&rtnl_sem); \
printk("RTNL: assertion failed at " __FILE__ "(%d)\n", __LINE__); } \
} while(0)
#define BUG_TRAP(x) if (!(x)) { printk("KERNEL: assertion (" #x ") failed at " __FILE__ "(%d)\n", __LINE__); }
#define ASSERT_RTNL() do { \
if (unlikely(down_trylock(&rtnl_sem) == 0)) { \
up(&rtnl_sem); \
printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \
__FILE__, __LINE__); \
dump_stack(); \
} \
} while(0)
#define BUG_TRAP(x) do { \
if (unlikely(!(x))) { \
printk(KERN_ERR "KERNEL: assertion (%s) failed at %s (%d)\n", \
#x, __FILE__ , __LINE__); \
} \
} while(0)
#endif /* __KERNEL__ */
......
......@@ -67,7 +67,15 @@ struct atm_clip_ops {
};
void atm_clip_ops_set(struct atm_clip_ops *);
#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE)
int try_atm_clip_ops(void);
#else
static inline int try_atm_clip_ops(void)
{
return 0;
}
#endif
extern struct neigh_table *clip_tbl_hook;
extern struct atm_clip_ops *atm_clip_ops;
......
......@@ -32,10 +32,8 @@
#include "common.h" /* atm_proc_init prototype */
#include "signaling.h" /* to get sigd - ugly too */
#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE)
#include <net/atmclip.h>
#include "ipcommon.h"
#endif
#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
#include "lec.h"
......
......@@ -222,6 +222,8 @@ void unregister_ip_vs_app(struct ip_vs_app *app)
ip_vs_app_inc_release(inc);
}
list_del(&app->a_list);
up(&__ip_vs_app_mutex);
/* decrease the module use count */
......
......@@ -73,12 +73,12 @@ ip_vs_rr_schedule(struct ip_vs_service *svc, struct iphdr *iph)
continue;
}
dest = list_entry(q, struct ip_vs_dest, n_list);
if (!(dest->flags & IP_VS_DEST_F_OVERLOAD) &&
atomic_read(&dest->weight) > 0)
/* HIT */
goto out;
q = q->next;
} while (q != p);
write_unlock(&svc->sched_lock);
return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment