]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
bnxt_en: Add board.serial_number field to info_get cb
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>
Sat, 20 Jun 2020 16:31:57 +0000 (22:01 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 22 Jun 2020 23:15:05 +0000 (16:15 -0700)
Add board.serial_number field info to info_get cb via devlink,
if driver can fetch the information from the device.

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

index a812beb4632578b04a3b104d32ab991a0fb631e1..2bd610fafc582e084f5073414c5c562fdf9c539a 100644 (file)
@@ -411,6 +411,12 @@ static int bnxt_dl_info_get(struct devlink *dl, struct devlink_info_req *req,
                        return rc;
        }
 
+       if (strlen(bp->board_serialno)) {
+               rc = devlink_info_board_serial_number_put(req, bp->board_serialno);
+               if (rc)
+                       return rc;
+       }
+
        sprintf(buf, "%X", bp->chip_num);
        rc = devlink_info_version_fixed_put(req,
                        DEVLINK_INFO_VERSION_GENERIC_ASIC_ID, buf);