aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/aoe/aoe.h2
-rw-r--r--drivers/block/aoe/aoecmd.c9
-rw-r--r--drivers/block/aoe/aoedev.c5
3 files changed, 8 insertions, 8 deletions
diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h
index 551dd8e5b14b..ae16a21aca5c 100644
--- a/drivers/block/aoe/aoe.h
+++ b/drivers/block/aoe/aoe.h
@@ -156,7 +156,7 @@ void aoecmd_cfg_rsp(struct sk_buff *);
156 156
157int aoedev_init(void); 157int aoedev_init(void);
158void aoedev_exit(void); 158void aoedev_exit(void);
159struct aoedev *aoedev_bymac(unsigned char *); 159struct aoedev *aoedev_by_aoeaddr(int maj, int min);
160void aoedev_downdev(struct aoedev *d); 160void aoedev_downdev(struct aoedev *d);
161struct aoedev *aoedev_set(ulong, unsigned char *, struct net_device *, ulong); 161struct aoedev *aoedev_set(ulong, unsigned char *, struct net_device *, ulong);
162int aoedev_busy(void); 162int aoedev_busy(void);
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 1b711a52dd25..5d437697c368 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -380,14 +380,15 @@ aoecmd_ata_rsp(struct sk_buff *skb)
380 register long n; 380 register long n;
381 ulong flags; 381 ulong flags;
382 char ebuf[128]; 382 char ebuf[128];
383 383 u16 aoemajor;
384
384 hin = (struct aoe_hdr *) skb->mac.raw; 385 hin = (struct aoe_hdr *) skb->mac.raw;
385 d = aoedev_bymac(hin->src); 386 aoemajor = __be16_to_cpu(*((u16 *) hin->major));
387 d = aoedev_by_aoeaddr(aoemajor, hin->minor);
386 if (d == NULL) { 388 if (d == NULL) {
387 snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response " 389 snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response "
388 "for unknown device %d.%d\n", 390 "for unknown device %d.%d\n",
389 __be16_to_cpu(*((u16 *) hin->major)), 391 aoemajor, hin->minor);
390 hin->minor);
391 aoechr_error(ebuf); 392 aoechr_error(ebuf);
392 return; 393 return;
393 } 394 }
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
index 240abaec159b..a40a78a7f44a 100644
--- a/drivers/block/aoe/aoedev.c
+++ b/drivers/block/aoe/aoedev.c
@@ -13,7 +13,7 @@ static struct aoedev *devlist;
13static spinlock_t devlist_lock; 13static spinlock_t devlist_lock;
14 14
15struct aoedev * 15struct aoedev *
16aoedev_bymac(unsigned char *macaddr) 16aoedev_by_aoeaddr(int maj, int min)
17{ 17{
18 struct aoedev *d; 18 struct aoedev *d;
19 ulong flags; 19 ulong flags;
@@ -21,7 +21,7 @@ aoedev_bymac(unsigned char *macaddr)
21 spin_lock_irqsave(&devlist_lock, flags); 21 spin_lock_irqsave(&devlist_lock, flags);
22 22
23 for (d=devlist; d; d=d->next) 23 for (d=devlist; d; d=d->next)
24 if (!memcmp(d->addr, macaddr, 6)) 24 if (d->aoemajor == maj && d->aoeminor == min)
25 break; 25 break;
26 26
27 spin_unlock_irqrestore(&devlist_lock, flags); 27 spin_unlock_irqrestore(&devlist_lock, flags);
@@ -125,7 +125,6 @@ aoedev_set(ulong sysminor, unsigned char *addr, struct net_device *ifp, ulong bu
125 d->ifp = ifp; 125 d->ifp = ifp;
126 126
127 if (d->sysminor != sysminor 127 if (d->sysminor != sysminor
128 || memcmp(d->addr, addr, sizeof d->addr)
129 || (d->flags & DEVFL_UP) == 0) { 128 || (d->flags & DEVFL_UP) == 0) {
130 aoedev_downdev(d); /* flushes outstanding frames */ 129 aoedev_downdev(d); /* flushes outstanding frames */
131 memcpy(d->addr, addr, sizeof d->addr); 130 memcpy(d->addr, addr, sizeof d->addr);