diff options
author | Ron Mercer <ron.mercer@qlogic.com> | 2009-06-09 07:39:29 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-10 10:04:08 +0200 |
commit | cfec0cbc92cdcec5a540bf340c5a9fb8c89e5af1 (patch) | |
tree | 8ddab4c01ca308c04988d305a3bbd3ee158c7d64 /drivers/net/qlge/qlge_mpi.c | |
parent | netfilter: Fix extra semi-colon in skb_walk_frags() changes. (diff) | |
download | linux-cfec0cbc92cdcec5a540bf340c5a9fb8c89e5af1.tar.xz linux-cfec0cbc92cdcec5a540bf340c5a9fb8c89e5af1.zip |
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: return status; } + +/* Get MPI firmware version. This will be used for + * driver banner and for ethtool info. + * Returns zero on success. + */ +int ql_mb_about_fw(struct ql_adapter *qdev) +{ + struct mbox_params mbc; + struct mbox_params *mbcp = &mbc; + int status = 0; + + memset(mbcp, 0, sizeof(struct mbox_params)); + + mbcp->in_count = 1; + mbcp->out_count = 3; + + mbcp->mbox_in[0] = MB_CMD_ABOUT_FW; + + status = ql_mailbox_command(qdev, mbcp); + if (status) + return status; + + if (mbcp->mbox_out[0] != MB_CMD_STS_GOOD) { + QPRINTK(qdev, DRV, ERR, + "Failed about firmware command\n"); + status = -EIO; + } + + /* Store the firmware version */ + qdev->fw_rev_id = mbcp->mbox_out[1]; + + return status; +} + /* Get functional state for MPI firmware. * Returns zero on success. */ |