Skip to contentSkip to conversation

net-bnx2x: Force link UP when the interface is in LOOPBACK mode

PATCH Applied Mahesh Bandewar 3 participants 3 messages Jan 30, 2013 – Feb 3, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net-bnx2x: Force link UP when the interface is in LOOPBACK mode

When the interface does not have carrier but when it's put into loopback mode (for tests), it does not make sense to not have the carrier. So force it!

---
v1.0 : Added check to ensure it's not forced in LOOPBACK_EXT mode.

 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +6 -0
index 859df751345e..c6da77fa9d07 100644
@@ -4748,6 +4748,12 @@ void bnx2x_link_status_update(struct link_params *params,
 	vars->link_status = REG_RD(bp, params->shmem_base +
 				   offsetof(struct shmem_region,
 					    port_mb[port].link_status));
+
+	/* Force link UP in non LOOPBACK_EXT loopback mode(s) */
+	if (bp->link_params.loopback_mode != LOOPBACK_NONE &&
+	    bp->link_params.loopback_mode != LOOPBACK_EXT)
+		vars->link_status |= LINK_STATUS_LINK_UP;
+
 	if (bnx2x_eee_has_cap(params))
 		vars->eee_status = REG_RD(bp, params->shmem2_base +
 					  offsetof(struct shmem2_region,
Signature · 1 line
1.8.1