net: ena: complete host info to match latest ENA spec
[sfrench/cifs-2.6.git] / drivers / net / ethernet / amazon / ena / ena_netdev.c
index 13eb6a4d98d516e716ea71260ddfa526b11f27ba..86fd01df0d3125c2cf6e7c752d4e6ff04783f4fb 100644 (file)
@@ -2201,7 +2201,8 @@ static u16 ena_select_queue(struct net_device *dev, struct sk_buff *skb,
        return qid;
 }
 
        return qid;
 }
 
-static void ena_config_host_info(struct ena_com_dev *ena_dev)
+static void ena_config_host_info(struct ena_com_dev *ena_dev,
+                                struct pci_dev *pdev)
 {
        struct ena_admin_host_info *host_info;
        int rc;
 {
        struct ena_admin_host_info *host_info;
        int rc;
@@ -2215,6 +2216,7 @@ static void ena_config_host_info(struct ena_com_dev *ena_dev)
 
        host_info = ena_dev->host_attr.host_info;
 
 
        host_info = ena_dev->host_attr.host_info;
 
+       host_info->bdf = (pdev->bus->number << 8) | pdev->devfn;
        host_info->os_type = ENA_ADMIN_OS_LINUX;
        host_info->kernel_ver = LINUX_VERSION_CODE;
        strncpy(host_info->kernel_ver_str, utsname()->version,
        host_info->os_type = ENA_ADMIN_OS_LINUX;
        host_info->kernel_ver = LINUX_VERSION_CODE;
        strncpy(host_info->kernel_ver_str, utsname()->version,
@@ -2225,7 +2227,9 @@ static void ena_config_host_info(struct ena_com_dev *ena_dev)
        host_info->driver_version =
                (DRV_MODULE_VER_MAJOR) |
                (DRV_MODULE_VER_MINOR << ENA_ADMIN_HOST_INFO_MINOR_SHIFT) |
        host_info->driver_version =
                (DRV_MODULE_VER_MAJOR) |
                (DRV_MODULE_VER_MINOR << ENA_ADMIN_HOST_INFO_MINOR_SHIFT) |
-               (DRV_MODULE_VER_SUBMINOR << ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT);
+               (DRV_MODULE_VER_SUBMINOR << ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT) |
+               ("K"[0] << ENA_ADMIN_HOST_INFO_MODULE_TYPE_SHIFT);
+       host_info->num_cpus = num_online_cpus();
 
        rc = ena_com_set_host_attributes(ena_dev);
        if (rc) {
 
        rc = ena_com_set_host_attributes(ena_dev);
        if (rc) {
@@ -2449,7 +2453,7 @@ static int ena_device_init(struct ena_com_dev *ena_dev, struct pci_dev *pdev,
         */
        ena_com_set_admin_polling_mode(ena_dev, true);
 
         */
        ena_com_set_admin_polling_mode(ena_dev, true);
 
-       ena_config_host_info(ena_dev);
+       ena_config_host_info(ena_dev, pdev);
 
        /* Get Device Attributes*/
        rc = ena_com_get_dev_attr_feat(ena_dev, get_feat_ctx);
 
        /* Get Device Attributes*/
        rc = ena_com_get_dev_attr_feat(ena_dev, get_feat_ctx);