OSDN Git Service

一部のコンフィギュレーションを外部指定できるように変更
[mimic/MiMicSDK.git] / lib / src / uip / NyLPC_cUipService_protected.h
index 40a2aa1..9450421 100644 (file)
@@ -27,8 +27,7 @@
 #ifndef NyLPC_uipService_protected_H\r
 #define NyLPC_uipService_protected_H\r
 #include "NyLPC_cUipService.h"\r
-#include "../driver/uip/EthDev.h"\r
-#include "../driver/uip/EthDev_LPC17xx.h"\r
+#include "../driver/ethernet/EthDev.h"\r
 \r
 /**********************************************************************\r
  *\r
@@ -39,7 +38,8 @@
 extern "C" {\r
 #endif /* __cplusplus */\r
 \r
-#define NyLPC_TcUipService_SIZE_OF_REPLY_BUF 128\r
+//#define NyLPC_TcUipService_SIZE_OF_REPLY_BUF 128\r
+\r
 \r
 \r
 struct NyLPC_TcUipService\r
@@ -58,12 +58,6 @@ struct NyLPC_TcUipService
        /** (Ethernetメモリ排他制御用)*/\r
        NyLPC_TcMutex_t _mutex;\r
        const struct TiEthernetDevice* _ethif;\r
-       /** ipタスクが使う小サイズ送信バッファ*/\r
-       struct\r
-       {\r
-               struct NyLPC_TTxBufferHeader h;\r
-               NyLPC_TUInt8 buf[NyLPC_TcUipService_SIZE_OF_REPLY_BUF];\r
-       }stx;\r
 };\r
 \r
 \r
@@ -99,6 +93,11 @@ extern NyLPC_TcUipService_t* _NyLPC_TcUipService_inst;
  * cTcpSocketからコールする関数\r
  **********************************************************************/\r
 \r
+/**\r
+ * NyLPC_cUipService_allocTxBufが返却するメモリサイズ。\r
+ *\r
+ */\r
+#define NyLPC_cUipService_SYS_TX_BUF_SIZE (64-sizeof(struct NyLPC_TEthernetIIHeader))\r
 \r
 \r
 /**\r
@@ -125,6 +124,15 @@ void NyLPC_cUipService_sendIPv4Tx(void* i_eth_payload);
 void* NyLPC_cUipService_allocTxBuf(NyLPC_TUInt16 i_hint,NyLPC_TUInt16* o_size);\r
 \r
 /**\r
+ * システム用の小さな送信ペイロードメモリを返します。\r
+ * この関数は、リエントラントを許容します。\r
+ * 返却するメモリブロックのサイズが小さいこと、メモリが確実に返される点がNyLPC_cUipService_allocTxBufと異なります。\r
+ * この関数が返すメモリのサイズは、NyLPC_cUipService_SYS_TX_BUF_SIZEの値です。\r
+ * 関数を使用するコードでは開始時に1度だけNyLPC_cUipService_SYS_TX_BUF_SIZEの値を確認して下さい。\r
+ */\r
+void* NyLPC_cUipService_allocSysTxBuf(void);\r
+\r
+/**\r
  * allocTxbufで確保したメモリを開放します。\r
  */\r
 void* NyLPC_cUipService_releaseTxBuf(void* i_buf);\r