src/dpdk/drivers/net/cxgbe/base/t4_hw.c
int t4_enable_vi_params(struct adapter *adap, unsigned int mbox,
			unsigned int viid, bool rx_en, bool tx_en, bool dcb_en)
{
	struct fw_vi_enable_cmd c;

	memset(&c, 0, sizeof(c));
	c.op_to_viid = cpu_to_be32(V_FW_CMD_OP(FW_VI_ENABLE_CMD) |
				   F_FW_CMD_REQUEST | F_FW_CMD_EXEC |
				   V_FW_VI_ENABLE_CMD_VIID(viid));
	c.ien_to_len16 = cpu_to_be32(V_FW_VI_ENABLE_CMD_IEN(rx_en) |
				     V_FW_VI_ENABLE_CMD_EEN(tx_en) |
				     V_FW_VI_ENABLE_CMD_DCB_INFO(dcb_en) |
				     FW_LEN16(c));
	if (is_pf4(adap))
		return t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), NULL);
	else
		return t4vf_wr_mbox_ns(adap, &c, sizeof(c), NULL);
}
/**
 * t4_enable_vi_params - enable/disable a virtual interface
 * @adap: the adapter
 * @mbox: mailbox to use for the FW command
 * @viid: the VI id
 * @rx_en: 1=enable Rx, 0=disable Rx
 * @tx_en: 1=enable Tx, 0=disable Tx
 * @dcb_en: 1=enable delivery of Data Center Bridging messages.
 *
 * Enables/disables a virtual interface.  Note that setting DCB Enable
 * only makes sense when enabling a Virtual Interface ...
 */


Enables/disables a virtual interface.  Note that setting DCB Enable
only makes sense when enabling a Virtual Interface
Enables / disables a virtual interface . Note that setting DCB Enable only makes sense when enabling a Virtual Interface
int t4_enable_vi_params(struct adapter *adap, unsigned int mbox,
			unsigned int viid, bool rx_en, bool tx_en, bool dcb_en)
{
	struct fw_vi_enable_cmd c;
	memset(&c, 0, sizeof(c));
	c.op_to_viid = cpu_to_be32(V_FW_CMD_OP(FW_VI_ENABLE_CMD) |
				   F_FW_CMD_REQUEST | F_FW_CMD_EXEC |
				   V_FW_VI_ENABLE_CMD_VIID(viid));
	c.ien_to_len16 = cpu_to_be32(V_FW_VI_ENABLE_CMD_IEN(rx_en) |
				     V_FW_VI_ENABLE_CMD_EEN(tx_en) |
				     V_FW_VI_ENABLE_CMD_DCB_INFO(dcb_en) |
				     FW_LEN16(c));
	if (is_pf4(adap))
		return t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), NULL);
	else
		return t4vf_wr_mbox_ns(adap, &c, sizeof(c), NULL);
}
int t4_enable_vi_params ( struct adapter * adap , unsigned int mbox , unsigned int viid , bool rx_en , bool tx_en , bool dcb_en ) { struct fw_vi_enable_cmd c ; memset ( & c , 0 , sizeof ( c ) ) ; c . op_to_viid = cpu_to_be32 ( V_FW_CMD_OP ( FW_VI_ENABLE_CMD ) | F_FW_CMD_REQUEST | F_FW_CMD_EXEC | V_FW_VI_ENABLE_CMD_VIID ( viid ) ) ; c . ien_to_len16 = cpu_to_be32 ( V_FW_VI_ENABLE_CMD_IEN ( rx_en ) | V_FW_VI_ENABLE_CMD_EEN ( tx_en ) | V_FW_VI_ENABLE_CMD_DCB_INFO ( dcb_en ) | FW_LEN16 ( c ) ) ; if ( is_pf4 ( adap ) ) return t4_wr_mbox_ns ( adap , mbox , & c , sizeof ( c ) , NULL ) ; else return t4vf_wr_mbox_ns ( adap , & c , sizeof ( c ) , NULL ) ; }
t4_enable_vi_params - enable/disable a virtual interface
 @adap: the adapter
 @mbox: mailbox to use for the FW command
 @viid: the VI id
 @rx_en: 1=enable Rx, 0=disable Rx
 @tx_en: 1=enable Tx, 0=disable Tx
 @dcb_en: 1=enable delivery of Data Center Bridging messages.
t4_enable_vi_params - enable / disable a virtual interface @adap : the adapter @mbox : mailbox to use for the FW command @viid : the VI id @rx_en : 1 = enable Rx 0 = disable Rx @tx_en : 1 = enable Tx 0 = disable Tx @dcb_en : 1 = enable delivery of Data Center Bridging messages .