diff options
Diffstat (limited to 'drivers/net/cxgb3/cxgb3_offload.c')
-rw-r--r-- | drivers/net/cxgb3/cxgb3_offload.c | 21 |
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) | |||
1248 | mutex_unlock(&cxgb3_db_lock); | 1248 | mutex_unlock(&cxgb3_db_lock); |
1249 | } | 1249 | } |
1250 | 1250 | ||
1251 | static inline int adap2type(struct adapter *adapter) | ||
1252 | { | ||
1253 | int type = 0; | ||
1254 | |||
1255 | switch (adapter->params.rev) { | ||
1256 | case T3_REV_A: | ||
1257 | type = T3A; | ||
1258 | break; | ||
1259 | case T3_REV_B: | ||
1260 | case T3_REV_B2: | ||
1261 | type = T3B; | ||
1262 | break; | ||
1263 | case T3_REV_C: | ||
1264 | type = T3C; | ||
1265 | break; | ||
1266 | } | ||
1267 | return type; | ||
1268 | } | ||
1269 | |||
1251 | void __devinit cxgb3_adapter_ofld(struct adapter *adapter) | 1270 | void __devinit cxgb3_adapter_ofld(struct adapter *adapter) |
1252 | { | 1271 | { |
1253 | struct t3cdev *tdev = &adapter->tdev; | 1272 | struct t3cdev *tdev = &adapter->tdev; |
@@ -1257,7 +1276,7 @@ void __devinit cxgb3_adapter_ofld(struct adapter *adapter) | |||
1257 | cxgb3_set_dummy_ops(tdev); | 1276 | cxgb3_set_dummy_ops(tdev); |
1258 | tdev->send = t3_offload_tx; | 1277 | tdev->send = t3_offload_tx; |
1259 | tdev->ctl = cxgb_offload_ctl; | 1278 | tdev->ctl = cxgb_offload_ctl; |
1260 | tdev->type = adapter->params.rev == 0 ? T3A : T3B; | 1279 | tdev->type = adap2type(adapter); |
1261 | 1280 | ||
1262 | register_tdev(tdev); | 1281 | register_tdev(tdev); |
1263 | } | 1282 | } |