aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@pathscale.com>2006-07-01 07:36:13 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-01 12:56:01 -0400
commit8307c28eecea917c4754075fbb85eb398a3bc516 (patch)
tree1e11c5632bf01deed1e14559b9f5a2024fac9d81
parent46bbeac922906559ec46454cbc76caf03bc57353 (diff)
[PATCH] IB/ipath: support more models of InfiniPath hardware
We do a few more explicit checks for specific models, and now also support the old PathScale serial number style, or new QLogic style. This is backwards compatible with previous versions of software and hardware. That is, older software will see a plausible serial number and correct GUID when used with a new board, while newer software will correctly handle an older board. Signed-off-by: Mike Albaugh <mike.albaugh@qlogic.com> Signed-off-by: Dave Olson <dave.olson@qlogic.com> Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com> Cc: "Michael S. Tsirkin" <mst@mellanox.co.il> Cc: Roland Dreier <rolandd@cisco.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/infiniband/hw/ipath/ipath_common.h12
-rw-r--r--drivers/infiniband/hw/ipath/ipath_eeprom.c27
-rw-r--r--drivers/infiniband/hw/ipath/ipath_kernel.h7
-rw-r--r--drivers/infiniband/hw/ipath/ipath_pe800.c2
4 files changed, 38 insertions, 10 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_common.h b/drivers/infiniband/hw/ipath/ipath_common.h
index 106f8f49cbb1..3130a7ed254b 100644
--- a/drivers/infiniband/hw/ipath/ipath_common.h
+++ b/drivers/infiniband/hw/ipath/ipath_common.h
@@ -476,7 +476,7 @@ struct ipath_sma_pkt
476 * Data layout in I2C flash (for GUID, etc.) 476 * Data layout in I2C flash (for GUID, etc.)
477 * All fields are little-endian binary unless otherwise stated 477 * All fields are little-endian binary unless otherwise stated
478 */ 478 */
479#define IPATH_FLASH_VERSION 1 479#define IPATH_FLASH_VERSION 2
480struct ipath_flash { 480struct ipath_flash {
481 /* flash layout version (IPATH_FLASH_VERSION) */ 481 /* flash layout version (IPATH_FLASH_VERSION) */
482 __u8 if_fversion; 482 __u8 if_fversion;
@@ -484,14 +484,14 @@ struct ipath_flash {
484 __u8 if_csum; 484 __u8 if_csum;
485 /* 485 /*
486 * valid length (in use, protected by if_csum), including 486 * valid length (in use, protected by if_csum), including
487 * if_fversion and if_sum themselves) 487 * if_fversion and if_csum themselves)
488 */ 488 */
489 __u8 if_length; 489 __u8 if_length;
490 /* the GUID, in network order */ 490 /* the GUID, in network order */
491 __u8 if_guid[8]; 491 __u8 if_guid[8];
492 /* number of GUIDs to use, starting from if_guid */ 492 /* number of GUIDs to use, starting from if_guid */
493 __u8 if_numguid; 493 __u8 if_numguid;
494 /* the board serial number, in ASCII */ 494 /* the (last 10 characters of) board serial number, in ASCII */
495 char if_serial[12]; 495 char if_serial[12];
496 /* board mfg date (YYYYMMDD ASCII) */ 496 /* board mfg date (YYYYMMDD ASCII) */
497 char if_mfgdate[8]; 497 char if_mfgdate[8];
@@ -503,8 +503,10 @@ struct ipath_flash {
503 __u8 if_powerhour[2]; 503 __u8 if_powerhour[2];
504 /* ASCII free-form comment field */ 504 /* ASCII free-form comment field */
505 char if_comment[32]; 505 char if_comment[32];
506 /* 78 bytes used, min flash size is 128 bytes */ 506 /* Backwards compatible prefix for longer QLogic Serial Numbers */
507 __u8 if_future[50]; 507 char if_sprefix[4];
508 /* 82 bytes used, min flash size is 128 bytes */
509 __u8 if_future[46];
508}; 510};
509 511
510/* 512/*
diff --git a/drivers/infiniband/hw/ipath/ipath_eeprom.c b/drivers/infiniband/hw/ipath/ipath_eeprom.c
index f086e3360459..3313356ab93a 100644
--- a/drivers/infiniband/hw/ipath/ipath_eeprom.c
+++ b/drivers/infiniband/hw/ipath/ipath_eeprom.c
@@ -601,8 +601,31 @@ void ipath_get_eeprom_info(struct ipath_devdata *dd)
601 guid = *(__be64 *) ifp->if_guid; 601 guid = *(__be64 *) ifp->if_guid;
602 dd->ipath_guid = guid; 602 dd->ipath_guid = guid;
603 dd->ipath_nguid = ifp->if_numguid; 603 dd->ipath_nguid = ifp->if_numguid;
604 memcpy(dd->ipath_serial, ifp->if_serial, 604 /*
605 sizeof(ifp->if_serial)); 605 * Things are slightly complicated by the desire to transparently
606 * support both the Pathscale 10-digit serial number and the QLogic
607 * 13-character version.
608 */
609 if ((ifp->if_fversion > 1) && ifp->if_sprefix[0]
610 && ((u8 *)ifp->if_sprefix)[0] != 0xFF) {
611 /* This board has a Serial-prefix, which is stored
612 * elsewhere for backward-compatibility.
613 */
614 char *snp = dd->ipath_serial;
615 int len;
616 memcpy(snp, ifp->if_sprefix, sizeof ifp->if_sprefix);
617 snp[sizeof ifp->if_sprefix] = '\0';
618 len = strlen(snp);
619 snp += len;
620 len = (sizeof dd->ipath_serial) - len;
621 if (len > sizeof ifp->if_serial) {
622 len = sizeof ifp->if_serial;
623 }
624 memcpy(snp, ifp->if_serial, len);
625 } else
626 memcpy(dd->ipath_serial, ifp->if_serial,
627 sizeof ifp->if_serial);
628
606 ipath_cdbg(VERBOSE, "Initted GUID to %llx from eeprom\n", 629 ipath_cdbg(VERBOSE, "Initted GUID to %llx from eeprom\n",
607 (unsigned long long) be64_to_cpu(dd->ipath_guid)); 630 (unsigned long long) be64_to_cpu(dd->ipath_guid));
608 631
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h
index fe3c862e23b5..00a6bbdbe957 100644
--- a/drivers/infiniband/hw/ipath/ipath_kernel.h
+++ b/drivers/infiniband/hw/ipath/ipath_kernel.h
@@ -491,8 +491,11 @@ struct ipath_devdata {
491 u16 ipath_lid; 491 u16 ipath_lid;
492 /* list of pkeys programmed; 0 if not set */ 492 /* list of pkeys programmed; 0 if not set */
493 u16 ipath_pkeys[4]; 493 u16 ipath_pkeys[4];
494 /* ASCII serial number, from flash */ 494 /*
495 u8 ipath_serial[12]; 495 * ASCII serial number, from flash, large enough for original
496 * all digit strings, and longer QLogic serial number format
497 */
498 u8 ipath_serial[16];
496 /* human readable board version */ 499 /* human readable board version */
497 u8 ipath_boardversion[80]; 500 u8 ipath_boardversion[80];
498 /* chip major rev, from ipath_revision */ 501 /* chip major rev, from ipath_revision */
diff --git a/drivers/infiniband/hw/ipath/ipath_pe800.c b/drivers/infiniband/hw/ipath/ipath_pe800.c
index 98fd5d37dfff..b83f66d8262c 100644
--- a/drivers/infiniband/hw/ipath/ipath_pe800.c
+++ b/drivers/infiniband/hw/ipath/ipath_pe800.c
@@ -533,7 +533,7 @@ static int ipath_pe_boardname(struct ipath_devdata *dd, char *name,
533 if (n) 533 if (n)
534 snprintf(name, namelen, "%s", n); 534 snprintf(name, namelen, "%s", n);
535 535
536 if (dd->ipath_majrev != 4 || dd->ipath_minrev != 1) { 536 if (dd->ipath_majrev != 4 || !dd->ipath_minrev || dd->ipath_minrev>2) {
537 ipath_dev_err(dd, "Unsupported PE-800 revision %u.%u!\n", 537 ipath_dev_err(dd, "Unsupported PE-800 revision %u.%u!\n",
538 dd->ipath_majrev, dd->ipath_minrev); 538 dd->ipath_majrev, dd->ipath_minrev);
539 ret = 1; 539 ret = 1;