Commit 5167865a authored by Hariprasad Shenai's avatar Hariprasad Shenai Committed by David S. Miller

RDMA/cxgb4/csiostor: Cleansup FW related macros/register defines for PF/VF and LDST

This patch cleanups PF/VF and LDST 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 77a80e23
...@@ -478,7 +478,7 @@ static void send_flowc(struct c4iw_ep *ep, struct sk_buff *skb) ...@@ -478,7 +478,7 @@ static void send_flowc(struct c4iw_ep *ep, struct sk_buff *skb)
16)) | FW_WR_FLOWID_V(ep->hwtid)); 16)) | FW_WR_FLOWID_V(ep->hwtid));
flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN; flowc->mnemval[0].mnemonic = FW_FLOWC_MNEM_PFNVFN;
flowc->mnemval[0].val = cpu_to_be32(FW_PFVF_CMD_PFN flowc->mnemval[0].val = cpu_to_be32(FW_PFVF_CMD_PFN_V
(ep->com.dev->rdev.lldi.pf)); (ep->com.dev->rdev.lldi.pf));
flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH; flowc->mnemval[1].mnemonic = FW_FLOWC_MNEM_CH;
flowc->mnemval[1].val = cpu_to_be32(ep->tx_chan); flowc->mnemval[1].val = cpu_to_be32(ep->tx_chan);
......
...@@ -141,7 +141,7 @@ static unsigned int pfvfres_pmask(struct adapter *adapter, ...@@ -141,7 +141,7 @@ static unsigned int pfvfres_pmask(struct adapter *adapter,
* Give PF's access to all of the ports. * Give PF's access to all of the ports.
*/ */
if (vf == 0) if (vf == 0)
return FW_PFVF_CMD_PMASK_MASK; return FW_PFVF_CMD_PMASK_M;
/* /*
* For VFs, we'll assign them access to the ports based purely on the * For VFs, we'll assign them access to the ports based purely on the
...@@ -512,9 +512,10 @@ static void dcb_tx_queue_prio_enable(struct net_device *dev, int enable) ...@@ -512,9 +512,10 @@ static void dcb_tx_queue_prio_enable(struct net_device *dev, int enable)
u32 name, value; u32 name, value;
int err; int err;
name = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) | name = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DMAQ) |
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_EQ_DCBPRIO_ETH) | FW_PARAMS_PARAM_X_V(
FW_PARAMS_PARAM_YZ(txq->q.cntxt_id)); FW_PARAMS_PARAM_DMAQ_EQ_DCBPRIO_ETH) |
FW_PARAMS_PARAM_YZ_V(txq->q.cntxt_id));
value = enable ? i : 0xffffffff; value = enable ? i : 0xffffffff;
/* Since we can be called while atomic (from "interrupt /* Since we can be called while atomic (from "interrupt
...@@ -2717,9 +2718,10 @@ static int set_rspq_intr_params(struct sge_rspq *q, ...@@ -2717,9 +2718,10 @@ static int set_rspq_intr_params(struct sge_rspq *q,
new_idx = closest_thres(&adap->sge, cnt); new_idx = closest_thres(&adap->sge, cnt);
if (q->desc && q->pktcnt_idx != new_idx) { if (q->desc && q->pktcnt_idx != new_idx) {
/* the queue has already been created, update it */ /* the queue has already been created, update it */
v = FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) | v = FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DMAQ) |
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH) | FW_PARAMS_PARAM_X_V(
FW_PARAMS_PARAM_YZ(q->cntxt_id); FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH) |
FW_PARAMS_PARAM_YZ_V(q->cntxt_id);
err = t4_set_params(adap, adap->fn, adap->fn, 0, 1, &v, err = t4_set_params(adap, adap->fn, adap->fn, 0, 1, &v,
&new_idx); &new_idx);
if (err) if (err)
...@@ -4870,11 +4872,11 @@ static u32 t4_read_pcie_cfg4(struct adapter *adap, int reg) ...@@ -4870,11 +4872,11 @@ static u32 t4_read_pcie_cfg4(struct adapter *adap, int reg)
htonl(FW_CMD_OP_V(FW_LDST_CMD) | htonl(FW_CMD_OP_V(FW_LDST_CMD) |
FW_CMD_REQUEST_F | FW_CMD_REQUEST_F |
FW_CMD_READ_F | FW_CMD_READ_F |
FW_LDST_CMD_ADDRSPACE(FW_LDST_ADDRSPC_FUNC_PCIE)); FW_LDST_CMD_ADDRSPACE_V(FW_LDST_ADDRSPC_FUNC_PCIE));
ldst_cmd.cycles_to_len16 = htonl(FW_LEN16(ldst_cmd)); ldst_cmd.cycles_to_len16 = htonl(FW_LEN16(ldst_cmd));
ldst_cmd.u.pcie.select_naccess = FW_LDST_CMD_NACCESS(1); ldst_cmd.u.pcie.select_naccess = FW_LDST_CMD_NACCESS_V(1);
ldst_cmd.u.pcie.ctrl_to_fn = ldst_cmd.u.pcie.ctrl_to_fn =
(FW_LDST_CMD_LC | FW_LDST_CMD_FN(adap->fn)); (FW_LDST_CMD_LC_F | FW_LDST_CMD_FN_V(adap->fn));
ldst_cmd.u.pcie.r = reg; ldst_cmd.u.pcie.r = reg;
ret = t4_wr_mbox(adap, adap->mbox, &ldst_cmd, sizeof(ldst_cmd), ret = t4_wr_mbox(adap, adap->mbox, &ldst_cmd, sizeof(ldst_cmd),
&ldst_cmd); &ldst_cmd);
...@@ -5148,8 +5150,8 @@ static int adap_init0_config(struct adapter *adapter, int reset) ...@@ -5148,8 +5150,8 @@ static int adap_init0_config(struct adapter *adapter, int reset)
if (cf->size >= FLASH_CFG_MAX_SIZE) if (cf->size >= FLASH_CFG_MAX_SIZE)
ret = -ENOMEM; ret = -ENOMEM;
else { else {
params[0] = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | params[0] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DEV) |
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_CF)); FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_DEV_CF));
ret = t4_query_params(adapter, adapter->mbox, ret = t4_query_params(adapter, adapter->mbox,
adapter->fn, 0, 1, params, val); adapter->fn, 0, 1, params, val);
if (ret == 0) { if (ret == 0) {
...@@ -5167,8 +5169,8 @@ static int adap_init0_config(struct adapter *adapter, int reset) ...@@ -5167,8 +5169,8 @@ static int adap_init0_config(struct adapter *adapter, int reset)
size_t size = cf->size & ~0x3; size_t size = cf->size & ~0x3;
__be32 *data = (__be32 *)cf->data; __be32 *data = (__be32 *)cf->data;
mtype = FW_PARAMS_PARAM_Y_GET(val[0]); mtype = FW_PARAMS_PARAM_Y_G(val[0]);
maddr = FW_PARAMS_PARAM_Z_GET(val[0]) << 16; maddr = FW_PARAMS_PARAM_Z_G(val[0]) << 16;
spin_lock(&adapter->win0_lock); spin_lock(&adapter->win0_lock);
ret = t4_memory_rw(adapter, 0, mtype, maddr, ret = t4_memory_rw(adapter, 0, mtype, maddr,
...@@ -5209,9 +5211,9 @@ static int adap_init0_config(struct adapter *adapter, int reset) ...@@ -5209,9 +5211,9 @@ static int adap_init0_config(struct adapter *adapter, int reset)
FW_CMD_REQUEST_F | FW_CMD_REQUEST_F |
FW_CMD_READ_F); FW_CMD_READ_F);
caps_cmd.cfvalid_to_len16 = caps_cmd.cfvalid_to_len16 =
htonl(FW_CAPS_CONFIG_CMD_CFVALID | htonl(FW_CAPS_CONFIG_CMD_CFVALID_F |
FW_CAPS_CONFIG_CMD_MEMTYPE_CF(mtype) | FW_CAPS_CONFIG_CMD_MEMTYPE_CF_V(mtype) |
FW_CAPS_CONFIG_CMD_MEMADDR64K_CF(maddr >> 16) | FW_CAPS_CONFIG_CMD_MEMADDR64K_CF_V(maddr >> 16) |
FW_LEN16(caps_cmd)); FW_LEN16(caps_cmd));
ret = t4_wr_mbox(adapter, adapter->mbox, &caps_cmd, sizeof(caps_cmd), ret = t4_wr_mbox(adapter, adapter->mbox, &caps_cmd, sizeof(caps_cmd),
&caps_cmd); &caps_cmd);
...@@ -5377,7 +5379,7 @@ static int adap_init0_no_config(struct adapter *adapter, int reset) ...@@ -5377,7 +5379,7 @@ static int adap_init0_no_config(struct adapter *adapter, int reset)
PFRES_NEQ, PFRES_NETHCTRL, PFRES_NEQ, PFRES_NETHCTRL,
PFRES_NIQFLINT, PFRES_NIQ, PFRES_NIQFLINT, PFRES_NIQ,
PFRES_TC, PFRES_NVI, PFRES_TC, PFRES_NVI,
FW_PFVF_CMD_CMASK_MASK, FW_PFVF_CMD_CMASK_M,
pfvfres_pmask(adapter, adapter->fn, 0), pfvfres_pmask(adapter, adapter->fn, 0),
PFRES_NEXACTF, PFRES_NEXACTF,
PFRES_R_CAPS, PFRES_WX_CAPS); PFRES_R_CAPS, PFRES_WX_CAPS);
...@@ -5422,7 +5424,7 @@ static int adap_init0_no_config(struct adapter *adapter, int reset) ...@@ -5422,7 +5424,7 @@ static int adap_init0_no_config(struct adapter *adapter, int reset)
VFRES_NEQ, VFRES_NETHCTRL, VFRES_NEQ, VFRES_NETHCTRL,
VFRES_NIQFLINT, VFRES_NIQ, VFRES_NIQFLINT, VFRES_NIQ,
VFRES_TC, VFRES_NVI, VFRES_TC, VFRES_NVI,
FW_PFVF_CMD_CMASK_MASK, FW_PFVF_CMD_CMASK_M,
pfvfres_pmask( pfvfres_pmask(
adapter, pf, vf), adapter, pf, vf),
VFRES_NEXACTF, VFRES_NEXACTF,
...@@ -5686,8 +5688,8 @@ static int adap_init0(struct adapter *adap) ...@@ -5686,8 +5688,8 @@ static int adap_init0(struct adapter *adap)
* and portvec ... * and portvec ...
*/ */
v = v =
FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DEV) |
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_PORTVEC); FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_DEV_PORTVEC);
ret = t4_query_params(adap, adap->mbox, adap->fn, 0, 1, &v, &port_vec); ret = t4_query_params(adap, adap->mbox, adap->fn, 0, 1, &v, &port_vec);
if (ret < 0) if (ret < 0)
goto bye; goto bye;
...@@ -5723,8 +5725,9 @@ static int adap_init0(struct adapter *adap) ...@@ -5723,8 +5725,9 @@ static int adap_init0(struct adapter *adap)
* Find out whether we're dealing with a version of * Find out whether we're dealing with a version of
* the firmware which has configuration file support. * the firmware which has configuration file support.
*/ */
params[0] = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | params[0] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DEV) |
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_CF)); FW_PARAMS_PARAM_X_V(
FW_PARAMS_PARAM_DEV_CF));
ret = t4_query_params(adap, adap->mbox, adap->fn, 0, 1, ret = t4_query_params(adap, adap->mbox, adap->fn, 0, 1,
params, val); params, val);
...@@ -5784,14 +5787,14 @@ static int adap_init0(struct adapter *adap) ...@@ -5784,14 +5787,14 @@ static int adap_init0(struct adapter *adap)
* Grab some of our basic fundamental operating parameters. * Grab some of our basic fundamental operating parameters.
*/ */
#define FW_PARAM_DEV(param) \ #define FW_PARAM_DEV(param) \
(FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | \ (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DEV) | \
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_##param)) FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_DEV_##param))
#define FW_PARAM_PFVF(param) \ #define FW_PARAM_PFVF(param) \
FW_PARAMS_MNEM(FW_PARAMS_MNEM_PFVF) | \ FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_PFVF) | \
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_PFVF_##param)| \ FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_PFVF_##param)| \
FW_PARAMS_PARAM_Y(0) | \ FW_PARAMS_PARAM_Y_V(0) | \
FW_PARAMS_PARAM_Z(0) FW_PARAMS_PARAM_Z_V(0)
params[0] = FW_PARAM_PFVF(EQ_START); params[0] = FW_PARAM_PFVF(EQ_START);
params[1] = FW_PARAM_PFVF(L2T_START); params[1] = FW_PARAM_PFVF(L2T_START);
......
...@@ -711,8 +711,8 @@ int get_vpd_params(struct adapter *adapter, struct vpd_params *p) ...@@ -711,8 +711,8 @@ int get_vpd_params(struct adapter *adapter, struct vpd_params *p)
* Ask firmware for the Core Clock since it knows how to translate the * Ask firmware for the Core Clock since it knows how to translate the
* Reference Clock ('V2') VPD field into a Core Clock value ... * Reference Clock ('V2') VPD field into a Core Clock value ...
*/ */
cclk_param = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | cclk_param = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DEV) |
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_CCLK)); FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_DEV_CCLK));
ret = t4_query_params(adapter, adapter->mbox, 0, 0, ret = t4_query_params(adapter, adapter->mbox, 0, 0,
1, &cclk_param, &cclk_val); 1, &cclk_param, &cclk_val);
...@@ -2577,7 +2577,7 @@ int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox, ...@@ -2577,7 +2577,7 @@ int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox,
memset(&c, 0, sizeof(c)); memset(&c, 0, sizeof(c));
c.op_to_addrspace = htonl(FW_CMD_OP_V(FW_LDST_CMD) | FW_CMD_REQUEST_F | c.op_to_addrspace = htonl(FW_CMD_OP_V(FW_LDST_CMD) | FW_CMD_REQUEST_F |
FW_CMD_WRITE_F | FW_CMD_WRITE_F |
FW_LDST_CMD_ADDRSPACE(FW_LDST_ADDRSPC_FIRMWARE)); FW_LDST_CMD_ADDRSPACE_V(FW_LDST_ADDRSPC_FIRMWARE));
c.cycles_to_len16 = htonl(FW_LEN16(c)); c.cycles_to_len16 = htonl(FW_LEN16(c));
c.u.addrval.addr = htonl(addr); c.u.addrval.addr = htonl(addr);
c.u.addrval.val = htonl(val); c.u.addrval.val = htonl(val);
...@@ -2604,10 +2604,10 @@ int t4_mdio_rd(struct adapter *adap, unsigned int mbox, unsigned int phy_addr, ...@@ -2604,10 +2604,10 @@ int t4_mdio_rd(struct adapter *adap, unsigned int mbox, unsigned int phy_addr,
memset(&c, 0, sizeof(c)); memset(&c, 0, sizeof(c));
c.op_to_addrspace = htonl(FW_CMD_OP_V(FW_LDST_CMD) | FW_CMD_REQUEST_F | c.op_to_addrspace = htonl(FW_CMD_OP_V(FW_LDST_CMD) | FW_CMD_REQUEST_F |
FW_CMD_READ_F | FW_LDST_CMD_ADDRSPACE(FW_LDST_ADDRSPC_MDIO)); FW_CMD_READ_F | FW_LDST_CMD_ADDRSPACE_V(FW_LDST_ADDRSPC_MDIO));
c.cycles_to_len16 = htonl(FW_LEN16(c)); c.cycles_to_len16 = htonl(FW_LEN16(c));
c.u.mdio.paddr_mmd = htons(FW_LDST_CMD_PADDR(phy_addr) | c.u.mdio.paddr_mmd = htons(FW_LDST_CMD_PADDR_V(phy_addr) |
FW_LDST_CMD_MMD(mmd)); FW_LDST_CMD_MMD_V(mmd));
c.u.mdio.raddr = htons(reg); c.u.mdio.raddr = htons(reg);
ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c);
...@@ -2634,10 +2634,10 @@ int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr, ...@@ -2634,10 +2634,10 @@ int t4_mdio_wr(struct adapter *adap, unsigned int mbox, unsigned int phy_addr,
memset(&c, 0, sizeof(c)); memset(&c, 0, sizeof(c));
c.op_to_addrspace = htonl(FW_CMD_OP_V(FW_LDST_CMD) | FW_CMD_REQUEST_F | c.op_to_addrspace = htonl(FW_CMD_OP_V(FW_LDST_CMD) | FW_CMD_REQUEST_F |
FW_CMD_WRITE_F | FW_LDST_CMD_ADDRSPACE(FW_LDST_ADDRSPC_MDIO)); FW_CMD_WRITE_F | FW_LDST_CMD_ADDRSPACE_V(FW_LDST_ADDRSPC_MDIO));
c.cycles_to_len16 = htonl(FW_LEN16(c)); c.cycles_to_len16 = htonl(FW_LEN16(c));
c.u.mdio.paddr_mmd = htons(FW_LDST_CMD_PADDR(phy_addr) | c.u.mdio.paddr_mmd = htons(FW_LDST_CMD_PADDR_V(phy_addr) |
FW_LDST_CMD_MMD(mmd)); FW_LDST_CMD_MMD_V(mmd));
c.u.mdio.raddr = htons(reg); c.u.mdio.raddr = htons(reg);
c.u.mdio.rval = htons(val); c.u.mdio.rval = htons(val);
...@@ -2774,13 +2774,13 @@ int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox, ...@@ -2774,13 +2774,13 @@ int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox,
memset(&c, 0, sizeof(c)); memset(&c, 0, sizeof(c));
INIT_CMD(c, HELLO, WRITE); INIT_CMD(c, HELLO, WRITE);
c.err_to_clearinit = htonl( c.err_to_clearinit = htonl(
FW_HELLO_CMD_MASTERDIS(master == MASTER_CANT) | FW_HELLO_CMD_MASTERDIS_V(master == MASTER_CANT) |
FW_HELLO_CMD_MASTERFORCE(master == MASTER_MUST) | FW_HELLO_CMD_MASTERFORCE_V(master == MASTER_MUST) |
FW_HELLO_CMD_MBMASTER(master == MASTER_MUST ? mbox : FW_HELLO_CMD_MBMASTER_V(master == MASTER_MUST ? mbox :
FW_HELLO_CMD_MBMASTER_MASK) | FW_HELLO_CMD_MBMASTER_M) |
FW_HELLO_CMD_MBASYNCNOT(evt_mbox) | FW_HELLO_CMD_MBASYNCNOT_V(evt_mbox) |
FW_HELLO_CMD_STAGE(fw_hello_cmd_stage_os) | FW_HELLO_CMD_STAGE_V(fw_hello_cmd_stage_os) |
FW_HELLO_CMD_CLEARINIT); FW_HELLO_CMD_CLEARINIT_F);
/* /*
* Issue the HELLO command to the firmware. If it's not successful * Issue the HELLO command to the firmware. If it's not successful
...@@ -2799,11 +2799,11 @@ int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox, ...@@ -2799,11 +2799,11 @@ int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox,
} }
v = ntohl(c.err_to_clearinit); v = ntohl(c.err_to_clearinit);
master_mbox = FW_HELLO_CMD_MBMASTER_GET(v); master_mbox = FW_HELLO_CMD_MBMASTER_G(v);
if (state) { if (state) {
if (v & FW_HELLO_CMD_ERR) if (v & FW_HELLO_CMD_ERR_F)
*state = DEV_STATE_ERR; *state = DEV_STATE_ERR;
else if (v & FW_HELLO_CMD_INIT) else if (v & FW_HELLO_CMD_INIT_F)
*state = DEV_STATE_INIT; *state = DEV_STATE_INIT;
else else
*state = DEV_STATE_UNINIT; *state = DEV_STATE_UNINIT;
...@@ -2820,7 +2820,7 @@ int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox, ...@@ -2820,7 +2820,7 @@ int t4_fw_hello(struct adapter *adap, unsigned int mbox, unsigned int evt_mbox,
* this case, the Master PF returned by the firmware will be * this case, the Master PF returned by the firmware will be
* FW_PCIE_FW_MASTER_MASK so the test below will work ... * FW_PCIE_FW_MASTER_MASK so the test below will work ...
*/ */
if ((v & (FW_HELLO_CMD_ERR|FW_HELLO_CMD_INIT)) == 0 && if ((v & (FW_HELLO_CMD_ERR_F|FW_HELLO_CMD_INIT_F)) == 0 &&
master_mbox != mbox) { master_mbox != mbox) {
int waiting = FW_CMD_HELLO_TIMEOUT; int waiting = FW_CMD_HELLO_TIMEOUT;
...@@ -2961,7 +2961,7 @@ static int t4_fw_halt(struct adapter *adap, unsigned int mbox, int force) ...@@ -2961,7 +2961,7 @@ static int t4_fw_halt(struct adapter *adap, unsigned int mbox, int force)
memset(&c, 0, sizeof(c)); memset(&c, 0, sizeof(c));
INIT_CMD(c, RESET, WRITE); INIT_CMD(c, RESET, WRITE);
c.val = htonl(PIORST | PIORSTMODE); c.val = htonl(PIORST | PIORSTMODE);
c.halt_pkd = htonl(FW_RESET_CMD_HALT(1U)); c.halt_pkd = htonl(FW_RESET_CMD_HALT_F);
ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
} }
...@@ -3252,8 +3252,8 @@ int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf, ...@@ -3252,8 +3252,8 @@ int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf,
memset(&c, 0, sizeof(c)); memset(&c, 0, sizeof(c));
c.op_to_vfn = htonl(FW_CMD_OP_V(FW_PARAMS_CMD) | FW_CMD_REQUEST_F | c.op_to_vfn = htonl(FW_CMD_OP_V(FW_PARAMS_CMD) | FW_CMD_REQUEST_F |
FW_CMD_READ_F | FW_PARAMS_CMD_PFN(pf) | FW_CMD_READ_F | FW_PARAMS_CMD_PFN_V(pf) |
FW_PARAMS_CMD_VFN(vf)); FW_PARAMS_CMD_VFN_V(vf));
c.retval_len16 = htonl(FW_LEN16(c)); c.retval_len16 = htonl(FW_LEN16(c));
for (i = 0; i < nparams; i++, p += 2) for (i = 0; i < nparams; i++, p += 2)
*p = htonl(*params++); *p = htonl(*params++);
...@@ -3293,8 +3293,8 @@ int t4_set_params_nosleep(struct adapter *adap, unsigned int mbox, ...@@ -3293,8 +3293,8 @@ int t4_set_params_nosleep(struct adapter *adap, unsigned int mbox,
memset(&c, 0, sizeof(c)); memset(&c, 0, sizeof(c));
c.op_to_vfn = cpu_to_be32(FW_CMD_OP_V(FW_PARAMS_CMD) | c.op_to_vfn = cpu_to_be32(FW_CMD_OP_V(FW_PARAMS_CMD) |
FW_CMD_REQUEST_F | FW_CMD_WRITE_F | FW_CMD_REQUEST_F | FW_CMD_WRITE_F |
FW_PARAMS_CMD_PFN(pf) | FW_PARAMS_CMD_PFN_V(pf) |
FW_PARAMS_CMD_VFN(vf)); FW_PARAMS_CMD_VFN_V(vf));
c.retval_len16 = cpu_to_be32(FW_LEN16(c)); c.retval_len16 = cpu_to_be32(FW_LEN16(c));
while (nparams--) { while (nparams--) {
...@@ -3330,8 +3330,8 @@ int t4_set_params(struct adapter *adap, unsigned int mbox, unsigned int pf, ...@@ -3330,8 +3330,8 @@ int t4_set_params(struct adapter *adap, unsigned int mbox, unsigned int pf,
memset(&c, 0, sizeof(c)); memset(&c, 0, sizeof(c));
c.op_to_vfn = htonl(FW_CMD_OP_V(FW_PARAMS_CMD) | FW_CMD_REQUEST_F | c.op_to_vfn = htonl(FW_CMD_OP_V(FW_PARAMS_CMD) | FW_CMD_REQUEST_F |
FW_CMD_WRITE_F | FW_PARAMS_CMD_PFN(pf) | FW_CMD_WRITE_F | FW_PARAMS_CMD_PFN_V(pf) |
FW_PARAMS_CMD_VFN(vf)); FW_PARAMS_CMD_VFN_V(vf));
c.retval_len16 = htonl(FW_LEN16(c)); c.retval_len16 = htonl(FW_LEN16(c));
while (nparams--) { while (nparams--) {
*p++ = htonl(*params++); *p++ = htonl(*params++);
...@@ -3372,19 +3372,19 @@ int t4_cfg_pfvf(struct adapter *adap, unsigned int mbox, unsigned int pf, ...@@ -3372,19 +3372,19 @@ int t4_cfg_pfvf(struct adapter *adap, unsigned int mbox, unsigned int pf,
memset(&c, 0, sizeof(c)); memset(&c, 0, sizeof(c));
c.op_to_vfn = htonl(FW_CMD_OP_V(FW_PFVF_CMD) | FW_CMD_REQUEST_F | c.op_to_vfn = htonl(FW_CMD_OP_V(FW_PFVF_CMD) | FW_CMD_REQUEST_F |
FW_CMD_WRITE_F | FW_PFVF_CMD_PFN(pf) | FW_CMD_WRITE_F | FW_PFVF_CMD_PFN_V(pf) |
FW_PFVF_CMD_VFN(vf)); FW_PFVF_CMD_VFN_V(vf));
c.retval_len16 = htonl(FW_LEN16(c)); c.retval_len16 = htonl(FW_LEN16(c));
c.niqflint_niq = htonl(FW_PFVF_CMD_NIQFLINT(rxqi) | c.niqflint_niq = htonl(FW_PFVF_CMD_NIQFLINT_V(rxqi) |
FW_PFVF_CMD_NIQ(rxq)); FW_PFVF_CMD_NIQ_V(rxq));
c.type_to_neq = htonl(FW_PFVF_CMD_CMASK(cmask) | c.type_to_neq = htonl(FW_PFVF_CMD_CMASK_V(cmask) |
FW_PFVF_CMD_PMASK(pmask) | FW_PFVF_CMD_PMASK_V(pmask) |
FW_PFVF_CMD_NEQ(txq)); FW_PFVF_CMD_NEQ_V(txq));
c.tc_to_nexactf = htonl(FW_PFVF_CMD_TC(tc) | FW_PFVF_CMD_NVI(vi) | c.tc_to_nexactf = htonl(FW_PFVF_CMD_TC_V(tc) | FW_PFVF_CMD_NVI_V(vi) |
FW_PFVF_CMD_NEXACTF(nexact)); FW_PFVF_CMD_NEXACTF_V(nexact));
c.r_caps_to_nethctrl = htonl(FW_PFVF_CMD_R_CAPS(rcaps) | c.r_caps_to_nethctrl = htonl(FW_PFVF_CMD_R_CAPS_V(rcaps) |
FW_PFVF_CMD_WX_CAPS(wxcaps) | FW_PFVF_CMD_WX_CAPS_V(wxcaps) |
FW_PFVF_CMD_NETHCTRL(txq_eth_ctrl)); FW_PFVF_CMD_NETHCTRL_V(txq_eth_ctrl));
return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
} }
......
...@@ -1030,10 +1030,10 @@ static int set_rxq_intr_params(struct adapter *adapter, struct sge_rspq *rspq, ...@@ -1030,10 +1030,10 @@ static int set_rxq_intr_params(struct adapter *adapter, struct sge_rspq *rspq,
pktcnt_idx = closest_thres(&adapter->sge, cnt); pktcnt_idx = closest_thres(&adapter->sge, cnt);
if (rspq->desc && rspq->pktcnt_idx != pktcnt_idx) { if (rspq->desc && rspq->pktcnt_idx != pktcnt_idx) {
v = FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) | v = FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DMAQ) |
FW_PARAMS_PARAM_X( FW_PARAMS_PARAM_X_V(
FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH) | FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH) |
FW_PARAMS_PARAM_YZ(rspq->cntxt_id); FW_PARAMS_PARAM_YZ_V(rspq->cntxt_id);
err = t4vf_set_params(adapter, 1, &v, &pktcnt_idx); err = t4vf_set_params(adapter, 1, &v, &pktcnt_idx);
if (err) if (err)
return err; return err;
...@@ -2184,8 +2184,8 @@ static int adap_init0(struct adapter *adapter) ...@@ -2184,8 +2184,8 @@ static int adap_init0(struct adapter *adapter)
* firmware won't understand this and we'll just get * firmware won't understand this and we'll just get
* unencapsulated messages ... * unencapsulated messages ...
*/ */
param = FW_PARAMS_MNEM(FW_PARAMS_MNEM_PFVF) | param = FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_PFVF) |
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_PFVF_CPLFW4MSG_ENCAP); FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_PFVF_CPLFW4MSG_ENCAP);
val = 1; val = 1;
(void) t4vf_set_params(adapter, 1, &param, &val); (void) t4vf_set_params(adapter, 1, &param, &val);
......
...@@ -443,20 +443,20 @@ int t4vf_get_sge_params(struct adapter *adapter) ...@@ -443,20 +443,20 @@ int t4vf_get_sge_params(struct adapter *adapter)
u32 params[7], vals[7]; u32 params[7], vals[7];
int v; int v;
params[0] = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | params[0] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_REG) |
FW_PARAMS_PARAM_XYZ(SGE_CONTROL)); FW_PARAMS_PARAM_XYZ_V(SGE_CONTROL));
params[1] = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | params[1] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_REG) |
FW_PARAMS_PARAM_XYZ(SGE_HOST_PAGE_SIZE)); FW_PARAMS_PARAM_XYZ_V(SGE_HOST_PAGE_SIZE));
params[2] = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | params[2] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_REG) |
FW_PARAMS_PARAM_XYZ(SGE_FL_BUFFER_SIZE0)); FW_PARAMS_PARAM_XYZ_V(SGE_FL_BUFFER_SIZE0));
params[3] = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | params[3] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_REG) |
FW_PARAMS_PARAM_XYZ(SGE_FL_BUFFER_SIZE1)); FW_PARAMS_PARAM_XYZ_V(SGE_FL_BUFFER_SIZE1));
params[4] = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | params[4] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_REG) |
FW_PARAMS_PARAM_XYZ(SGE_TIMER_VALUE_0_AND_1)); FW_PARAMS_PARAM_XYZ_V(SGE_TIMER_VALUE_0_AND_1));
params[5] = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | params[5] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_REG) |
FW_PARAMS_PARAM_XYZ(SGE_TIMER_VALUE_2_AND_3)); FW_PARAMS_PARAM_XYZ_V(SGE_TIMER_VALUE_2_AND_3));
params[6] = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | params[6] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_REG) |
FW_PARAMS_PARAM_XYZ(SGE_TIMER_VALUE_4_AND_5)); FW_PARAMS_PARAM_XYZ_V(SGE_TIMER_VALUE_4_AND_5));
v = t4vf_query_params(adapter, 7, params, vals); v = t4vf_query_params(adapter, 7, params, vals);
if (v) if (v)
return v; return v;
...@@ -479,8 +479,8 @@ int t4vf_get_sge_params(struct adapter *adapter) ...@@ -479,8 +479,8 @@ int t4vf_get_sge_params(struct adapter *adapter)
* right value. * right value.
*/ */
if (!is_t4(adapter->params.chip)) { if (!is_t4(adapter->params.chip)) {
params[0] = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | params[0] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_REG) |
FW_PARAMS_PARAM_XYZ(SGE_CONTROL2_A)); FW_PARAMS_PARAM_XYZ_V(SGE_CONTROL2_A));
v = t4vf_query_params(adapter, 1, params, vals); v = t4vf_query_params(adapter, 1, params, vals);
if (v != FW_SUCCESS) { if (v != FW_SUCCESS) {
dev_err(adapter->pdev_dev, dev_err(adapter->pdev_dev,
...@@ -491,10 +491,10 @@ int t4vf_get_sge_params(struct adapter *adapter) ...@@ -491,10 +491,10 @@ int t4vf_get_sge_params(struct adapter *adapter)
sge_params->sge_control2 = vals[0]; sge_params->sge_control2 = vals[0];
} }
params[0] = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | params[0] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_REG) |
FW_PARAMS_PARAM_XYZ(SGE_INGRESS_RX_THRESHOLD)); FW_PARAMS_PARAM_XYZ_V(SGE_INGRESS_RX_THRESHOLD));
params[1] = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | params[1] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_REG) |
FW_PARAMS_PARAM_XYZ(SGE_CONM_CTRL)); FW_PARAMS_PARAM_XYZ_V(SGE_CONM_CTRL));
v = t4vf_query_params(adapter, 2, params, vals); v = t4vf_query_params(adapter, 2, params, vals);
if (v) if (v)
return v; return v;
...@@ -517,8 +517,8 @@ int t4vf_get_vpd_params(struct adapter *adapter) ...@@ -517,8 +517,8 @@ int t4vf_get_vpd_params(struct adapter *adapter)
u32 params[7], vals[7]; u32 params[7], vals[7];
int v; int v;
params[0] = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | params[0] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DEV) |
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_CCLK)); FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_DEV_CCLK));
v = t4vf_query_params(adapter, 1, params, vals); v = t4vf_query_params(adapter, 1, params, vals);
if (v) if (v)
return v; return v;
...@@ -540,10 +540,10 @@ int t4vf_get_dev_params(struct adapter *adapter) ...@@ -540,10 +540,10 @@ int t4vf_get_dev_params(struct adapter *adapter)
u32 params[7], vals[7]; u32 params[7], vals[7];
int v; int v;
params[0] = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | params[0] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DEV) |
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_FWREV)); FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_DEV_FWREV));
params[1] = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | params[1] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DEV) |
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_TPREV)); FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_DEV_TPREV));
v = t4vf_query_params(adapter, 2, params, vals); v = t4vf_query_params(adapter, 2, params, vals);
if (v) if (v)
return v; return v;
...@@ -659,22 +659,22 @@ int t4vf_get_vfres(struct adapter *adapter) ...@@ -659,22 +659,22 @@ int t4vf_get_vfres(struct adapter *adapter)
* Extract VF resource limits and return success. * Extract VF resource limits and return success.
*/ */
word = be32_to_cpu(rpl.niqflint_niq); word = be32_to_cpu(rpl.niqflint_niq);
vfres->niqflint = FW_PFVF_CMD_NIQFLINT_GET(word); vfres->niqflint = FW_PFVF_CMD_NIQFLINT_G(word);
vfres->niq = FW_PFVF_CMD_NIQ_GET(word); vfres->niq = FW_PFVF_CMD_NIQ_G(word);
word = be32_to_cpu(rpl.type_to_neq); word = be32_to_cpu(rpl.type_to_neq);
vfres->neq = FW_PFVF_CMD_NEQ_GET(word); vfres->neq = FW_PFVF_CMD_NEQ_G(word);
vfres->pmask = FW_PFVF_CMD_PMASK_GET(word); vfres->pmask = FW_PFVF_CMD_PMASK_G(word);
word = be32_to_cpu(rpl.tc_to_nexactf); word = be32_to_cpu(rpl.tc_to_nexactf);
vfres->tc = FW_PFVF_CMD_TC_GET(word); vfres->tc = FW_PFVF_CMD_TC_G(word);
vfres->nvi = FW_PFVF_CMD_NVI_GET(word); vfres->nvi = FW_PFVF_CMD_NVI_G(word);
vfres->nexactf = FW_PFVF_CMD_NEXACTF_GET(word); vfres->nexactf = FW_PFVF_CMD_NEXACTF_G(word);
word = be32_to_cpu(rpl.r_caps_to_nethctrl); word = be32_to_cpu(rpl.r_caps_to_nethctrl);
vfres->r_caps = FW_PFVF_CMD_R_CAPS_GET(word); vfres->r_caps = FW_PFVF_CMD_R_CAPS_G(word);
vfres->wx_caps = FW_PFVF_CMD_WX_CAPS_GET(word); vfres->wx_caps = FW_PFVF_CMD_WX_CAPS_G(word);
vfres->nethctrl = FW_PFVF_CMD_NETHCTRL_GET(word); vfres->nethctrl = FW_PFVF_CMD_NETHCTRL_G(word);
return 0; return 0;
} }
......
...@@ -1170,7 +1170,7 @@ csio_hw_fw_halt(struct csio_hw *hw, uint32_t mbox, int32_t force) ...@@ -1170,7 +1170,7 @@ csio_hw_fw_halt(struct csio_hw *hw, uint32_t mbox, int32_t force)
} }
csio_mb_reset(hw, mbp, CSIO_MB_DEFAULT_TMO, csio_mb_reset(hw, mbp, CSIO_MB_DEFAULT_TMO,
PIORSTMODE | PIORST, FW_RESET_CMD_HALT(1), PIORSTMODE | PIORST, FW_RESET_CMD_HALT_F,
NULL); NULL);
if (csio_mb_issue(hw, mbp)) { if (csio_mb_issue(hw, mbp)) {
...@@ -1374,9 +1374,9 @@ csio_hw_fw_config_file(struct csio_hw *hw, ...@@ -1374,9 +1374,9 @@ csio_hw_fw_config_file(struct csio_hw *hw,
FW_CMD_REQUEST_F | FW_CMD_REQUEST_F |
FW_CMD_READ_F); FW_CMD_READ_F);
caps_cmd->cfvalid_to_len16 = caps_cmd->cfvalid_to_len16 =
htonl(FW_CAPS_CONFIG_CMD_CFVALID | htonl(FW_CAPS_CONFIG_CMD_CFVALID_F |
FW_CAPS_CONFIG_CMD_MEMTYPE_CF(mtype) | FW_CAPS_CONFIG_CMD_MEMTYPE_CF_V(mtype) |
FW_CAPS_CONFIG_CMD_MEMADDR64K_CF(maddr >> 16) | FW_CAPS_CONFIG_CMD_MEMADDR64K_CF_V(maddr >> 16) |
FW_LEN16(*caps_cmd)); FW_LEN16(*caps_cmd));
if (csio_mb_issue(hw, mbp)) { if (csio_mb_issue(hw, mbp)) {
...@@ -1723,8 +1723,8 @@ csio_hw_check_fwconfig(struct csio_hw *hw, u32 *param) ...@@ -1723,8 +1723,8 @@ csio_hw_check_fwconfig(struct csio_hw *hw, u32 *param)
* Find out whether we're dealing with a version of * Find out whether we're dealing with a version of
* the firmware which has configuration file support. * the firmware which has configuration file support.
*/ */
_param[0] = (FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | _param[0] = (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DEV) |
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_CF)); FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_DEV_CF));
csio_mb_params(hw, mbp, CSIO_MB_DEFAULT_TMO, hw->pfn, 0, csio_mb_params(hw, mbp, CSIO_MB_DEFAULT_TMO, hw->pfn, 0,
ARRAY_SIZE(_param), _param, NULL, false, NULL); ARRAY_SIZE(_param), _param, NULL, false, NULL);
...@@ -1781,8 +1781,8 @@ csio_hw_flash_config(struct csio_hw *hw, u32 *fw_cfg_param, char *path) ...@@ -1781,8 +1781,8 @@ csio_hw_flash_config(struct csio_hw *hw, u32 *fw_cfg_param, char *path)
goto leave; goto leave;
} }
mtype = FW_PARAMS_PARAM_Y_GET(*fw_cfg_param); mtype = FW_PARAMS_PARAM_Y_G(*fw_cfg_param);
maddr = FW_PARAMS_PARAM_Z_GET(*fw_cfg_param) << 16; maddr = FW_PARAMS_PARAM_Z_G(*fw_cfg_param) << 16;
ret = csio_memory_write(hw, mtype, maddr, ret = csio_memory_write(hw, mtype, maddr,
cf->size + value_to_add, cfg_data); cf->size + value_to_add, cfg_data);
...@@ -1871,8 +1871,8 @@ csio_hw_use_fwconfig(struct csio_hw *hw, int reset, u32 *fw_cfg_param) ...@@ -1871,8 +1871,8 @@ csio_hw_use_fwconfig(struct csio_hw *hw, int reset, u32 *fw_cfg_param)
goto bye; goto bye;
} }
} else { } else {
mtype = FW_PARAMS_PARAM_Y_GET(*fw_cfg_param); mtype = FW_PARAMS_PARAM_Y_G(*fw_cfg_param);
maddr = FW_PARAMS_PARAM_Z_GET(*fw_cfg_param) << 16; maddr = FW_PARAMS_PARAM_Z_G(*fw_cfg_param) << 16;
using_flash = 0; using_flash = 0;
} }
......
...@@ -85,13 +85,13 @@ csio_mb_hello(struct csio_hw *hw, struct csio_mb *mbp, uint32_t tmo, ...@@ -85,13 +85,13 @@ csio_mb_hello(struct csio_hw *hw, struct csio_mb *mbp, uint32_t tmo,
FW_CMD_REQUEST_F | FW_CMD_WRITE_F); FW_CMD_REQUEST_F | FW_CMD_WRITE_F);
cmdp->retval_len16 = htonl(FW_CMD_LEN16_V(sizeof(*cmdp) / 16)); cmdp->retval_len16 = htonl(FW_CMD_LEN16_V(sizeof(*cmdp) / 16));
cmdp->err_to_clearinit = htonl( cmdp->err_to_clearinit = htonl(
FW_HELLO_CMD_MASTERDIS(master == CSIO_MASTER_CANT) | FW_HELLO_CMD_MASTERDIS_V(master == CSIO_MASTER_CANT) |
FW_HELLO_CMD_MASTERFORCE(master == CSIO_MASTER_MUST) | FW_HELLO_CMD_MASTERFORCE_V(master == CSIO_MASTER_MUST) |
FW_HELLO_CMD_MBMASTER(master == CSIO_MASTER_MUST ? FW_HELLO_CMD_MBMASTER_V(master == CSIO_MASTER_MUST ?
m_mbox : FW_HELLO_CMD_MBMASTER_MASK) | m_mbox : FW_HELLO_CMD_MBMASTER_M) |
FW_HELLO_CMD_MBASYNCNOT(a_mbox) | FW_HELLO_CMD_MBASYNCNOT_V(a_mbox) |
FW_HELLO_CMD_STAGE(fw_hello_cmd_stage_os) | FW_HELLO_CMD_STAGE_V(fw_hello_cmd_stage_os) |
FW_HELLO_CMD_CLEARINIT); FW_HELLO_CMD_CLEARINIT_F);
} }
...@@ -118,11 +118,11 @@ csio_mb_process_hello_rsp(struct csio_hw *hw, struct csio_mb *mbp, ...@@ -118,11 +118,11 @@ csio_mb_process_hello_rsp(struct csio_hw *hw, struct csio_mb *mbp,
hw->fwrev = ntohl(rsp->fwrev); hw->fwrev = ntohl(rsp->fwrev);
value = ntohl(rsp->err_to_clearinit); value = ntohl(rsp->err_to_clearinit);
*mpfn = FW_HELLO_CMD_MBMASTER_GET(value); *mpfn = FW_HELLO_CMD_MBMASTER_G(value);
if (value & FW_HELLO_CMD_INIT) if (value & FW_HELLO_CMD_INIT_F)
*state = CSIO_DEV_STATE_INIT; *state = CSIO_DEV_STATE_INIT;
else if (value & FW_HELLO_CMD_ERR) else if (value & FW_HELLO_CMD_ERR_F)
*state = CSIO_DEV_STATE_ERR; *state = CSIO_DEV_STATE_ERR;
else else
*state = CSIO_DEV_STATE_UNINIT; *state = CSIO_DEV_STATE_UNINIT;
...@@ -205,8 +205,8 @@ csio_mb_params(struct csio_hw *hw, struct csio_mb *mbp, uint32_t tmo, ...@@ -205,8 +205,8 @@ csio_mb_params(struct csio_hw *hw, struct csio_mb *mbp, uint32_t tmo,
cmdp->op_to_vfn = htonl(FW_CMD_OP_V(FW_PARAMS_CMD) | cmdp->op_to_vfn = htonl(FW_CMD_OP_V(FW_PARAMS_CMD) |
FW_CMD_REQUEST_F | FW_CMD_REQUEST_F |
(wr ? FW_CMD_WRITE_F : FW_CMD_READ_F) | (wr ? FW_CMD_WRITE_F : FW_CMD_READ_F) |
FW_PARAMS_CMD_PFN(pf) | FW_PARAMS_CMD_PFN_V(pf) |
FW_PARAMS_CMD_VFN(vf)); FW_PARAMS_CMD_VFN_V(vf));
cmdp->retval_len16 = htonl(FW_CMD_LEN16_V(sizeof(*cmdp) / 16)); cmdp->retval_len16 = htonl(FW_CMD_LEN16_V(sizeof(*cmdp) / 16));
/* Write Params */ /* Write Params */
...@@ -274,11 +274,11 @@ csio_mb_ldst(struct csio_hw *hw, struct csio_mb *mbp, uint32_t tmo, int reg) ...@@ -274,11 +274,11 @@ csio_mb_ldst(struct csio_hw *hw, struct csio_mb *mbp, uint32_t tmo, int reg)
htonl(FW_CMD_OP_V(FW_LDST_CMD) | htonl(FW_CMD_OP_V(FW_LDST_CMD) |
FW_CMD_REQUEST_F | FW_CMD_REQUEST_F |
FW_CMD_READ_F | FW_CMD_READ_F |
FW_LDST_CMD_ADDRSPACE(FW_LDST_ADDRSPC_FUNC_PCIE)); FW_LDST_CMD_ADDRSPACE_V(FW_LDST_ADDRSPC_FUNC_PCIE));
ldst_cmd->cycles_to_len16 = htonl(FW_LEN16(struct fw_ldst_cmd)); ldst_cmd->cycles_to_len16 = htonl(FW_LEN16(struct fw_ldst_cmd));
ldst_cmd->u.pcie.select_naccess = FW_LDST_CMD_NACCESS(1); ldst_cmd->u.pcie.select_naccess = FW_LDST_CMD_NACCESS_V(1);
ldst_cmd->u.pcie.ctrl_to_fn = ldst_cmd->u.pcie.ctrl_to_fn =
(FW_LDST_CMD_LC | FW_LDST_CMD_FN(hw->pfn)); (FW_LDST_CMD_LC_F | FW_LDST_CMD_FN_V(hw->pfn));
ldst_cmd->u.pcie.r = (uint8_t)reg; ldst_cmd->u.pcie.r = (uint8_t)reg;
} }
......
...@@ -79,14 +79,14 @@ enum csio_dev_state { ...@@ -79,14 +79,14 @@ enum csio_dev_state {
}; };
#define FW_PARAM_DEV(param) \ #define FW_PARAM_DEV(param) \
(FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | \ (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_DEV) | \
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_##param)) FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_DEV_##param))
#define FW_PARAM_PFVF(param) \ #define FW_PARAM_PFVF(param) \
(FW_PARAMS_MNEM(FW_PARAMS_MNEM_PFVF) | \ (FW_PARAMS_MNEM_V(FW_PARAMS_MNEM_PFVF) | \
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_PFVF_##param)| \ FW_PARAMS_PARAM_X_V(FW_PARAMS_PARAM_PFVF_##param)| \
FW_PARAMS_PARAM_Y(0) | \ FW_PARAMS_PARAM_Y_V(0) | \
FW_PARAMS_PARAM_Z(0)) FW_PARAMS_PARAM_Z_V(0))
enum { enum {
PAUSE_RX = 1 << 0, PAUSE_RX = 1 << 0,
......
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