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

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

cxgb4/cxgb4vf/csiostor: Cleanup macros/register defines related to port and VI



This patch cleanups all port and VI related macros/register defines that are
defined in t4fw_api.h and the affected files.

Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6e4b51a6
Loading
Loading
Loading
Loading
+7 −7
Original line number Original line Diff line number Diff line
@@ -243,7 +243,7 @@ void cxgb4_dcb_handle_fw_update(struct adapter *adap,
				const struct fw_port_cmd *pcmd)
				const struct fw_port_cmd *pcmd)
{
{
	const union fw_port_dcb *fwdcb = &pcmd->u.dcb;
	const union fw_port_dcb *fwdcb = &pcmd->u.dcb;
	int port = FW_PORT_CMD_PORTID_GET(be32_to_cpu(pcmd->op_to_portid));
	int port = FW_PORT_CMD_PORTID_G(be32_to_cpu(pcmd->op_to_portid));
	struct net_device *dev = adap->port[port];
	struct net_device *dev = adap->port[port];
	struct port_info *pi = netdev_priv(dev);
	struct port_info *pi = netdev_priv(dev);
	struct port_dcb_info *dcb = &pi->dcb;
	struct port_dcb_info *dcb = &pi->dcb;
@@ -256,12 +256,12 @@ void cxgb4_dcb_handle_fw_update(struct adapter *adap,
	if (dcb_type == FW_PORT_DCB_TYPE_CONTROL) {
	if (dcb_type == FW_PORT_DCB_TYPE_CONTROL) {
		enum cxgb4_dcb_state_input input =
		enum cxgb4_dcb_state_input input =
			((pcmd->u.dcb.control.all_syncd_pkd &
			((pcmd->u.dcb.control.all_syncd_pkd &
			  FW_PORT_CMD_ALL_SYNCD)
			  FW_PORT_CMD_ALL_SYNCD_F)
			 ? CXGB4_DCB_STATE_FW_ALLSYNCED
			 ? CXGB4_DCB_STATE_FW_ALLSYNCED
			 : CXGB4_DCB_STATE_FW_INCOMPLETE);
			 : CXGB4_DCB_STATE_FW_INCOMPLETE);


		if (dcb->dcb_version != FW_PORT_DCB_VER_UNKNOWN) {
		if (dcb->dcb_version != FW_PORT_DCB_VER_UNKNOWN) {
			dcb_running_version = FW_PORT_CMD_DCB_VERSION_GET(
			dcb_running_version = FW_PORT_CMD_DCB_VERSION_G(
				be16_to_cpu(
				be16_to_cpu(
				pcmd->u.dcb.control.dcb_version_to_app_state));
				pcmd->u.dcb.control.dcb_version_to_app_state));
			if (dcb_running_version == FW_PORT_DCB_VER_CEE1D01 ||
			if (dcb_running_version == FW_PORT_DCB_VER_CEE1D01 ||
@@ -519,7 +519,7 @@ static void cxgb4_setpgtccfg_tx(struct net_device *dev, int tc,


	INIT_PORT_DCB_WRITE_CMD(pcmd, pi->port_id);
	INIT_PORT_DCB_WRITE_CMD(pcmd, pi->port_id);
	if (pi->dcb.state == CXGB4_DCB_STATE_HOST)
	if (pi->dcb.state == CXGB4_DCB_STATE_HOST)
		pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY);
		pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY_F);


	err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd);
	err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd);
	if (err != FW_PORT_DCB_CFG_SUCCESS)
	if (err != FW_PORT_DCB_CFG_SUCCESS)
@@ -583,7 +583,7 @@ static void cxgb4_setpgbwgcfg_tx(struct net_device *dev, int pgid,


	INIT_PORT_DCB_WRITE_CMD(pcmd, pi->port_id);
	INIT_PORT_DCB_WRITE_CMD(pcmd, pi->port_id);
	if (pi->dcb.state == CXGB4_DCB_STATE_HOST)
	if (pi->dcb.state == CXGB4_DCB_STATE_HOST)
		pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY);
		pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY_F);


	err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd);
	err = t4_wr_mbox(adap, adap->mbox, &pcmd, sizeof(pcmd), &pcmd);


@@ -623,7 +623,7 @@ static void cxgb4_setpfccfg(struct net_device *dev, int priority, u8 pfccfg)


	INIT_PORT_DCB_WRITE_CMD(pcmd, pi->port_id);
	INIT_PORT_DCB_WRITE_CMD(pcmd, pi->port_id);
	if (pi->dcb.state == CXGB4_DCB_STATE_HOST)
	if (pi->dcb.state == CXGB4_DCB_STATE_HOST)
		pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY);
		pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY_F);


	pcmd.u.dcb.pfc.type = FW_PORT_DCB_TYPE_PFC;
	pcmd.u.dcb.pfc.type = FW_PORT_DCB_TYPE_PFC;
	pcmd.u.dcb.pfc.pfcen = pi->dcb.pfcen;
	pcmd.u.dcb.pfc.pfcen = pi->dcb.pfcen;
@@ -842,7 +842,7 @@ static int __cxgb4_setapp(struct net_device *dev, u8 app_idtype, u16 app_id,
	/* write out new app table entry */
	/* write out new app table entry */
	INIT_PORT_DCB_WRITE_CMD(pcmd, pi->port_id);
	INIT_PORT_DCB_WRITE_CMD(pcmd, pi->port_id);
	if (pi->dcb.state == CXGB4_DCB_STATE_HOST)
	if (pi->dcb.state == CXGB4_DCB_STATE_HOST)
		pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY);
		pcmd.op_to_portid |= cpu_to_be32(FW_PORT_CMD_APPLY_F);


	pcmd.u.dcb.app_priority.type = FW_PORT_DCB_TYPE_APP_ID;
	pcmd.u.dcb.app_priority.type = FW_PORT_DCB_TYPE_APP_ID;
	pcmd.u.dcb.app_priority.protocolid = cpu_to_be16(app_id);
	pcmd.u.dcb.app_priority.protocolid = cpu_to_be16(app_id);
+2 −2
Original line number Original line Diff line number Diff line
@@ -45,9 +45,9 @@
			cpu_to_be32(FW_CMD_OP_V(FW_PORT_CMD) | \
			cpu_to_be32(FW_CMD_OP_V(FW_PORT_CMD) | \
				    FW_CMD_REQUEST_F | \
				    FW_CMD_REQUEST_F | \
				    FW_CMD_##__op##_F | \
				    FW_CMD_##__op##_F | \
				    FW_PORT_CMD_PORTID(__port)); \
				    FW_PORT_CMD_PORTID_V(__port)); \
		(__pcmd).action_to_len16 = \
		(__pcmd).action_to_len16 = \
			cpu_to_be32(FW_PORT_CMD_ACTION(__action) | \
			cpu_to_be32(FW_PORT_CMD_ACTION_V(__action) | \
				    FW_LEN16(pcmd)); \
				    FW_LEN16(pcmd)); \
	} while (0)
	} while (0)


+4 −4
Original line number Original line Diff line number Diff line
@@ -710,7 +710,7 @@ EXPORT_SYMBOL(cxgb4_dcb_enabled);
/* Handle a Data Center Bridging update message from the firmware. */
/* Handle a Data Center Bridging update message from the firmware. */
static void dcb_rpl(struct adapter *adap, const struct fw_port_cmd *pcmd)
static void dcb_rpl(struct adapter *adap, const struct fw_port_cmd *pcmd)
{
{
	int port = FW_PORT_CMD_PORTID_GET(ntohl(pcmd->op_to_portid));
	int port = FW_PORT_CMD_PORTID_G(ntohl(pcmd->op_to_portid));
	struct net_device *dev = adap->port[port];
	struct net_device *dev = adap->port[port];
	int old_dcb_enabled = cxgb4_dcb_enabled(dev);
	int old_dcb_enabled = cxgb4_dcb_enabled(dev);
	int new_dcb_enabled;
	int new_dcb_enabled;
@@ -835,15 +835,15 @@ static int fwevtq_handler(struct sge_rspq *q, const __be64 *rsp,
		const struct fw_port_cmd *pcmd = (const void *)p->data;
		const struct fw_port_cmd *pcmd = (const void *)p->data;
		unsigned int cmd = FW_CMD_OP_G(ntohl(pcmd->op_to_portid));
		unsigned int cmd = FW_CMD_OP_G(ntohl(pcmd->op_to_portid));
		unsigned int action =
		unsigned int action =
			FW_PORT_CMD_ACTION_GET(ntohl(pcmd->action_to_len16));
			FW_PORT_CMD_ACTION_G(ntohl(pcmd->action_to_len16));


		if (cmd == FW_PORT_CMD &&
		if (cmd == FW_PORT_CMD &&
		    action == FW_PORT_ACTION_GET_PORT_INFO) {
		    action == FW_PORT_ACTION_GET_PORT_INFO) {
			int port = FW_PORT_CMD_PORTID_GET(
			int port = FW_PORT_CMD_PORTID_G(
					be32_to_cpu(pcmd->op_to_portid));
					be32_to_cpu(pcmd->op_to_portid));
			struct net_device *dev = q->adap->port[port];
			struct net_device *dev = q->adap->port[port];
			int state_input = ((pcmd->u.info.dcbxdis_pkd &
			int state_input = ((pcmd->u.info.dcbxdis_pkd &
					    FW_PORT_CMD_DCBXDIS)
					    FW_PORT_CMD_DCBXDIS_F)
					   ? CXGB4_DCB_INPUT_FW_DISABLED
					   ? CXGB4_DCB_INPUT_FW_DISABLED
					   : CXGB4_DCB_INPUT_FW_ENABLED);
					   : CXGB4_DCB_INPUT_FW_ENABLED);


+2 −2
Original line number Original line Diff line number Diff line
@@ -435,9 +435,9 @@ u64 cxgb4_select_ntuple(struct net_device *dev,


	if (tp->vnic_shift >= 0) {
	if (tp->vnic_shift >= 0) {
		u32 viid = cxgb4_port_viid(dev);
		u32 viid = cxgb4_port_viid(dev);
		u32 vf = FW_VIID_VIN_GET(viid);
		u32 vf = FW_VIID_VIN_G(viid);
		u32 pf = FW_VIID_PFN_G(viid);
		u32 pf = FW_VIID_PFN_G(viid);
		u32 vld = FW_VIID_VIVLD_GET(viid);
		u32 vld = FW_VIID_VIVLD_G(viid);


		ntuple |= (u64)(V_FT_VNID_ID_VF(vf) |
		ntuple |= (u64)(V_FT_VNID_ID_VF(vf) |
				V_FT_VNID_ID_PF(pf) |
				V_FT_VNID_ID_PF(pf) |
+53 −53
Original line number Original line Diff line number Diff line
@@ -1237,7 +1237,7 @@ int t4_link_start(struct adapter *adap, unsigned int mbox, unsigned int port,
		  struct link_config *lc)
		  struct link_config *lc)
{
{
	struct fw_port_cmd c;
	struct fw_port_cmd c;
	unsigned int fc = 0, mdi = FW_PORT_MDI(FW_PORT_MDI_AUTO);
	unsigned int fc = 0, mdi = FW_PORT_CAP_MDI_V(FW_PORT_CAP_MDI_AUTO);


	lc->link_ok = 0;
	lc->link_ok = 0;
	if (lc->requested_fc & PAUSE_RX)
	if (lc->requested_fc & PAUSE_RX)
@@ -1247,8 +1247,8 @@ int t4_link_start(struct adapter *adap, unsigned int mbox, unsigned int port,


	memset(&c, 0, sizeof(c));
	memset(&c, 0, sizeof(c));
	c.op_to_portid = htonl(FW_CMD_OP_V(FW_PORT_CMD) | FW_CMD_REQUEST_F |
	c.op_to_portid = htonl(FW_CMD_OP_V(FW_PORT_CMD) | FW_CMD_REQUEST_F |
			       FW_CMD_EXEC_F | FW_PORT_CMD_PORTID(port));
			       FW_CMD_EXEC_F | FW_PORT_CMD_PORTID_V(port));
	c.action_to_len16 = htonl(FW_PORT_CMD_ACTION(FW_PORT_ACTION_L1_CFG) |
	c.action_to_len16 = htonl(FW_PORT_CMD_ACTION_V(FW_PORT_ACTION_L1_CFG) |
				  FW_LEN16(c));
				  FW_LEN16(c));


	if (!(lc->supported & FW_PORT_CAP_ANEG)) {
	if (!(lc->supported & FW_PORT_CAP_ANEG)) {
@@ -1277,8 +1277,8 @@ int t4_restart_aneg(struct adapter *adap, unsigned int mbox, unsigned int port)


	memset(&c, 0, sizeof(c));
	memset(&c, 0, sizeof(c));
	c.op_to_portid = htonl(FW_CMD_OP_V(FW_PORT_CMD) | FW_CMD_REQUEST_F |
	c.op_to_portid = htonl(FW_CMD_OP_V(FW_PORT_CMD) | FW_CMD_REQUEST_F |
			       FW_CMD_EXEC_F | FW_PORT_CMD_PORTID(port));
			       FW_CMD_EXEC_F | FW_PORT_CMD_PORTID_V(port));
	c.action_to_len16 = htonl(FW_PORT_CMD_ACTION(FW_PORT_ACTION_L1_CFG) |
	c.action_to_len16 = htonl(FW_PORT_CMD_ACTION_V(FW_PORT_ACTION_L1_CFG) |
				  FW_LEN16(c));
				  FW_LEN16(c));
	c.u.l1cfg.rcap = htonl(FW_PORT_CAP_ANEG);
	c.u.l1cfg.rcap = htonl(FW_PORT_CAP_ANEG);
	return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
	return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
@@ -3415,9 +3415,9 @@ int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port,
	memset(&c, 0, sizeof(c));
	memset(&c, 0, sizeof(c));
	c.op_to_vfn = htonl(FW_CMD_OP_V(FW_VI_CMD) | FW_CMD_REQUEST_F |
	c.op_to_vfn = htonl(FW_CMD_OP_V(FW_VI_CMD) | FW_CMD_REQUEST_F |
			    FW_CMD_WRITE_F | FW_CMD_EXEC_F |
			    FW_CMD_WRITE_F | FW_CMD_EXEC_F |
			    FW_VI_CMD_PFN(pf) | FW_VI_CMD_VFN(vf));
			    FW_VI_CMD_PFN_V(pf) | FW_VI_CMD_VFN_V(vf));
	c.alloc_to_len16 = htonl(FW_VI_CMD_ALLOC | FW_LEN16(c));
	c.alloc_to_len16 = htonl(FW_VI_CMD_ALLOC_F | FW_LEN16(c));
	c.portid_pkd = FW_VI_CMD_PORTID(port);
	c.portid_pkd = FW_VI_CMD_PORTID_V(port);
	c.nmac = nmac - 1;
	c.nmac = nmac - 1;


	ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c);
	ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c);
@@ -3438,8 +3438,8 @@ int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port,
		}
		}
	}
	}
	if (rss_size)
	if (rss_size)
		*rss_size = FW_VI_CMD_RSSSIZE_GET(ntohs(c.rsssize_pkd));
		*rss_size = FW_VI_CMD_RSSSIZE_G(ntohs(c.rsssize_pkd));
	return FW_VI_CMD_VIID_GET(ntohs(c.type_viid));
	return FW_VI_CMD_VIID_G(ntohs(c.type_viid));
}
}


/**
/**
@@ -3466,23 +3466,23 @@ int t4_set_rxmode(struct adapter *adap, unsigned int mbox, unsigned int viid,
	if (mtu < 0)
	if (mtu < 0)
		mtu = FW_RXMODE_MTU_NO_CHG;
		mtu = FW_RXMODE_MTU_NO_CHG;
	if (promisc < 0)
	if (promisc < 0)
		promisc = FW_VI_RXMODE_CMD_PROMISCEN_MASK;
		promisc = FW_VI_RXMODE_CMD_PROMISCEN_M;
	if (all_multi < 0)
	if (all_multi < 0)
		all_multi = FW_VI_RXMODE_CMD_ALLMULTIEN_MASK;
		all_multi = FW_VI_RXMODE_CMD_ALLMULTIEN_M;
	if (bcast < 0)
	if (bcast < 0)
		bcast = FW_VI_RXMODE_CMD_BROADCASTEN_MASK;
		bcast = FW_VI_RXMODE_CMD_BROADCASTEN_M;
	if (vlanex < 0)
	if (vlanex < 0)
		vlanex = FW_VI_RXMODE_CMD_VLANEXEN_MASK;
		vlanex = FW_VI_RXMODE_CMD_VLANEXEN_M;


	memset(&c, 0, sizeof(c));
	memset(&c, 0, sizeof(c));
	c.op_to_viid = htonl(FW_CMD_OP_V(FW_VI_RXMODE_CMD) | FW_CMD_REQUEST_F |
	c.op_to_viid = htonl(FW_CMD_OP_V(FW_VI_RXMODE_CMD) | FW_CMD_REQUEST_F |
			     FW_CMD_WRITE_F | FW_VI_RXMODE_CMD_VIID(viid));
			     FW_CMD_WRITE_F | FW_VI_RXMODE_CMD_VIID_V(viid));
	c.retval_len16 = htonl(FW_LEN16(c));
	c.retval_len16 = htonl(FW_LEN16(c));
	c.mtu_to_vlanexen = htonl(FW_VI_RXMODE_CMD_MTU(mtu) |
	c.mtu_to_vlanexen = htonl(FW_VI_RXMODE_CMD_MTU_V(mtu) |
				  FW_VI_RXMODE_CMD_PROMISCEN(promisc) |
				  FW_VI_RXMODE_CMD_PROMISCEN_V(promisc) |
				  FW_VI_RXMODE_CMD_ALLMULTIEN(all_multi) |
				  FW_VI_RXMODE_CMD_ALLMULTIEN_V(all_multi) |
				  FW_VI_RXMODE_CMD_BROADCASTEN(bcast) |
				  FW_VI_RXMODE_CMD_BROADCASTEN_V(bcast) |
				  FW_VI_RXMODE_CMD_VLANEXEN(vlanex));
				  FW_VI_RXMODE_CMD_VLANEXEN_V(vlanex));
	return t4_wr_mbox_meat(adap, mbox, &c, sizeof(c), NULL, sleep_ok);
	return t4_wr_mbox_meat(adap, mbox, &c, sizeof(c), NULL, sleep_ok);
}
}


@@ -3525,13 +3525,13 @@ int t4_alloc_mac_filt(struct adapter *adap, unsigned int mbox,
	memset(&c, 0, sizeof(c));
	memset(&c, 0, sizeof(c));
	c.op_to_viid = htonl(FW_CMD_OP_V(FW_VI_MAC_CMD) | FW_CMD_REQUEST_F |
	c.op_to_viid = htonl(FW_CMD_OP_V(FW_VI_MAC_CMD) | FW_CMD_REQUEST_F |
			     FW_CMD_WRITE_F | (free ? FW_CMD_EXEC_F : 0) |
			     FW_CMD_WRITE_F | (free ? FW_CMD_EXEC_F : 0) |
			     FW_VI_MAC_CMD_VIID(viid));
			     FW_VI_MAC_CMD_VIID_V(viid));
	c.freemacs_to_len16 = htonl(FW_VI_MAC_CMD_FREEMACS(free) |
	c.freemacs_to_len16 = htonl(FW_VI_MAC_CMD_FREEMACS_V(free) |
				    FW_CMD_LEN16_V((naddr + 2) / 2));
				    FW_CMD_LEN16_V((naddr + 2) / 2));


	for (i = 0, p = c.u.exact; i < naddr; i++, p++) {
	for (i = 0, p = c.u.exact; i < naddr; i++, p++) {
		p->valid_to_idx = htons(FW_VI_MAC_CMD_VALID |
		p->valid_to_idx = htons(FW_VI_MAC_CMD_VALID_F |
				      FW_VI_MAC_CMD_IDX(FW_VI_MAC_ADD_MAC));
				      FW_VI_MAC_CMD_IDX_V(FW_VI_MAC_ADD_MAC));
		memcpy(p->macaddr, addr[i], sizeof(p->macaddr));
		memcpy(p->macaddr, addr[i], sizeof(p->macaddr));
	}
	}


@@ -3540,7 +3540,7 @@ int t4_alloc_mac_filt(struct adapter *adap, unsigned int mbox,
		return ret;
		return ret;


	for (i = 0, p = c.u.exact; i < naddr; i++, p++) {
	for (i = 0, p = c.u.exact; i < naddr; i++, p++) {
		u16 index = FW_VI_MAC_CMD_IDX_GET(ntohs(p->valid_to_idx));
		u16 index = FW_VI_MAC_CMD_IDX_G(ntohs(p->valid_to_idx));


		if (idx)
		if (idx)
			idx[i] = index >= max_naddr ? 0xffff : index;
			idx[i] = index >= max_naddr ? 0xffff : index;
@@ -3587,16 +3587,16 @@ int t4_change_mac(struct adapter *adap, unsigned int mbox, unsigned int viid,


	memset(&c, 0, sizeof(c));
	memset(&c, 0, sizeof(c));
	c.op_to_viid = htonl(FW_CMD_OP_V(FW_VI_MAC_CMD) | FW_CMD_REQUEST_F |
	c.op_to_viid = htonl(FW_CMD_OP_V(FW_VI_MAC_CMD) | FW_CMD_REQUEST_F |
			     FW_CMD_WRITE_F | FW_VI_MAC_CMD_VIID(viid));
			     FW_CMD_WRITE_F | FW_VI_MAC_CMD_VIID_V(viid));
	c.freemacs_to_len16 = htonl(FW_CMD_LEN16_V(1));
	c.freemacs_to_len16 = htonl(FW_CMD_LEN16_V(1));
	p->valid_to_idx = htons(FW_VI_MAC_CMD_VALID |
	p->valid_to_idx = htons(FW_VI_MAC_CMD_VALID_F |
				FW_VI_MAC_CMD_SMAC_RESULT(mode) |
				FW_VI_MAC_CMD_SMAC_RESULT_V(mode) |
				FW_VI_MAC_CMD_IDX(idx));
				FW_VI_MAC_CMD_IDX_V(idx));
	memcpy(p->macaddr, addr, sizeof(p->macaddr));
	memcpy(p->macaddr, addr, sizeof(p->macaddr));


	ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c);
	ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c);
	if (ret == 0) {
	if (ret == 0) {
		ret = FW_VI_MAC_CMD_IDX_GET(ntohs(p->valid_to_idx));
		ret = FW_VI_MAC_CMD_IDX_G(ntohs(p->valid_to_idx));
		if (ret >= max_mac_addr)
		if (ret >= max_mac_addr)
			ret = -ENOMEM;
			ret = -ENOMEM;
	}
	}
@@ -3621,9 +3621,9 @@ int t4_set_addr_hash(struct adapter *adap, unsigned int mbox, unsigned int viid,


	memset(&c, 0, sizeof(c));
	memset(&c, 0, sizeof(c));
	c.op_to_viid = htonl(FW_CMD_OP_V(FW_VI_MAC_CMD) | FW_CMD_REQUEST_F |
	c.op_to_viid = htonl(FW_CMD_OP_V(FW_VI_MAC_CMD) | FW_CMD_REQUEST_F |
			     FW_CMD_WRITE_F | FW_VI_ENABLE_CMD_VIID(viid));
			     FW_CMD_WRITE_F | FW_VI_ENABLE_CMD_VIID_V(viid));
	c.freemacs_to_len16 = htonl(FW_VI_MAC_CMD_HASHVECEN |
	c.freemacs_to_len16 = htonl(FW_VI_MAC_CMD_HASHVECEN_F |
				    FW_VI_MAC_CMD_HASHUNIEN(ucast) |
				    FW_VI_MAC_CMD_HASHUNIEN_V(ucast) |
				    FW_CMD_LEN16_V(1));
				    FW_CMD_LEN16_V(1));
	c.u.hash.hashvec = cpu_to_be64(vec);
	c.u.hash.hashvec = cpu_to_be64(vec);
	return t4_wr_mbox_meat(adap, mbox, &c, sizeof(c), NULL, sleep_ok);
	return t4_wr_mbox_meat(adap, mbox, &c, sizeof(c), NULL, sleep_ok);
@@ -3648,11 +3648,11 @@ int t4_enable_vi_params(struct adapter *adap, unsigned int mbox,


	memset(&c, 0, sizeof(c));
	memset(&c, 0, sizeof(c));
	c.op_to_viid = htonl(FW_CMD_OP_V(FW_VI_ENABLE_CMD) | FW_CMD_REQUEST_F |
	c.op_to_viid = htonl(FW_CMD_OP_V(FW_VI_ENABLE_CMD) | FW_CMD_REQUEST_F |
			     FW_CMD_EXEC_F | FW_VI_ENABLE_CMD_VIID(viid));
			     FW_CMD_EXEC_F | FW_VI_ENABLE_CMD_VIID_V(viid));


	c.ien_to_len16 = htonl(FW_VI_ENABLE_CMD_IEN(rx_en) |
	c.ien_to_len16 = htonl(FW_VI_ENABLE_CMD_IEN_V(rx_en) |
			       FW_VI_ENABLE_CMD_EEN(tx_en) | FW_LEN16(c) |
			       FW_VI_ENABLE_CMD_EEN_V(tx_en) | FW_LEN16(c) |
			       FW_VI_ENABLE_CMD_DCB_INFO(dcb_en));
			       FW_VI_ENABLE_CMD_DCB_INFO_V(dcb_en));
	return t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), NULL);
	return t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), NULL);
}
}


@@ -3688,8 +3688,8 @@ int t4_identify_port(struct adapter *adap, unsigned int mbox, unsigned int viid,


	memset(&c, 0, sizeof(c));
	memset(&c, 0, sizeof(c));
	c.op_to_viid = htonl(FW_CMD_OP_V(FW_VI_ENABLE_CMD) | FW_CMD_REQUEST_F |
	c.op_to_viid = htonl(FW_CMD_OP_V(FW_VI_ENABLE_CMD) | FW_CMD_REQUEST_F |
			     FW_CMD_EXEC_F | FW_VI_ENABLE_CMD_VIID(viid));
			     FW_CMD_EXEC_F | FW_VI_ENABLE_CMD_VIID_V(viid));
	c.ien_to_len16 = htonl(FW_VI_ENABLE_CMD_LED | FW_LEN16(c));
	c.ien_to_len16 = htonl(FW_VI_ENABLE_CMD_LED_F | FW_LEN16(c));
	c.blinkdur = htons(nblinks);
	c.blinkdur = htons(nblinks);
	return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
	return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
}
}
@@ -3811,25 +3811,25 @@ int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl)
	if (opcode == FW_PORT_CMD) {    /* link/module state change message */
	if (opcode == FW_PORT_CMD) {    /* link/module state change message */
		int speed = 0, fc = 0;
		int speed = 0, fc = 0;
		const struct fw_port_cmd *p = (void *)rpl;
		const struct fw_port_cmd *p = (void *)rpl;
		int chan = FW_PORT_CMD_PORTID_GET(ntohl(p->op_to_portid));
		int chan = FW_PORT_CMD_PORTID_G(ntohl(p->op_to_portid));
		int port = adap->chan_map[chan];
		int port = adap->chan_map[chan];
		struct port_info *pi = adap2pinfo(adap, port);
		struct port_info *pi = adap2pinfo(adap, port);
		struct link_config *lc = &pi->link_cfg;
		struct link_config *lc = &pi->link_cfg;
		u32 stat = ntohl(p->u.info.lstatus_to_modtype);
		u32 stat = ntohl(p->u.info.lstatus_to_modtype);
		int link_ok = (stat & FW_PORT_CMD_LSTATUS) != 0;
		int link_ok = (stat & FW_PORT_CMD_LSTATUS_F) != 0;
		u32 mod = FW_PORT_CMD_MODTYPE_GET(stat);
		u32 mod = FW_PORT_CMD_MODTYPE_G(stat);


		if (stat & FW_PORT_CMD_RXPAUSE)
		if (stat & FW_PORT_CMD_RXPAUSE_F)
			fc |= PAUSE_RX;
			fc |= PAUSE_RX;
		if (stat & FW_PORT_CMD_TXPAUSE)
		if (stat & FW_PORT_CMD_TXPAUSE_F)
			fc |= PAUSE_TX;
			fc |= PAUSE_TX;
		if (stat & FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_100M))
		if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_100M))
			speed = 100;
			speed = 100;
		else if (stat & FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_1G))
		else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_1G))
			speed = 1000;
			speed = 1000;
		else if (stat & FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_10G))
		else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_10G))
			speed = 10000;
			speed = 10000;
		else if (stat & FW_PORT_CMD_LSPEED(FW_PORT_CAP_SPEED_40G))
		else if (stat & FW_PORT_CMD_LSPEED_V(FW_PORT_CAP_SPEED_40G))
			speed = 40000;
			speed = 40000;


		if (link_ok != lc->link_ok || speed != lc->speed ||
		if (link_ok != lc->link_ok || speed != lc->speed ||
@@ -4124,9 +4124,9 @@ int t4_port_init(struct adapter *adap, int mbox, int pf, int vf)


		c.op_to_portid = htonl(FW_CMD_OP_V(FW_PORT_CMD) |
		c.op_to_portid = htonl(FW_CMD_OP_V(FW_PORT_CMD) |
				       FW_CMD_REQUEST_F | FW_CMD_READ_F |
				       FW_CMD_REQUEST_F | FW_CMD_READ_F |
				       FW_PORT_CMD_PORTID(j));
				       FW_PORT_CMD_PORTID_V(j));
		c.action_to_len16 = htonl(
		c.action_to_len16 = htonl(
			FW_PORT_CMD_ACTION(FW_PORT_ACTION_GET_PORT_INFO) |
			FW_PORT_CMD_ACTION_V(FW_PORT_ACTION_GET_PORT_INFO) |
			FW_LEN16(c));
			FW_LEN16(c));
		ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c);
		ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c);
		if (ret)
		if (ret)
@@ -4144,9 +4144,9 @@ int t4_port_init(struct adapter *adap, int mbox, int pf, int vf)
		adap->port[i]->dev_port = j;
		adap->port[i]->dev_port = j;


		ret = ntohl(c.u.info.lstatus_to_modtype);
		ret = ntohl(c.u.info.lstatus_to_modtype);
		p->mdio_addr = (ret & FW_PORT_CMD_MDIOCAP) ?
		p->mdio_addr = (ret & FW_PORT_CMD_MDIOCAP_F) ?
			FW_PORT_CMD_MDIOADDR_GET(ret) : -1;
			FW_PORT_CMD_MDIOADDR_G(ret) : -1;
		p->port_type = FW_PORT_CMD_PTYPE_GET(ret);
		p->port_type = FW_PORT_CMD_PTYPE_G(ret);
		p->mod_type = FW_PORT_MOD_TYPE_NA;
		p->mod_type = FW_PORT_MOD_TYPE_NA;


		rvc.op_to_viid = htonl(FW_CMD_OP_V(FW_RSS_VI_CONFIG_CMD) |
		rvc.op_to_viid = htonl(FW_CMD_OP_V(FW_RSS_VI_CONFIG_CMD) |
Loading