MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / sal_netdev_cleanup

Function sal_netdev_cleanup

components/net/sal/src/sal_socket.c:415–440  ·  view source on GitHub ↗

* This function will clean the netdev. * * @note please don't invoke it on ISR. */

Source from the content-addressed store, hash-verified

413 * @note please don't invoke it on ISR.
414 */
415int sal_netdev_cleanup(struct netdev *netdev)
416{
417 uint32_t idx = 0;
418 int find_dev;
419
420 do
421 {
422 find_dev = 0;
423 sal_lock();
424 for (idx = 0; idx < socket_table.max_socket; idx++)
425 {
426 if (socket_table.sockets[idx] && socket_table.sockets[idx]->netdev == netdev)
427 {
428 find_dev = 1;
429 break;
430 }
431 }
432 sal_unlock();
433 if (find_dev)
434 {
435 rt_thread_mdelay(100);
436 }
437 } while (find_dev);
438
439 return 0;
440}
441
442/**
443 * This function will initialize sal socket object and set socket options

Callers 1

netdev_unregisterFunction · 0.85

Calls 3

sal_lockFunction · 0.85
sal_unlockFunction · 0.85
rt_thread_mdelayFunction · 0.85

Tested by

no test coverage detected