]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sif: ireg: Use the firmware release version as sysfs fw_ver
authorKnut Omang <knut.omang@oracle.com>
Fri, 2 Sep 2016 16:17:26 +0000 (18:17 +0200)
committerKnut Omang <knut.omang@oracle.com>
Fri, 9 Sep 2016 10:32:01 +0000 (12:32 +0200)
Report the official release version as reported by
ibv_query_device etc. instead of the previously used
internal firmware build version.

Orabug: 24533579

Signed-off-by: Knut Omang <knut.omang@oracle.com>
Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com>
drivers/infiniband/hw/sif/sif_epsc.h
drivers/infiniband/hw/sif/sif_ireg.c

index 4a7c6682cbab53f7cfbbd5db6c30b87622cc3057..03d6ed4a39a824ea2a6f34957e484eee45591557 100644 (file)
@@ -57,8 +57,8 @@ struct eps_version_data {
        u16 epsc_major;
        u16 epsc_minor;
 #endif
-       u16 fw_minor;
-       u16 fw_major;
+       u16 fw_minor;   /* This is the internal firmware version, */
+       u16 fw_major;   /* which is not the same as the official release version */
        int seq_set_proto; /* Protocol version of the initial setup meta protocol (0 == legacy) */
        struct psif_epsc_csr_config nb_cfg; /* "Network" byte order config storage (see #3804) */
        char *fw_version[FWV_MAX];
index 958e724330dfe73ff1144ba0986a974f1b63a2cb..32682586f13768fd473fa5f885b00aaecc427b73 100644 (file)
@@ -52,8 +52,12 @@ static ssize_t show_fw_ver(struct device *device,
 {
        struct sif_dev *sdev = dev_get_drvdata(device);
        struct sif_eps *es = &sdev->es[sdev->mbox_epsc];
+       u64 fw_ver = cpu_to_be64(es->data->dev.fw_ver);
 
-       return sprintf(buf, "%hu.%hu.0\n", es->ver.fw_major, es->ver.fw_minor);
+       return sprintf(buf, "%llu.%llu.%llu\n",
+               (fw_ver >> 32) & 0xffff,
+               (fw_ver >> 16) & 0xffff,
+               (fw_ver & 0xffff));
 }
 
 static ssize_t show_eps_api_ver(struct device *device,