src/dpdk/drivers/net/cxgbe/base/t4_hw.c
int t4_free_vi(struct adapter *adap, unsigned int mbox, unsigned int pf,
	       unsigned int vf, unsigned int viid)
{
	struct fw_vi_cmd c;

	memset(&c, 0, sizeof(c));
	c.op_to_vfn = cpu_to_be32(V_FW_CMD_OP(FW_VI_CMD) | F_FW_CMD_REQUEST |
				  F_FW_CMD_EXEC);
	if (is_pf4(adap))
		c.op_to_vfn |= cpu_to_be32(V_FW_VI_CMD_PFN(pf) |
					   V_FW_VI_CMD_VFN(vf));
	c.alloc_to_len16 = cpu_to_be32(F_FW_VI_CMD_FREE | FW_LEN16(c));
	c.type_to_viid = cpu_to_be16(V_FW_VI_CMD_VIID(viid));

	if (is_pf4(adap))
		return t4_wr_mbox(adap, mbox, &c, sizeof(c), &c);
	else
		return t4vf_wr_mbox(adap, &c, sizeof(c), NULL);
}
/**
 * t4_free_vi - free a virtual interface
 * @adap: the adapter
 * @mbox: mailbox to use for the FW command
 * @pf: the PF owning the VI
 * @vf: the VF owning the VI
 * @viid: virtual interface identifiler
 *
 * Free a previously allocated virtual interface.
 */


Free a previously allocated virtual interface.
Free a previously allocated virtual interface .
int t4_free_vi(struct adapter *adap, unsigned int mbox, unsigned int pf,
	       unsigned int vf, unsigned int viid)
{
	struct fw_vi_cmd c;
	memset(&c, 0, sizeof(c));
	c.op_to_vfn = cpu_to_be32(V_FW_CMD_OP(FW_VI_CMD) | F_FW_CMD_REQUEST |
				  F_FW_CMD_EXEC);
	if (is_pf4(adap))
		c.op_to_vfn |= cpu_to_be32(V_FW_VI_CMD_PFN(pf) |
					   V_FW_VI_CMD_VFN(vf));
	c.alloc_to_len16 = cpu_to_be32(F_FW_VI_CMD_FREE | FW_LEN16(c));
	c.type_to_viid = cpu_to_be16(V_FW_VI_CMD_VIID(viid));
	if (is_pf4(adap))
		return t4_wr_mbox(adap, mbox, &c, sizeof(c), &c);
	else
		return t4vf_wr_mbox(adap, &c, sizeof(c), NULL);
}
int t4_free_vi ( struct adapter * adap , unsigned int mbox , unsigned int pf , unsigned int vf , unsigned int viid ) { struct fw_vi_cmd c ; memset ( & c , 0 , sizeof ( c ) ) ; c . op_to_vfn = cpu_to_be32 ( V_FW_CMD_OP ( FW_VI_CMD ) | F_FW_CMD_REQUEST | F_FW_CMD_EXEC ) ; if ( is_pf4 ( adap ) ) c . op_to_vfn |= cpu_to_be32 ( V_FW_VI_CMD_PFN ( pf ) | V_FW_VI_CMD_VFN ( vf ) ) ; c . alloc_to_len16 = cpu_to_be32 ( F_FW_VI_CMD_FREE | FW_LEN16 ( c ) ) ; c . type_to_viid = cpu_to_be16 ( V_FW_VI_CMD_VIID ( viid ) ) ; if ( is_pf4 ( adap ) ) return t4_wr_mbox ( adap , mbox , & c , sizeof ( c ) , & c ) ; else return t4vf_wr_mbox ( adap , & c , sizeof ( c ) , NULL ) ; }
t4_free_vi - free a virtual interface
 @adap: the adapter
 @mbox: mailbox to use for the FW command
 @pf: the PF owning the VI
 @vf: the VF owning the VI
 @viid: virtual interface identifiler
t4_free_vi - free a virtual interface @adap : the adapter @mbox : mailbox to use for the FW command @pf : the PF owning the VI @vf : the VF owning the VI @viid : virtual interface identifiler