aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfa_svc.c
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2011-07-20 20:01:07 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-07-27 06:45:44 -0400
commitfb778b06299f424c4db60817bd3dcfcaad3a8a75 (patch)
treec7e141ca0e0ef2c390192f57ae8499471b6c614f /drivers/scsi/bfa/bfa_svc.c
parentca6e0ea71cd0f442875b05357dd51774bd84b418 (diff)
[SCSI] bfa: Check supported speed based on port mode
Added logic to check the loopback test input speed based on port mode. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa/bfa_svc.c')
-rw-r--r--drivers/scsi/bfa/bfa_svc.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c
index 136f5f922cd3..6e1ed9a9aa2a 100644
--- a/drivers/scsi/bfa/bfa_svc.c
+++ b/drivers/scsi/bfa/bfa_svc.c
@@ -5553,11 +5553,29 @@ bfa_fcdiag_loopback(struct bfa_s *bfa, enum bfa_port_opmode opmode,
5553 return BFA_STATUS_PORT_NOT_DISABLED; 5553 return BFA_STATUS_PORT_NOT_DISABLED;
5554 } 5554 }
5555 5555
5556 /* Check if the speed is supported */ 5556 /*
5557 bfa_fcport_get_attr(bfa, &attr); 5557 * Check if input speed is supported by the port mode
5558 bfa_trc(fcdiag, attr.speed_supported); 5558 */
5559 if (speed > attr.speed_supported) 5559 if (bfa_ioc_get_type(&bfa->ioc) == BFA_IOC_TYPE_FC) {
5560 return BFA_STATUS_UNSUPP_SPEED; 5560 if (!(speed == BFA_PORT_SPEED_1GBPS ||
5561 speed == BFA_PORT_SPEED_2GBPS ||
5562 speed == BFA_PORT_SPEED_4GBPS ||
5563 speed == BFA_PORT_SPEED_8GBPS ||
5564 speed == BFA_PORT_SPEED_16GBPS ||
5565 speed == BFA_PORT_SPEED_AUTO)) {
5566 bfa_trc(fcdiag, speed);
5567 return BFA_STATUS_UNSUPP_SPEED;
5568 }
5569 bfa_fcport_get_attr(bfa, &attr);
5570 bfa_trc(fcdiag, attr.speed_supported);
5571 if (speed > attr.speed_supported)
5572 return BFA_STATUS_UNSUPP_SPEED;
5573 } else {
5574 if (speed != BFA_PORT_SPEED_10GBPS) {
5575 bfa_trc(fcdiag, speed);
5576 return BFA_STATUS_UNSUPP_SPEED;
5577 }
5578 }
5561 5579
5562 /* For Mezz card, port speed entered needs to be checked */ 5580 /* For Mezz card, port speed entered needs to be checked */
5563 if (bfa_mfg_is_mezz(bfa->ioc.attr->card_type)) { 5581 if (bfa_mfg_is_mezz(bfa->ioc.attr->card_type)) {