diff options
author | Ron Mercer <ron.mercer@qlogic.com> | 2009-06-09 01:39:29 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-10 04:04:08 -0400 |
commit | cfec0cbc92cdcec5a540bf340c5a9fb8c89e5af1 (patch) | |
tree | 8ddab4c01ca308c04988d305a3bbd3ee158c7d64 /drivers/net/qlge/qlge_mpi.c | |
parent | 0808dc80939b08ec215f472e17a5d8f6b148037e (diff) |
qlge: Add support for retrieving firmware version.
This is used by driver banner and ethtool info.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge/qlge_mpi.c')
-rw-r--r-- | drivers/net/qlge/qlge_mpi.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/net/qlge/qlge_mpi.c b/drivers/net/qlge/qlge_mpi.c index 3bd60a4f5d71..a67c14a7befd 100644 --- a/drivers/net/qlge/qlge_mpi.c +++ b/drivers/net/qlge/qlge_mpi.c | |||
@@ -547,6 +547,40 @@ end: | |||
547 | return status; | 547 | return status; |
548 | } | 548 | } |
549 | 549 | ||
550 | |||
551 | /* Get MPI firmware version. This will be used for | ||
552 | * driver banner and for ethtool info. | ||
553 | * Returns zero on success. | ||
554 | */ | ||
555 | int ql_mb_about_fw(struct ql_adapter *qdev) | ||
556 | { | ||
557 | struct mbox_params mbc; | ||
558 | struct mbox_params *mbcp = &mbc; | ||
559 | int status = 0; | ||
560 | |||
561 | memset(mbcp, 0, sizeof(struct mbox_params)); | ||
562 | |||
563 | mbcp->in_count = 1; | ||
564 | mbcp->out_count = 3; | ||
565 | |||
566 | mbcp->mbox_in[0] = MB_CMD_ABOUT_FW; | ||
567 | |||
568 | status = ql_mailbox_command(qdev, mbcp); | ||
569 | if (status) | ||
570 | return status; | ||
571 | |||
572 | if (mbcp->mbox_out[0] != MB_CMD_STS_GOOD) { | ||
573 | QPRINTK(qdev, DRV, ERR, | ||
574 | "Failed about firmware command\n"); | ||
575 | status = -EIO; | ||
576 | } | ||
577 | |||
578 | /* Store the firmware version */ | ||
579 | qdev->fw_rev_id = mbcp->mbox_out[1]; | ||
580 | |||
581 | return status; | ||
582 | } | ||
583 | |||
550 | /* Get functional state for MPI firmware. | 584 | /* Get functional state for MPI firmware. |
551 | * Returns zero on success. | 585 | * Returns zero on success. |
552 | */ | 586 | */ |