Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7fddaf0 authored by Hariprasad Shenai's avatar Hariprasad Shenai Committed by David S. Miller
Browse files

iw_cxgb4: Cleanup register defines/MACROS defined in t4fw_ri_api.h



Cleanup all the MACROS that are defined in t4fw_ri_api.h and affected files

Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6969de73
Loading
Loading
Loading
Loading
+15 −15
Original line number Diff line number Diff line
@@ -674,7 +674,7 @@ static int send_connect(struct c4iw_ep *ep)
		opt2 |= WND_SCALE_EN_F;
	if (is_t5(ep->com.dev->rdev.lldi.adapter_type)) {
		opt2 |= T5_OPT_2_VALID_F;
		opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE);
		opt2 |= CONG_CNTRL_V(CONG_ALG_TAHOE);
		opt2 |= CONG_CNTRL_VALID; /* OPT_2_ISS for T5 */
	}
	t4_set_arp_err_handler(skb, ep, act_open_req_arp_failure);
@@ -1258,8 +1258,8 @@ static int update_rx_credits(struct c4iw_ep *ep, u32 credits)
	OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_RX_DATA_ACK,
						    ep->hwtid));
	req->credit_dack = cpu_to_be32(credits | RX_FORCE_ACK_F |
				       F_RX_DACK_CHANGE |
				       V_RX_DACK_MODE(dack_mode));
				       RX_DACK_CHANGE_F |
				       RX_DACK_MODE_V(dack_mode));
	set_wr_txq(skb, CPL_PRIORITY_ACK, ep->ctrlq_idx);
	c4iw_ofld_send(&ep->com.dev->rdev, skb);
	return credits;
@@ -2205,15 +2205,15 @@ static void accept_cr(struct c4iw_ep *ep, struct sk_buff *skb,
		const struct tcphdr *tcph;
		u32 hlen = ntohl(req->hdr_len);

		tcph = (const void *)(req + 1) + G_ETH_HDR_LEN(hlen) +
			G_IP_HDR_LEN(hlen);
		tcph = (const void *)(req + 1) + ETH_HDR_LEN_G(hlen) +
			IP_HDR_LEN_G(hlen);
		if (tcph->ece && tcph->cwr)
			opt2 |= CCTRL_ECN_V(1);
	}
	if (is_t5(ep->com.dev->rdev.lldi.adapter_type)) {
		u32 isn = (prandom_u32() & ~7UL) - 1;
		opt2 |= T5_OPT_2_VALID_F;
		opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE);
		opt2 |= CONG_CNTRL_V(CONG_ALG_TAHOE);
		opt2 |= CONG_CNTRL_VALID; /* OPT_2_ISS for T5 */
		rpl5 = (void *)rpl;
		memset(&rpl5->iss, 0, roundup(sizeof(*rpl5)-sizeof(*rpl), 16));
@@ -2245,8 +2245,8 @@ static void get_4tuple(struct cpl_pass_accept_req *req, int *iptype,
		       __u8 *local_ip, __u8 *peer_ip,
		       __be16 *local_port, __be16 *peer_port)
{
	int eth_len = G_ETH_HDR_LEN(be32_to_cpu(req->hdr_len));
	int ip_len = G_IP_HDR_LEN(be32_to_cpu(req->hdr_len));
	int eth_len = ETH_HDR_LEN_G(be32_to_cpu(req->hdr_len));
	int ip_len = IP_HDR_LEN_G(be32_to_cpu(req->hdr_len));
	struct iphdr *ip = (struct iphdr *)((u8 *)(req + 1) + eth_len);
	struct ipv6hdr *ip6 = (struct ipv6hdr *)((u8 *)(req + 1) + eth_len);
	struct tcphdr *tcp = (struct tcphdr *)
@@ -3500,20 +3500,20 @@ static void build_cpl_pass_accept_req(struct sk_buff *skb, int stid , u8 tos)

	req = (struct cpl_pass_accept_req *)__skb_push(skb, sizeof(*req));
	memset(req, 0, sizeof(*req));
	req->l2info = cpu_to_be16(V_SYN_INTF(intf) |
			 V_SYN_MAC_IDX(RX_MACIDX_G(
	req->l2info = cpu_to_be16(SYN_INTF_V(intf) |
			 SYN_MAC_IDX_V(RX_MACIDX_G(
			 (__force int) htonl(l2info))) |
			 F_SYN_XACT_MATCH);
			 SYN_XACT_MATCH_F);
	eth_hdr_len = is_t4(dev->rdev.lldi.adapter_type) ?
			    RX_ETHHDR_LEN_G((__force int)htonl(l2info)) :
			    RX_T5_ETHHDR_LEN_G((__force int)htonl(l2info));
	req->hdr_len = cpu_to_be32(V_SYN_RX_CHAN(RX_CHAN_G(
	req->hdr_len = cpu_to_be32(SYN_RX_CHAN_V(RX_CHAN_G(
					(__force int) htonl(l2info))) |
				   V_TCP_HDR_LEN(RX_TCPHDR_LEN_G(
				   TCP_HDR_LEN_V(RX_TCPHDR_LEN_G(
					(__force int) htons(hdr_len))) |
				   V_IP_HDR_LEN(RX_IPHDR_LEN_G(
				   IP_HDR_LEN_V(RX_IPHDR_LEN_G(
					(__force int) htons(hdr_len))) |
				   V_ETH_HDR_LEN(RX_ETHHDR_LEN_G(eth_hdr_len)));
				   ETH_HDR_LEN_V(RX_ETHHDR_LEN_G(eth_hdr_len)));
	req->vlan = (__force __be16) vlantag;
	req->len = (__force __be16) len;
	req->tos_stid = cpu_to_be32(PASS_OPEN_TID_V(stid) |
+11 −11
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ static int destroy_cq(struct c4iw_rdev *rdev, struct t4_cq *cq,
	memset(res_wr, 0, wr_len);
	res_wr->op_nres = cpu_to_be32(
			FW_WR_OP_V(FW_RI_RES_WR) |
			V_FW_RI_RES_WR_NRES(1) |
			FW_RI_RES_WR_NRES_V(1) |
			FW_WR_COMPL_F);
	res_wr->len16_pkd = cpu_to_be32(DIV_ROUND_UP(wr_len, 16));
	res_wr->cookie = (unsigned long) &wr_wait;
@@ -122,7 +122,7 @@ static int create_cq(struct c4iw_rdev *rdev, struct t4_cq *cq,
	memset(res_wr, 0, wr_len);
	res_wr->op_nres = cpu_to_be32(
			FW_WR_OP_V(FW_RI_RES_WR) |
			V_FW_RI_RES_WR_NRES(1) |
			FW_RI_RES_WR_NRES_V(1) |
			FW_WR_COMPL_F);
	res_wr->len16_pkd = cpu_to_be32(DIV_ROUND_UP(wr_len, 16));
	res_wr->cookie = (unsigned long) &wr_wait;
@@ -131,17 +131,17 @@ static int create_cq(struct c4iw_rdev *rdev, struct t4_cq *cq,
	res->u.cq.op = FW_RI_RES_OP_WRITE;
	res->u.cq.iqid = cpu_to_be32(cq->cqid);
	res->u.cq.iqandst_to_iqandstindex = cpu_to_be32(
			V_FW_RI_RES_WR_IQANUS(0) |
			V_FW_RI_RES_WR_IQANUD(1) |
			F_FW_RI_RES_WR_IQANDST |
			V_FW_RI_RES_WR_IQANDSTINDEX(
			FW_RI_RES_WR_IQANUS_V(0) |
			FW_RI_RES_WR_IQANUD_V(1) |
			FW_RI_RES_WR_IQANDST_F |
			FW_RI_RES_WR_IQANDSTINDEX_V(
				rdev->lldi.ciq_ids[cq->vector]));
	res->u.cq.iqdroprss_to_iqesize = cpu_to_be16(
			F_FW_RI_RES_WR_IQDROPRSS |
			V_FW_RI_RES_WR_IQPCIECH(2) |
			V_FW_RI_RES_WR_IQINTCNTTHRESH(0) |
			F_FW_RI_RES_WR_IQO |
			V_FW_RI_RES_WR_IQESIZE(1));
			FW_RI_RES_WR_IQDROPRSS_F |
			FW_RI_RES_WR_IQPCIECH_V(2) |
			FW_RI_RES_WR_IQINTCNTTHRESH_V(0) |
			FW_RI_RES_WR_IQO_F |
			FW_RI_RES_WR_IQESIZE_V(1));
	res->u.cq.iqsize = cpu_to_be16(cq->size);
	res->u.cq.iqaddr = cpu_to_be64(cq->dma_addr);

+6 −6
Original line number Diff line number Diff line
@@ -380,12 +380,12 @@ static int dump_stag(int id, void *p, void *data)
		      "stag: idx 0x%x valid %d key 0x%x state %d pdid %d "
		      "perm 0x%x ps %d len 0x%llx va 0x%llx\n",
		      (u32)id<<8,
		      G_FW_RI_TPTE_VALID(ntohl(tpte.valid_to_pdid)),
		      G_FW_RI_TPTE_STAGKEY(ntohl(tpte.valid_to_pdid)),
		      G_FW_RI_TPTE_STAGSTATE(ntohl(tpte.valid_to_pdid)),
		      G_FW_RI_TPTE_PDID(ntohl(tpte.valid_to_pdid)),
		      G_FW_RI_TPTE_PERM(ntohl(tpte.locread_to_qpid)),
		      G_FW_RI_TPTE_PS(ntohl(tpte.locread_to_qpid)),
		      FW_RI_TPTE_VALID_G(ntohl(tpte.valid_to_pdid)),
		      FW_RI_TPTE_STAGKEY_G(ntohl(tpte.valid_to_pdid)),
		      FW_RI_TPTE_STAGSTATE_G(ntohl(tpte.valid_to_pdid)),
		      FW_RI_TPTE_PDID_G(ntohl(tpte.valid_to_pdid)),
		      FW_RI_TPTE_PERM_G(ntohl(tpte.locread_to_qpid)),
		      FW_RI_TPTE_PS_G(ntohl(tpte.locread_to_qpid)),
		      ((u64)ntohl(tpte.len_hi) << 32) | ntohl(tpte.len_lo),
		      ((u64)ntohl(tpte.va_hi) << 32) | ntohl(tpte.va_lo_fbo));
	if (cc < space)
+6 −6
Original line number Diff line number Diff line
@@ -50,12 +50,12 @@ static void print_tpte(struct c4iw_dev *dev, u32 stag)
	PDBG("stag idx 0x%x valid %d key 0x%x state %d pdid %d "
	       "perm 0x%x ps %d len 0x%llx va 0x%llx\n",
	       stag & 0xffffff00,
	       G_FW_RI_TPTE_VALID(ntohl(tpte.valid_to_pdid)),
	       G_FW_RI_TPTE_STAGKEY(ntohl(tpte.valid_to_pdid)),
	       G_FW_RI_TPTE_STAGSTATE(ntohl(tpte.valid_to_pdid)),
	       G_FW_RI_TPTE_PDID(ntohl(tpte.valid_to_pdid)),
	       G_FW_RI_TPTE_PERM(ntohl(tpte.locread_to_qpid)),
	       G_FW_RI_TPTE_PS(ntohl(tpte.locread_to_qpid)),
	       FW_RI_TPTE_VALID_G(ntohl(tpte.valid_to_pdid)),
	       FW_RI_TPTE_STAGKEY_G(ntohl(tpte.valid_to_pdid)),
	       FW_RI_TPTE_STAGSTATE_G(ntohl(tpte.valid_to_pdid)),
	       FW_RI_TPTE_PDID_G(ntohl(tpte.valid_to_pdid)),
	       FW_RI_TPTE_PERM_G(ntohl(tpte.locread_to_qpid)),
	       FW_RI_TPTE_PS_G(ntohl(tpte.locread_to_qpid)),
	       ((u64)ntohl(tpte.len_hi) << 32) | ntohl(tpte.len_lo),
	       ((u64)ntohl(tpte.va_hi) << 32) | ntohl(tpte.va_lo_fbo));
}
+9 −9
Original line number Diff line number Diff line
@@ -286,17 +286,17 @@ static int write_tpt_entry(struct c4iw_rdev *rdev, u32 reset_tpt_entry,
	if (reset_tpt_entry)
		memset(&tpt, 0, sizeof(tpt));
	else {
		tpt.valid_to_pdid = cpu_to_be32(F_FW_RI_TPTE_VALID |
			V_FW_RI_TPTE_STAGKEY((*stag & M_FW_RI_TPTE_STAGKEY)) |
			V_FW_RI_TPTE_STAGSTATE(stag_state) |
			V_FW_RI_TPTE_STAGTYPE(type) | V_FW_RI_TPTE_PDID(pdid));
		tpt.locread_to_qpid = cpu_to_be32(V_FW_RI_TPTE_PERM(perm) |
			(bind_enabled ? F_FW_RI_TPTE_MWBINDEN : 0) |
			V_FW_RI_TPTE_ADDRTYPE((zbva ? FW_RI_ZERO_BASED_TO :
		tpt.valid_to_pdid = cpu_to_be32(FW_RI_TPTE_VALID_F |
			FW_RI_TPTE_STAGKEY_V((*stag & FW_RI_TPTE_STAGKEY_M)) |
			FW_RI_TPTE_STAGSTATE_V(stag_state) |
			FW_RI_TPTE_STAGTYPE_V(type) | FW_RI_TPTE_PDID_V(pdid));
		tpt.locread_to_qpid = cpu_to_be32(FW_RI_TPTE_PERM_V(perm) |
			(bind_enabled ? FW_RI_TPTE_MWBINDEN_F : 0) |
			FW_RI_TPTE_ADDRTYPE_V((zbva ? FW_RI_ZERO_BASED_TO :
						      FW_RI_VA_BASED_TO))|
			V_FW_RI_TPTE_PS(page_size));
			FW_RI_TPTE_PS_V(page_size));
		tpt.nosnoop_pbladdr = !pbl_size ? 0 : cpu_to_be32(
			V_FW_RI_TPTE_PBLADDR(PBL_OFF(rdev, pbl_addr)>>3));
			FW_RI_TPTE_PBLADDR_V(PBL_OFF(rdev, pbl_addr)>>3));
		tpt.len_lo = cpu_to_be32((u32)(len & 0xffffffffUL));
		tpt.va_hi = cpu_to_be32((u32)(to >> 32));
		tpt.va_lo_fbo = cpu_to_be32((u32)(to & 0xffffffffUL));
Loading