* This function will clean the netdev. * * @note please don't invoke it on ISR. */
| 413 | * @note please don't invoke it on ISR. |
| 414 | */ |
| 415 | int 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 |
no test coverage detected