📄 net.h
字号:
/***************************************** Copyright (c) 2001-2002 Sigma Designs, Inc. All Rights Reserved Proprietary and Confidential *****************************************//* This file is part of the Jasper DVD boot loader *//* * net.h * * network layer * * first revision by Ho Lee 11/06/2002 */#ifndef __BOOT_LOADER_NET_H#define __BOOT_LOADER_NET_Hstruct ethhdr;struct arprequest;struct iphdr;struct icmphdr;struct udphdr;struct bootphdr;struct tftphdr;struct sk_buff { unsigned char *data; unsigned int len; unsigned int buflen; int valid; // after packet parsing struct ethhdr *eth; unsigned char *ethdata; int ethdata_len; struct arprequest *arp; struct iphdr *ip; unsigned char *ipdata; int ipdata_len; struct icmphdr *icmp; struct udphdr *udp; unsigned char *udpdata; int udpdata_len; struct bootphdr *bootp; struct tftphdr *tftp;};enum { ETHIRQ_RX = 0x01, ETHIRQ_TX = 0x02 };enum { NETDEV_NODEV, NETDEV_DOWN, NETDEV_UP };#define MACADDR_LEN 6struct net_device { int state; void *priv; int (*init)(struct net_device *dev); int (*open)(struct net_device *dev); int (*close)(struct net_device *dev); int (*irq_pending)(struct net_device *dev); int (*send_packet)(struct sk_buff *skbuff, struct net_device *dev); int (*receive_packet)(struct net_device *dev); void (*print_status)(struct net_device *dev); unsigned char dev_addr[MACADDR_LEN]; // EEPROM int eeprom_size; unsigned short (*eeprom_readw)(struct net_device *dev, int reg); void (*eeprom_writew)(struct net_device *dev, int reg, int data);};extern struct net_device g_netdev;//// function prototypes//int net_init(void);int net_found(void);int net_arp_setup(void);int net_dev_up(void);int net_dev_down(void);int net_rx_ready(void);struct sk_buff *net_getpacket(int timeout);int net_sendpacket(struct sk_buff *skb);void net_device_status(void);struct sk_buff *skb_alloc(int len);void skb_free(struct sk_buff *skb);void skb_dealloc(struct sk_buff *skb);void skb_put(struct sk_buff *skb);struct sk_buff *skb_get(void);#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -