Skip to content

Commit

Permalink
[SCSI] qla2xxx: Honour "Extended BB credits" bit for CNAs.
Browse files Browse the repository at this point in the history
We now enable/disable "Additional Receive Credits" in f/w based on nvram
parameter "Extended_BB_Credits" bit (i.e. Enhanced-Features: at offset 0x196).
This is applicable only for GEN2 CNAs.

Signed-off-by: Santosh Vernekar <santosh.vernekar@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
Santosh Vernekar authored and James Bottomley committed Mar 27, 2010
1 parent d88a714 commit cad454b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
18 changes: 15 additions & 3 deletions drivers/scsi/qla2xxx/qla_fw.h
Original file line number Diff line number Diff line change
Expand Up @@ -1592,18 +1592,30 @@ struct nvram_81xx {

/* Offset 384. */
uint8_t reserved_21[16];
uint16_t reserved_22[8];
uint16_t reserved_22[3];

/*
* BIT 0 = Extended BB credits for LR
* BIT 1 = Virtual Fabric Enable
* BIT 2 = Enhanced Features Unused
* BIT 3-7 = Enhanced Features Reserved
*/
/* Enhanced Features */
uint8_t enhanced_features;

uint8_t reserved_23;
uint16_t reserved_24[4];

/* Offset 416. */
uint16_t reserved_23[32];
uint16_t reserved_25[32];

/* Offset 480. */
uint8_t model_name[16];

/* Offset 496. */
uint16_t feature_mask_l;
uint16_t feature_mask_h;
uint16_t reserved_24[2];
uint16_t reserved_26[2];

uint16_t subsystem_vendor_id;
uint16_t subsystem_device_id;
Expand Down
8 changes: 7 additions & 1 deletion drivers/scsi/qla2xxx/qla_mbx.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ qla2x00_load_ram(scsi_qla_host_t *vha, dma_addr_t req_dma, uint32_t risc_addr,
return rval;
}

#define EXTENDED_BB_CREDITS BIT_0
/*
* qla2x00_execute_fw
* Start adapter firmware.
Expand Down Expand Up @@ -371,7 +372,12 @@ qla2x00_execute_fw(scsi_qla_host_t *vha, uint32_t risc_addr)
mcp->mb[1] = MSW(risc_addr);
mcp->mb[2] = LSW(risc_addr);
mcp->mb[3] = 0;
mcp->mb[4] = 0;
if (IS_QLA81XX(ha)) {
struct nvram_81xx *nv = ha->nvram;
mcp->mb[4] = (nv->enhanced_features &
EXTENDED_BB_CREDITS);
} else
mcp->mb[4] = 0;
mcp->out_mb |= MBX_4|MBX_3|MBX_2|MBX_1;
mcp->in_mb |= MBX_1;
} else {
Expand Down

0 comments on commit cad454b

Please sign in to comment.