/* Called from the LLD when the network link is not ready. There may be multiple calls while the link is down.  */
int fcoe_ctlr_link_down(struct fcoe_ctlr *fip)
/* Called from the LLD when the network link is not ready. There may be multiple calls while the link is down.  */
int fcoe_ctlr_link_down(struct fcoe_ctlr *fip)
{
	int link_dropped;
	LIBFCOE_FIP_DBG(fip, "link down.\n");
	spin_lock_bh(&fip->lock);
	fcoe_ctlr_reset(fip);
	link_dropped = fip->link;
	fip->link = 0;
	fip->last_link = 0;
	fip->state = FIP_ST_LINK_WAIT;
	spin_unlock_bh(&fip->lock);
	if (link_dropped)
		fc_linkdown(fip->lp);
	return link_dropped;
}