⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 netdev.h

📁 开源的BIOS启动软件
💻 H
字号:
/* *  bootdev.h * *  Copyright (C) 1998 Russell King */#ifndef BIOS_NETDEV_H#define BIOS_NETDEV_H#include <bios/types.h>#include <bios/buflist.h>#define htonl(x)	(((x) & 0x000000ff) << 24 |\			 ((x) & 0x0000ff00) << 8  |\			 ((x) & 0x00ff0000) >> 8  |\			 ((x) & 0xff000000) >> 24)#define htons(x)	(((x) & 0x000000ff) << 8 |\			 ((x) & 0x0000ff00) >> 8)typedef enum {	media_autodetect,	media_10b2,	media_10bt,	media_100btx,	media_100bfx,	media_mii,	media_nway,	media_aui} media_t;struct netdev;struct netdev_ops {	int		(*probe)(void);	int		(*open)(struct netdev *);	int		(*close)(struct netdev *);	int		(*status)(struct netdev *);	int		(*set_media)(struct netdev *, media_t media);	int		(*check_media)(struct netdev *);	int		(*send)(struct netdev *, void *buffer, int size);	int		(*recv)(struct netdev *, void *buf);};struct trans_ops {	struct buflist *(*header)(struct netdev *nd, u8 *dest, u16 proto, struct buflist *blp);	int		(*send)(struct netdev *nd, struct buflist *blp);	int		(*recv)(struct netdev *nd, u16 proto, u8 *buf);};struct netdev {	const struct netdev_ops	*hard;	const struct trans_ops	*trans;	struct netdev	*next;	u32		io_base;	u8		hw_addr[6];	u8		hw_broadcast[6];	u8		hw_addr_len;	u32		ip_addr;	media_t		default_media;	media_t		media;	int		up:1;	unsigned int	driver;	void		*ptr1;	void		*ptr2;};extern struct netdev *probed_net_devs;#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -