mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
Correct some problems with network timed events when there are multiple network devices in the configuration.
Squashed commit of the following: Author: Gregory Nutt <gnutt@nuttx.org> Ran nxstyle against many of the affected files. But this job was too big for today. Many of the network drivers under arch are highly non-compiant and generate many, many faults from nxstyle. Those will have to be visited again another day. Author: Xiang Xiao <xiaoxiang@xiaomi.com> This effects all network drivers as well as timing related portions of net/: devif_poll_tcp_timer shouldn't be skipped in the multiple card case. devif_timer will be called multiple time in one period if the multiple card exist, the elapsed time calculated for the first callback is right, but the flowing callback in the same period is wrong(very short) because the global variable g_polltimer is used in the calculation. So let's pass the delay time to devif_timer and remove g_polltimer.
This commit is contained in:
@@ -157,6 +157,7 @@ static void btnet_hci_disconnected(FAR struct bt_conn_s *conn,
|
||||
FAR void *context);
|
||||
|
||||
/* Network interface support ************************************************/
|
||||
|
||||
/* Common TX logic */
|
||||
|
||||
static int btnet_txpoll_callback(FAR struct net_driver_s *netdev);
|
||||
@@ -542,7 +543,7 @@ static void btnet_txpoll_work(FAR void *arg)
|
||||
|
||||
/* Then perform the poll */
|
||||
|
||||
(void)devif_timer(&priv->bd_dev.r_dev, btnet_txpoll_callback);
|
||||
(void)devif_timer(&priv->bd_dev.r_dev, TXPOLL_WDDELAY, btnet_txpoll_callback);
|
||||
|
||||
/* Setup the watchdog poll timer again */
|
||||
|
||||
@@ -1132,6 +1133,7 @@ int bt_netdev_register(FAR const struct bt_driver_s *btdev)
|
||||
nerr("ERROR: netdev_register() failed: %d\n", ret);
|
||||
|
||||
errout:
|
||||
|
||||
/* Release wdog timers */
|
||||
|
||||
wd_delete(priv->bd_txpoll);
|
||||
|
||||
Reference in New Issue
Block a user