Added RAW sockets.

Fork of WIZnetInterface by WIZnet

Revision:
5:f432ae8f8708
Parent:
4:4930f81bbe98
Child:
6:94a81e80c675
diff -r 4930f81bbe98 -r f432ae8f8708 arch/ext/W5500.h
--- a/arch/ext/W5500.h	Mon Jun 15 22:12:21 2015 +0900
+++ b/arch/ext/W5500.h	Mon Jun 15 22:39:51 2015 +0900
@@ -28,9 +28,6 @@
 
 
 
-#define SOCK_OK               1        ///< Result is OK about socket process.
-#define SOCK_BUSY             0        ///< Socket is busy on processing the operation. Valid only Non-block IO Mode.
-#define SOCK_FATAL            -1000    ///< Result is fatal error about socket process.
 
 #define SOCK_ERROR            0        
 #define SOCKERR_SOCKNUM       (SOCK_ERROR - 1)     ///< Invalid socket number
@@ -64,15 +61,9 @@
 #define SIMR      0x0018
 #define RTR       0x0019
 #define RCR       0x001b
-#define PTIMER    0x001c
-#define PMAGIC    0x001d
-#define PHAR      0x001e
-#define PSID      0x0024
-#define PMRU      0x0026
 #define UIPR      0x0028
 #define UPORTR    0x002c
 #define PHYCFGR   0x002e
-#define VERSIONR  0x0039
 
 // W5500 socket register
 #define Sn_MR         0x0000
@@ -83,9 +74,6 @@
 #define Sn_DHAR       0x0006
 #define Sn_DIPR       0x000c
 #define Sn_DPORT      0x0010
-#define Sn_MSSR       0x0012
-#define Sn_TOS        0x0015
-#define Sn_TTL        0x0016
 #define Sn_RXBUF_SIZE 0x001e
 #define Sn_TXBUF_SIZE 0x001f
 #define Sn_TX_FSR     0x0020
@@ -95,12 +83,7 @@
 #define Sn_RX_RD      0x0028
 #define Sn_RX_WR      0x002a
 #define Sn_IMR        0x002c
-#define Sn_FRAG        0x002d
-#define Sn_KPALVTR    0x002f
 
-//define for Mode Register option value
-#define MR_PPPOE      0x08
-#define MR_RST        0x80
 
 //Define for Socket Command register option value
 #define Sn_CR_OPEN      0x01
@@ -133,20 +116,6 @@
 #define Sn_IR_DISCON                 0x02
 #define Sn_IR_CON                    0x01
 
-/*
- * SOCKET FLAG
- */
-#define SF_ETHER_OWN           (Sn_MR_MFEN)        ///< In \ref Sn_MR_MACRAW, Receive only the packet as broadcast, multicast and own packet
-#define SF_IGMP_VER2           (Sn_MR_ND)          ///< In \ref Sn_MR_UDP with \ref SF_MULTI_ENABLE, Select IGMP version 2.   
-#define SF_TCP_NODELAY         (Sn_MR_ND)          ///< In \ref Sn_MR_TCP, Use to nodelayed ack.
-#define SF_MULTI_ENABLE        (Sn_MR_MULTI)       ///< In \ref Sn_MR_UDP, Enable multicast mode.
-#define SF_IO_NONBLOCK           0x01              ///< Socket nonblock io mode. It used parameter in \ref socket().
-#define SF_BROAD_BLOCK         (Sn_MR_BCASTB)   ///< In \ref Sn_MR_UDP or \ref Sn_MR_MACRAW, Block broadcast packet. Valid only in W5500
-#define SF_MULTI_BLOCK         (Sn_MR_MMB)      ///< In \ref Sn_MR_MACRAW, Block multicast packet. Valid only in W5500
-#define SF_IPv6_BLOCK          (Sn_MR_MIP6B)    ///< In \ref Sn_MR_MACRAW, Block IPv6 packet. Valid only in W5500
-#define SF_UNI_BLOCK           (Sn_MR_UCASTB)   ///< In \ref Sn_MR_UDP with \ref SF_MULTI_ENABLE. Valid only in W5500
-
-#define SOCK_MACRAW                  0x42
 
 
 /* PHYCFGR register value */
@@ -210,6 +179,16 @@
     INT_SEND_OK = 0x10,
 };
 
+enum Status {
+    SOCK_CLOSED      = 0x00,
+    SOCK_INIT        = 0x13,
+    SOCK_LISTEN      = 0x14,
+    SOCK_SYNSENT     = 0x15,
+    SOCK_ESTABLISHED = 0x17,
+    SOCK_CLOSE_WAIT  = 0x1c,
+    SOCK_UDP         = 0x22,
+};
+
     
     uint16_t sock_any_port;