diff options
author | Steve Wise <swise@opengridcomputing.com> | 2009-03-24 23:44:18 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2009-03-24 23:44:18 -0400 |
commit | d1fbe04eee32ed2642cff139b8592866f1d43f41 (patch) | |
tree | b3a934fd0415f794fe7acca9bfbf9905e5967f38 /drivers | |
parent | 426328963078f644c7194403a308588cf684d4c6 (diff) |
RDMA/cxgb3: Enforce required firmware
The cxgb3 NIC driver can handle more firmware versions than iw_cxgb3,
and since commit 8207befa ("cxgb3: untie strict FW matching") cxgb3
will load with firmware versions that iw_cxgb3 can't handle. The FW
major number indicates a specific interface between the FW and
iw_cxgb3. Thus if the major number of the running firmware does not
match the required version compiled into iw_cxgb3, then iw_cxgb3 must
not register that device.
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/hw/cxgb3/cxio_hal.c | 17 | ||||
-rw-r--r-- | drivers/infiniband/hw/cxgb3/cxio_hal.h | 3 |
2 files changed, 20 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.c b/drivers/infiniband/hw/cxgb3/cxio_hal.c index c2740e790f73..d4d7204c11ed 100644 --- a/drivers/infiniband/hw/cxgb3/cxio_hal.c +++ b/drivers/infiniband/hw/cxgb3/cxio_hal.c | |||
@@ -938,6 +938,23 @@ int cxio_rdev_open(struct cxio_rdev *rdev_p) | |||
938 | if (!rdev_p->t3cdev_p) | 938 | if (!rdev_p->t3cdev_p) |
939 | rdev_p->t3cdev_p = dev2t3cdev(netdev_p); | 939 | rdev_p->t3cdev_p = dev2t3cdev(netdev_p); |
940 | rdev_p->t3cdev_p->ulp = (void *) rdev_p; | 940 | rdev_p->t3cdev_p->ulp = (void *) rdev_p; |
941 | |||
942 | err = rdev_p->t3cdev_p->ctl(rdev_p->t3cdev_p, GET_EMBEDDED_INFO, | ||
943 | &(rdev_p->fw_info)); | ||
944 | if (err) { | ||
945 | printk(KERN_ERR "%s t3cdev_p(%p)->ctl returned error %d.\n", | ||
946 | __func__, rdev_p->t3cdev_p, err); | ||
947 | goto err1; | ||
948 | } | ||
949 | if (G_FW_VERSION_MAJOR(rdev_p->fw_info.fw_vers) != CXIO_FW_MAJ) { | ||
950 | printk(KERN_ERR MOD "fatal firmware version mismatch: " | ||
951 | "need version %u but adapter has version %u\n", | ||
952 | CXIO_FW_MAJ, | ||
953 | G_FW_VERSION_MAJOR(rdev_p->fw_info.fw_vers)); | ||
954 | err = -EINVAL; | ||
955 | goto err1; | ||
956 | } | ||
957 | |||
941 | err = rdev_p->t3cdev_p->ctl(rdev_p->t3cdev_p, RDMA_GET_PARAMS, | 958 | err = rdev_p->t3cdev_p->ctl(rdev_p->t3cdev_p, RDMA_GET_PARAMS, |
942 | &(rdev_p->rnic_info)); | 959 | &(rdev_p->rnic_info)); |
943 | if (err) { | 960 | if (err) { |
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.h b/drivers/infiniband/hw/cxgb3/cxio_hal.h index 656fe47bc84f..e44dc2289471 100644 --- a/drivers/infiniband/hw/cxgb3/cxio_hal.h +++ b/drivers/infiniband/hw/cxgb3/cxio_hal.h | |||
@@ -61,6 +61,8 @@ | |||
61 | 61 | ||
62 | #define T3_MAX_DEV_NAME_LEN 32 | 62 | #define T3_MAX_DEV_NAME_LEN 32 |
63 | 63 | ||
64 | #define CXIO_FW_MAJ 7 | ||
65 | |||
64 | struct cxio_hal_ctrl_qp { | 66 | struct cxio_hal_ctrl_qp { |
65 | u32 wptr; | 67 | u32 wptr; |
66 | u32 rptr; | 68 | u32 rptr; |
@@ -108,6 +110,7 @@ struct cxio_rdev { | |||
108 | struct gen_pool *pbl_pool; | 110 | struct gen_pool *pbl_pool; |
109 | struct gen_pool *rqt_pool; | 111 | struct gen_pool *rqt_pool; |
110 | struct list_head entry; | 112 | struct list_head entry; |
113 | struct ch_embedded_info fw_info; | ||
111 | }; | 114 | }; |
112 | 115 | ||
113 | static inline int cxio_num_stags(struct cxio_rdev *rdev_p) | 116 | static inline int cxio_num_stags(struct cxio_rdev *rdev_p) |