summaryrefslogtreecommitdiff
path: root/extras/multipath/unused.c
diff options
context:
space:
mode:
authorchristophe.varoqui@free.fr <christophe.varoqui@free.fr>2003-12-22 20:53:55 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:13:10 -0700
commit01ff79f58925dd26a717ae78f201d739053b5477 (patch)
treeada112d67746f225875f6f83e1ba7084e588b5f2 /extras/multipath/unused.c
parent88bca8484d88ce543f40d631ec9048795a725c13 (diff)
[PATCH] extras multipath update
incremental to 20031222-2, 2003-12-22 multipath-010 * tweak the install target in Makefile * stop passing fds as argument : this change enable a strict segregation of ugly 2.4 code * sysfs version of get_lun_strings() * be careful about the return of get_unique_id() since errors formerly caught up by if(open()) in the caller fn are now returned by get_unique_id() * send get_serial() in unused.c
Diffstat (limited to 'extras/multipath/unused.c')
-rw-r--r--extras/multipath/unused.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/extras/multipath/unused.c b/extras/multipath/unused.c
index 33b3e859d1..08144cf717 100644
--- a/extras/multipath/unused.c
+++ b/extras/multipath/unused.c
@@ -1,4 +1,21 @@
static int
+get_serial (int fd, char * str)
+{
+ char buff[MX_ALLOC_LEN + 1];
+ int len;
+
+ if (0 == do_inq(fd, 0, 1, 0x80, buff, MX_ALLOC_LEN, 0)) {
+ len = buff[3];
+ if (len > 0) {
+ memcpy(str, buff + 4, len);
+ buff[len] = '\0';
+ }
+ return 1;
+ }
+ return 0;
+}
+
+static int
do_tur(int fd)
{
unsigned char turCmdBlk[TUR_CMD_LEN] = { 0x00, 0, 0, 0, 0, 0 };