Index: trunk/src/os2ahci/Makefile
===================================================================
--- trunk/src/os2ahci/Makefile	(revision 165)
+++ trunk/src/os2ahci/Makefile	(revision 166)
@@ -30,5 +30,5 @@
 # Define default build version if not specified in environment
 BLD_MAJOR=1
-BLD_MINOR=29 # must be 2 digits
+BLD_MINOR=30 # must be 2 digits
 BLD_REV=0 # not used at this time
 FIXPACK=
@@ -90,6 +90,5 @@
 
 AFLAGS = -q
-# In order to build the SMP safe version you must have the updated devhelp.h and define OS2AHCI_SMP.
-CFLAGS= -ei -6 -d0 -bt=os2 -ms -zu -wx -ecc -zp1 -q -s -zgp -zfp -oi -DOS2AHCI_SMP
+CFLAGS= -ei -6 -d0 -bt=os2 -ms -zu -wx -ecc -zp1 -q -s -zgp -zfp -oi
 CFLAGS_DEBUG = -ei -6 -d3 -hc -bt=os2 -ms -zu -ecc -zp1 -q -s -zgp -zfp -od
 
Index: trunk/src/os2ahci/README
===================================================================
--- trunk/src/os2ahci/README	(revision 165)
+++ trunk/src/os2ahci/README	(revision 166)
@@ -154,9 +154,6 @@
                        (default = -1, all ports)
 
-Adapter-specific Options
-
-Option                 Description
-------------------------------------------------------------------------------
-/i                     Ignore current adapter
+/i                     Ignore current adapter if no port has been specified.
+                       Otherwise, ignore the current port on the current adapter.
 
 Port-specific Options
@@ -402,4 +399,5 @@
     be there anyway.
   Fixed a defect in the SMART IOCtl.
+  Added ability to ignore individual ports.
 
 v.1.29 12-Jun-2013 - David Azarewicz
Index: trunk/src/os2ahci/ahci.c
===================================================================
--- trunk/src/os2ahci/ahci.c	(revision 165)
+++ trunk/src/os2ahci/ahci.c	(revision 166)
@@ -598,70 +598,70 @@
   dprintf("ahci_scan_ports: scanning ports on adapter %d\n", ad_no(ai));
   for (p = 0; p < AHCI_MAX_PORTS; p++) {
-    if (ai->port_map & (1UL << p)) {
-
-      ddprintf("ahci_scan_ports: Wait till not busy on port %d\n", p);
-      /* wait until all active commands have completed on this port */
-      timer_init(&Timer, 250);
-      while (ahci_port_busy(ai, p)) {
-        if (timer_check_and_block(&Timer)) break;
+    if (!(ai->port_map & (1UL << p))) continue;
+    if (port_ignore[ad_no(ai)][p]) continue;
+
+    ddprintf("ahci_scan_ports: Wait till not busy on port %d\n", p);
+    /* wait until all active commands have completed on this port */
+    timer_init(&Timer, 250);
+    while (ahci_port_busy(ai, p)) {
+      if (timer_check_and_block(&Timer)) break;
+    }
+
+    if (!init_complete) {
+      if ((pc = ahci_save_port_config(ai, p)) == NULL) {
+        goto exit_port_scan;
       }
-
-      if (!init_complete) {
-        if ((pc = ahci_save_port_config(ai, p)) == NULL) {
-          goto exit_port_scan;
-        }
+    }
+
+    /* start/reset port; if no device is attached, this is expected to fail */
+    if (init_reset) {
+      rc = ahci_reset_port(ai, p, 0);
+    } else {
+      ddprintf("ahci_scan_ports: (re)starting port %d\n", p);
+      ahci_stop_port(ai, p);
+      rc = ahci_start_port(ai, p, 0);
+    }
+    if (rc) {
+      /* no device attached to this port */
+      ai->port_map &= ~(1UL << p);
+      goto restore_port_config;
+    }
+
+    /* this port seems to have a device attached and ready for commands */
+    ddprintf("ahci_scan_ports: port %d seems to be attached to a device; probing...\n", p);
+
+    /* Get ATA(PI) identity. The so-called signature gives us a hint whether
+     * this is an ATA or an ATAPI device but we'll try both in either case;
+     * the signature will merely determine whether we're going to probe for
+     * an ATA or ATAPI device, first, in order to reduce the chance of sending
+     * the wrong command (which would result in a port reset given the way
+     * ahci_exec_polled_cmd() was implemented).
+     */
+    is_ata = readl(port_base(ai, p) + PORT_SIG) == 0x00000101UL;
+    for (i = 0; i < 2; i++) {
+      rc = ahci_exec_polled_cmd(ai, p, 0, 500,
+                                (is_ata) ? ATA_CMD_ID_ATA : ATA_CMD_ID_ATAPI,
+                                AP_VADDR, (void _far *) id_buf, 512,
+                                AP_END);
+      if (rc == 0) {
+        break;
       }
 
-      /* start/reset port; if no device is attached, this is expected to fail */
-      if (init_reset) {
-        rc = ahci_reset_port(ai, p, 0);
-      } else {
-        ddprintf("ahci_scan_ports: (re)starting port %d\n", p);
-        ahci_stop_port(ai, p);
-        rc = ahci_start_port(ai, p, 0);
-      }
-      if (rc) {
-        /* no device attached to this port */
-        ai->port_map &= ~(1UL << p);
-        goto restore_port_config;
-      }
-
-      /* this port seems to have a device attached and ready for commands */
-      ddprintf("ahci_scan_ports: port %d seems to be attached to a device; probing...\n", p);
-
-      /* Get ATA(PI) identity. The so-called signature gives us a hint whether
-       * this is an ATA or an ATAPI device but we'll try both in either case;
-       * the signature will merely determine whether we're going to probe for
-       * an ATA or ATAPI device, first, in order to reduce the chance of sending
-       * the wrong command (which would result in a port reset given the way
-       * ahci_exec_polled_cmd() was implemented).
-       */
-      is_ata = readl(port_base(ai, p) + PORT_SIG) == 0x00000101UL;
-      for (i = 0; i < 2; i++) {
-        rc = ahci_exec_polled_cmd(ai, p, 0, 500,
-                                  (is_ata) ? ATA_CMD_ID_ATA : ATA_CMD_ID_ATAPI,
-                                  AP_VADDR, (void _far *) id_buf, 512,
-                                  AP_END);
-        if (rc == 0) {
-          break;
-        }
-
-        /* try again with ATA/ATAPI swapped */
-        is_ata = !is_ata;
-      }
-
-      if (rc == 0) {
-        /* we have a valid IDENTIFY or IDENTIFY_PACKET response */
-        ddphex(id_buf, 512, "ATA_IDENTIFY%s results:\n", (is_ata) ? "" : "_PACKET");
-        ahci_setup_device(ai, p, 0, id_buf);
-      } else {
-        /* no device attached to this port */
-        ai->port_map &= ~(1UL << p);
-      }
-
-    restore_port_config:
-      if (pc != NULL) {
-        ahci_restore_port_config(ai, p, pc);
-      }
+      /* try again with ATA/ATAPI swapped */
+      is_ata = !is_ata;
+    }
+
+    if (rc == 0) {
+      /* we have a valid IDENTIFY or IDENTIFY_PACKET response */
+      ddphex(id_buf, 512, "ATA_IDENTIFY%s results:\n", (is_ata) ? "" : "_PACKET");
+      ahci_setup_device(ai, p, 0, id_buf);
+    } else {
+      /* no device attached to this port */
+      ai->port_map &= ~(1UL << p);
+    }
+
+  restore_port_config:
+    if (pc != NULL) {
+      ahci_restore_port_config(ai, p, pc);
     }
   }
Index: trunk/src/os2ahci/os2ahci.c
===================================================================
--- trunk/src/os2ahci/os2ahci.c	(revision 165)
+++ trunk/src/os2ahci/os2ahci.c	(revision 166)
@@ -144,4 +144,5 @@
 u8              link_power[MAX_AD][AHCI_MAX_PORTS];
 u8              track_size[MAX_AD][AHCI_MAX_PORTS];
+u8              port_ignore[MAX_AD][AHCI_MAX_PORTS];
 
 static char     init_msg[] = "%s driver version %d.%02d\n";
@@ -324,5 +325,6 @@
         /* ignore current adapter index */
         if (adapter_index >= 0) {
-          ad_ignore |= 1U << adapter_index;
+          if (port_index >= 0) port_ignore[adapter_index][port_index] = !invert_option;
+          else ad_ignore |= 1U << adapter_index;
         }
         break;
@@ -400,7 +402,4 @@
   }
 
-  /* print initialization message */
-  ciprintf(init_msg, drv_name, VERSION / 100, VERSION % 100);
-
   if (com_baud) init_com(com_baud); /* initialize com port for debug output */
 
@@ -415,4 +414,7 @@
   ntprintf("BldLevel: %s\n", BldLevel);
   ntprintf("CmdLine: %Fs\n", cmd_line);
+
+  /* print initialization message */
+  ciprintf(init_msg, drv_name, VERSION / 100, VERSION % 100);
 
   /* scan PCI bus for supported devices */
Index: trunk/src/os2ahci/os2ahci.h
===================================================================
--- trunk/src/os2ahci/os2ahci.h	(revision 165)
+++ trunk/src/os2ahci/os2ahci.h	(revision 166)
@@ -654,3 +654,4 @@
 extern u8            link_power[MAX_AD][AHCI_MAX_PORTS];
 extern u8            track_size[MAX_AD][AHCI_MAX_PORTS];
-
+extern u8            port_ignore[MAX_AD][AHCI_MAX_PORTS];
+
Index: trunk/src/os2ahci/pci.c
===================================================================
--- trunk/src/os2ahci/pci.c	(revision 165)
+++ trunk/src/os2ahci/pci.c	(revision 166)
@@ -610,13 +610,7 @@
 
   /* found a supported AHCI device */
-  ciiprintf("found AHCI device: %s %s (%04x:%04x) class:0x%06lx bus:%d devfunc:0x%02x\n",
+  ciiprintf("Found AHCI device %s %s (%d:%d:%d %04x:%04x) class:0x%06lx\n",
             vendor_from_id(vendor), device_from_id(device),
-            vendor, device,
-            class, bus, dev_func);
-
-  dprintf("found AHCI device: %s %s (%04x:%04x) class:0x%06lx bus:%d devfunc:0x%02x\n",
-            vendor_from_id(vendor), device_from_id(device),
-            vendor, device,
-            class, bus, dev_func);
+            bus, dev_func>>3, dev_func&7, vendor, device, class);
 
   /* make sure we got room in the adapter information array */
Index: trunk/src/os2ahci/trace.c
===================================================================
--- trunk/src/os2ahci/trace.c	(revision 165)
+++ trunk/src/os2ahci/trace.c	(revision 166)
@@ -220,5 +220,5 @@
     AD_INFO *ai = ad_infos + a;
 
-    ntprintf("Adapter %d: PCI=%d:%d:%d ID=%x:%x irq=%d addr=0x%lx version=%lx\n", a,
+    ntprintf("Adapter %d: PCI=%d:%d:%d ID=%04x:%04x irq=%d addr=0x%lx version=%lx\n", a,
       ai->bus, ai->dev_func>>3, ai->dev_func&7,
       ai->pci->vendor, ai->pci->device,
