Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aadfc3b2 authored by Ira Weiny's avatar Ira Weiny Committed by Doug Ledford
Browse files

IB/hfi1: fix pstateinfo from returning improperly byteswapped value



Byteswap link_width_downgrade_*_active values before sending on the wire.  In
addition properly define the Port State Info structure.

Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Reviewed-by: default avatarChristian Gomez <christian.gomez@intel.com>
Signed-off-by: default avatarRimmer, Todd <todd.rimmer@intel.com>
Signed-off-by: default avatarIra Weiny <ira.weiny@intel.com>
Acked-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 447e9a4d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1717,9 +1717,9 @@ static int __subn_get_opa_psi(struct opa_smp *smp, u32 am, u8 *data,
	psi->port_states.portphysstate_portstate =
		(hfi1_ibphys_portstate(ppd) << 4) | (lstate & 0xf);
	psi->link_width_downgrade_tx_active =
	  ppd->link_width_downgrade_tx_active;
		cpu_to_be16(ppd->link_width_downgrade_tx_active);
	psi->link_width_downgrade_rx_active =
	  ppd->link_width_downgrade_rx_active;
		cpu_to_be16(ppd->link_width_downgrade_rx_active);
	if (resp_len)
		*resp_len += sizeof(struct opa_port_state_info);

+2 −2
Original line number Diff line number Diff line
@@ -294,8 +294,8 @@ struct opa_port_states {

struct opa_port_state_info {
	struct opa_port_states port_states;
	u16 link_width_downgrade_tx_active;
	u16 link_width_downgrade_rx_active;
	__be16 link_width_downgrade_tx_active;
	__be16 link_width_downgrade_rx_active;
};

struct opa_port_info {