2) SylixOS 通过 netdev 来描述一个网络设备
- typedef struct netdev {
- UINT32 magic_no; /* MUST beNETDEV_MAGIC */
- UINT32 init_flags;
- UINT32 chksum_flags;
- UINT32 net_type;
- UINT64 speed; /* link layer speed bps */
- UINT32 mtu; /* link layer maxpacket length */
- UINT8 hwaddr_len; /* link layer address length MUST 6 or 8 */
- UINT8 hwaddr[NETIF_MAX_HWADDR_LEN]; /* link layer address */
- struct netdev_funcs *drv; /* netdev driver */
- void*priv; /* user network device privatedata (私有结构,自定义)
- intif_flags;
- ULONG sys[254]; /* reserve for netif (存放netif结构体)*/
- } netdev_t;