diff options
author | Rasesh Mody <rmody@brocade.com> | 2011-09-27 14:39:07 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-09-30 03:36:35 +0400 |
commit | 1bf9fd70dd7411372e80fdb8b4b3d5c36236e7b7 (patch) | |
tree | f7dac20732ce93a46ea24c3364d6bafe01b662a5 /drivers/net/ethernet/brocade/bna/cna_fwimg.c | |
parent | f391fda1f447222fa45db3380fc1e9d2d93c85c9 (diff) | |
download | linux-1bf9fd70dd7411372e80fdb8b4b3d5c36236e7b7.tar.xz |
bna: Implement FW Download for New HW
Add new device ID 0x22 and new asic generation BFI_ASIC_GEN_CT2 for 1860.
Implement FW download from user space for new Brocade HW.
Signed-off-by: Gurunatha Karaje <gkaraje@brocade.com>
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/brocade/bna/cna_fwimg.c')
-rw-r--r-- | drivers/net/ethernet/brocade/bna/cna_fwimg.c | 48 |
1 files changed, 38 insertions, 10 deletions
diff --git a/drivers/net/ethernet/brocade/bna/cna_fwimg.c b/drivers/net/ethernet/brocade/bna/cna_fwimg.c index e8f4ecd9ebb5..725b9fff337f 100644 --- a/drivers/net/ethernet/brocade/bna/cna_fwimg.c +++ b/drivers/net/ethernet/brocade/bna/cna_fwimg.c @@ -16,11 +16,12 @@ * www.brocade.com */ #include <linux/firmware.h> +#include "bfi.h" #include "cna.h" const struct firmware *bfi_fw; -static u32 *bfi_image_ct_cna; -static u32 bfi_image_ct_cna_size; +static u32 *bfi_image_ct_cna, *bfi_image_ct2_cna; +static u32 bfi_image_ct_cna_size, bfi_image_ct2_cna_size; static u32 * cna_read_firmware(struct pci_dev *pdev, u32 **bfi_image, @@ -45,20 +46,47 @@ error: u32 * cna_get_firmware_buf(struct pci_dev *pdev) { - if (bfi_image_ct_cna_size == 0) - cna_read_firmware(pdev, &bfi_image_ct_cna, - &bfi_image_ct_cna_size, CNA_FW_FILE_CT); - return bfi_image_ct_cna; + if (pdev->device == BFA_PCI_DEVICE_ID_CT2) { + if (bfi_image_ct2_cna_size == 0) + cna_read_firmware(pdev, &bfi_image_ct2_cna, + &bfi_image_ct2_cna_size, CNA_FW_FILE_CT2); + return bfi_image_ct2_cna; + } else if (bfa_asic_id_ct(pdev->device)) { + if (bfi_image_ct_cna_size == 0) + cna_read_firmware(pdev, &bfi_image_ct_cna, + &bfi_image_ct_cna_size, CNA_FW_FILE_CT); + return bfi_image_ct_cna; + } + + return NULL; } u32 * -bfa_cb_image_get_chunk(int type, u32 off) +bfa_cb_image_get_chunk(enum bfi_asic_gen asic_gen, u32 off) { - return (u32 *)(bfi_image_ct_cna + off); + switch (asic_gen) { + case BFI_ASIC_GEN_CT: + return (u32 *)(bfi_image_ct_cna + off); + break; + case BFI_ASIC_GEN_CT2: + return (u32 *)(bfi_image_ct2_cna + off); + break; + default: + return NULL; + } } u32 -bfa_cb_image_get_size(int type) +bfa_cb_image_get_size(enum bfi_asic_gen asic_gen) { - return bfi_image_ct_cna_size; + switch (asic_gen) { + case BFI_ASIC_GEN_CT: + return bfi_image_ct_cna_size; + break; + case BFI_ASIC_GEN_CT2: + return bfi_image_ct2_cna_size; + break; + default: + return 0; + } } |