diff options
author | Pratik Pujar <pratik.pujar@qlogic.com> | 2013-08-16 19:07:16 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-08-20 03:32:02 -0400 |
commit | fef349ce37b2edafea34a73d4e8a719214fc6ffc (patch) | |
tree | a2c18c91fa1f9b9cd06268733de8e5bd617ecc79 /drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | |
parent | 77bead466cfb0bc352e424eacdd17700aca851b3 (diff) |
qlcnic: Add support for 84xx adapters to load firmware from file
o Use appropriate firmware image file name based on device IDs.
Signed-off-by: Pratik Pujar <pratik.pujar@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c index c97e2e07b279..f23e66780e7a 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | |||
@@ -1948,12 +1948,36 @@ static void qlcnic_83xx_init_hw(struct qlcnic_adapter *p_dev) | |||
1948 | dev_err(&p_dev->pdev->dev, "%s: failed\n", __func__); | 1948 | dev_err(&p_dev->pdev->dev, "%s: failed\n", __func__); |
1949 | } | 1949 | } |
1950 | 1950 | ||
1951 | static inline void qlcnic_83xx_get_fw_file_name(struct qlcnic_adapter *adapter, | ||
1952 | char *file_name) | ||
1953 | { | ||
1954 | struct pci_dev *pdev = adapter->pdev; | ||
1955 | |||
1956 | memset(file_name, 0, QLC_FW_FILE_NAME_LEN); | ||
1957 | |||
1958 | switch (pdev->device) { | ||
1959 | case PCI_DEVICE_ID_QLOGIC_QLE834X: | ||
1960 | strncpy(file_name, QLC_83XX_FW_FILE_NAME, | ||
1961 | QLC_FW_FILE_NAME_LEN); | ||
1962 | break; | ||
1963 | case PCI_DEVICE_ID_QLOGIC_QLE844X: | ||
1964 | strncpy(file_name, QLC_84XX_FW_FILE_NAME, | ||
1965 | QLC_FW_FILE_NAME_LEN); | ||
1966 | break; | ||
1967 | default: | ||
1968 | dev_err(&pdev->dev, "%s: Invalid device id\n", | ||
1969 | __func__); | ||
1970 | } | ||
1971 | } | ||
1972 | |||
1951 | static int qlcnic_83xx_load_fw_image_from_host(struct qlcnic_adapter *adapter) | 1973 | static int qlcnic_83xx_load_fw_image_from_host(struct qlcnic_adapter *adapter) |
1952 | { | 1974 | { |
1975 | char fw_file_name[QLC_FW_FILE_NAME_LEN]; | ||
1953 | int err = -EIO; | 1976 | int err = -EIO; |
1954 | 1977 | ||
1955 | if (request_firmware(&adapter->ahw->fw_info.fw, | 1978 | qlcnic_83xx_get_fw_file_name(adapter, fw_file_name); |
1956 | QLC_83XX_FW_FILE_NAME, &(adapter->pdev->dev))) { | 1979 | if (request_firmware(&adapter->ahw->fw_info.fw, fw_file_name, |
1980 | &(adapter->pdev->dev))) { | ||
1957 | dev_err(&adapter->pdev->dev, | 1981 | dev_err(&adapter->pdev->dev, |
1958 | "No file FW image, loading flash FW image.\n"); | 1982 | "No file FW image, loading flash FW image.\n"); |
1959 | QLC_SHARED_REG_WR32(adapter, QLCNIC_FW_IMG_VALID, | 1983 | QLC_SHARED_REG_WR32(adapter, QLCNIC_FW_IMG_VALID, |