154568cb3Sopenharmony_ci/* 254568cb3Sopenharmony_ci * Copyright (c) 2022-2022 Huawei Technologies Co., Ltd. All rights reserved. 354568cb3Sopenharmony_ci * 454568cb3Sopenharmony_ci * UniProton is licensed under Mulan PSL v2. 554568cb3Sopenharmony_ci * You can use this software according to the terms and conditions of the Mulan PSL v2. 654568cb3Sopenharmony_ci * You may obtain a copy of Mulan PSL v2 at: 754568cb3Sopenharmony_ci * http://license.coscl.org.cn/MulanPSL2 854568cb3Sopenharmony_ci * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, 954568cb3Sopenharmony_ci * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, 1054568cb3Sopenharmony_ci * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 1154568cb3Sopenharmony_ci * See the Mulan PSL v2 for more details. 1254568cb3Sopenharmony_ci * Create: 2022-09-21 1354568cb3Sopenharmony_ci * Description: 网络 1454568cb3Sopenharmony_ci */ 1554568cb3Sopenharmony_ci 1654568cb3Sopenharmony_ci#ifndef LWIP_PORTING_NETIF_H 1754568cb3Sopenharmony_ci#define LWIP_PORTING_NETIF_H 1854568cb3Sopenharmony_ci 1954568cb3Sopenharmony_ci#include "lwip/arch.h" 2054568cb3Sopenharmony_ci#include <net/if.h> 2154568cb3Sopenharmony_ci#include <netinet/ip.h> 2254568cb3Sopenharmony_ci 2354568cb3Sopenharmony_ci#define netif_find OsNetifapiNetifFindByName 2454568cb3Sopenharmony_ci 2554568cb3Sopenharmony_ci#if LWIP_DHCPS 2654568cb3Sopenharmony_ci#define LWIP_NETIF_CLIENT_DATA_INDEX_DHCP LWIP_NETIF_CLIENT_DATA_INDEX_DHCP, \ 2754568cb3Sopenharmony_ci LWIP_NETIF_CLIENT_DATA_INDEX_DHCPS 2854568cb3Sopenharmony_ci#endif 2954568cb3Sopenharmony_ci 3054568cb3Sopenharmony_ci#define linkoutput linkoutput; \ 3154568cb3Sopenharmony_ci void (*drv_send)(struct netif *netif, struct pbuf *p); \ 3254568cb3Sopenharmony_ci u8_t (*drv_set_hwaddr)(struct netif *netif, u8_t *addr, u8_t len); \ 3354568cb3Sopenharmony_ci void (*drv_config)(struct netif *netif, u32_t config_flags, u8_t setBit); \ 3454568cb3Sopenharmony_ci char full_name[IFNAMSIZ]; \ 3554568cb3Sopenharmony_ci u16_t link_layer_type 3654568cb3Sopenharmony_ci#include_next <lwip/netif.h> 3754568cb3Sopenharmony_ci#undef linkoutput 3854568cb3Sopenharmony_ci#if LWIP_DHCPS 3954568cb3Sopenharmony_ci#undef LWIP_NETIF_CLIENT_DATA_INDEX_DHCP 4054568cb3Sopenharmony_ci#endif 4154568cb3Sopenharmony_ci 4254568cb3Sopenharmony_ci#include <lwip/etharp.h> 4354568cb3Sopenharmony_ci 4454568cb3Sopenharmony_ci// redefine NETIF_NAMESIZE which was defined in netif.h 4554568cb3Sopenharmony_ci#undef NETIF_NAMESIZE 4654568cb3Sopenharmony_ci#define NETIF_NAMESIZE IFNAMSIZ 4754568cb3Sopenharmony_ci 4854568cb3Sopenharmony_ci#define LOOPBACK_IF 0 4954568cb3Sopenharmony_ci#define ETHERNET_DRIVER_IF 1 5054568cb3Sopenharmony_ci#define WIFI_DRIVER_IF 801 5154568cb3Sopenharmony_ci#define BT_PROXY_IF 802 5254568cb3Sopenharmony_ci 5354568cb3Sopenharmony_cierr_t driverif_init(struct netif *netif); 5454568cb3Sopenharmony_civoid driverif_input(struct netif *netif, struct pbuf *p); 5554568cb3Sopenharmony_ci 5654568cb3Sopenharmony_ci#define netif_get_name(netif) ((netif)->full_name) 5754568cb3Sopenharmony_ci 5854568cb3Sopenharmony_ci#endif /* LWIP_PORTING_NETIF_H */ 59