Lines Matching refs:c

2865 	unsigned int i, c, left, val, offset = addr & 0xff;  in t4_write_flash()  local
2876 for (left = n; left; left -= c) { in t4_write_flash()
2877 c = min(left, 4U); in t4_write_flash()
2878 for (val = 0, i = 0; i < c; ++i) in t4_write_flash()
2881 ret = sf1_write(adapter, c, c != left, 1, val); in t4_write_flash()
3057 int k, int c) in should_install_fs_fw()
3066 if (k > c) { in should_install_fs_fw()
3076 FW_HDR_FW_VER_MAJOR_G(c), FW_HDR_FW_VER_MINOR_G(c), in should_install_fs_fw()
3077 FW_HDR_FW_VER_MICRO_G(c), FW_HDR_FW_VER_BUILD_G(c), reason, in should_install_fs_fw()
3140 uint32_t d, c, k; in t4_prep_fw() local
3143 c = be32_to_cpu(card_fw->fw_ver); in t4_prep_fw()
3153 FW_HDR_FW_VER_MAJOR_G(c), FW_HDR_FW_VER_MINOR_G(c), in t4_prep_fw()
3154 FW_HDR_FW_VER_MICRO_G(c), FW_HDR_FW_VER_BUILD_G(c), in t4_prep_fw()
3473 struct fw_params_cmd c; in t4_fwcache() local
3475 memset(&c, 0, sizeof(c)); in t4_fwcache()
3476 c.op_to_vfn = in t4_fwcache()
3481 c.retval_len16 = cpu_to_be32(FW_LEN16(c)); in t4_fwcache()
3482 c.param[0].mnem = in t4_fwcache()
3485 c.param[0].val = (__force __be32)op; in t4_fwcache()
3487 return t4_wr_mbox(adap, adap->mbox, &c, sizeof(c), NULL); in t4_fwcache()
3580 struct fw_port_cmd c; in t4_link_l1cfg() local
3589 memset(&c, 0, sizeof(c)); in t4_link_l1cfg()
3590 c.op_to_portid = cpu_to_be32(FW_CMD_OP_V(FW_PORT_CMD) | in t4_link_l1cfg()
3593 c.action_to_len16 = in t4_link_l1cfg()
3595 FW_LEN16(c)); in t4_link_l1cfg()
3598 c.u.l1cfg.rcap = cpu_to_be32((lc->supported & ADVERT_MASK) | in t4_link_l1cfg()
3602 c.u.l1cfg.rcap = cpu_to_be32(lc->requested_speed | fc | mdi); in t4_link_l1cfg()
3605 c.u.l1cfg.rcap = cpu_to_be32(lc->advertising | fc | mdi); in t4_link_l1cfg()
3607 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); in t4_link_l1cfg()
3620 struct fw_port_cmd c; in t4_restart_aneg() local
3622 memset(&c, 0, sizeof(c)); in t4_restart_aneg()
3623 c.op_to_portid = cpu_to_be32(FW_CMD_OP_V(FW_PORT_CMD) | in t4_restart_aneg()
3626 c.action_to_len16 = in t4_restart_aneg()
3628 FW_LEN16(c)); in t4_restart_aneg()
3629 c.u.l1cfg.rcap = cpu_to_be32(FW_PORT_CAP_ANEG); in t4_restart_aneg()
3630 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); in t4_restart_aneg()
4524 struct fw_rss_glb_config_cmd c; in t4_config_glbl_rss() local
4526 memset(&c, 0, sizeof(c)); in t4_config_glbl_rss()
4527 c.op_to_write = cpu_to_be32(FW_CMD_OP_V(FW_RSS_GLB_CONFIG_CMD) | in t4_config_glbl_rss()
4529 c.retval_len16 = cpu_to_be32(FW_LEN16(c)); in t4_config_glbl_rss()
4531 c.u.manual.mode_pkd = in t4_config_glbl_rss()
4534 c.u.basicvirtual.mode_pkd = in t4_config_glbl_rss()
4536 c.u.basicvirtual.synmapen_to_hashtoeplitz = cpu_to_be32(flags); in t4_config_glbl_rss()
4539 return t4_wr_mbox(adapter, mbox, &c, sizeof(c), NULL); in t4_config_glbl_rss()
4555 struct fw_rss_vi_config_cmd c; in t4_config_vi_rss() local
4557 memset(&c, 0, sizeof(c)); in t4_config_vi_rss()
4558 c.op_to_viid = cpu_to_be32(FW_CMD_OP_V(FW_RSS_VI_CONFIG_CMD) | in t4_config_vi_rss()
4561 c.retval_len16 = cpu_to_be32(FW_LEN16(c)); in t4_config_vi_rss()
4562 c.u.basicvirtual.defaultq_to_udpen = cpu_to_be32(flags | in t4_config_vi_rss()
4564 return t4_wr_mbox(adapter, mbox, &c, sizeof(c), NULL); in t4_config_vi_rss()
4617 struct fw_ldst_cmd c; in t4_fw_tp_pio_rw() local
4620 memset(&c, 0, sizeof(c)); in t4_fw_tp_pio_rw()
4621 c.op_to_addrspace = cpu_to_be32(FW_CMD_OP_V(FW_LDST_CMD) | in t4_fw_tp_pio_rw()
4626 c.cycles_to_len16 = cpu_to_be32(FW_LEN16(c)); in t4_fw_tp_pio_rw()
4628 c.u.addrval.addr = cpu_to_be32(start_index + i); in t4_fw_tp_pio_rw()
4629 c.u.addrval.val = rw ? 0 : cpu_to_be32(vals[i]); in t4_fw_tp_pio_rw()
4630 ret = t4_wr_mbox(adap, adap->mbox, &c, sizeof(c), &c); in t4_fw_tp_pio_rw()
4632 vals[i] = be32_to_cpu(c.u.addrval.val); in t4_fw_tp_pio_rw()
5533 struct fw_ldst_cmd c; in t4_fwaddrspace_write() local
5535 memset(&c, 0, sizeof(c)); in t4_fwaddrspace_write()
5537 c.op_to_addrspace = cpu_to_be32(FW_CMD_OP_V(FW_LDST_CMD) | in t4_fwaddrspace_write()
5541 c.cycles_to_len16 = cpu_to_be32(FW_LEN16(c)); in t4_fwaddrspace_write()
5542 c.u.addrval.addr = cpu_to_be32(addr); in t4_fwaddrspace_write()
5543 c.u.addrval.val = cpu_to_be32(val); in t4_fwaddrspace_write()
5545 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); in t4_fwaddrspace_write()
5564 struct fw_ldst_cmd c; in t4_mdio_rd() local
5566 memset(&c, 0, sizeof(c)); in t4_mdio_rd()
5568 c.op_to_addrspace = cpu_to_be32(FW_CMD_OP_V(FW_LDST_CMD) | in t4_mdio_rd()
5571 c.cycles_to_len16 = cpu_to_be32(FW_LEN16(c)); in t4_mdio_rd()
5572 c.u.mdio.paddr_mmd = cpu_to_be16(FW_LDST_CMD_PADDR_V(phy_addr) | in t4_mdio_rd()
5574 c.u.mdio.raddr = cpu_to_be16(reg); in t4_mdio_rd()
5576 ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); in t4_mdio_rd()
5578 *valp = be16_to_cpu(c.u.mdio.rval); in t4_mdio_rd()
5597 struct fw_ldst_cmd c; in t4_mdio_wr() local
5599 memset(&c, 0, sizeof(c)); in t4_mdio_wr()
5601 c.op_to_addrspace = cpu_to_be32(FW_CMD_OP_V(FW_LDST_CMD) | in t4_mdio_wr()
5604 c.cycles_to_len16 = cpu_to_be32(FW_LEN16(c)); in t4_mdio_wr()
5605 c.u.mdio.paddr_mmd = cpu_to_be16(FW_LDST_CMD_PADDR_V(phy_addr) | in t4_mdio_wr()
5607 c.u.mdio.raddr = cpu_to_be16(reg); in t4_mdio_wr()
5608 c.u.mdio.rval = cpu_to_be16(val); in t4_mdio_wr()
5610 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); in t4_mdio_wr()
5731 struct fw_ldst_cmd c; in t4_sge_ctxt_flush() local
5733 memset(&c, 0, sizeof(c)); in t4_sge_ctxt_flush()
5735 c.op_to_addrspace = cpu_to_be32(FW_CMD_OP_V(FW_LDST_CMD) | in t4_sge_ctxt_flush()
5738 c.cycles_to_len16 = cpu_to_be32(FW_LEN16(c)); in t4_sge_ctxt_flush()
5739 c.u.idctxt.msg_ctxtflush = cpu_to_be32(FW_LDST_CMD_CTXTFLUSH_F); in t4_sge_ctxt_flush()
5741 ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); in t4_sge_ctxt_flush()
5760 struct fw_hello_cmd c; in t4_fw_hello() local
5766 memset(&c, 0, sizeof(c)); in t4_fw_hello()
5767 INIT_CMD(c, HELLO, WRITE); in t4_fw_hello()
5768 c.err_to_clearinit = cpu_to_be32( in t4_fw_hello()
5784 ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); in t4_fw_hello()
5793 v = be32_to_cpu(c.err_to_clearinit); in t4_fw_hello()
5884 struct fw_bye_cmd c; in t4_fw_bye() local
5886 memset(&c, 0, sizeof(c)); in t4_fw_bye()
5887 INIT_CMD(c, BYE, WRITE); in t4_fw_bye()
5888 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); in t4_fw_bye()
5901 struct fw_initialize_cmd c; in t4_early_init() local
5903 memset(&c, 0, sizeof(c)); in t4_early_init()
5904 INIT_CMD(c, INITIALIZE, WRITE); in t4_early_init()
5905 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); in t4_early_init()
5918 struct fw_reset_cmd c; in t4_fw_reset() local
5920 memset(&c, 0, sizeof(c)); in t4_fw_reset()
5921 INIT_CMD(c, RESET, WRITE); in t4_fw_reset()
5922 c.val = cpu_to_be32(reset); in t4_fw_reset()
5923 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); in t4_fw_reset()
5951 struct fw_reset_cmd c; in t4_fw_halt() local
5953 memset(&c, 0, sizeof(c)); in t4_fw_halt()
5954 INIT_CMD(c, RESET, WRITE); in t4_fw_halt()
5955 c.val = cpu_to_be32(PIORST_F | PIORSTMODE_F); in t4_fw_halt()
5956 c.halt_pkd = cpu_to_be32(FW_RESET_CMD_HALT_F); in t4_fw_halt()
5957 ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); in t4_fw_halt()
6218 struct fw_initialize_cmd c; in t4_fw_initialize() local
6220 memset(&c, 0, sizeof(c)); in t4_fw_initialize()
6221 INIT_CMD(c, INITIALIZE, WRITE); in t4_fw_initialize()
6222 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); in t4_fw_initialize()
6244 struct fw_params_cmd c; in t4_query_params_rw() local
6245 __be32 *p = &c.param[0].mnem; in t4_query_params_rw()
6250 memset(&c, 0, sizeof(c)); in t4_query_params_rw()
6251 c.op_to_vfn = cpu_to_be32(FW_CMD_OP_V(FW_PARAMS_CMD) | in t4_query_params_rw()
6255 c.retval_len16 = cpu_to_be32(FW_LEN16(c)); in t4_query_params_rw()
6264 ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); in t4_query_params_rw()
6266 for (i = 0, p = &c.param[0].val; i < nparams; i++, p += 2) in t4_query_params_rw()
6297 struct fw_params_cmd c; in t4_set_params_timeout() local
6298 __be32 *p = &c.param[0].mnem; in t4_set_params_timeout()
6303 memset(&c, 0, sizeof(c)); in t4_set_params_timeout()
6304 c.op_to_vfn = cpu_to_be32(FW_CMD_OP_V(FW_PARAMS_CMD) | in t4_set_params_timeout()
6308 c.retval_len16 = cpu_to_be32(FW_LEN16(c)); in t4_set_params_timeout()
6315 return t4_wr_mbox_timeout(adap, mbox, &c, sizeof(c), NULL, timeout); in t4_set_params_timeout()
6366 struct fw_pfvf_cmd c; in t4_cfg_pfvf() local
6368 memset(&c, 0, sizeof(c)); in t4_cfg_pfvf()
6369 c.op_to_vfn = cpu_to_be32(FW_CMD_OP_V(FW_PFVF_CMD) | FW_CMD_REQUEST_F | in t4_cfg_pfvf()
6372 c.retval_len16 = cpu_to_be32(FW_LEN16(c)); in t4_cfg_pfvf()
6373 c.niqflint_niq = cpu_to_be32(FW_PFVF_CMD_NIQFLINT_V(rxqi) | in t4_cfg_pfvf()
6375 c.type_to_neq = cpu_to_be32(FW_PFVF_CMD_CMASK_V(cmask) | in t4_cfg_pfvf()
6378 c.tc_to_nexactf = cpu_to_be32(FW_PFVF_CMD_TC_V(tc) | in t4_cfg_pfvf()
6381 c.r_caps_to_nethctrl = cpu_to_be32(FW_PFVF_CMD_R_CAPS_V(rcaps) | in t4_cfg_pfvf()
6384 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); in t4_cfg_pfvf()
6409 struct fw_vi_cmd c; in t4_alloc_vi() local
6411 memset(&c, 0, sizeof(c)); in t4_alloc_vi()
6412 c.op_to_vfn = cpu_to_be32(FW_CMD_OP_V(FW_VI_CMD) | FW_CMD_REQUEST_F | in t4_alloc_vi()
6415 c.alloc_to_len16 = cpu_to_be32(FW_VI_CMD_ALLOC_F | FW_LEN16(c)); in t4_alloc_vi()
6416 c.portid_pkd = FW_VI_CMD_PORTID_V(port); in t4_alloc_vi()
6417 c.nmac = nmac - 1; in t4_alloc_vi()
6419 ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); in t4_alloc_vi()
6424 memcpy(mac, c.mac, sizeof(c.mac)); in t4_alloc_vi()
6427 memcpy(mac + 24, c.nmac3, sizeof(c.nmac3)); in t4_alloc_vi()
6429 memcpy(mac + 18, c.nmac2, sizeof(c.nmac2)); in t4_alloc_vi()
6431 memcpy(mac + 12, c.nmac1, sizeof(c.nmac1)); in t4_alloc_vi()
6433 memcpy(mac + 6, c.nmac0, sizeof(c.nmac0)); in t4_alloc_vi()
6437 *rss_size = FW_VI_CMD_RSSSIZE_G(be16_to_cpu(c.rsssize_pkd)); in t4_alloc_vi()
6438 return FW_VI_CMD_VIID_G(be16_to_cpu(c.type_viid)); in t4_alloc_vi()
6454 struct fw_vi_cmd c; in t4_free_vi() local
6456 memset(&c, 0, sizeof(c)); in t4_free_vi()
6457 c.op_to_vfn = cpu_to_be32(FW_CMD_OP_V(FW_VI_CMD) | in t4_free_vi()
6462 c.alloc_to_len16 = cpu_to_be32(FW_VI_CMD_FREE_F | FW_LEN16(c)); in t4_free_vi()
6463 c.type_viid = cpu_to_be16(FW_VI_CMD_VIID_V(viid)); in t4_free_vi()
6465 return t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); in t4_free_vi()
6486 struct fw_vi_rxmode_cmd c; in t4_set_rxmode() local
6500 memset(&c, 0, sizeof(c)); in t4_set_rxmode()
6501 c.op_to_viid = cpu_to_be32(FW_CMD_OP_V(FW_VI_RXMODE_CMD) | in t4_set_rxmode()
6504 c.retval_len16 = cpu_to_be32(FW_LEN16(c)); in t4_set_rxmode()
6505 c.mtu_to_vlanexen = in t4_set_rxmode()
6511 return t4_wr_mbox_meat(adap, mbox, &c, sizeof(c), NULL, sleep_ok); in t4_set_rxmode()
6541 struct fw_vi_mac_cmd c; in t4_alloc_mac_filt() local
6550 unsigned int fw_naddr = (rem < ARRAY_SIZE(c.u.exact) ? in t4_alloc_mac_filt()
6551 rem : ARRAY_SIZE(c.u.exact)); in t4_alloc_mac_filt()
6557 memset(&c, 0, sizeof(c)); in t4_alloc_mac_filt()
6558 c.op_to_viid = cpu_to_be32(FW_CMD_OP_V(FW_VI_MAC_CMD) | in t4_alloc_mac_filt()
6563 c.freemacs_to_len16 = in t4_alloc_mac_filt()
6567 for (i = 0, p = c.u.exact; i < fw_naddr; i++, p++) { in t4_alloc_mac_filt()
6580 ret = t4_wr_mbox_meat(adap, mbox, &c, sizeof(c), &c, sleep_ok); in t4_alloc_mac_filt()
6584 for (i = 0, p = c.u.exact; i < fw_naddr; i++, p++) { in t4_alloc_mac_filt()
6631 struct fw_vi_mac_cmd c; in t4_change_mac() local
6632 struct fw_vi_mac_exact *p = c.u.exact; in t4_change_mac()
6639 memset(&c, 0, sizeof(c)); in t4_change_mac()
6640 c.op_to_viid = cpu_to_be32(FW_CMD_OP_V(FW_VI_MAC_CMD) | in t4_change_mac()
6643 c.freemacs_to_len16 = cpu_to_be32(FW_CMD_LEN16_V(1)); in t4_change_mac()
6649 ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); in t4_change_mac()
6672 struct fw_vi_mac_cmd c; in t4_set_addr_hash() local
6674 memset(&c, 0, sizeof(c)); in t4_set_addr_hash()
6675 c.op_to_viid = cpu_to_be32(FW_CMD_OP_V(FW_VI_MAC_CMD) | in t4_set_addr_hash()
6678 c.freemacs_to_len16 = cpu_to_be32(FW_VI_MAC_CMD_HASHVECEN_F | in t4_set_addr_hash()
6681 c.u.hash.hashvec = cpu_to_be64(vec); in t4_set_addr_hash()
6682 return t4_wr_mbox_meat(adap, mbox, &c, sizeof(c), NULL, sleep_ok); in t4_set_addr_hash()
6700 struct fw_vi_enable_cmd c; in t4_enable_vi_params() local
6702 memset(&c, 0, sizeof(c)); in t4_enable_vi_params()
6703 c.op_to_viid = cpu_to_be32(FW_CMD_OP_V(FW_VI_ENABLE_CMD) | in t4_enable_vi_params()
6706 c.ien_to_len16 = cpu_to_be32(FW_VI_ENABLE_CMD_IEN_V(rx_en) | in t4_enable_vi_params()
6709 FW_LEN16(c)); in t4_enable_vi_params()
6710 return t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), NULL); in t4_enable_vi_params()
6741 struct fw_vi_enable_cmd c; in t4_identify_port() local
6743 memset(&c, 0, sizeof(c)); in t4_identify_port()
6744 c.op_to_viid = cpu_to_be32(FW_CMD_OP_V(FW_VI_ENABLE_CMD) | in t4_identify_port()
6747 c.ien_to_len16 = cpu_to_be32(FW_VI_ENABLE_CMD_LED_F | FW_LEN16(c)); in t4_identify_port()
6748 c.blinkdur = cpu_to_be16(nblinks); in t4_identify_port()
6749 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); in t4_identify_port()
6769 struct fw_iq_cmd c; in t4_iq_free() local
6771 memset(&c, 0, sizeof(c)); in t4_iq_free()
6772 c.op_to_vfn = cpu_to_be32(FW_CMD_OP_V(FW_IQ_CMD) | FW_CMD_REQUEST_F | in t4_iq_free()
6775 c.alloc_to_len16 = cpu_to_be32(FW_IQ_CMD_FREE_F | FW_LEN16(c)); in t4_iq_free()
6776 c.type_to_iqandstindex = cpu_to_be32(FW_IQ_CMD_TYPE_V(iqtype)); in t4_iq_free()
6777 c.iqid = cpu_to_be16(iqid); in t4_iq_free()
6778 c.fl0id = cpu_to_be16(fl0id); in t4_iq_free()
6779 c.fl1id = cpu_to_be16(fl1id); in t4_iq_free()
6780 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); in t4_iq_free()
6796 struct fw_eq_eth_cmd c; in t4_eth_eq_free() local
6798 memset(&c, 0, sizeof(c)); in t4_eth_eq_free()
6799 c.op_to_vfn = cpu_to_be32(FW_CMD_OP_V(FW_EQ_ETH_CMD) | in t4_eth_eq_free()
6803 c.alloc_to_len16 = cpu_to_be32(FW_EQ_ETH_CMD_FREE_F | FW_LEN16(c)); in t4_eth_eq_free()
6804 c.eqid_pkd = cpu_to_be32(FW_EQ_ETH_CMD_EQID_V(eqid)); in t4_eth_eq_free()
6805 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); in t4_eth_eq_free()
6821 struct fw_eq_ctrl_cmd c; in t4_ctrl_eq_free() local
6823 memset(&c, 0, sizeof(c)); in t4_ctrl_eq_free()
6824 c.op_to_vfn = cpu_to_be32(FW_CMD_OP_V(FW_EQ_CTRL_CMD) | in t4_ctrl_eq_free()
6828 c.alloc_to_len16 = cpu_to_be32(FW_EQ_CTRL_CMD_FREE_F | FW_LEN16(c)); in t4_ctrl_eq_free()
6829 c.cmpliqid_eqid = cpu_to_be32(FW_EQ_CTRL_CMD_EQID_V(eqid)); in t4_ctrl_eq_free()
6830 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); in t4_ctrl_eq_free()
6846 struct fw_eq_ofld_cmd c; in t4_ofld_eq_free() local
6848 memset(&c, 0, sizeof(c)); in t4_ofld_eq_free()
6849 c.op_to_vfn = cpu_to_be32(FW_CMD_OP_V(FW_EQ_OFLD_CMD) | in t4_ofld_eq_free()
6853 c.alloc_to_len16 = cpu_to_be32(FW_EQ_OFLD_CMD_FREE_F | FW_LEN16(c)); in t4_ofld_eq_free()
6854 c.eqid_pkd = cpu_to_be32(FW_EQ_OFLD_CMD_EQID_V(eqid)); in t4_ofld_eq_free()
6855 return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); in t4_ofld_eq_free()
7416 struct fw_port_cmd c; in t4_port_init() local
7419 memset(&c, 0, sizeof(c)); in t4_port_init()
7429 c.op_to_portid = cpu_to_be32(FW_CMD_OP_V(FW_PORT_CMD) | in t4_port_init()
7432 c.action_to_len16 = cpu_to_be32( in t4_port_init()
7434 FW_LEN16(c)); in t4_port_init()
7435 ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); in t4_port_init()
7450 ret = be32_to_cpu(c.u.info.lstatus_to_modtype); in t4_port_init()
7466 init_link_config(&p->link_cfg, be16_to_cpu(c.u.info.pcap)); in t4_port_init()