Commit ceb7e1c7 authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

cnic: Pass cp pointer to BNX2X_HW_CID.

Preparation work for upcoming firmware interface changes.
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 85407885
...@@ -1209,7 +1209,7 @@ static int cnic_submit_kwqe_16(struct cnic_dev *dev, u32 cmd, u32 cid, ...@@ -1209,7 +1209,7 @@ static int cnic_submit_kwqe_16(struct cnic_dev *dev, u32 cmd, u32 cid,
kwqe.hdr.conn_and_cmd_data = kwqe.hdr.conn_and_cmd_data =
cpu_to_le32(((cmd << SPE_HDR_CMD_ID_SHIFT) | cpu_to_le32(((cmd << SPE_HDR_CMD_ID_SHIFT) |
BNX2X_HW_CID(cid, cp->func))); BNX2X_HW_CID(cp, cid)));
kwqe.hdr.type = cpu_to_le16(type); kwqe.hdr.type = cpu_to_le16(type);
kwqe.hdr.reserved = 0; kwqe.hdr.reserved = 0;
kwqe.data.phy_address.lo = cpu_to_le32(l5_data->phy_address.lo); kwqe.data.phy_address.lo = cpu_to_le32(l5_data->phy_address.lo);
...@@ -1461,7 +1461,7 @@ static int cnic_setup_bnx2x_ctx(struct cnic_dev *dev, struct kwqe *wqes[], ...@@ -1461,7 +1461,7 @@ static int cnic_setup_bnx2x_ctx(struct cnic_dev *dev, struct kwqe *wqes[],
struct cnic_context *ctx = &cp->ctx_tbl[req1->iscsi_conn_id]; struct cnic_context *ctx = &cp->ctx_tbl[req1->iscsi_conn_id];
struct cnic_iscsi *iscsi = ctx->proto.iscsi; struct cnic_iscsi *iscsi = ctx->proto.iscsi;
u32 cid = ctx->cid; u32 cid = ctx->cid;
u32 hw_cid = BNX2X_HW_CID(cid, cp->func); u32 hw_cid = BNX2X_HW_CID(cp, cid);
struct iscsi_context *ictx; struct iscsi_context *ictx;
struct regpair context_addr; struct regpair context_addr;
int i, j, n = 2, n_max; int i, j, n = 2, n_max;
...@@ -1673,8 +1673,7 @@ static int cnic_bnx2x_iscsi_ofld1(struct cnic_dev *dev, struct kwqe *wqes[], ...@@ -1673,8 +1673,7 @@ static int cnic_bnx2x_iscsi_ofld1(struct cnic_dev *dev, struct kwqe *wqes[],
} }
kcqe.completion_status = ISCSI_KCQE_COMPLETION_STATUS_SUCCESS; kcqe.completion_status = ISCSI_KCQE_COMPLETION_STATUS_SUCCESS;
kcqe.iscsi_conn_context_id = BNX2X_HW_CID(cp->ctx_tbl[l5_cid].cid, kcqe.iscsi_conn_context_id = BNX2X_HW_CID(cp, cp->ctx_tbl[l5_cid].cid);
cp->func);
done: done:
cqes[0] = (struct kcqe *) &kcqe; cqes[0] = (struct kcqe *) &kcqe;
...@@ -3885,7 +3884,6 @@ static void cnic_init_bnx2x_tx_ring(struct cnic_dev *dev) ...@@ -3885,7 +3884,6 @@ static void cnic_init_bnx2x_tx_ring(struct cnic_dev *dev)
struct eth_context *context; struct eth_context *context;
struct regpair context_addr; struct regpair context_addr;
dma_addr_t buf_map; dma_addr_t buf_map;
int func = CNIC_FUNC(cp);
int port = CNIC_PORT(cp); int port = CNIC_PORT(cp);
int i; int i;
int cli = BNX2X_ISCSI_CL_ID(CNIC_E1HVN(cp)); int cli = BNX2X_ISCSI_CL_ID(CNIC_E1HVN(cp));
...@@ -3931,7 +3929,7 @@ static void cnic_init_bnx2x_tx_ring(struct cnic_dev *dev) ...@@ -3931,7 +3929,7 @@ static void cnic_init_bnx2x_tx_ring(struct cnic_dev *dev)
XSTORM_ETH_ST_CONTEXT_STATISTICS_ENABLE; XSTORM_ETH_ST_CONTEXT_STATISTICS_ENABLE;
context->xstorm_ag_context.cdu_reserved = context->xstorm_ag_context.cdu_reserved =
CDU_RSRVD_VALUE_TYPE_A(BNX2X_HW_CID(BNX2X_ISCSI_L2_CID, func), CDU_RSRVD_VALUE_TYPE_A(BNX2X_HW_CID(cp, BNX2X_ISCSI_L2_CID),
CDU_REGION_NUMBER_XCM_AG, CDU_REGION_NUMBER_XCM_AG,
ETH_CONNECTION_TYPE); ETH_CONNECTION_TYPE);
...@@ -3959,7 +3957,6 @@ static void cnic_init_bnx2x_rx_ring(struct cnic_dev *dev) ...@@ -3959,7 +3957,6 @@ static void cnic_init_bnx2x_rx_ring(struct cnic_dev *dev)
struct regpair context_addr; struct regpair context_addr;
int i; int i;
int port = CNIC_PORT(cp); int port = CNIC_PORT(cp);
int func = CNIC_FUNC(cp);
int cli = BNX2X_ISCSI_CL_ID(CNIC_E1HVN(cp)); int cli = BNX2X_ISCSI_CL_ID(CNIC_E1HVN(cp));
u32 val; u32 val;
struct tstorm_eth_client_config tstorm_client = {0}; struct tstorm_eth_client_config tstorm_client = {0};
...@@ -3998,7 +3995,7 @@ static void cnic_init_bnx2x_rx_ring(struct cnic_dev *dev) ...@@ -3998,7 +3995,7 @@ static void cnic_init_bnx2x_rx_ring(struct cnic_dev *dev)
cp->l2_single_buf_size; cp->l2_single_buf_size;
context->ustorm_ag_context.cdu_usage = context->ustorm_ag_context.cdu_usage =
CDU_RSRVD_VALUE_TYPE_A(BNX2X_HW_CID(BNX2X_ISCSI_L2_CID, func), CDU_RSRVD_VALUE_TYPE_A(BNX2X_HW_CID(cp, BNX2X_ISCSI_L2_CID),
CDU_REGION_NUMBER_UCM_AG, CDU_REGION_NUMBER_UCM_AG,
ETH_CONNECTION_TYPE); ETH_CONNECTION_TYPE);
......
...@@ -335,9 +335,7 @@ struct bnx2x_bd_chain_next { ...@@ -335,9 +335,7 @@ struct bnx2x_bd_chain_next {
#define BNX2X_ISCSI_GLB_BUF_SIZE 64 #define BNX2X_ISCSI_GLB_BUF_SIZE 64
#define BNX2X_ISCSI_PBL_NOT_CACHED 0xff #define BNX2X_ISCSI_PBL_NOT_CACHED 0xff
#define BNX2X_ISCSI_PDU_HEADER_NOT_CACHED 0xff #define BNX2X_ISCSI_PDU_HEADER_NOT_CACHED 0xff
#define BNX2X_HW_CID(x, func) ((x) | (((func) % PORT_MAX) << 23) | \
(((func) >> 1) << 17))
#define BNX2X_SW_CID(x) (x & 0x1ffff)
#define BNX2X_CHIP_NUM_57711 0x164f #define BNX2X_CHIP_NUM_57711 0x164f
#define BNX2X_CHIP_NUM_57711E 0x1650 #define BNX2X_CHIP_NUM_57711E 0x1650
#define BNX2X_CHIP_NUM(x) (x >> 16) #define BNX2X_CHIP_NUM(x) (x >> 16)
...@@ -372,5 +370,10 @@ struct bnx2x_bd_chain_next { ...@@ -372,5 +370,10 @@ struct bnx2x_bd_chain_next {
#define CNIC_FUNC(cp) ((cp)->func) #define CNIC_FUNC(cp) ((cp)->func)
#define CNIC_E1HVN(cp) ((cp)->func >> 1) #define CNIC_E1HVN(cp) ((cp)->func >> 1)
#define BNX2X_HW_CID(cp, x) (((CNIC_FUNC(cp) % PORT_MAX) << 23) | \
(CNIC_E1HVN(cp) << 17) | (x))
#define BNX2X_SW_CID(x) (x & 0x1ffff)
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment