|
楼主 |
发表于 2025-2-18 11:25:52
|
显示全部楼层
在px4源码中搜struct ifreq的时候, 我们看到下面的内容
sudo vi build/px4_fmu-v6x_default/external/Build/px4io_firmware/NuttX/nuttx/include/net/if.h +209
/* This is the I/F request that should be used with IPv4. */
struct ifreq
{
char ifr_name[IFNAMSIZ]; /* Network device name (e.g. "eth0") */
#ifdef CONFIG_NETDEV_IFINDEX
int16_t ifr_ifindex; /* Interface index */
#endif
union
{
struct sockaddr ifru_addr; /* IP Address */
struct sockaddr ifru_dstaddr; /* P-to-P Address */
struct sockaddr ifru_broadaddr; /* Broadcast address */
struct sockaddr ifru_netmask; /* Netmask */
struct sockaddr ifru_hwaddr; /* MAC address */
int ifru_count; /* Number of devices */
int ifru_mtu; /* MTU size */
uint8_t ifru_flags; /* Interface flags */
struct mii_ioctl_notify_s ifru_mii_notify; /* PHY event notification */
struct mii_ioctl_data_s ifru_mii_data; /* MII request data */
struct can_ioctl_data_s ifru_can_data; /* CAN bitrate request data */
} ifr_ifru;
};
cuigaosheng@cuigaosheng:~/linshiceshi2/px4_vtol$ sudo git diff boards/px4/fmu-v6x/nuttx-config/nsh/defconfig
diff --git a/boards/px4/fmu-v6x/nuttx-config/nsh/defconfig b/boards/px4/fmu-v6x/nuttx-config/nsh/defconfig
index d75b3c5f60..8858d149d7 100644
--- a/boards/px4/fmu-v6x/nuttx-config/nsh/defconfig
+++ b//boards/px4/fmu-v6x/nuttx-config/nsh/defconfig
@@ -59,6 +59,7 @@ CONFIG_DEFAULT_SMALL=y
CONFIG_DEV_FIFO_SIZE=0
CONFIG_DEV_PIPE_MAXSIZE=1024
CONFIG_DEV_PIPE_SIZE=70
+CONFIG_NETDEV_IFINDEX=y
CONFIG_ETH0_PHY_LAN8742A=y
CONFIG_EXPERIMENTAL=y
CONFIG_FAT_DMAMEMORY=y
cuigaosheng@cuigaosheng:~/linshiceshi2/px4_vtol$
上面是我在原先v6x板子上,defconfig配置文件中添加CONFIG_NETDEV_IFINDEX=y后, 用git diff打印出来的。
|
|