Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions drivers/usbdev/rndis.c
Original file line number Diff line number Diff line change
Expand Up @@ -2752,6 +2752,22 @@ static void usbclass_resetconfig(FAR struct rndis_dev_s *priv)
}
}

/****************************************************************************
* Name: rndis_carrier_on_work
*
* Description:
* Schedule to work queue because netdev_carrier_on API can't be used in
* interrupt context
*
****************************************************************************/

static void rndis_carrier_on_work(FAR void *arg)
{
FAR struct rndis_dev_s *priv = arg;

netdev_carrier_on(&priv->netdev);
}

/****************************************************************************
* Name: usbclass_setconfig
*
Expand Down Expand Up @@ -2860,10 +2876,16 @@ static int usbclass_setconfig(FAR struct rndis_dev_s *priv, uint8_t config)
/* We are successfully configured */

priv->config = config;
if (priv->netdev.d_ifup(&priv->netdev) == OK)
{
priv->netdev.d_flags |= IFF_UP;
}

priv->netdev.d_flags |= IFF_UP;

/* Schedule to work queue because netdev_carrier_on API can't be used in
* interrupt context. Since the current network card is not yet RUNNING,
* it will not be selected to trigger rndis_txavail, so pollwork can be
* reused.
*/

work_queue(LPWORK, &priv->pollwork, rndis_carrier_on_work, priv, 0);

return OK;

Expand Down
Loading