diff options
author | Karen Xie <kxie@chelsio.com> | 2008-07-08 12:32:34 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-07-11 01:20:33 -0400 |
commit | 9439f749441f3a7c2c8ef9e32b698cfe9ed60f48 (patch) | |
tree | d867229f0330e6fe66d09a375962d56e9e18562d /drivers/net/cxgb3 | |
parent | 5e4fe5c45ac6dda534c362e29bd4eb39f4d9cba8 (diff) |
cxgb3 - Add iscsi support
Add iSCSI (S3xx) support.
Signed-off-by: Karen Xie <kxie@chelsio.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/cxgb3')
-rw-r--r-- | drivers/net/cxgb3/cxgb3_ctl_defs.h | 5 | ||||
-rw-r--r-- | drivers/net/cxgb3/cxgb3_offload.c | 11 | ||||
-rw-r--r-- | drivers/net/cxgb3/regs.h | 10 | ||||
-rw-r--r-- | drivers/net/cxgb3/t3_cpl.h | 40 | ||||
-rw-r--r-- | drivers/net/cxgb3/t3cdev.h | 1 |
5 files changed, 59 insertions, 8 deletions
diff --git a/drivers/net/cxgb3/cxgb3_ctl_defs.h b/drivers/net/cxgb3/cxgb3_ctl_defs.h index 6c4f32066919..d38e6cc92668 100644 --- a/drivers/net/cxgb3/cxgb3_ctl_defs.h +++ b/drivers/net/cxgb3/cxgb3_ctl_defs.h | |||
@@ -110,10 +110,7 @@ struct ulp_iscsi_info { | |||
110 | unsigned int llimit; | 110 | unsigned int llimit; |
111 | unsigned int ulimit; | 111 | unsigned int ulimit; |
112 | unsigned int tagmask; | 112 | unsigned int tagmask; |
113 | unsigned int pgsz3; | 113 | u8 pgsz_factor[4]; |
114 | unsigned int pgsz2; | ||
115 | unsigned int pgsz1; | ||
116 | unsigned int pgsz0; | ||
117 | unsigned int max_rxsz; | 114 | unsigned int max_rxsz; |
118 | unsigned int max_txsz; | 115 | unsigned int max_txsz; |
119 | struct pci_dev *pdev; | 116 | struct pci_dev *pdev; |
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c index ae6ff5df779c..c69f4c0187d9 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; |
diff --git a/drivers/net/cxgb3/regs.h b/drivers/net/cxgb3/regs.h index 567178879345..4bda27c551c9 100644 --- a/drivers/net/cxgb3/regs.h +++ b/drivers/net/cxgb3/regs.h | |||
@@ -1517,16 +1517,18 @@ | |||
1517 | 1517 | ||
1518 | #define A_ULPRX_ISCSI_TAGMASK 0x514 | 1518 | #define A_ULPRX_ISCSI_TAGMASK 0x514 |
1519 | 1519 | ||
1520 | #define S_HPZ0 0 | 1520 | #define A_ULPRX_ISCSI_PSZ 0x518 |
1521 | #define M_HPZ0 0xf | ||
1522 | #define V_HPZ0(x) ((x) << S_HPZ0) | ||
1523 | #define G_HPZ0(x) (((x) >> S_HPZ0) & M_HPZ0) | ||
1524 | 1521 | ||
1525 | #define A_ULPRX_TDDP_LLIMIT 0x51c | 1522 | #define A_ULPRX_TDDP_LLIMIT 0x51c |
1526 | 1523 | ||
1527 | #define A_ULPRX_TDDP_ULIMIT 0x520 | 1524 | #define A_ULPRX_TDDP_ULIMIT 0x520 |
1528 | #define A_ULPRX_TDDP_PSZ 0x528 | 1525 | #define A_ULPRX_TDDP_PSZ 0x528 |
1529 | 1526 | ||
1527 | #define S_HPZ0 0 | ||
1528 | #define M_HPZ0 0xf | ||
1529 | #define V_HPZ0(x) ((x) << S_HPZ0) | ||
1530 | #define G_HPZ0(x) (((x) >> S_HPZ0) & M_HPZ0) | ||
1531 | |||
1530 | #define A_ULPRX_STAG_LLIMIT 0x52c | 1532 | #define A_ULPRX_STAG_LLIMIT 0x52c |
1531 | 1533 | ||
1532 | #define A_ULPRX_STAG_ULIMIT 0x530 | 1534 | #define A_ULPRX_STAG_ULIMIT 0x530 |
diff --git a/drivers/net/cxgb3/t3_cpl.h b/drivers/net/cxgb3/t3_cpl.h index a666c5d51cc0..917970ed24a1 100644 --- a/drivers/net/cxgb3/t3_cpl.h +++ b/drivers/net/cxgb3/t3_cpl.h | |||
@@ -191,6 +191,9 @@ union opcode_tid { | |||
191 | #define G_OPCODE(x) (((x) >> S_OPCODE) & 0xFF) | 191 | #define G_OPCODE(x) (((x) >> S_OPCODE) & 0xFF) |
192 | #define G_TID(x) ((x) & 0xFFFFFF) | 192 | #define G_TID(x) ((x) & 0xFFFFFF) |
193 | 193 | ||
194 | #define S_QNUM 0 | ||
195 | #define G_QNUM(x) (((x) >> S_QNUM) & 0xFFFF) | ||
196 | |||
194 | #define S_HASHTYPE 22 | 197 | #define S_HASHTYPE 22 |
195 | #define M_HASHTYPE 0x3 | 198 | #define M_HASHTYPE 0x3 |
196 | #define G_HASHTYPE(x) (((x) >> S_HASHTYPE) & M_HASHTYPE) | 199 | #define G_HASHTYPE(x) (((x) >> S_HASHTYPE) & M_HASHTYPE) |
@@ -779,6 +782,12 @@ struct tx_data_wr { | |||
779 | __be32 param; | 782 | __be32 param; |
780 | }; | 783 | }; |
781 | 784 | ||
785 | /* tx_data_wr.flags fields */ | ||
786 | #define S_TX_ACK_PAGES 21 | ||
787 | #define M_TX_ACK_PAGES 0x7 | ||
788 | #define V_TX_ACK_PAGES(x) ((x) << S_TX_ACK_PAGES) | ||
789 | #define G_TX_ACK_PAGES(x) (((x) >> S_TX_ACK_PAGES) & M_TX_ACK_PAGES) | ||
790 | |||
782 | /* tx_data_wr.param fields */ | 791 | /* tx_data_wr.param fields */ |
783 | #define S_TX_PORT 0 | 792 | #define S_TX_PORT 0 |
784 | #define M_TX_PORT 0x7 | 793 | #define M_TX_PORT 0x7 |
@@ -1452,4 +1461,35 @@ struct cpl_rdma_terminate { | |||
1452 | #define M_TERM_TID 0xFFFFF | 1461 | #define M_TERM_TID 0xFFFFF |
1453 | #define V_TERM_TID(x) ((x) << S_TERM_TID) | 1462 | #define V_TERM_TID(x) ((x) << S_TERM_TID) |
1454 | #define G_TERM_TID(x) (((x) >> S_TERM_TID) & M_TERM_TID) | 1463 | #define G_TERM_TID(x) (((x) >> S_TERM_TID) & M_TERM_TID) |
1464 | |||
1465 | /* ULP_TX opcodes */ | ||
1466 | enum { ULP_MEM_READ = 2, ULP_MEM_WRITE = 3, ULP_TXPKT = 4 }; | ||
1467 | |||
1468 | #define S_ULPTX_CMD 28 | ||
1469 | #define M_ULPTX_CMD 0xF | ||
1470 | #define V_ULPTX_CMD(x) ((x) << S_ULPTX_CMD) | ||
1471 | |||
1472 | #define S_ULPTX_NFLITS 0 | ||
1473 | #define M_ULPTX_NFLITS 0xFF | ||
1474 | #define V_ULPTX_NFLITS(x) ((x) << S_ULPTX_NFLITS) | ||
1475 | |||
1476 | struct ulp_mem_io { | ||
1477 | WR_HDR; | ||
1478 | __be32 cmd_lock_addr; | ||
1479 | __be32 len; | ||
1480 | }; | ||
1481 | |||
1482 | /* ulp_mem_io.cmd_lock_addr fields */ | ||
1483 | #define S_ULP_MEMIO_ADDR 0 | ||
1484 | #define M_ULP_MEMIO_ADDR 0x7FFFFFF | ||
1485 | #define V_ULP_MEMIO_ADDR(x) ((x) << S_ULP_MEMIO_ADDR) | ||
1486 | #define S_ULP_MEMIO_LOCK 27 | ||
1487 | #define V_ULP_MEMIO_LOCK(x) ((x) << S_ULP_MEMIO_LOCK) | ||
1488 | #define F_ULP_MEMIO_LOCK V_ULP_MEMIO_LOCK(1U) | ||
1489 | |||
1490 | /* ulp_mem_io.len fields */ | ||
1491 | #define S_ULP_MEMIO_DATA_LEN 28 | ||
1492 | #define M_ULP_MEMIO_DATA_LEN 0xF | ||
1493 | #define V_ULP_MEMIO_DATA_LEN(x) ((x) << S_ULP_MEMIO_DATA_LEN) | ||
1494 | |||
1455 | #endif /* T3_CPL_H */ | 1495 | #endif /* T3_CPL_H */ |
diff --git a/drivers/net/cxgb3/t3cdev.h b/drivers/net/cxgb3/t3cdev.h index 8556628fd5af..0a21cfbd2b21 100644 --- a/drivers/net/cxgb3/t3cdev.h +++ b/drivers/net/cxgb3/t3cdev.h | |||
@@ -64,6 +64,7 @@ struct t3cdev { | |||
64 | void *l3opt; /* optional layer 3 data */ | 64 | void *l3opt; /* optional layer 3 data */ |
65 | void *l4opt; /* optional layer 4 data */ | 65 | void *l4opt; /* optional layer 4 data */ |
66 | void *ulp; /* ulp stuff */ | 66 | void *ulp; /* ulp stuff */ |
67 | void *ulp_iscsi; /* ulp iscsi */ | ||
67 | }; | 68 | }; |
68 | 69 | ||
69 | #endif /* _T3CDEV_H_ */ | 70 | #endif /* _T3CDEV_H_ */ |