diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-04 10:08:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-04 10:08:10 -0400 |
commit | a1d4ebdbb3806e9d2c37f32a043ec54f4534977c (patch) | |
tree | 44b2ce77adcb79849d8bbefbc254b03fccd6a394 /drivers | |
parent | 742b0c905d970fd60893cce14a3c68b523504bc4 (diff) | |
parent | 0e57c7166675a86293f150d5ef7779edd629fe2a (diff) |
Merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/gregkh/aoe-2.6.git/
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/aoe/aoe.h | 2 | ||||
-rw-r--r-- | drivers/block/aoe/aoeblk.c | 13 | ||||
-rw-r--r-- | drivers/block/aoe/aoedev.c | 11 | ||||
-rw-r--r-- | drivers/block/aoe/aoenet.c | 17 |
4 files changed, 34 insertions, 9 deletions
diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h index aa8b547ffafa..721ba8086043 100644 --- a/drivers/block/aoe/aoe.h +++ b/drivers/block/aoe/aoe.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */ | 1 | /* Copyright (c) 2004 Coraid, Inc. See COPYING for GPL terms. */ |
2 | #define VERSION "6" | 2 | #define VERSION "10" |
3 | #define AOE_MAJOR 152 | 3 | #define AOE_MAJOR 152 |
4 | #define DEVICE_NAME "aoe" | 4 | #define DEVICE_NAME "aoe" |
5 | 5 | ||
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c index 4780f7926d42..0e97fcb9f3a1 100644 --- a/drivers/block/aoe/aoeblk.c +++ b/drivers/block/aoe/aoeblk.c | |||
@@ -37,6 +37,13 @@ static ssize_t aoedisk_show_netif(struct gendisk * disk, char *page) | |||
37 | 37 | ||
38 | return snprintf(page, PAGE_SIZE, "%s\n", d->ifp->name); | 38 | return snprintf(page, PAGE_SIZE, "%s\n", d->ifp->name); |
39 | } | 39 | } |
40 | /* firmware version */ | ||
41 | static ssize_t aoedisk_show_fwver(struct gendisk * disk, char *page) | ||
42 | { | ||
43 | struct aoedev *d = disk->private_data; | ||
44 | |||
45 | return snprintf(page, PAGE_SIZE, "0x%04x\n", (unsigned int) d->fw_ver); | ||
46 | } | ||
40 | 47 | ||
41 | static struct disk_attribute disk_attr_state = { | 48 | static struct disk_attribute disk_attr_state = { |
42 | .attr = {.name = "state", .mode = S_IRUGO }, | 49 | .attr = {.name = "state", .mode = S_IRUGO }, |
@@ -50,6 +57,10 @@ static struct disk_attribute disk_attr_netif = { | |||
50 | .attr = {.name = "netif", .mode = S_IRUGO }, | 57 | .attr = {.name = "netif", .mode = S_IRUGO }, |
51 | .show = aoedisk_show_netif | 58 | .show = aoedisk_show_netif |
52 | }; | 59 | }; |
60 | static struct disk_attribute disk_attr_fwver = { | ||
61 | .attr = {.name = "firmware-version", .mode = S_IRUGO }, | ||
62 | .show = aoedisk_show_fwver | ||
63 | }; | ||
53 | 64 | ||
54 | static void | 65 | static void |
55 | aoedisk_add_sysfs(struct aoedev *d) | 66 | aoedisk_add_sysfs(struct aoedev *d) |
@@ -57,6 +68,7 @@ aoedisk_add_sysfs(struct aoedev *d) | |||
57 | sysfs_create_file(&d->gd->kobj, &disk_attr_state.attr); | 68 | sysfs_create_file(&d->gd->kobj, &disk_attr_state.attr); |
58 | sysfs_create_file(&d->gd->kobj, &disk_attr_mac.attr); | 69 | sysfs_create_file(&d->gd->kobj, &disk_attr_mac.attr); |
59 | sysfs_create_file(&d->gd->kobj, &disk_attr_netif.attr); | 70 | sysfs_create_file(&d->gd->kobj, &disk_attr_netif.attr); |
71 | sysfs_create_file(&d->gd->kobj, &disk_attr_fwver.attr); | ||
60 | } | 72 | } |
61 | void | 73 | void |
62 | aoedisk_rm_sysfs(struct aoedev *d) | 74 | aoedisk_rm_sysfs(struct aoedev *d) |
@@ -64,6 +76,7 @@ aoedisk_rm_sysfs(struct aoedev *d) | |||
64 | sysfs_remove_link(&d->gd->kobj, "state"); | 76 | sysfs_remove_link(&d->gd->kobj, "state"); |
65 | sysfs_remove_link(&d->gd->kobj, "mac"); | 77 | sysfs_remove_link(&d->gd->kobj, "mac"); |
66 | sysfs_remove_link(&d->gd->kobj, "netif"); | 78 | sysfs_remove_link(&d->gd->kobj, "netif"); |
79 | sysfs_remove_link(&d->gd->kobj, "firmware-version"); | ||
67 | } | 80 | } |
68 | 81 | ||
69 | static int | 82 | static int |
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); |
diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c index bc92aacb6dad..9e6f51c528b0 100644 --- a/drivers/block/aoe/aoenet.c +++ b/drivers/block/aoe/aoenet.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/hdreg.h> | 7 | #include <linux/hdreg.h> |
8 | #include <linux/blkdev.h> | 8 | #include <linux/blkdev.h> |
9 | #include <linux/netdevice.h> | 9 | #include <linux/netdevice.h> |
10 | #include <linux/moduleparam.h> | ||
10 | #include "aoe.h" | 11 | #include "aoe.h" |
11 | 12 | ||
12 | #define NECODES 5 | 13 | #define NECODES 5 |
@@ -26,6 +27,19 @@ enum { | |||
26 | }; | 27 | }; |
27 | 28 | ||
28 | static char aoe_iflist[IFLISTSZ]; | 29 | static char aoe_iflist[IFLISTSZ]; |
30 | module_param_string(aoe_iflist, aoe_iflist, IFLISTSZ, 0600); | ||
31 | MODULE_PARM_DESC(aoe_iflist, "aoe_iflist=\"dev1 [dev2 ...]\"\n"); | ||
32 | |||
33 | #ifndef MODULE | ||
34 | static int __init aoe_iflist_setup(char *str) | ||
35 | { | ||
36 | strncpy(aoe_iflist, str, IFLISTSZ); | ||
37 | aoe_iflist[IFLISTSZ - 1] = '\0'; | ||
38 | return 1; | ||
39 | } | ||
40 | |||
41 | __setup("aoe_iflist=", aoe_iflist_setup); | ||
42 | #endif | ||
29 | 43 | ||
30 | int | 44 | int |
31 | is_aoe_netif(struct net_device *ifp) | 45 | is_aoe_netif(struct net_device *ifp) |
@@ -36,7 +50,8 @@ is_aoe_netif(struct net_device *ifp) | |||
36 | if (aoe_iflist[0] == '\0') | 50 | if (aoe_iflist[0] == '\0') |
37 | return 1; | 51 | return 1; |
38 | 52 | ||
39 | for (p = aoe_iflist; *p; p = q + strspn(q, WHITESPACE)) { | 53 | p = aoe_iflist + strspn(aoe_iflist, WHITESPACE); |
54 | for (; *p; p = q + strspn(q, WHITESPACE)) { | ||
40 | q = p + strcspn(p, WHITESPACE); | 55 | q = p + strcspn(p, WHITESPACE); |
41 | if (q != p) | 56 | if (q != p) |
42 | len = q - p; | 57 | len = q - p; |