mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +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);
|
||||
|
||||
@@ -476,7 +476,7 @@ static void lo_poll_work(FAR void *arg)
|
||||
|
||||
/* Then perform the poll */
|
||||
|
||||
(void)devif_timer(&priv->lo_radio.r_dev, lo_loopback);
|
||||
(void)devif_timer(&priv->lo_radio.r_dev, LO_WDDELAY, lo_loopback);
|
||||
|
||||
/* Setup the watchdog poll timer again */
|
||||
|
||||
@@ -1034,6 +1034,7 @@ static int lo_properties(FAR struct radio_driver_s *netdev,
|
||||
|
||||
#ifdef CONFIG_NET_STARPOINT
|
||||
/* Star hub node address -- Not supported*/
|
||||
|
||||
#endif
|
||||
|
||||
return OK;
|
||||
|
||||
@@ -193,6 +193,7 @@ static int macnet_rxframe(FAR struct macnet_driver_s *maccb,
|
||||
FAR struct ieee802154_data_ind_s *ind);
|
||||
|
||||
/* Network interface support ************************************************/
|
||||
|
||||
/* Common TX logic */
|
||||
|
||||
static int macnet_txpoll_callback(FAR struct net_driver_s *dev);
|
||||
@@ -579,7 +580,7 @@ static void macnet_txpoll_work(FAR void *arg)
|
||||
|
||||
/* Then perform the poll */
|
||||
|
||||
(void)devif_timer(&priv->md_dev.r_dev, macnet_txpoll_callback);
|
||||
(void)devif_timer(&priv->md_dev.r_dev, TXPOLL_WDDELAY, macnet_txpoll_callback);
|
||||
|
||||
/* Setup the watchdog poll timer again */
|
||||
|
||||
@@ -1438,6 +1439,7 @@ int mac802154netdev_register(MACHANDLE mac)
|
||||
return macnet_ifdown(&priv->md_dev.r_dev);
|
||||
|
||||
errout:
|
||||
|
||||
/* Release wdog timers */
|
||||
|
||||
wd_delete(priv->md_txpoll);
|
||||
|
||||
@@ -434,7 +434,7 @@ static void lo_poll_work(FAR void *arg)
|
||||
|
||||
/* And perform the poll */
|
||||
|
||||
(void)devif_timer(&priv->lo_radio.r_dev, lo_loopback);
|
||||
(void)devif_timer(&priv->lo_radio.r_dev, LO_WDDELAY, lo_loopback);
|
||||
|
||||
/* Setup the watchdog poll timer again */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user