[IBBUS] Fix device strings for consistency - I/O Unit device ID comes
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 3 Apr 2006 21:27:57 +0000 (21:27 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 3 Apr 2006 21:27:57 +0000 (21:27 +0000)
from NodeInfo, which is 16-bits.

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@275 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/bus/kernel/bus_iou_mgr.c

index 3d78de2..808c83e 100644 (file)
@@ -52,9 +52,11 @@ DEFINE_GUID(GUID_BUS_TYPE_IBA,
  * Size of device descriptions, in the format:\r
  *     IBA\VxxxxxxPxxxxxxxxvxxxxxxxx\r
  */\r
-#define IOU_DEV_ID_SIZE                sizeof(L"IBA\\VxxxxxxPxxxxxxxxvxxxxxxxx")\r
+#define IOU_DEV_ID_SIZE                sizeof(L"IBA\\VxxxxxxPxxxxvxxxxxxxx")\r
+#define IOU_DEV_ID_STRING1     L"IBA\\V%06xP%04hxv%08x"\r
+#define IOU_DEV_ID_STRING2     L"IBA\\V%06xP%04hx"\r
 #define IOU_HW_ID_SIZE         \\r
-       sizeof(L"IBA\\VxxxxxxPxxxxxxxxvxxxxxxxx\0IBA\\VxxxxxxPxxxxxxxx\0\0")\r
+       sizeof(L"IBA\\VxxxxxxPxxxxvxxxxxxxx\0IBA\\VxxxxxxPxxxx\0\0")\r
 #define IOU_COMPAT_ID          L"IBA\\IB_IOU\0\0"\r
 #define IOU_LOCATION_SIZE      \\r
        sizeof(L"Chassis 0xxxxxxxxxxxxxxxxx, Slot xx")\r
@@ -873,7 +875,7 @@ iou_query_device_id(
        }\r
 \r
        status =\r
-               RtlStringCbPrintfW( p_string, IOU_DEV_ID_SIZE, L"IBA\\V%06xP%08xv%08x",\r
+               RtlStringCbPrintfW( p_string, IOU_DEV_ID_SIZE, IOU_DEV_ID_STRING1,\r
                        p_ext->vend_id, p_ext->dev_id, p_ext->revision );\r
        if( !NT_SUCCESS( status ) )\r
        {\r
@@ -921,7 +923,7 @@ iou_query_hardware_ids(
        size = IOU_HW_ID_SIZE;\r
        /* Fill in the first HW ID. */\r
        status = RtlStringCbPrintfExW( p_start, size, &p_start, &size,\r
-               STRSAFE_FILL_BEHIND_NULL, L"IBA\\V%06xP%04xv%08x",\r
+               STRSAFE_FILL_BEHIND_NULL | STRSAFE_NO_TRUNCATION, IOU_DEV_ID_STRING1,\r
                p_ext->vend_id, p_ext->dev_id, p_ext->revision );\r
        if( !NT_SUCCESS( status ) )\r
        {\r
@@ -935,7 +937,7 @@ iou_query_hardware_ids(
        p_start++;\r
        size -= sizeof(WCHAR);\r
        status = RtlStringCbPrintfExW( p_start, size, NULL, NULL,\r
-               STRSAFE_FILL_BEHIND_NULL, L"IBA\\V%06xP%04x",\r
+               STRSAFE_FILL_BEHIND_NULL | STRSAFE_NO_TRUNCATION, IOU_DEV_ID_STRING2,\r
                p_ext->vend_id, p_ext->dev_id );\r
        if( !NT_SUCCESS( status ) )\r
        {\r