summaryrefslogtreecommitdiff
path: root/drivers/net/cxgb3/cxgb3_offload.c
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2008-06-23 22:02:59 +0400
committerJeff Garzik <jgarzik@redhat.com>2008-06-25 06:59:33 +0400
commit8f85cd7fefa3d01c4e05aac1cb198733336cf44b (patch)
tree7d704246455b35247b6bb4ae40f9c139faf260fd /drivers/net/cxgb3/cxgb3_offload.c
parent78a655181409d9d0f2b730ccb897c18794826495 (diff)
downloadlinux-8f85cd7fefa3d01c4e05aac1cb198733336cf44b.tar.xz
cxgb3 - add missing adapter type for RDMA
T3C added support is now reflected to the RDMA driver. Signed-off-by: Divy Le Ray <divy@chelsio.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/cxgb3/cxgb3_offload.c')
-rw-r--r--drivers/net/cxgb3/cxgb3_offload.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
index ff9c013ce535..ae6ff5df779c 100644
--- a/drivers/net/cxgb3/cxgb3_offload.c
+++ b/drivers/net/cxgb3/cxgb3_offload.c
@@ -1248,6 +1248,25 @@ static inline void unregister_tdev(struct t3cdev *tdev)
mutex_unlock(&cxgb3_db_lock);
}
+static inline int adap2type(struct adapter *adapter)
+{
+ int type = 0;
+
+ switch (adapter->params.rev) {
+ case T3_REV_A:
+ type = T3A;
+ break;
+ case T3_REV_B:
+ case T3_REV_B2:
+ type = T3B;
+ break;
+ case T3_REV_C:
+ type = T3C;
+ break;
+ }
+ return type;
+}
+
void __devinit cxgb3_adapter_ofld(struct adapter *adapter)
{
struct t3cdev *tdev = &adapter->tdev;
@@ -1257,7 +1276,7 @@ void __devinit cxgb3_adapter_ofld(struct adapter *adapter)
cxgb3_set_dummy_ops(tdev);
tdev->send = t3_offload_tx;
tdev->ctl = cxgb_offload_ctl;
- tdev->type = adapter->params.rev == 0 ? T3A : T3B;
+ tdev->type = adap2type(adapter);
register_tdev(tdev);
}