OSDN Git Service

一部のコンフィギュレーションを外部指定できるように変更
[mimic/MiMicSDK.git] / lib / src / uip / NyLPC_cUipService_protected.h
index fbdebda..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
 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
 {\r
        const NyLPC_TcIPv4Config_t* _ref_config;\r
-       NyLPC_TUInt16   _status;                        /**< ステータスビット*/\r
-       void*                   _task_cmd;                      /**< タスク操作用コマンド*/\r
+       volatile NyLPC_TUInt16  _status;                        /**< ステータスビット*/\r
        NyLPC_TcSemaphore_t _emac_semapho;      /** EMACの制御用セマフォです。*/\r
        NyLPC_TcStopwatch_t _arp_sw;            /**<ARP用のストップウォッチ*/\r
        NyLPC_TcStopwatch_t _periodic_sw;       /**<周期実行用のストップウォッチ*/\r
@@ -59,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
@@ -78,16 +71,16 @@ extern NyLPC_TcUipService_t* _NyLPC_TcUipService_inst;
 /**\r
  * サービスが稼働中か返します。\r
  */\r
-#define NyLPC_cUipService_isRun() NyLPC_TUInt16_isBitOn(_NyLPC_TcUipService_inst->_status,NyLPC_TcUipService_STATUS_RUN)\r
+#define NyLPC_cUipService_isRun() NyLPC_TUInt16_isBitOn(_NyLPC_TcUipService_inst->_status,NyLPC_TcUipService_STATUSBIT_IS_RUNNING)\r
 \r
 \r
 /**********************************************************************\r
  * コントロールビットの定義\r
  **********************************************************************/\r
-//ã\82µã\83¼ã\83\93ã\82¹ã\81¯å®\9fè¡\8c中\r
-#define NyLPC_TcUipService_STATUS_RUN          0x0001\r
-//サービスは停止中\r
-#define NyLPC_TcUipService_STATUS_STOP         0x0002\r
+//ã\82µã\83¼ã\83\93ã\82¹ã\81\8cå®\9fè¡\8c中ã\81®å ´å\90\881\r
+#define NyLPC_TcUipService_STATUSBIT_IS_RUNNING 0\r
+#define NyLPC_TcUipService_ORDER_START                 1\r
+#define NyLPC_TcUipService_ORDER_STOP                  2\r
 \r
 \r
 \r
@@ -100,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
@@ -126,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
@@ -141,8 +148,6 @@ void NyLPC_cUipService_sendArpRequest(const struct NyLPC_TIPv4Addr* i_addr);
 NyLPC_TBool NyLPC_cUipService_hasArpInfo(const struct NyLPC_TIPv4Addr* i_addr);\r
 \r
 \r
-void NyLPC_cTcpSocket_periodic(\r
-       NyLPC_TcTcpSocket_t* i_inst);\r
 \r
 \r
 \r