-/*
- * Extract device serial number from PCIe Configuration Space and
- * determine the pkg file path according to the DSN.
- */
-#ifndef RTE_EXEC_ENV_WINDOWS
-static int
-ice_pkg_file_search_path(struct rte_pci_device *pci_dev, char *pkg_file)
-{
- off_t pos;
- char opt_ddp_filename[ICE_MAX_PKG_FILENAME_SIZE];
- uint32_t dsn_low, dsn_high;
- memset(opt_ddp_filename, 0, ICE_MAX_PKG_FILENAME_SIZE);
-
- pos = rte_pci_find_ext_capability(pci_dev, RTE_PCI_EXT_CAP_ID_DSN);
-
- if (pos) {
- if (rte_pci_read_config(pci_dev, &dsn_low, 4, pos + 4) < 0) {
- PMD_INIT_LOG(ERR, "Failed to read pci config space\n");
- return -1;
- }
- if (rte_pci_read_config(pci_dev, &dsn_high, 4, pos + 8) < 0) {
- PMD_INIT_LOG(ERR, "Failed to read pci config space\n");
- return -1;
- }
- snprintf(opt_ddp_filename, ICE_MAX_PKG_FILENAME_SIZE,
- "ice-%08x%08x.pkg", dsn_high, dsn_low);
- } else {
- PMD_INIT_LOG(ERR, "Failed to read device serial number\n");
- goto fail_dsn;
- }
-
- strncpy(pkg_file, ICE_PKG_FILE_SEARCH_PATH_UPDATES,
- ICE_MAX_PKG_FILENAME_SIZE);
- if (!ice_access(strcat(pkg_file, opt_ddp_filename), 0))
- return 0;
-
- strncpy(pkg_file, ICE_PKG_FILE_SEARCH_PATH_DEFAULT,
- ICE_MAX_PKG_FILENAME_SIZE);
- if (!ice_access(strcat(pkg_file, opt_ddp_filename), 0))
- return 0;
-
-fail_dsn:
- strncpy(pkg_file, ICE_PKG_FILE_UPDATES, ICE_MAX_PKG_FILENAME_SIZE);
- if (!ice_access(pkg_file, 0))
- return 0;
- strncpy(pkg_file, ICE_PKG_FILE_DEFAULT, ICE_MAX_PKG_FILENAME_SIZE);
- return 0;
-}
-#endif
-
-enum ice_pkg_type