/* stop lcs device This function will be called by user doing ifconfig xxx down  */
static int lcs_stop_device(struct net_device *dev)
/* stop lcs device This function will be called by user doing ifconfig xxx down  */
static int lcs_stop_device(struct net_device *dev)
{
	struct lcs_card *card;
	int rc;
	LCS_DBF_TEXT(2, trace, "stopdev");
	card   = (struct lcs_card *) dev->ml_priv;
	netif_carrier_off(dev);
	netif_tx_disable(dev);
	dev->flags &= ~IFF_UP;
	wait_event(card->write.wait_q,
		(card->write.state != LCS_CH_STATE_RUNNING));
	rc = lcs_stopcard(card);
	if (rc)
		dev_err(&card->dev->dev,
			" Shutting down the LCS device failed\n ");
	return rc;
}