diff options
Diffstat (limited to 'drivers/net/cxgb3/cxgb3_offload.c')
-rw-r--r-- | drivers/net/cxgb3/cxgb3_offload.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c index cf2696873796..c5b3de1bb456 100644 --- a/drivers/net/cxgb3/cxgb3_offload.c +++ b/drivers/net/cxgb3/cxgb3_offload.c | |||
@@ -207,6 +207,17 @@ static int cxgb_ulp_iscsi_ctl(struct adapter *adapter, unsigned int req, | |||
207 | break; | 207 | break; |
208 | case ULP_ISCSI_SET_PARAMS: | 208 | case ULP_ISCSI_SET_PARAMS: |
209 | t3_write_reg(adapter, A_ULPRX_ISCSI_TAGMASK, uiip->tagmask); | 209 | t3_write_reg(adapter, A_ULPRX_ISCSI_TAGMASK, uiip->tagmask); |
210 | /* set MaxRxData and MaxCoalesceSize to 16224 */ | ||
211 | t3_write_reg(adapter, A_TP_PARA_REG2, 0x3f603f60); | ||
212 | /* program the ddp page sizes */ | ||
213 | { | ||
214 | int i; | ||
215 | unsigned int val = 0; | ||
216 | for (i = 0; i < 4; i++) | ||
217 | val |= (uiip->pgsz_factor[i] & 0xF) << (8 * i); | ||
218 | if (val) | ||
219 | t3_write_reg(adapter, A_ULPRX_ISCSI_PSZ, val); | ||
220 | } | ||
210 | break; | 221 | break; |
211 | default: | 222 | default: |
212 | ret = -EOPNOTSUPP; | 223 | ret = -EOPNOTSUPP; |
@@ -1255,6 +1266,25 @@ static inline void unregister_tdev(struct t3cdev *tdev) | |||
1255 | mutex_unlock(&cxgb3_db_lock); | 1266 | mutex_unlock(&cxgb3_db_lock); |
1256 | } | 1267 | } |
1257 | 1268 | ||
1269 | static inline int adap2type(struct adapter *adapter) | ||
1270 | { | ||
1271 | int type = 0; | ||
1272 | |||
1273 | switch (adapter->params.rev) { | ||
1274 | case T3_REV_A: | ||
1275 | type = T3A; | ||
1276 | break; | ||
1277 | case T3_REV_B: | ||
1278 | case T3_REV_B2: | ||
1279 | type = T3B; | ||
1280 | break; | ||
1281 | case T3_REV_C: | ||
1282 | type = T3C; | ||
1283 | break; | ||
1284 | } | ||
1285 | return type; | ||
1286 | } | ||
1287 | |||
1258 | void __devinit cxgb3_adapter_ofld(struct adapter *adapter) | 1288 | void __devinit cxgb3_adapter_ofld(struct adapter *adapter) |
1259 | { | 1289 | { |
1260 | struct t3cdev *tdev = &adapter->tdev; | 1290 | struct t3cdev *tdev = &adapter->tdev; |
@@ -1264,7 +1294,7 @@ void __devinit cxgb3_adapter_ofld(struct adapter *adapter) | |||
1264 | cxgb3_set_dummy_ops(tdev); | 1294 | cxgb3_set_dummy_ops(tdev); |
1265 | tdev->send = t3_offload_tx; | 1295 | tdev->send = t3_offload_tx; |
1266 | tdev->ctl = cxgb_offload_ctl; | 1296 | tdev->ctl = cxgb_offload_ctl; |
1267 | tdev->type = adapter->params.rev == 0 ? T3A : T3B; | 1297 | tdev->type = adap2type(adapter); |
1268 | 1298 | ||
1269 | register_tdev(tdev); | 1299 | register_tdev(tdev); |
1270 | } | 1300 | } |