src/dpdk/drivers/net/cxgbe/base/t4_hw.c
int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl)
{
	u8 opcode = *(const u8 *)rpl;

	/*
	 * This might be a port command ... this simplifies the following
	 * conditionals ...  We can get away with pre-dereferencing
	 * action_to_len16 because it's in the first 16 bytes and all messages
	 * will be at least that long.
	 */
	const struct fw_port_cmd *p = (const void *)rpl;
	unsigned int action =
		G_FW_PORT_CMD_ACTION(be32_to_cpu(p->action_to_len16));

	if (opcode == FW_PORT_CMD && action == FW_PORT_ACTION_GET_PORT_INFO32) {
		/* link/module state change message */
		int chan = G_FW_PORT_CMD_PORTID(be32_to_cpu(p->op_to_portid));
		struct port_info *pi = NULL;
		int i;

		for_each_port(adap, i) {
			pi = adap2pinfo(adap, i);
			if (pi->tx_chan == chan)
				break;
		}

		t4_handle_get_port_info(pi, rpl);
	} else {
		dev_warn(adap, "Unknown firmware reply %d\n", opcode);
		return -EINVAL;
	}
	return 0;
}
/**
 * t4_handle_fw_rpl - process a FW reply message
 * @adap: the adapter
 * @rpl: start of the FW message
 *
 * Processes a FW message, such as link state change messages.
 */
process a FW reply message
@adap: the adapter
@rpl: start of the FW message

Processes a FW message, such as link state change messages.
process a FW reply message @adap : the adapter @rpl : start of the FW message Processes a FW message such as link state change messages .
int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl)
{
	u8 opcode = *(const u8 *)rpl;
	const struct fw_port_cmd *p = (const void *)rpl;
	unsigned int action =
		G_FW_PORT_CMD_ACTION(be32_to_cpu(p->action_to_len16));
	if (opcode == FW_PORT_CMD && action == FW_PORT_ACTION_GET_PORT_INFO32) {
		int chan = G_FW_PORT_CMD_PORTID(be32_to_cpu(p->op_to_portid));
		struct port_info *pi = NULL;
		int i;
		for_each_port(adap, i) {
			pi = adap2pinfo(adap, i);
			if (pi->tx_chan == chan)
				break;
		}
		t4_handle_get_port_info(pi, rpl);
	} else {
		dev_warn(adap, "Unknown firmware reply %d\n", opcode);
		return -EINVAL;
	}
	return 0;
}
int t4_handle_fw_rpl ( struct adapter * adap , const __be64 * rpl ) { u8 opcode = * ( const u8 * ) rpl ; const struct fw_port_cmd * p = ( const void * ) rpl ; unsigned int action = G_FW_PORT_CMD_ACTION ( be32_to_cpu ( p -> action_to_len16 ) ) ; if ( opcode == FW_PORT_CMD && action == FW_PORT_ACTION_GET_PORT_INFO32 ) { int chan = G_FW_PORT_CMD_PORTID ( be32_to_cpu ( p -> op_to_portid ) ) ; struct port_info * pi = NULL ; int i ; for_each_port ( adap , i ) { pi = adap2pinfo ( adap , i ) ; if ( pi -> tx_chan == chan ) break ; } t4_handle_get_port_info ( pi , rpl ) ; } else { dev_warn ( adap , " \n " , opcode ) ; return - EINVAL ; } return 0 ; }
t4_handle_fw_rpl - process a FW reply message
 @adap: the adapter
 @rpl: start of the FW message
t4_handle_fw_rpl - process a FW reply message @adap : the adapter @rpl : start of the FW message
/*
	 * This might be a port command ... this simplifies the following
	 * conditionals ...  We can get away with pre-dereferencing
	 * action_to_len16 because it's in the first 16 bytes and all messages
	 * will be at least that long.
	 */ /* link/module state change message */