net/ice/base: move LLDP function to common module
To implement a FW workaround for LFC, a set_local_mib must be performed after every link up event. For systems that do not have DCB configured, we need to move the function ice_aq_set_lldp_mib() from the DCB specific ice_dcb.c to ice_common.c so that the driver always has access to this AQ command. Signed-off-by: Dave Ertman <david.m.ertman@intel.com> Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com> Acked-by: Qiming Yang <qiming.yang@intel.com>
This commit is contained in:
parent
8921d08861
commit
946a5337b2
@ -4557,3 +4557,36 @@ bool ice_is_phy_caps_an_enabled(struct ice_aqc_get_phy_caps_data *caps)
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* ice_aq_set_lldp_mib - Set the LLDP MIB
|
||||
* @hw: pointer to the HW struct
|
||||
* @mib_type: Local, Remote or both Local and Remote MIBs
|
||||
* @buf: pointer to the caller-supplied buffer to store the MIB block
|
||||
* @buf_size: size of the buffer (in bytes)
|
||||
* @cd: pointer to command details structure or NULL
|
||||
*
|
||||
* Set the LLDP MIB. (0x0A08)
|
||||
*/
|
||||
enum ice_status
|
||||
ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size,
|
||||
struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_lldp_set_local_mib *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
|
||||
cmd = &desc.params.lldp_set_mib;
|
||||
|
||||
if (buf_size == 0 || !buf)
|
||||
return ICE_ERR_PARAM;
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_set_local_mib);
|
||||
|
||||
desc.flags |= CPU_TO_LE16((u16)ICE_AQ_FLAG_RD);
|
||||
desc.datalen = CPU_TO_LE16(buf_size);
|
||||
|
||||
cmd->type = mib_type;
|
||||
cmd->length = CPU_TO_LE16(buf_size);
|
||||
|
||||
return ice_aq_send_cmd(hw, &desc, buf, buf_size, cd);
|
||||
}
|
||||
|
@ -220,4 +220,7 @@ void ice_print_rollback_msg(struct ice_hw *hw);
|
||||
enum ice_status
|
||||
ice_sched_query_elem(struct ice_hw *hw, u32 node_teid,
|
||||
struct ice_aqc_get_elem *buf);
|
||||
enum ice_status
|
||||
ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size,
|
||||
struct ice_sq_cd *cd);
|
||||
#endif /* _ICE_COMMON_H_ */
|
||||
|
@ -135,39 +135,6 @@ ice_aq_start_lldp(struct ice_hw *hw, bool persist, struct ice_sq_cd *cd)
|
||||
return ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
|
||||
}
|
||||
|
||||
/**
|
||||
* ice_aq_set_lldp_mib - Set the LLDP MIB
|
||||
* @hw: pointer to the HW struct
|
||||
* @mib_type: Local, Remote or both Local and Remote MIBs
|
||||
* @buf: pointer to the caller-supplied buffer to store the MIB block
|
||||
* @buf_size: size of the buffer (in bytes)
|
||||
* @cd: pointer to command details structure or NULL
|
||||
*
|
||||
* Set the LLDP MIB. (0x0A08)
|
||||
*/
|
||||
enum ice_status
|
||||
ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size,
|
||||
struct ice_sq_cd *cd)
|
||||
{
|
||||
struct ice_aqc_lldp_set_local_mib *cmd;
|
||||
struct ice_aq_desc desc;
|
||||
|
||||
cmd = &desc.params.lldp_set_mib;
|
||||
|
||||
if (buf_size == 0 || !buf)
|
||||
return ICE_ERR_PARAM;
|
||||
|
||||
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_set_local_mib);
|
||||
|
||||
desc.flags |= CPU_TO_LE16((u16)ICE_AQ_FLAG_RD);
|
||||
desc.datalen = CPU_TO_LE16(buf_size);
|
||||
|
||||
cmd->type = mib_type;
|
||||
cmd->length = CPU_TO_LE16(buf_size);
|
||||
|
||||
return ice_aq_send_cmd(hw, &desc, buf, buf_size, cd);
|
||||
}
|
||||
|
||||
/**
|
||||
* ice_get_dcbx_status
|
||||
* @hw: pointer to the HW struct
|
||||
|
@ -183,9 +183,6 @@ ice_aq_get_lldp_mib(struct ice_hw *hw, u8 bridge_type, u8 mib_type, void *buf,
|
||||
u16 buf_size, u16 *local_len, u16 *remote_len,
|
||||
struct ice_sq_cd *cd);
|
||||
enum ice_status
|
||||
ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size,
|
||||
struct ice_sq_cd *cd);
|
||||
enum ice_status
|
||||
ice_aq_get_cee_dcb_cfg(struct ice_hw *hw,
|
||||
struct ice_aqc_get_cee_dcb_cfg_resp *buff,
|
||||
struct ice_sq_cd *cd);
|
||||
|
Loading…
Reference in New Issue
Block a user