📄 net_cfg.h
字号:
*/
#define NET_TMR_CFG_NBR_TMR 10 /* Configure total number of TIMERs (see Note #1). */
#define NET_TMR_CFG_TASK_FREQ 10 /* Configure Timer Task frequency (see Note #2). */
/*
*********************************************************************************************************
* BUFFER MANAGEMENT CONFIGURATION
*
* Note(s) : (1) (a) Configure NET_BUF_CFG_NBR_SMALL with the desired number of SMALL network BUFFER objects.
*
* (b) Configure NET_BUF_CFG_NBR_LARGE with the desired number of SMALL network BUFFER objects.
*
* (c) Buffers are required to :
*
* (1) Receive packets from the network
* (2) Transmit packets to the network
*
* (2) (a) Configure NET_BUF_CFG_DATA_SIZE_SMALL with the desired data buffer size for SMALL network BUFFERs.
*
* (b) Configure NET_BUF_CFG_DATA_SIZE_LARGE with the desired data buffer size for LARGE network BUFFERs.
*
* (c) NET_BUF_CFG_DATA_SIZE_SMALL & NET_BUF_CFG_DATA_SIZE_LARGE MUST be declared with values ...
*
* (1) that are greater than or equal to NET_BUF_DATA_SIZE_MIN (see 'net_buf.h NET BUFFER INDEX
* & SIZE DEFINES')
* (2) such that NET_BUF_CFG_DATA_SIZE_LARGE has a value greater than NET_BUF_CFG_DATA_SIZE_SMALL
*
* ... and SHOULD be declared with values
*
* (3) that are integer multiples of CPU_ALIGN word size (to force word-alignment of buffer arrays)
*
* See also 'net_buf.h BUFFERS Notes #3 & #4'.
*********************************************************************************************************
*/
#define NET_BUF_CFG_NBR_SMALL 10 /* Configure total number of SMALL BUFFERs. */
#define NET_BUF_CFG_NBR_LARGE 10 /* Configure total number of LARGE BUFFERs. */
/* See Note #1. */
#define NET_BUF_CFG_DATA_SIZE_SMALL 256 /* Configure size of SMALL BUFFER DATA area. */
#define NET_BUF_CFG_DATA_SIZE_LARGE 1536 /* Configure size of LARGE BUFFER DATA area. */
/* See Note #2. */
/*$PAGE*/
/*
*********************************************************************************************************
* NETWORK INTERFACE CARD CONFIGURATION
*
* Note(s) : (1) Configure NIC-specific parameters.
*
* Consult the specific NIC's documentation to determine the NIC's required configuration
* parameters; see also the specific NIC's source documentation in the following network
* directory :
*
* \<Network Protocol Suite>\NIC\<if>\<nic>\
*
* where
* <Network Protocol Suite> directory path for network protocol suite
* <nic> directory name for specific network interface card
*
* (2) (a) Configure NET_NIC_CFG_TX_RDY_INIT_VAL to initialize the NIC-transmit-ready OS object with
* one of the following values :
*
* (1) 0, for NIC driver's that implement the NIC's transmit-ready status using a
* Transmit Empty interrupt.
*
* (2) 1, for NIC driver's that implement the NIC's transmit-ready status using a
* Transmit Complete interrupt.
*
* (b) This configuration currently applicable for single-transmit-packet-buffer NIC drivers ONLY.
*
* See also 'net_os.c NetOS_NIC_Init() Note #1a'.
*
* (3) Configure NET_NIC_CFG_INT_CTRL_EN to enable/disable any software to handle the presence of
* an interrupt controller.
*********************************************************************************************************
*/
#define NET_NIC_CFG_TX_RDY_INIT_VAL 1 /* Configure transmit ready initial value (see Note #2).*/
/* Configure presence of interrupt controller ... */
/* ... (see Note #3) : */
/* Configure transmit preparation feature (see Note #5):*/
#define NET_NIC_CFG_TX_PKT_PREPARE_EN DEF_DISABLED
/* DEF_DISABLED Transmit packets NOT pre-prepared */
/* DEF_ENABLED Transmit packets pre-prepared */
#define NET_NIC_CFG_INT_CTRL_EN DEF_ENABLED
/* DEF_DISABLED Interrupt controller NOT present */
/* DEF_ENABLED Interrupt controller present */
/* Configure MAC address set method : */
#define CS8900A_CFG_MAC_ADDR_SEL CS8900A_MAC_ADDR_SEL_CFG
/* CS8900A_MAC_ADDR_SEL_EEPROM from NIC's EEPROM */
/* CS8900A_MAC_ADDR_SEL_CFG from application */
/*
*********************************************************************************************************
* NETWORK INTERFACE LAYER CONFIGURATION
*
* Note(s) : (1) See 'net_def.h NETWORK INTERFACE LAYER DEFINES' for supported network interface types.
*********************************************************************************************************
*/
/* Configure interface type (see Note #1) : */
#define NET_IF_CFG_TYPE NET_IF_TYPE_ETHER
#define NET_IF_CFG_ADDR_FLTR_EN DEF_ENABLED /* Configure Net IF address filter feature : */
/* DEF_DISABLED Addresses NOT filtered */
/* DEF_ENABLED Addresses filtered */
/*
*********************************************************************************************************
* ADDRESS RESOLUTION PROTOCOL LAYER CONFIGURATION
*
* Note(s) : (1) Address Resolution Protocol ONLY required for some network interfaces (see 'net_arp.h
* Note #1').
*
* (2) See 'net_arp.h ARP HARDWARE & PROTOCOL DEFINES Note #1' for supported ARP hardware &
* protocol types.
*********************************************************************************************************
*/
/* Configure ARP types (see Note #2) : */
#define NET_ARP_CFG_HW_TYPE NET_ARP_HW_TYPE_ETHER
#define NET_ARP_CFG_PROTOCOL_TYPE NET_ARP_PROTOCOL_TYPE_IP_V4
#define NET_ARP_CFG_NBR_CACHE 10 /* Configure ARP cache size. */
#define NET_ARP_CFG_ADDR_FLTR_EN DEF_ENABLED /* Configure ARP address filter feature : */
/* DEF_DISABLED ARP addresses NOT filtered */
/* DEF_ENABLED ARP addresses filtered */
/*
*********************************************************************************************************
* INTERNET PROTOCOL LAYER CONFIGURATION
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* INTERNET CONTROL MESSAGE PROTOCOL LAYER CONFIGURATION
*********************************************************************************************************
*/
#define NET_ICMP_CFG_MON_TASK_EN DEF_ENABLED /* Configure ICMP Monitor Task feature : */
/* DEF_DISABLED Monitor Task ENABLED */
/* DEF_ENABLED Monitor Task DISABLED */
#define NET_ICMP_CFG_TX_SRC_QUENCH_EN DEF_ENABLED
#define NET_ICMP_CFG_TX_SRC_QUENCH_SIZE 20 /* Configure ICMP transmit source quench list size. */
/*$PAGE*/
/*
*********************************************************************************************************
* TRANSPORT LAYER CONFIGURATION
*********************************************************************************************************
*/
/* Configure Transport Layer Selection : */
#define NET_CFG_TRANSPORT_LAYER_SEL NET_TRANSPORT_LAYER_SEL_UDP_TCP
/* NET_TRANSPORT_LAYER_SEL_UDP_TCP UDP/TCP */
/* NET_TRANSPORT_LAYER_SEL_UDP UDP ONLY */
/*
*********************************************************************************************************
* USER DATAGRAM PROTOCOL LAYER CONFIGURATION
*
* Note(s) : (1) Configure NET_UDP_CFG_APP_API_SEL with the desired configuration for demultiplexing
* UDP datagrams to application connections :
*
* NET_UDP_APP_API_SEL_SOCK Demultiplex UDP datagrams to BSD sockets ONLY.
* NET_UDP_APP_API_SEL_APP Demultiplex UDP datagrams to application-specific
* connections ONLY.
* NET_UDP_APP_API_SEL_SOCK_APP Demultiplex UDP datagrams to BSD sockets first;
* if NO socket connection found to demultiplex
* a UDP datagram, demultiplex to application-
* specific connection.
*
* See also 'net_udp.c NetUDP_RxPktDemuxDatagram() Note #1'
* & 'net_udp.c NetUDP_RxPktDemuxAppData() Note #1'.
*
* (2) (a) Before a UDP Datagram Check-Sum is validated, it is necessary to check whether the
* UDP datagram was transmitted with or without a computed Check-Sum (see RFC #768,
* Section 'Fields : Checksum').
*
* (b) Configure NET_UDP_CFG_RX_CHK_SUM_DISCARD_EN to enable/disable discarding of UDP
* datagrams received with NO computed check-sum :
*
* (1) When ENABLED, ALL UDP datagrams received without a check-sum are discarded.
*
* (2) When DISABLED, ALL UDP datagrams received without a check-sum are flagged so
* that "an application MAY optionally ... discard ... datagrams without checksums"
* (see RFC #1122, Section 4.1.3.4).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -