Commit a29fdd3c authored by James Bottomley's avatar James Bottomley Committed by James Bottomley

[SCSI] aic94xx: tie driver to the major number of the sequencer firmware

The sequencer firmware file has both a string (currently showing
V17/10c6) and a number (currently set to 1.1).  It has become apparent
that Adaptec may issue sequencer firmware in the future which could be
incompatible with the current driver.  Therefore, the driver will be
tied to the particular major number of the firmware (i.e. the current
driver will load any 1.x firmware).  Additionally, the driver will print
out both the ascii string and the major number, so with this pach the
current firmware will print out

aic94xx: Found sequencer firmware version 1.1 (V17/10c6)
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 8d63f375
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#define PAUSE_TRIES 1000 #define PAUSE_TRIES 1000
static const struct firmware *sequencer_fw; static const struct firmware *sequencer_fw;
static const char *sequencer_version;
static u16 cseq_vecs[CSEQ_NUM_VECS], lseq_vecs[LSEQ_NUM_VECS], mode2_task, static u16 cseq_vecs[CSEQ_NUM_VECS], lseq_vecs[LSEQ_NUM_VECS], mode2_task,
cseq_idle_loop, lseq_idle_loop; cseq_idle_loop, lseq_idle_loop;
static u8 *cseq_code, *lseq_code; static u8 *cseq_code, *lseq_code;
...@@ -1276,7 +1275,6 @@ static int asd_request_firmware(struct asd_ha_struct *asd_ha) ...@@ -1276,7 +1275,6 @@ static int asd_request_firmware(struct asd_ha_struct *asd_ha)
header.csum = le32_to_cpu(hdr_ptr->csum); header.csum = le32_to_cpu(hdr_ptr->csum);
header.major = le32_to_cpu(hdr_ptr->major); header.major = le32_to_cpu(hdr_ptr->major);
header.minor = le32_to_cpu(hdr_ptr->minor); header.minor = le32_to_cpu(hdr_ptr->minor);
sequencer_version = hdr_ptr->version;
header.cseq_table_offset = le32_to_cpu(hdr_ptr->cseq_table_offset); header.cseq_table_offset = le32_to_cpu(hdr_ptr->cseq_table_offset);
header.cseq_table_size = le32_to_cpu(hdr_ptr->cseq_table_size); header.cseq_table_size = le32_to_cpu(hdr_ptr->cseq_table_size);
header.lseq_table_offset = le32_to_cpu(hdr_ptr->lseq_table_offset); header.lseq_table_offset = le32_to_cpu(hdr_ptr->lseq_table_offset);
...@@ -1303,6 +1301,16 @@ static int asd_request_firmware(struct asd_ha_struct *asd_ha) ...@@ -1303,6 +1301,16 @@ static int asd_request_firmware(struct asd_ha_struct *asd_ha)
return -EINVAL; return -EINVAL;
} }
asd_printk("Found sequencer Firmware version %d.%d (%s)\n",
header.major, header.minor, hdr_ptr->version);
if (header.major != SAS_RAZOR_SEQUENCER_FW_MAJOR) {
asd_printk("Firmware Major Version Mismatch;"
"driver requires version %d.X",
SAS_RAZOR_SEQUENCER_FW_MAJOR);
return -EINVAL;
}
ptr_cseq_vecs = (u16 *)&sequencer_fw->data[header.cseq_table_offset]; ptr_cseq_vecs = (u16 *)&sequencer_fw->data[header.cseq_table_offset];
ptr_lseq_vecs = (u16 *)&sequencer_fw->data[header.lseq_table_offset]; ptr_lseq_vecs = (u16 *)&sequencer_fw->data[header.lseq_table_offset];
mode2_task = header.mode2_task; mode2_task = header.mode2_task;
...@@ -1335,7 +1343,6 @@ int asd_init_seqs(struct asd_ha_struct *asd_ha) ...@@ -1335,7 +1343,6 @@ int asd_init_seqs(struct asd_ha_struct *asd_ha)
return err; return err;
} }
asd_printk("using sequencer %s\n", sequencer_version);
err = asd_seq_download_seqs(asd_ha); err = asd_seq_download_seqs(asd_ha);
if (err) { if (err) {
asd_printk("couldn't download sequencers for %s\n", asd_printk("couldn't download sequencers for %s\n",
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#define LSEQ_NUM_VECS 11 #define LSEQ_NUM_VECS 11
#define SAS_RAZOR_SEQUENCER_FW_FILE "aic94xx-seq.fw" #define SAS_RAZOR_SEQUENCER_FW_FILE "aic94xx-seq.fw"
#define SAS_RAZOR_SEQUENCER_FW_MAJOR 1
/* Note: All quantites in the sequencer file are little endian */ /* Note: All quantites in the sequencer file are little endian */
struct sequencer_file_header { struct sequencer_file_header {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment