diff options
author | Ed L Cashin <ecashin@coraid.com> | 2005-04-29 10:24:22 -0400 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-05-04 02:34:54 -0400 |
commit | 93d489fc56f819d8805d80ae83cbafc5e5719804 (patch) | |
tree | 946adcae0abe20dc6d9d58682ea2d6980efd1a4c /drivers | |
parent | 67d9f84786cc4fd42cb40c9474c248eadaff15c6 (diff) |
[PATCH] aoe: allow multiple aoe devices to have the same mac
allow multiple aoe devices to have the same mac
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
diff -u b/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/aoe/aoedev.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c index ec16c64dd114..6e231c5a1199 100644 --- a/drivers/block/aoe/aoedev.c +++ b/drivers/block/aoe/aoedev.c | |||
@@ -109,25 +109,22 @@ aoedev_set(ulong sysminor, unsigned char *addr, struct net_device *ifp, ulong bu | |||
109 | spin_lock_irqsave(&devlist_lock, flags); | 109 | spin_lock_irqsave(&devlist_lock, flags); |
110 | 110 | ||
111 | for (d=devlist; d; d=d->next) | 111 | for (d=devlist; d; d=d->next) |
112 | if (d->sysminor == sysminor | 112 | if (d->sysminor == sysminor) |
113 | || memcmp(d->addr, addr, sizeof d->addr) == 0) | ||
114 | break; | 113 | break; |
115 | 114 | ||
116 | if (d == NULL && (d = aoedev_newdev(bufcnt)) == NULL) { | 115 | if (d == NULL && (d = aoedev_newdev(bufcnt)) == NULL) { |
117 | spin_unlock_irqrestore(&devlist_lock, flags); | 116 | spin_unlock_irqrestore(&devlist_lock, flags); |
118 | printk(KERN_INFO "aoe: aoedev_set: aoedev_newdev failure.\n"); | 117 | printk(KERN_INFO "aoe: aoedev_set: aoedev_newdev failure.\n"); |
119 | return NULL; | 118 | return NULL; |
120 | } | 119 | } /* if newdev, (d->flags & DEVFL_UP) == 0 for below */ |
121 | 120 | ||
122 | spin_unlock_irqrestore(&devlist_lock, flags); | 121 | spin_unlock_irqrestore(&devlist_lock, flags); |
123 | spin_lock_irqsave(&d->lock, flags); | 122 | spin_lock_irqsave(&d->lock, flags); |
124 | 123 | ||
125 | d->ifp = ifp; | 124 | d->ifp = ifp; |
126 | 125 | memcpy(d->addr, addr, sizeof d->addr); | |
127 | if (d->sysminor != sysminor | 126 | if ((d->flags & DEVFL_UP) == 0) { |
128 | || (d->flags & DEVFL_UP) == 0) { | ||
129 | aoedev_downdev(d); /* flushes outstanding frames */ | 127 | aoedev_downdev(d); /* flushes outstanding frames */ |
130 | memcpy(d->addr, addr, sizeof d->addr); | ||
131 | d->sysminor = sysminor; | 128 | d->sysminor = sysminor; |
132 | d->aoemajor = AOEMAJOR(sysminor); | 129 | d->aoemajor = AOEMAJOR(sysminor); |
133 | d->aoeminor = AOEMINOR(sysminor); | 130 | d->aoeminor = AOEMINOR(sysminor); |