aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/hw/cxgb4/cm.c158
-rw-r--r--drivers/infiniband/hw/cxgb4/iw_cxgb4.h1
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/t4_msg.h19
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/t4_regs.h2
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h143
-rw-r--r--drivers/scsi/csiostor/t4fw_api_stor.h39
6 files changed, 315 insertions, 47 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 5de86968379d..4878704b6d70 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -61,6 +61,14 @@ static char *states[] = {
61 NULL, 61 NULL,
62}; 62};
63 63
64static int nocong;
65module_param(nocong, int, 0644);
66MODULE_PARM_DESC(nocong, "Turn of congestion control (default=0)");
67
68static int enable_ecn;
69module_param(enable_ecn, int, 0644);
70MODULE_PARM_DESC(enable_ecn, "Enable ECN (default=0/disabled)");
71
64static int dack_mode = 1; 72static int dack_mode = 1;
65module_param(dack_mode, int, 0644); 73module_param(dack_mode, int, 0644);
66MODULE_PARM_DESC(dack_mode, "Delayed ack mode (default=1)"); 74MODULE_PARM_DESC(dack_mode, "Delayed ack mode (default=1)");
@@ -441,6 +449,50 @@ static int send_abort(struct c4iw_ep *ep, struct sk_buff *skb, gfp_t gfp)
441 return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t); 449 return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t);
442} 450}
443 451
452#define VLAN_NONE 0xfff
453#define FILTER_SEL_VLAN_NONE 0xffff
454#define FILTER_SEL_WIDTH_P_FC (3+1) /* port uses 3 bits, FCoE one bit */
455#define FILTER_SEL_WIDTH_VIN_P_FC \
456 (6 + 7 + FILTER_SEL_WIDTH_P_FC) /* 6 bits are unused, VF uses 7 bits*/
457#define FILTER_SEL_WIDTH_TAG_P_FC \
458 (3 + FILTER_SEL_WIDTH_VIN_P_FC) /* PF uses 3 bits */
459#define FILTER_SEL_WIDTH_VLD_TAG_P_FC (1 + FILTER_SEL_WIDTH_TAG_P_FC)
460
461static unsigned int select_ntuple(struct c4iw_dev *dev, struct dst_entry *dst,
462 struct l2t_entry *l2t)
463{
464 unsigned int ntuple = 0;
465 u32 viid;
466
467 switch (dev->rdev.lldi.filt_mode) {
468
469 /* default filter mode */
470 case HW_TPL_FR_MT_PR_IV_P_FC:
471 if (l2t->vlan == VLAN_NONE)
472 ntuple |= FILTER_SEL_VLAN_NONE << FILTER_SEL_WIDTH_P_FC;
473 else {
474 ntuple |= l2t->vlan << FILTER_SEL_WIDTH_P_FC;
475 ntuple |= 1 << FILTER_SEL_WIDTH_VLD_TAG_P_FC;
476 }
477 ntuple |= l2t->lport << S_PORT | IPPROTO_TCP <<
478 FILTER_SEL_WIDTH_VLD_TAG_P_FC;
479 break;
480 case HW_TPL_FR_MT_PR_OV_P_FC: {
481 viid = cxgb4_port_viid(l2t->neigh->dev);
482
483 ntuple |= FW_VIID_VIN_GET(viid) << FILTER_SEL_WIDTH_P_FC;
484 ntuple |= FW_VIID_PFN_GET(viid) << FILTER_SEL_WIDTH_VIN_P_FC;
485 ntuple |= FW_VIID_VIVLD_GET(viid) << FILTER_SEL_WIDTH_TAG_P_FC;
486 ntuple |= l2t->lport << S_PORT | IPPROTO_TCP <<
487 FILTER_SEL_WIDTH_VLD_TAG_P_FC;
488 break;
489 }
490 default:
491 break;
492 }
493 return ntuple;
494}
495
444static int send_connect(struct c4iw_ep *ep) 496static int send_connect(struct c4iw_ep *ep)
445{ 497{
446 struct cpl_act_open_req *req; 498 struct cpl_act_open_req *req;
@@ -463,7 +515,8 @@ static int send_connect(struct c4iw_ep *ep)
463 515
464 cxgb4_best_mtu(ep->com.dev->rdev.lldi.mtus, ep->mtu, &mtu_idx); 516 cxgb4_best_mtu(ep->com.dev->rdev.lldi.mtus, ep->mtu, &mtu_idx);
465 wscale = compute_wscale(rcv_win); 517 wscale = compute_wscale(rcv_win);
466 opt0 = KEEP_ALIVE(1) | 518 opt0 = (nocong ? NO_CONG(1) : 0) |
519 KEEP_ALIVE(1) |
467 DELACK(1) | 520 DELACK(1) |
468 WND_SCALE(wscale) | 521 WND_SCALE(wscale) |
469 MSS_IDX(mtu_idx) | 522 MSS_IDX(mtu_idx) |
@@ -474,6 +527,7 @@ static int send_connect(struct c4iw_ep *ep)
474 ULP_MODE(ULP_MODE_TCPDDP) | 527 ULP_MODE(ULP_MODE_TCPDDP) |
475 RCV_BUFSIZ(rcv_win>>10); 528 RCV_BUFSIZ(rcv_win>>10);
476 opt2 = RX_CHANNEL(0) | 529 opt2 = RX_CHANNEL(0) |
530 CCTRL_ECN(enable_ecn) |
477 RSS_QUEUE_VALID | RSS_QUEUE(ep->rss_qid); 531 RSS_QUEUE_VALID | RSS_QUEUE(ep->rss_qid);
478 if (enable_tcp_timestamps) 532 if (enable_tcp_timestamps)
479 opt2 |= TSTAMPS_EN(1); 533 opt2 |= TSTAMPS_EN(1);
@@ -492,7 +546,7 @@ static int send_connect(struct c4iw_ep *ep)
492 req->local_ip = ep->com.local_addr.sin_addr.s_addr; 546 req->local_ip = ep->com.local_addr.sin_addr.s_addr;
493 req->peer_ip = ep->com.remote_addr.sin_addr.s_addr; 547 req->peer_ip = ep->com.remote_addr.sin_addr.s_addr;
494 req->opt0 = cpu_to_be64(opt0); 548 req->opt0 = cpu_to_be64(opt0);
495 req->params = 0; 549 req->params = cpu_to_be32(select_ntuple(ep->com.dev, ep->dst, ep->l2t));
496 req->opt2 = cpu_to_be32(opt2); 550 req->opt2 = cpu_to_be32(opt2);
497 return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t); 551 return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t);
498} 552}
@@ -1383,6 +1437,61 @@ static int abort_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
1383 return 0; 1437 return 0;
1384} 1438}
1385 1439
1440static void send_fw_act_open_req(struct c4iw_ep *ep, unsigned int atid)
1441{
1442 struct sk_buff *skb;
1443 struct fw_ofld_connection_wr *req;
1444 unsigned int mtu_idx;
1445 int wscale;
1446
1447 skb = get_skb(NULL, sizeof(*req), GFP_KERNEL);
1448 req = (struct fw_ofld_connection_wr *)__skb_put(skb, sizeof(*req));
1449 memset(req, 0, sizeof(*req));
1450 req->op_compl = htonl(V_WR_OP(FW_OFLD_CONNECTION_WR));
1451 req->len16_pkd = htonl(FW_WR_LEN16(DIV_ROUND_UP(sizeof(*req), 16)));
1452 req->le.filter = cpu_to_be32(select_ntuple(ep->com.dev, ep->dst,
1453 ep->l2t));
1454 req->le.lport = ep->com.local_addr.sin_port;
1455 req->le.pport = ep->com.remote_addr.sin_port;
1456 req->le.u.ipv4.lip = ep->com.local_addr.sin_addr.s_addr;
1457 req->le.u.ipv4.pip = ep->com.remote_addr.sin_addr.s_addr;
1458 req->tcb.t_state_to_astid =
1459 htonl(V_FW_OFLD_CONNECTION_WR_T_STATE(TCP_SYN_SENT) |
1460 V_FW_OFLD_CONNECTION_WR_ASTID(atid));
1461 req->tcb.cplrxdataack_cplpassacceptrpl =
1462 htons(F_FW_OFLD_CONNECTION_WR_CPLRXDATAACK);
1463 req->tcb.tx_max = jiffies;
1464 cxgb4_best_mtu(ep->com.dev->rdev.lldi.mtus, ep->mtu, &mtu_idx);
1465 wscale = compute_wscale(rcv_win);
1466 req->tcb.opt0 = TCAM_BYPASS(1) |
1467 (nocong ? NO_CONG(1) : 0) |
1468 KEEP_ALIVE(1) |
1469 DELACK(1) |
1470 WND_SCALE(wscale) |
1471 MSS_IDX(mtu_idx) |
1472 L2T_IDX(ep->l2t->idx) |
1473 TX_CHAN(ep->tx_chan) |
1474 SMAC_SEL(ep->smac_idx) |
1475 DSCP(ep->tos) |
1476 ULP_MODE(ULP_MODE_TCPDDP) |
1477 RCV_BUFSIZ(rcv_win >> 10);
1478 req->tcb.opt2 = PACE(1) |
1479 TX_QUEUE(ep->com.dev->rdev.lldi.tx_modq[ep->tx_chan]) |
1480 RX_CHANNEL(0) |
1481 CCTRL_ECN(enable_ecn) |
1482 RSS_QUEUE_VALID | RSS_QUEUE(ep->rss_qid);
1483 if (enable_tcp_timestamps)
1484 req->tcb.opt2 |= TSTAMPS_EN(1);
1485 if (enable_tcp_sack)
1486 req->tcb.opt2 |= SACK_EN(1);
1487 if (wscale && enable_tcp_window_scaling)
1488 req->tcb.opt2 |= WND_SCALE_EN(1);
1489 req->tcb.opt0 = cpu_to_be64(req->tcb.opt0);
1490 req->tcb.opt2 = cpu_to_be32(req->tcb.opt2);
1491 set_wr_txq(skb, CPL_PRIORITY_CONTROL, 0);
1492 c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t);
1493}
1494
1386/* 1495/*
1387 * Return whether a failed active open has allocated a TID 1496 * Return whether a failed active open has allocated a TID
1388 */ 1497 */
@@ -1419,6 +1528,14 @@ static int act_open_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
1419 case CPL_ERR_CONN_RESET: 1528 case CPL_ERR_CONN_RESET:
1420 case CPL_ERR_CONN_TIMEDOUT: 1529 case CPL_ERR_CONN_TIMEDOUT:
1421 break; 1530 break;
1531 case CPL_ERR_TCAM_FULL:
1532 mutex_lock(&dev->rdev.stats.lock);
1533 dev->rdev.stats.tcam_full++;
1534 mutex_unlock(&dev->rdev.stats.lock);
1535 send_fw_act_open_req(ep,
1536 GET_TID_TID(GET_AOPEN_ATID(ntohl(rpl->atid_status))));
1537 return 0;
1538 break;
1422 default: 1539 default:
1423 printk(KERN_INFO MOD "Active open failure - " 1540 printk(KERN_INFO MOD "Active open failure - "
1424 "atid %u status %u errno %d %pI4:%u->%pI4:%u\n", 1541 "atid %u status %u errno %d %pI4:%u->%pI4:%u\n",
@@ -1510,14 +1627,15 @@ static void accept_cr(struct c4iw_ep *ep, __be32 peer_ip, struct sk_buff *skb,
1510 skb_get(skb); 1627 skb_get(skb);
1511 cxgb4_best_mtu(ep->com.dev->rdev.lldi.mtus, ep->mtu, &mtu_idx); 1628 cxgb4_best_mtu(ep->com.dev->rdev.lldi.mtus, ep->mtu, &mtu_idx);
1512 wscale = compute_wscale(rcv_win); 1629 wscale = compute_wscale(rcv_win);
1513 opt0 = KEEP_ALIVE(1) | 1630 opt0 = (nocong ? NO_CONG(1) : 0) |
1631 KEEP_ALIVE(1) |
1514 DELACK(1) | 1632 DELACK(1) |
1515 WND_SCALE(wscale) | 1633 WND_SCALE(wscale) |
1516 MSS_IDX(mtu_idx) | 1634 MSS_IDX(mtu_idx) |
1517 L2T_IDX(ep->l2t->idx) | 1635 L2T_IDX(ep->l2t->idx) |
1518 TX_CHAN(ep->tx_chan) | 1636 TX_CHAN(ep->tx_chan) |
1519 SMAC_SEL(ep->smac_idx) | 1637 SMAC_SEL(ep->smac_idx) |
1520 DSCP(ep->tos) | 1638 DSCP(ep->tos >> 2) |
1521 ULP_MODE(ULP_MODE_TCPDDP) | 1639 ULP_MODE(ULP_MODE_TCPDDP) |
1522 RCV_BUFSIZ(rcv_win>>10); 1640 RCV_BUFSIZ(rcv_win>>10);
1523 opt2 = RX_CHANNEL(0) | 1641 opt2 = RX_CHANNEL(0) |
@@ -1529,6 +1647,15 @@ static void accept_cr(struct c4iw_ep *ep, __be32 peer_ip, struct sk_buff *skb,
1529 opt2 |= SACK_EN(1); 1647 opt2 |= SACK_EN(1);
1530 if (wscale && enable_tcp_window_scaling) 1648 if (wscale && enable_tcp_window_scaling)
1531 opt2 |= WND_SCALE_EN(1); 1649 opt2 |= WND_SCALE_EN(1);
1650 if (enable_ecn) {
1651 const struct tcphdr *tcph;
1652 u32 hlen = ntohl(req->hdr_len);
1653
1654 tcph = (const void *)(req + 1) + G_ETH_HDR_LEN(hlen) +
1655 G_IP_HDR_LEN(hlen);
1656 if (tcph->ece && tcph->cwr)
1657 opt2 |= CCTRL_ECN(1);
1658 }
1532 1659
1533 rpl = cplhdr(skb); 1660 rpl = cplhdr(skb);
1534 INIT_TP_WR(rpl, ep->hwtid); 1661 INIT_TP_WR(rpl, ep->hwtid);
@@ -2647,11 +2774,14 @@ static int fw6_msg(struct c4iw_dev *dev, struct sk_buff *skb)
2647 struct cpl_fw6_msg *rpl = cplhdr(skb); 2774 struct cpl_fw6_msg *rpl = cplhdr(skb);
2648 struct c4iw_wr_wait *wr_waitp; 2775 struct c4iw_wr_wait *wr_waitp;
2649 int ret; 2776 int ret;
2777 u8 opcode;
2778 struct cpl_fw6_msg_ofld_connection_wr_rpl *req;
2779 struct c4iw_ep *ep;
2650 2780
2651 PDBG("%s type %u\n", __func__, rpl->type); 2781 PDBG("%s type %u\n", __func__, rpl->type);
2652 2782
2653 switch (rpl->type) { 2783 switch (rpl->type) {
2654 case 1: 2784 case FW6_TYPE_WR_RPL:
2655 ret = (int)((be64_to_cpu(rpl->data[0]) >> 8) & 0xff); 2785 ret = (int)((be64_to_cpu(rpl->data[0]) >> 8) & 0xff);
2656 wr_waitp = (struct c4iw_wr_wait *)(__force unsigned long) rpl->data[1]; 2786 wr_waitp = (struct c4iw_wr_wait *)(__force unsigned long) rpl->data[1];
2657 PDBG("%s wr_waitp %p ret %u\n", __func__, wr_waitp, ret); 2787 PDBG("%s wr_waitp %p ret %u\n", __func__, wr_waitp, ret);
@@ -2659,9 +2789,25 @@ static int fw6_msg(struct c4iw_dev *dev, struct sk_buff *skb)
2659 c4iw_wake_up(wr_waitp, ret ? -ret : 0); 2789 c4iw_wake_up(wr_waitp, ret ? -ret : 0);
2660 kfree_skb(skb); 2790 kfree_skb(skb);
2661 break; 2791 break;
2662 case 2: 2792 case FW6_TYPE_CQE:
2663 sched(dev, skb); 2793 sched(dev, skb);
2664 break; 2794 break;
2795 case FW6_TYPE_OFLD_CONNECTION_WR_RPL:
2796 opcode = *(const u8 *)rpl->data;
2797 if (opcode == FW_OFLD_CONNECTION_WR) {
2798 req =
2799 (struct cpl_fw6_msg_ofld_connection_wr_rpl *)rpl->data;
2800 if (req->t_state == TCP_SYN_SENT
2801 && (req->retval == FW_ENOMEM
2802 || req->retval == FW_EADDRINUSE)) {
2803 ep = (struct c4iw_ep *)
2804 lookup_atid(dev->rdev.lldi.tids,
2805 req->tid);
2806 c4iw_l2t_send(&dev->rdev, skb, ep->l2t);
2807 return 0;
2808 }
2809 }
2810 break;
2665 default: 2811 default:
2666 printk(KERN_ERR MOD "%s unexpected fw6 msg type %u\n", __func__, 2812 printk(KERN_ERR MOD "%s unexpected fw6 msg type %u\n", __func__,
2667 rpl->type); 2813 rpl->type);
diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
index 9beb3a9f0336..6a17fde51eae 100644
--- a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
+++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
@@ -130,6 +130,7 @@ struct c4iw_stats {
130 u64 db_empty; 130 u64 db_empty;
131 u64 db_drop; 131 u64 db_drop;
132 u64 db_state_transitions; 132 u64 db_state_transitions;
133 u64 tcam_full;
133}; 134};
134 135
135struct c4iw_rdev { 136struct c4iw_rdev {
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h b/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
index 99ff71764499..dcf6d61794ea 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
@@ -193,6 +193,10 @@ struct work_request_hdr {
193 __be64 wr_lo; 193 __be64 wr_lo;
194}; 194};
195 195
196/* wr_hi fields */
197#define S_WR_OP 24
198#define V_WR_OP(x) ((__u64)(x) << S_WR_OP)
199
196#define WR_HDR struct work_request_hdr wr 200#define WR_HDR struct work_request_hdr wr
197 201
198struct cpl_pass_open_req { 202struct cpl_pass_open_req {
@@ -204,12 +208,14 @@ struct cpl_pass_open_req {
204 __be32 peer_ip; 208 __be32 peer_ip;
205 __be64 opt0; 209 __be64 opt0;
206#define TX_CHAN(x) ((x) << 2) 210#define TX_CHAN(x) ((x) << 2)
211#define NO_CONG(x) ((x) << 4)
207#define DELACK(x) ((x) << 5) 212#define DELACK(x) ((x) << 5)
208#define ULP_MODE(x) ((x) << 8) 213#define ULP_MODE(x) ((x) << 8)
209#define RCV_BUFSIZ(x) ((x) << 12) 214#define RCV_BUFSIZ(x) ((x) << 12)
210#define DSCP(x) ((x) << 22) 215#define DSCP(x) ((x) << 22)
211#define SMAC_SEL(x) ((u64)(x) << 28) 216#define SMAC_SEL(x) ((u64)(x) << 28)
212#define L2T_IDX(x) ((u64)(x) << 36) 217#define L2T_IDX(x) ((u64)(x) << 36)
218#define TCAM_BYPASS(x) ((u64)(x) << 48)
213#define NAGLE(x) ((u64)(x) << 49) 219#define NAGLE(x) ((u64)(x) << 49)
214#define WND_SCALE(x) ((u64)(x) << 50) 220#define WND_SCALE(x) ((u64)(x) << 50)
215#define KEEP_ALIVE(x) ((u64)(x) << 54) 221#define KEEP_ALIVE(x) ((u64)(x) << 54)
@@ -247,8 +253,10 @@ struct cpl_pass_accept_rpl {
247#define RSS_QUEUE_VALID (1 << 10) 253#define RSS_QUEUE_VALID (1 << 10)
248#define RX_COALESCE_VALID(x) ((x) << 11) 254#define RX_COALESCE_VALID(x) ((x) << 11)
249#define RX_COALESCE(x) ((x) << 12) 255#define RX_COALESCE(x) ((x) << 12)
256#define PACE(x) ((x) << 16)
250#define TX_QUEUE(x) ((x) << 23) 257#define TX_QUEUE(x) ((x) << 23)
251#define RX_CHANNEL(x) ((x) << 26) 258#define RX_CHANNEL(x) ((x) << 26)
259#define CCTRL_ECN(x) ((x) << 27)
252#define WND_SCALE_EN(x) ((x) << 28) 260#define WND_SCALE_EN(x) ((x) << 28)
253#define TSTAMPS_EN(x) ((x) << 29) 261#define TSTAMPS_EN(x) ((x) << 29)
254#define SACK_EN(x) ((x) << 30) 262#define SACK_EN(x) ((x) << 30)
@@ -635,6 +643,17 @@ struct cpl_fw6_msg {
635/* cpl_fw6_msg.type values */ 643/* cpl_fw6_msg.type values */
636enum { 644enum {
637 FW6_TYPE_CMD_RPL = 0, 645 FW6_TYPE_CMD_RPL = 0,
646 FW6_TYPE_WR_RPL = 1,
647 FW6_TYPE_CQE = 2,
648 FW6_TYPE_OFLD_CONNECTION_WR_RPL = 3,
649};
650
651struct cpl_fw6_msg_ofld_connection_wr_rpl {
652 __u64 cookie;
653 __be32 tid; /* or atid in case of active failure */
654 __u8 t_state;
655 __u8 retval;
656 __u8 rsvd[2];
638}; 657};
639 658
640enum { 659enum {
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h b/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h
index aef529198922..a2c29f7b7aa1 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h
@@ -1097,4 +1097,6 @@
1097 1097
1098#define A_TP_TX_SCHED_PCMD 0x25 1098#define A_TP_TX_SCHED_PCMD 0x25
1099 1099
1100#define S_PORT 1
1101
1100#endif /* __T4_REGS_H */ 1102#endif /* __T4_REGS_H */
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h b/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
index e98b6fff2c96..a0dcccd846c9 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
@@ -35,8 +35,43 @@
35#ifndef _T4FW_INTERFACE_H_ 35#ifndef _T4FW_INTERFACE_H_
36#define _T4FW_INTERFACE_H_ 36#define _T4FW_INTERFACE_H_
37 37
38enum fw_ret_val { 38enum fw_retval {
39 FW_ENOEXEC = 8, /* Exec format error; inv microcode */ 39 FW_SUCCESS = 0, /* completed sucessfully */
40 FW_EPERM = 1, /* operation not permitted */
41 FW_ENOENT = 2, /* no such file or directory */
42 FW_EIO = 5, /* input/output error; hw bad */
43 FW_ENOEXEC = 8, /* exec format error; inv microcode */
44 FW_EAGAIN = 11, /* try again */
45 FW_ENOMEM = 12, /* out of memory */
46 FW_EFAULT = 14, /* bad address; fw bad */
47 FW_EBUSY = 16, /* resource busy */
48 FW_EEXIST = 17, /* file exists */
49 FW_EINVAL = 22, /* invalid argument */
50 FW_ENOSPC = 28, /* no space left on device */
51 FW_ENOSYS = 38, /* functionality not implemented */
52 FW_EPROTO = 71, /* protocol error */
53 FW_EADDRINUSE = 98, /* address already in use */
54 FW_EADDRNOTAVAIL = 99, /* cannot assigned requested address */
55 FW_ENETDOWN = 100, /* network is down */
56 FW_ENETUNREACH = 101, /* network is unreachable */
57 FW_ENOBUFS = 105, /* no buffer space available */
58 FW_ETIMEDOUT = 110, /* timeout */
59 FW_EINPROGRESS = 115, /* fw internal */
60 FW_SCSI_ABORT_REQUESTED = 128, /* */
61 FW_SCSI_ABORT_TIMEDOUT = 129, /* */
62 FW_SCSI_ABORTED = 130, /* */
63 FW_SCSI_CLOSE_REQUESTED = 131, /* */
64 FW_ERR_LINK_DOWN = 132, /* */
65 FW_RDEV_NOT_READY = 133, /* */
66 FW_ERR_RDEV_LOST = 134, /* */
67 FW_ERR_RDEV_LOGO = 135, /* */
68 FW_FCOE_NO_XCHG = 136, /* */
69 FW_SCSI_RSP_ERR = 137, /* */
70 FW_ERR_RDEV_IMPL_LOGO = 138, /* */
71 FW_SCSI_UNDER_FLOW_ERR = 139, /* */
72 FW_SCSI_OVER_FLOW_ERR = 140, /* */
73 FW_SCSI_DDP_ERR = 141, /* DDP error*/
74 FW_SCSI_TASK_ERR = 142, /* No SCSI tasks available */
40}; 75};
41 76
42#define FW_T4VF_SGE_BASE_ADDR 0x0000 77#define FW_T4VF_SGE_BASE_ADDR 0x0000
@@ -50,6 +85,7 @@ enum fw_wr_opcodes {
50 FW_ULPTX_WR = 0x04, 85 FW_ULPTX_WR = 0x04,
51 FW_TP_WR = 0x05, 86 FW_TP_WR = 0x05,
52 FW_ETH_TX_PKT_WR = 0x08, 87 FW_ETH_TX_PKT_WR = 0x08,
88 FW_OFLD_CONNECTION_WR = 0x2f,
53 FW_FLOWC_WR = 0x0a, 89 FW_FLOWC_WR = 0x0a,
54 FW_OFLD_TX_DATA_WR = 0x0b, 90 FW_OFLD_TX_DATA_WR = 0x0b,
55 FW_CMD_WR = 0x10, 91 FW_CMD_WR = 0x10,
@@ -85,6 +121,7 @@ struct fw_wr_hdr {
85#define FW_WR_LEN16(x) ((x) << 0) 121#define FW_WR_LEN16(x) ((x) << 0)
86 122
87#define HW_TPL_FR_MT_PR_IV_P_FC 0X32B 123#define HW_TPL_FR_MT_PR_IV_P_FC 0X32B
124#define HW_TPL_FR_MT_PR_OV_P_FC 0X327
88 125
89/* filter wr reply code in cookie in CPL_SET_TCB_RPL */ 126/* filter wr reply code in cookie in CPL_SET_TCB_RPL */
90enum fw_filter_wr_cookie { 127enum fw_filter_wr_cookie {
@@ -379,6 +416,108 @@ struct fw_eth_tx_pkt_wr {
379 __be64 r3; 416 __be64 r3;
380}; 417};
381 418
419struct fw_ofld_connection_wr {
420 __be32 op_compl;
421 __be32 len16_pkd;
422 __u64 cookie;
423 __be64 r2;
424 __be64 r3;
425 struct fw_ofld_connection_le {
426 __be32 version_cpl;
427 __be32 filter;
428 __be32 r1;
429 __be16 lport;
430 __be16 pport;
431 union fw_ofld_connection_leip {
432 struct fw_ofld_connection_le_ipv4 {
433 __be32 pip;
434 __be32 lip;
435 __be64 r0;
436 __be64 r1;
437 __be64 r2;
438 } ipv4;
439 struct fw_ofld_connection_le_ipv6 {
440 __be64 pip_hi;
441 __be64 pip_lo;
442 __be64 lip_hi;
443 __be64 lip_lo;
444 } ipv6;
445 } u;
446 } le;
447 struct fw_ofld_connection_tcb {
448 __be32 t_state_to_astid;
449 __be16 cplrxdataack_cplpassacceptrpl;
450 __be16 rcv_adv;
451 __be32 rcv_nxt;
452 __be32 tx_max;
453 __be64 opt0;
454 __be32 opt2;
455 __be32 r1;
456 __be64 r2;
457 __be64 r3;
458 } tcb;
459};
460
461#define S_FW_OFLD_CONNECTION_WR_VERSION 31
462#define M_FW_OFLD_CONNECTION_WR_VERSION 0x1
463#define V_FW_OFLD_CONNECTION_WR_VERSION(x) \
464 ((x) << S_FW_OFLD_CONNECTION_WR_VERSION)
465#define G_FW_OFLD_CONNECTION_WR_VERSION(x) \
466 (((x) >> S_FW_OFLD_CONNECTION_WR_VERSION) & \
467 M_FW_OFLD_CONNECTION_WR_VERSION)
468#define F_FW_OFLD_CONNECTION_WR_VERSION \
469 V_FW_OFLD_CONNECTION_WR_VERSION(1U)
470
471#define S_FW_OFLD_CONNECTION_WR_CPL 30
472#define M_FW_OFLD_CONNECTION_WR_CPL 0x1
473#define V_FW_OFLD_CONNECTION_WR_CPL(x) ((x) << S_FW_OFLD_CONNECTION_WR_CPL)
474#define G_FW_OFLD_CONNECTION_WR_CPL(x) \
475 (((x) >> S_FW_OFLD_CONNECTION_WR_CPL) & M_FW_OFLD_CONNECTION_WR_CPL)
476#define F_FW_OFLD_CONNECTION_WR_CPL V_FW_OFLD_CONNECTION_WR_CPL(1U)
477
478#define S_FW_OFLD_CONNECTION_WR_T_STATE 28
479#define M_FW_OFLD_CONNECTION_WR_T_STATE 0xf
480#define V_FW_OFLD_CONNECTION_WR_T_STATE(x) \
481 ((x) << S_FW_OFLD_CONNECTION_WR_T_STATE)
482#define G_FW_OFLD_CONNECTION_WR_T_STATE(x) \
483 (((x) >> S_FW_OFLD_CONNECTION_WR_T_STATE) & \
484 M_FW_OFLD_CONNECTION_WR_T_STATE)
485
486#define S_FW_OFLD_CONNECTION_WR_RCV_SCALE 24
487#define M_FW_OFLD_CONNECTION_WR_RCV_SCALE 0xf
488#define V_FW_OFLD_CONNECTION_WR_RCV_SCALE(x) \
489 ((x) << S_FW_OFLD_CONNECTION_WR_RCV_SCALE)
490#define G_FW_OFLD_CONNECTION_WR_RCV_SCALE(x) \
491 (((x) >> S_FW_OFLD_CONNECTION_WR_RCV_SCALE) & \
492 M_FW_OFLD_CONNECTION_WR_RCV_SCALE)
493
494#define S_FW_OFLD_CONNECTION_WR_ASTID 0
495#define M_FW_OFLD_CONNECTION_WR_ASTID 0xffffff
496#define V_FW_OFLD_CONNECTION_WR_ASTID(x) \
497 ((x) << S_FW_OFLD_CONNECTION_WR_ASTID)
498#define G_FW_OFLD_CONNECTION_WR_ASTID(x) \
499 (((x) >> S_FW_OFLD_CONNECTION_WR_ASTID) & M_FW_OFLD_CONNECTION_WR_ASTID)
500
501#define S_FW_OFLD_CONNECTION_WR_CPLRXDATAACK 15
502#define M_FW_OFLD_CONNECTION_WR_CPLRXDATAACK 0x1
503#define V_FW_OFLD_CONNECTION_WR_CPLRXDATAACK(x) \
504 ((x) << S_FW_OFLD_CONNECTION_WR_CPLRXDATAACK)
505#define G_FW_OFLD_CONNECTION_WR_CPLRXDATAACK(x) \
506 (((x) >> S_FW_OFLD_CONNECTION_WR_CPLRXDATAACK) & \
507 M_FW_OFLD_CONNECTION_WR_CPLRXDATAACK)
508#define F_FW_OFLD_CONNECTION_WR_CPLRXDATAACK \
509 V_FW_OFLD_CONNECTION_WR_CPLRXDATAACK(1U)
510
511#define S_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL 14
512#define M_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL 0x1
513#define V_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL(x) \
514 ((x) << S_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL)
515#define G_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL(x) \
516 (((x) >> S_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL) & \
517 M_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL)
518#define F_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL \
519 V_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL(1U)
520
382enum fw_flowc_mnem { 521enum fw_flowc_mnem {
383 FW_FLOWC_MNEM_PFNVFN, /* PFN [15:8] VFN [7:0] */ 522 FW_FLOWC_MNEM_PFNVFN, /* PFN [15:8] VFN [7:0] */
384 FW_FLOWC_MNEM_CH, 523 FW_FLOWC_MNEM_CH,
diff --git a/drivers/scsi/csiostor/t4fw_api_stor.h b/drivers/scsi/csiostor/t4fw_api_stor.h
index 1223e0d5fc07..097e52c0f8e1 100644
--- a/drivers/scsi/csiostor/t4fw_api_stor.h
+++ b/drivers/scsi/csiostor/t4fw_api_stor.h
@@ -40,45 +40,6 @@
40 * R E T U R N V A L U E S 40 * R E T U R N V A L U E S
41 ********************************/ 41 ********************************/
42 42
43enum fw_retval {
44 FW_SUCCESS = 0, /* completed sucessfully */
45 FW_EPERM = 1, /* operation not permitted */
46 FW_ENOENT = 2, /* no such file or directory */
47 FW_EIO = 5, /* input/output error; hw bad */
48 FW_ENOEXEC = 8, /* exec format error; inv microcode */
49 FW_EAGAIN = 11, /* try again */
50 FW_ENOMEM = 12, /* out of memory */
51 FW_EFAULT = 14, /* bad address; fw bad */
52 FW_EBUSY = 16, /* resource busy */
53 FW_EEXIST = 17, /* file exists */
54 FW_EINVAL = 22, /* invalid argument */
55 FW_ENOSPC = 28, /* no space left on device */
56 FW_ENOSYS = 38, /* functionality not implemented */
57 FW_EPROTO = 71, /* protocol error */
58 FW_EADDRINUSE = 98, /* address already in use */
59 FW_EADDRNOTAVAIL = 99, /* cannot assigned requested address */
60 FW_ENETDOWN = 100, /* network is down */
61 FW_ENETUNREACH = 101, /* network is unreachable */
62 FW_ENOBUFS = 105, /* no buffer space available */
63 FW_ETIMEDOUT = 110, /* timeout */
64 FW_EINPROGRESS = 115, /* fw internal */
65 FW_SCSI_ABORT_REQUESTED = 128, /* */
66 FW_SCSI_ABORT_TIMEDOUT = 129, /* */
67 FW_SCSI_ABORTED = 130, /* */
68 FW_SCSI_CLOSE_REQUESTED = 131, /* */
69 FW_ERR_LINK_DOWN = 132, /* */
70 FW_RDEV_NOT_READY = 133, /* */
71 FW_ERR_RDEV_LOST = 134, /* */
72 FW_ERR_RDEV_LOGO = 135, /* */
73 FW_FCOE_NO_XCHG = 136, /* */
74 FW_SCSI_RSP_ERR = 137, /* */
75 FW_ERR_RDEV_IMPL_LOGO = 138, /* */
76 FW_SCSI_UNDER_FLOW_ERR = 139, /* */
77 FW_SCSI_OVER_FLOW_ERR = 140, /* */
78 FW_SCSI_DDP_ERR = 141, /* DDP error*/
79 FW_SCSI_TASK_ERR = 142, /* No SCSI tasks available */
80};
81
82enum fw_fcoe_link_sub_op { 43enum fw_fcoe_link_sub_op {
83 FCOE_LINK_DOWN = 0x0, 44 FCOE_LINK_DOWN = 0x0,
84 FCOE_LINK_UP = 0x1, 45 FCOE_LINK_UP = 0x1,