diff options
author | andrew.vasquez@qlogic.com <andrew.vasquez@qlogic.com> | 2006-01-31 19:04:51 -0500 |
---|---|---|
committer | <jejb@mulgrave.il.steeleye.com> | 2006-02-04 17:10:07 -0500 |
commit | 04414013bbda644b65537e73f1dacb2821b36811 (patch) | |
tree | d8859176c167bff43bfb929657a32da3bb814749 /drivers/scsi | |
parent | 53ea68ecea11bcbb3451c2758ce181bd97b569a9 (diff) |
[SCSI] qla2xxx: Add port-speed FC transport attribute.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 22 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 4 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 4 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 1 |
4 files changed, 29 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index b17ee62dd1a9..e03140fec179 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -426,6 +426,26 @@ qla2x00_get_host_port_id(struct Scsi_Host *shost) | |||
426 | } | 426 | } |
427 | 427 | ||
428 | static void | 428 | static void |
429 | qla2x00_get_host_speed(struct Scsi_Host *shost) | ||
430 | { | ||
431 | scsi_qla_host_t *ha = to_qla_host(shost); | ||
432 | uint32_t speed = 0; | ||
433 | |||
434 | switch (ha->link_data_rate) { | ||
435 | case LDR_1GB: | ||
436 | speed = 1; | ||
437 | break; | ||
438 | case LDR_2GB: | ||
439 | speed = 2; | ||
440 | break; | ||
441 | case LDR_4GB: | ||
442 | speed = 4; | ||
443 | break; | ||
444 | } | ||
445 | fc_host_speed(shost) = speed; | ||
446 | } | ||
447 | |||
448 | static void | ||
429 | qla2x00_get_starget_node_name(struct scsi_target *starget) | 449 | qla2x00_get_starget_node_name(struct scsi_target *starget) |
430 | { | 450 | { |
431 | struct Scsi_Host *host = dev_to_shost(starget->dev.parent); | 451 | struct Scsi_Host *host = dev_to_shost(starget->dev.parent); |
@@ -520,6 +540,8 @@ struct fc_function_template qla2xxx_transport_functions = { | |||
520 | 540 | ||
521 | .get_host_port_id = qla2x00_get_host_port_id, | 541 | .get_host_port_id = qla2x00_get_host_port_id, |
522 | .show_host_port_id = 1, | 542 | .show_host_port_id = 1, |
543 | .get_host_speed = qla2x00_get_host_speed, | ||
544 | .show_host_speed = 1, | ||
523 | 545 | ||
524 | .dd_fcrport_size = sizeof(struct fc_port *), | 546 | .dd_fcrport_size = sizeof(struct fc_port *), |
525 | .show_rport_supported_classes = 1, | 547 | .show_rport_supported_classes = 1, |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index bad066e5772a..26af5319c219 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -2331,6 +2331,10 @@ typedef struct scsi_qla_host { | |||
2331 | uint16_t min_external_loopid; /* First external loop Id */ | 2331 | uint16_t min_external_loopid; /* First external loop Id */ |
2332 | 2332 | ||
2333 | uint16_t link_data_rate; /* F/W operating speed */ | 2333 | uint16_t link_data_rate; /* F/W operating speed */ |
2334 | #define LDR_1GB 0 | ||
2335 | #define LDR_2GB 1 | ||
2336 | #define LDR_4GB 3 | ||
2337 | #define LDR_UNKNOWN 0xFFFF | ||
2334 | 2338 | ||
2335 | uint8_t current_topology; | 2339 | uint8_t current_topology; |
2336 | uint8_t prev_topology; | 2340 | uint8_t prev_topology; |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 71a46fcee8cc..42aa7a7c1a73 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -402,9 +402,9 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
402 | break; | 402 | break; |
403 | 403 | ||
404 | case MBA_LOOP_UP: /* Loop Up Event */ | 404 | case MBA_LOOP_UP: /* Loop Up Event */ |
405 | ha->link_data_rate = 0; | ||
406 | if (IS_QLA2100(ha) || IS_QLA2200(ha)) { | 405 | if (IS_QLA2100(ha) || IS_QLA2200(ha)) { |
407 | link_speed = link_speeds[0]; | 406 | link_speed = link_speeds[0]; |
407 | ha->link_data_rate = LDR_1GB; | ||
408 | } else { | 408 | } else { |
409 | link_speed = link_speeds[LS_UNKNOWN]; | 409 | link_speed = link_speeds[LS_UNKNOWN]; |
410 | if (mb[1] < 5) | 410 | if (mb[1] < 5) |
@@ -436,7 +436,7 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
436 | } | 436 | } |
437 | 437 | ||
438 | ha->flags.management_server_logged_in = 0; | 438 | ha->flags.management_server_logged_in = 0; |
439 | ha->link_data_rate = 0; | 439 | ha->link_data_rate = LDR_UNKNOWN; |
440 | if (ql2xfdmienable) | 440 | if (ql2xfdmienable) |
441 | set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags); | 441 | set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags); |
442 | 442 | ||
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 5866a7c706a8..6e133edb2016 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -1312,6 +1312,7 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info) | |||
1312 | ha->ports = MAX_BUSES; | 1312 | ha->ports = MAX_BUSES; |
1313 | ha->init_cb_size = sizeof(init_cb_t); | 1313 | ha->init_cb_size = sizeof(init_cb_t); |
1314 | ha->mgmt_svr_loop_id = MANAGEMENT_SERVER; | 1314 | ha->mgmt_svr_loop_id = MANAGEMENT_SERVER; |
1315 | ha->link_data_rate = LDR_UNKNOWN; | ||
1315 | 1316 | ||
1316 | /* Assign ISP specific operations. */ | 1317 | /* Assign ISP specific operations. */ |
1317 | ha->isp_ops.pci_config = qla2100_pci_config; | 1318 | ha->isp_ops.pci_config = qla2100_pci_config; |