@@ -12,11 +12,12 @@
#
# This file is released under the GPL.
#==============================================================================
-EXEC = mpath_prio_alua
+ALUA = mpath_prio_alua
+INTEL = mpath_prio_intel
BUILD = glibc
DEBUG = 0
DEBUG_DUMPHEX = 0
-OBJS = main.o rtpg.o
+FILES = main.c rtpg.c
INSTALL = install -D
TOPDIR = ../..
@@ -29,25 +30,23 @@
all: $(BUILD)
-glibc: $(OBJS)
- $(CC) -static -o $(EXEC).static $(OBJS) $(LDFLAGS)
-
-klibc: $(OBJS)
- $(CC) -static -o $(EXEC) $(OBJS)
-
-install: $(BUILD) $(EXEC).8
- $(INSTALL) -m 755 $(EXEC).static $(DESTDIR)$(bindir)/$(EXEC).static
- ln -sf $(EXEC).static $(DESTDIR)$(bindir)/$(EXEC)
- $(INSTALL) -m 644 $(EXEC).8 $(DESTDIR)$(mandir)/$(EXEC).8
+glibc: $(FILES)
+ $(CC) -static -o $(ALUA).static $(FILES) $(CFLAGS) -DALUA $(LDFLAGS)
+ $(CC) -static -o $(INTEL).static $(FILES) $(CFLAGS) -DINTEL $(LDFLAGS)
+
+install: $(BUILD) $(ALUA).8
+ $(INSTALL) -m 755 $(ALUA).static $(DESTDIR)$(bindir)/$(ALUA).static
+ $(INSTALL) -m 755 $(INTEL).static $(DESTDIR)$(bindir)/$(INTEL).static
+ ln -sf $(ALUA).static $(DESTDIR)$(bindir)/$(ALUA)
+ ln -sf $(INTEL).static $(DESTDIR)$(bindir)/$(INTEL)
+ $(INSTALL) -m 644 $(ALUA).8 $(DESTDIR)$(mandir)/$(ALUA).8
uninstall:
- rm $(DESTDIR)$(bindir)/$(EXEC)
- rm $(DESTDIR)$(bindir)/$(EXEC).static
- rm $(DESTDIR)$(mandir)/$(EXEC).8
+ rm $(DESTDIR)$(bindir)/$(ALUA)
+ rm $(DESTDIR)$(bindir)/$(ALUA).static
+ rm $(DESTDIR)$(mandir)/$(ALUA).8
+ rm $(DESTDIR)$(bindir)/$(INTEL)
+ rm $(DESTDIR)$(bindir)/$(INTEL).static
clean:
- rm -f *.o *.gz $(EXEC).static
-
-main.o: main.c rtpg.h spc3.h
-
-rtpg.o: rtpg.c rtpg.h spc3.h
+ rm -f *.o *.gz $(ALUA).static $(INTEL).static
@@ -295,7 +295,11 @@
"group.\n");
} else {
PRINT_DEBUG("pref=%i\n", dscr->pref);
+#ifdef ALUA
rc = rtpg_tpg_dscr_get_aas(dscr);
+#else
+ rc = rtpg_tpg_dscr_get_pref(dscr);
+#endif
}
}
}
@@ -302,6 +302,12 @@
return (d->b0 & 0x0f);
}
+static inline int
+rtpg_tpg_dscr_get_pref(struct rtpg_tpg_dscr *d)
+{
+ return ((d->b0 & 0x80)?0:2);
+}
+
struct rtpg_data {
unsigned char length[4]; /* size-4 */
struct rtpg_tpg_dscr data[0];