aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfad_fwimg.c
diff options
context:
space:
mode:
authorJing Huang <huangj@brocade.com>2010-07-08 22:45:20 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-27 13:04:03 -0400
commit293f82d59ed8b6d61d242e40ee7a6a146fae5eaa (patch)
treef1f5f0c935e20765188847ff7f6cf4863adf69e3 /drivers/scsi/bfa/bfad_fwimg.c
parent3cb5469a2ab4b87a7c63dd218fdc1625bc73eccc (diff)
[SCSI] bfa: enable new hardware
This patch enables support of new mezzanine cards for HP and IBM blade server. - Add new pciids for HP and IBM mezzanine card. - Add a new firmware image for HP mezzanine card, which is running in FC only mode. Rename firmware image to reflect the difference. Change the firmware download code accordingly for the above changes. Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa/bfad_fwimg.c')
-rw-r--r--drivers/scsi/bfa/bfad_fwimg.c76
1 files changed, 55 insertions, 21 deletions
diff --git a/drivers/scsi/bfa/bfad_fwimg.c b/drivers/scsi/bfa/bfad_fwimg.c
index 2ad65f275a92..1baca1a12085 100644
--- a/drivers/scsi/bfa/bfad_fwimg.c
+++ b/drivers/scsi/bfa/bfad_fwimg.c
@@ -33,16 +33,20 @@
33#include <bfa_fwimg_priv.h> 33#include <bfa_fwimg_priv.h>
34#include <bfa.h> 34#include <bfa.h>
35 35
36u32 bfi_image_ct_size; 36u32 bfi_image_ct_fc_size;
37u32 bfi_image_cb_size; 37u32 bfi_image_ct_cna_size;
38u32 *bfi_image_ct; 38u32 bfi_image_cb_fc_size;
39u32 *bfi_image_cb; 39u32 *bfi_image_ct_fc;
40u32 *bfi_image_ct_cna;
41u32 *bfi_image_cb_fc;
40 42
41 43
42#define BFAD_FW_FILE_CT "ctfw.bin" 44#define BFAD_FW_FILE_CT_FC "ctfw_fc.bin"
43#define BFAD_FW_FILE_CB "cbfw.bin" 45#define BFAD_FW_FILE_CT_CNA "ctfw_cna.bin"
44MODULE_FIRMWARE(BFAD_FW_FILE_CT); 46#define BFAD_FW_FILE_CB_FC "cbfw_fc.bin"
45MODULE_FIRMWARE(BFAD_FW_FILE_CB); 47MODULE_FIRMWARE(BFAD_FW_FILE_CT_FC);
48MODULE_FIRMWARE(BFAD_FW_FILE_CT_CNA);
49MODULE_FIRMWARE(BFAD_FW_FILE_CB_FC);
46 50
47u32 * 51u32 *
48bfad_read_firmware(struct pci_dev *pdev, u32 **bfi_image, 52bfad_read_firmware(struct pci_dev *pdev, u32 **bfi_image,
@@ -74,24 +78,54 @@ error:
74u32 * 78u32 *
75bfad_get_firmware_buf(struct pci_dev *pdev) 79bfad_get_firmware_buf(struct pci_dev *pdev)
76{ 80{
77 if (pdev->device == BFA_PCI_DEVICE_ID_CT) { 81 if (pdev->device == BFA_PCI_DEVICE_ID_CT_FC) {
78 if (bfi_image_ct_size == 0) 82 if (bfi_image_ct_fc_size == 0)
79 bfad_read_firmware(pdev, &bfi_image_ct, 83 bfad_read_firmware(pdev, &bfi_image_ct_fc,
80 &bfi_image_ct_size, BFAD_FW_FILE_CT); 84 &bfi_image_ct_fc_size, BFAD_FW_FILE_CT_FC);
81 return bfi_image_ct; 85 return bfi_image_ct_fc;
86 } else if (pdev->device == BFA_PCI_DEVICE_ID_CT) {
87 if (bfi_image_ct_cna_size == 0)
88 bfad_read_firmware(pdev, &bfi_image_ct_cna,
89 &bfi_image_ct_cna_size, BFAD_FW_FILE_CT_CNA);
90 return bfi_image_ct_cna;
82 } else { 91 } else {
83 if (bfi_image_cb_size == 0) 92 if (bfi_image_cb_fc_size == 0)
84 bfad_read_firmware(pdev, &bfi_image_cb, 93 bfad_read_firmware(pdev, &bfi_image_cb_fc,
85 &bfi_image_cb_size, BFAD_FW_FILE_CB); 94 &bfi_image_cb_fc_size, BFAD_FW_FILE_CB_FC);
86 return bfi_image_cb; 95 return bfi_image_cb_fc;
87 } 96 }
88} 97}
89 98
90u32 * 99u32 *
91bfi_image_ct_get_chunk(u32 off) 100bfi_image_ct_fc_get_chunk(u32 off)
92{ return (u32 *)(bfi_image_ct + off); } 101{ return (u32 *)(bfi_image_ct_fc + off); }
93 102
94u32 * 103u32 *
95bfi_image_cb_get_chunk(u32 off) 104bfi_image_ct_cna_get_chunk(u32 off)
96{ return (u32 *)(bfi_image_cb + off); } 105{ return (u32 *)(bfi_image_ct_cna + off); }
97 106
107u32 *
108bfi_image_cb_fc_get_chunk(u32 off)
109{ return (u32 *)(bfi_image_cb_fc + off); }
110
111uint32_t *
112bfi_image_get_chunk(int type, uint32_t off)
113{
114 switch (type) {
115 case BFI_IMAGE_CT_FC: return bfi_image_ct_fc_get_chunk(off); break;
116 case BFI_IMAGE_CT_CNA: return bfi_image_ct_cna_get_chunk(off); break;
117 case BFI_IMAGE_CB_FC: return bfi_image_cb_fc_get_chunk(off); break;
118 default: return 0; break;
119 }
120}
121
122uint32_t
123bfi_image_get_size(int type)
124{
125 switch (type) {
126 case BFI_IMAGE_CT_FC: return bfi_image_ct_fc_size; break;
127 case BFI_IMAGE_CT_CNA: return bfi_image_ct_cna_size; break;
128 case BFI_IMAGE_CB_FC: return bfi_image_cb_fc_size; break;
129 default: return 0; break;
130 }
131}