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

📄 sps.h

📁 由smsc公司改进的lwip2.1.1基于嵌入式系统的TCP/ip协议栈
💻 H
📖 第 1 页 / 共 5 页
字号:
#ifndef SMSC_THREADING_ENABLED
#define SMSC_THREADING_ENABLED		(0)
#endif


/*
INLINE_SIMPLE_FUNCTIONS: 
	if set to 1, many simple functions will be converted to
		macros. This will also cause many sanity checks to be ignored
	if set to 0, all simple functions will be implemented through
		actual function calls. This also enables many sanity checks, 
		provided that SMSC_ERROR_ENABLED==1.
*/
#ifndef INLINE_SIMPLE_FUNCTIONS
#define INLINE_SIMPLE_FUNCTIONS		(0)
#endif


/* ---------- Memory options ---------- */
/* MEMORY_ALIGNMENT: should be set to the alignment of the CPU for which
   lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2
   byte alignment -> define MEM_ALIGNMENT to 2. */
#ifndef MEMORY_ALIGNMENT
#define MEMORY_ALIGNMENT           (4)
#endif


/***********************************************************************
* MAXIMUM_TRANSFER_ALIGNMENT
*   This defines the alignment properties required for reading/writing 
*   packet buffers from/to the smsc911x hardware. Allowed values are
*   4, 8, 16, and 32. This value is used to make sure that enough
*   space is allocated in packet buffers to support larger transfer
*   alignments. When all transfers are PIO then 4 is the typical setting.
*   If some tranfers use DMA, and the DMA hardware requires larger alignments
*   then this value should be set to the maximum alignment requirement.
***********************************************************************/
#ifndef MAXIMUM_TRANSFER_ALIGNMENT
#define MAXIMUM_TRANSFER_ALIGNMENT			(4)
#endif


/*The following defines configure the memory pools for packet buffers */
#ifndef SMALL_BUFFER_SIZE
#define SMALL_BUFFER_SIZE	(128)
#endif


#ifndef SMALL_BUFFER_COUNT
#define SMALL_BUFFER_COUNT	(128)
#endif


#ifndef LARGE_BUFFER_SIZE
#define LARGE_BUFFER_SIZE	(1520)
#endif


#ifndef LARGE_BUFFER_COUNT
#define LARGE_BUFFER_COUNT	(128)
#endif


/* TASK_MANAGER_HIGHEST_PRIORITY indicates the highest priority allowed
	by the Task Manager. Priorities will range from 
		0 to TASK_MANAGER_HIGHEST_PRIORITY
*/
#ifndef TASK_PRIORITY_APPLICATION_LOW
#define TASK_PRIORITY_APPLICATION_LOW		(0) /* Must be lower than RX */
#endif


#ifndef TASK_PRIORITY_RX
#define TASK_PRIORITY_RX					(4)
#endif


#ifndef TASK_PRIORITY_RX_FILTER
#define TASK_PRIORITY_RX_FILTER				(5)
#endif


#ifndef TASK_PRIORITY_APPLICATION_NORMAL
#define TASK_PRIORITY_APPLICATION_NORMAL	(8)
#endif


#ifndef TASK_PRIORITY_TIMER
#define TASK_PRIORITY_TIMER					(14)
#endif


#ifndef TASK_PRIORITY_TX
#define TASK_PRIORITY_TX					(15)
#endif


#ifndef TASK_MANAGER_HIGHEST_PRIORITY
#define TASK_MANAGER_HIGHEST_PRIORITY		(15)
#endif


#ifndef TASK_COUNT
#define TASK_COUNT					(5)
#endif


/* ARP_TABLE_SIZE defines the ARP Table size of ARP protocols */
#ifndef ARP_TABLE_SIZE
#define ARP_TABLE_SIZE				(32)
#endif


#ifndef ARP_ENTRY_MAX_AGE
#define ARP_ENTRY_MAX_AGE			(240)
#endif


#ifndef ARP_ENTRY_MAX_PENDING_AGE
#define ARP_ENTRY_MAX_PENDING_AGE	(4)
#endif


/*This is the maximum number of packets that can be received
on a single task call */
#ifndef SMSC911X_RX_BURST_COUNT
#define SMSC911X_RX_BURST_COUNT		(4)
#endif


#ifndef LOOP_BACK_RX_BURST_COUNT
#define LOOP_BACK_RX_BURST_COUNT	(4)
#endif


/*This is the maximum number of packets that can be transmitted
on a single task call */
#ifndef SMSC911X_TX_BURST_COUNT
#define SMSC911X_TX_BURST_COUNT	(4)
#endif


/* interface enabling switches */
#ifndef LOOP_BACK_ENABLED
#define LOOP_BACK_ENABLED	(1)
#endif


#ifndef ETHERNET_ENABLED
#define ETHERNET_ENABLED	(1)
#endif


#ifndef SMSC911X_ENABLED
#define SMSC911X_ENABLED	(1)
#endif

	#ifndef SMSC911X_PACKET_DUMP_ENABLED
	#define SMSC911X_PACKET_DUMP_ENABLED (0)
	#endif

	/* Phy Workaround */
	#ifndef SMSC911X_USE_PHY_WORK_AROUND
	#define SMSC911X_USE_PHY_WORK_AROUND (1)
	#endif

	/* External phy detection */
	#ifndef SMSC911X_USE_EXTERNAL_PHY
	#define SMSC911X_USE_EXTERNAL_PHY (0)
	#endif

	/* use interrupt mode for link status if internal phy is 
	   detected. For polling mode, set it to 0.
	 */
	#ifndef SMSC911X_LINK_STATUS_INTERRUPT_MODE
	#define SMSC911X_LINK_STATUS_INTERRUPT_MODE (1)
	#endif

	
/* MINIMUM_MTU is used when allocating packets whose destination
interface is unknown. It should be set to the smallest MTU of
all interfaces. */
#ifndef MINIMUM_MTU
#define MINIMUM_MTU	(1500)
#endif


/* protocol enabling switches */
#ifndef IPV4_ENABLED
#define IPV4_ENABLED		(1)
#endif

#ifndef IPV4_HEADER_DUMP_ENABLED
#define IPV4_HEADER_DUMP_ENABLED	(0)
#endif

#ifndef IPV4_FORWARDING_ENABLED
#define IPV4_FORWARDING_ENABLED		(0)
#endif

#ifndef IPV4_FRAGMENTS_ENABLED
#define IPV4_FRAGMENTS_ENABLED		(1)
#endif

	#ifndef IPV4_FRAGMENTS_DATAGRAM_COUNT
	#define IPV4_FRAGMENTS_DATAGRAM_COUNT 	(5)
	#endif

	#ifndef IPV4_FRAGMENTS_DATAGRAM_MAX_AGE
	#define IPV4_FRAGMENTS_DATAGRAM_MAX_AGE	(3)
	#endif

#ifndef ICMPV4_ECHO_REPLY_ENABLED
#define ICMPV4_ECHO_REPLY_ENABLED	(1)
#endif

#ifndef ICMPV4_ECHO_REQUEST_ENABLED
#define ICMPV4_ECHO_REQUEST_ENABLED	(1)
#endif

#ifndef ICMPV4_ECHO_REQUEST_COUNT
#define ICMPV4_ECHO_REQUEST_COUNT	(5)
#endif


/**********************************************************************************
* IPV4_FILTER_ENABLED
*
* Enables IPV4 test filter code. All options that start with IPV4_FILTER_
* become valid when this option is not zero.
**********************************************************************************/
#ifndef IPV4_FILTER_ENABLED
#define IPV4_FILTER_ENABLED	(0)
#endif


/**********************************************************************************
* IPV4_FILTER_MAXIMUM_FRAGMENT_SIZE
*   All input packets that are larger than the specified size will be refragmented to 
*     fit with in the specified size.
* IPV4_TEST_FILTER_CREATE_FRAGMENT_OVERLAPS
*   If an input packet requires fragmentation according to 
*   IPV4_TEST_FILTER_MAXIMUM_FRAGMENT_SIZE then we will create those fragments
*   with overlaps where possible.
**********************************************************************************/
#ifndef IPV4_FILTER_MAXIMUM_FRAGMENT_SIZE
#define IPV4_FILTER_MAXIMUM_FRAGMENT_SIZE		(2000)
#endif

#ifndef IPV4_FILTER_CREATE_FRAGMENT_OVERLAPS
#define IPV4_FILTER_CREATE_FRAGMENT_OVERLAPS	(0)
#endif


/* The following rates may be a value from 0 to 100 to indicate a percentage 
   which represents a probability that the error will occure.
   Set to 0 to disable that type of error generation. */
#ifndef IPV4_FILTER_DUPLICATE_RATE
#define IPV4_FILTER_DUPLICATE_RATE		(0)
#endif

#ifndef IPV4_FILTER_DROP_RATE
#define IPV4_FILTER_DROP_RATE			(0)
#endif

#ifndef IPV4_FILTER_BIT_ERROR_RATE
#define IPV4_FILTER_BIT_ERROR_RATE		(0)
#endif


/*********************************************************************************
* IPV4_FILTER_MAXIMUM_DELAY
*   This is the maximum delay in milliseconds that will be applied to an individual
*   packet. Assuming the packet has not been dropped, then a random delay will
*   be chosen between 0 and IPV4_FILTER_MAXIMUM_DELAY. This random delay will create
*   out of order packets.
* IPV4_FILTER_BURST_COUNT
*   Only valid when IPV4_FILTER_MAXIMUM_DELAY is greater than zero.
*   This option indicates how many delayed packets can be passed into the IPv4 Layer
*     on a single call to the task function.
*********************************************************************************/
#ifndef IPV4_FILTER_MAXIMUM_DELAY
#define IPV4_FILTER_MAXIMUM_DELAY		(0)
#endif

#ifndef IPV4_FILTER_BURST_COUNT
#define IPV4_FILTER_BURST_COUNT			(4)
#endif


/* IPV6 is not currently implemented but you may search
for IPV6_ENABLED to find places where it is believed that
IPV6 code should be added.*/
#ifndef IPV6_ENABLED
#define IPV6_ENABLED		(0)
#endif


#ifndef RAW_ENABLED
#define RAW_ENABLED				(0)
#endif


#ifndef UDP_ENABLED
#define UDP_ENABLED				(1)
#endif

	#ifndef UDP_CONTROL_BLOCK_COUNT
	#define UDP_CONTROL_BLOCK_COUNT		(5)
	#endif

	#ifndef UDP_LOCAL_PORT_RANGE_START
	#define UDP_LOCAL_PORT_RANGE_START 	(0x1000)
	#endif

	#ifndef UDP_LOCAL_PORT_RANGE_END
	#define UDP_LOCAL_PORT_RANGE_END   	(0x7FFF)
	#endif

	
#ifndef TCP_ENABLED
#define TCP_ENABLED				(1)
#endif

	#ifndef TCP_TIME_TO_LIVE
	#define TCP_TIME_TO_LIVE					(255)
	#endif

	#ifndef TCP_MAXIMUM_SEGMENT_SIZE
	#define TCP_MAXIMUM_SEGMENT_SIZE			(1460)		/* Maximum Segment Size */
	#endif

	#ifndef TCP_WINDOW_SIZE
	#define TCP_WINDOW_SIZE						(4*TCP_MAXIMUM_SEGMENT_SIZE)	/* TCP receive window */

⌨️ 快捷键说明

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