* This function will check SAL network interface device internet status. * * @param netdev the network interface device to check */
| 319 | * @param netdev the network interface device to check |
| 320 | */ |
| 321 | int sal_check_netdev_internet_up(struct netdev *netdev) |
| 322 | { |
| 323 | RT_ASSERT(netdev); |
| 324 | |
| 325 | #ifdef SAL_INTERNET_CHECK |
| 326 | /* workqueue for network connect */ |
| 327 | struct rt_work *net_work = RT_NULL; |
| 328 | |
| 329 | |
| 330 | net_work = (struct rt_work *)rt_calloc(1, sizeof(struct rt_work)); |
| 331 | if (net_work == RT_NULL) |
| 332 | { |
| 333 | LOG_W("No memory for network interface device(%s) delay work.", netdev->name); |
| 334 | return -1; |
| 335 | } |
| 336 | |
| 337 | rt_work_init(net_work, check_netdev_internet_up_work, (void *)netdev); |
| 338 | rt_work_submit(net_work, RT_TICK_PER_SECOND); |
| 339 | #endif /* SAL_INTERNET_CHECK */ |
| 340 | return 0; |
| 341 | } |
| 342 | |
| 343 | /** |
| 344 | * This function will register TLS protocol to the global TLS protocol. |
no test coverage detected