OSDN Git Service

bnxt_en: Add partno to devlink info_get cb
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>
Fri, 27 Mar 2020 09:35:50 +0000 (15:05 +0530)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Mar 2020 22:34:42 +0000 (15:34 -0700)
Add part number info from the vital product data to info_get command
via devlink tool. Update bnxt.rst documentation as well.

Cc: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/devlink/bnxt.rst
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c

index 7ab34c9..9818118 100644 (file)
@@ -51,6 +51,9 @@ The ``bnxt_en`` driver reports the following versions
    * - Name
      - Type
      - Description
+   * - ``board.id``
+     - fixed
+     - Part number identifying the board design
    * - ``asic.id``
      - fixed
      - ASIC design identifier
index 39c2ac4..0c8283b 100644 (file)
@@ -403,6 +403,14 @@ static int bnxt_dl_info_get(struct devlink *dl, struct devlink_info_req *req,
        if (rc)
                return rc;
 
+       if (strlen(bp->board_partno)) {
+               rc = devlink_info_version_fixed_put(req,
+                       DEVLINK_INFO_VERSION_GENERIC_BOARD_ID,
+                       bp->board_partno);
+               if (rc)
+                       return rc;
+       }
+
        sprintf(buf, "%X", bp->chip_num);
        rc = devlink_info_version_fixed_put(req,
                        DEVLINK_INFO_VERSION_GENERIC_ASIC_ID, buf);