Commit dcf5371c authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: epl: remove WORD

It's u16 in kernelspace, not WORD.

Cc: Daniel Krueger <daniel.krueger@systec-electronic.com>
Cc: Ronald Sieber <Ronald.Sieber@systec-electronic.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d539cfb0
...@@ -634,13 +634,13 @@ ...@@ -634,13 +634,13 @@
extern "C" { extern "C" {
#endif #endif
void DumpData(char *szStr_p, u8 *pbData_p, WORD wSize_p); void DumpData(char *szStr_p, u8 *pbData_p, u16 wSize_p);
#ifdef __cplusplus #ifdef __cplusplus
} // von extern "C" } // von extern "C"
#endif #endif
#define DEBUG_DUMP_DATA(lvl,str,ptr,siz) if ((DEBUG_GLB_LVL() & (lvl))==(lvl)) \ #define DEBUG_DUMP_DATA(lvl,str,ptr,siz) if ((DEBUG_GLB_LVL() & (lvl))==(lvl)) \
DumpData (str, (u8 *)(ptr), (WORD)(siz)); DumpData (str, (u8 *)(ptr), (u16)(siz));
#else #else
#define DEBUG_DUMP_DATA(lvl,str,ptr,siz) #define DEBUG_DUMP_DATA(lvl,str,ptr,siz)
......
...@@ -464,9 +464,9 @@ tEplKernel EdrvDefineRxMacAddrEntry(u8 * pbMacAddr_p) ...@@ -464,9 +464,9 @@ tEplKernel EdrvDefineRxMacAddrEntry(u8 * pbMacAddr_p)
dwData = ether_crc(6, pbMacAddr_p); dwData = ether_crc(6, pbMacAddr_p);
printk("EdrvDefineRxMacAddrEntry('%02X:%02X:%02X:%02X:%02X:%02X') hash = %u / %u ether_crc = 0x%08lX\n", printk("EdrvDefineRxMacAddrEntry('%02X:%02X:%02X:%02X:%02X:%02X') hash = %u / %u ether_crc = 0x%08lX\n",
(WORD) pbMacAddr_p[0], (WORD) pbMacAddr_p[1], (WORD) pbMacAddr_p[2], (u16) pbMacAddr_p[0], (u16) pbMacAddr_p[1], (u16) pbMacAddr_p[2],
(WORD) pbMacAddr_p[3], (WORD) pbMacAddr_p[4], (WORD) pbMacAddr_p[5], (u16) pbMacAddr_p[3], (u16) pbMacAddr_p[4], (u16) pbMacAddr_p[5],
(WORD) bHash, (WORD) (dwData >> 26), dwData); (u16) bHash, (u16) (dwData >> 26), dwData);
*/ */
if (bHash > 31) { if (bHash > 31) {
dwData = EDRV_REGDW_READ(EDRV_REGDW_MAR4); dwData = EDRV_REGDW_READ(EDRV_REGDW_MAR4);
...@@ -624,7 +624,7 @@ tEplKernel EdrvSendTxMsg(tEdrvTxBuffer * pBuffer_p) ...@@ -624,7 +624,7 @@ tEplKernel EdrvSendTxMsg(tEdrvTxBuffer * pBuffer_p)
printk("%s InvOp TSD%u = 0x%08X", __func__, printk("%s InvOp TSD%u = 0x%08X", __func__,
EdrvInstance_l.m_uiCurTxDesc, dwTemp); EdrvInstance_l.m_uiCurTxDesc, dwTemp);
printk(" Cmd = 0x%02X\n", printk(" Cmd = 0x%02X\n",
(WORD) EDRV_REGB_READ(EDRV_REGB_COMMAND)); (u16) EDRV_REGB_READ(EDRV_REGB_COMMAND));
goto Exit; goto Exit;
} }
// save pointer to buffer structure for TxHandler // save pointer to buffer structure for TxHandler
...@@ -761,10 +761,10 @@ static int TgtEthIsr(int nIrqNum_p, void *ppDevInstData_p, ...@@ -761,10 +761,10 @@ static int TgtEthIsr(int nIrqNum_p, void *ppDevInstData_p,
// EdrvInterruptHandler(); // EdrvInterruptHandler();
tEdrvRxBuffer RxBuffer; tEdrvRxBuffer RxBuffer;
tEdrvTxBuffer *pTxBuffer; tEdrvTxBuffer *pTxBuffer;
WORD wStatus; u16 wStatus;
u32 dwTxStatus; u32 dwTxStatus;
u32 dwRxStatus; u32 dwRxStatus;
WORD wCurRx; u16 wCurRx;
u8 *pbRxBuf; u8 *pbRxBuf;
unsigned int uiLength; unsigned int uiLength;
int iHandled = IRQ_HANDLED; int iHandled = IRQ_HANDLED;
...@@ -898,7 +898,7 @@ static int TgtEthIsr(int nIrqNum_p, void *ppDevInstData_p, ...@@ -898,7 +898,7 @@ static int TgtEthIsr(int nIrqNum_p, void *ppDevInstData_p,
// calulate new offset (u32 aligned) // calulate new offset (u32 aligned)
wCurRx = wCurRx =
(WORD) ((wCurRx + uiLength + sizeof(dwRxStatus) + (u16) ((wCurRx + uiLength + sizeof(dwRxStatus) +
3) & ~0x3); 3) & ~0x3);
EDRV_TRACE_CAPR(wCurRx - 0x10); EDRV_TRACE_CAPR(wCurRx - 0x10);
EDRV_REGW_WRITE(EDRV_REGW_CAPR, wCurRx - 0x10); EDRV_REGW_WRITE(EDRV_REGW_CAPR, wCurRx - 0x10);
...@@ -1087,7 +1087,7 @@ static int EdrvInitOne(struct pci_dev *pPciDev, const struct pci_device_id *pId) ...@@ -1087,7 +1087,7 @@ static int EdrvInitOne(struct pci_dev *pPciDev, const struct pci_device_id *pId)
dwTemp = EDRV_REGDW_READ(EDRV_REGDW_TSAD3); dwTemp = EDRV_REGDW_READ(EDRV_REGDW_TSAD3);
printk(" Command = 0x%02X\n", printk(" Command = 0x%02X\n",
(WORD) EDRV_REGB_READ(EDRV_REGB_COMMAND)); (u16) EDRV_REGB_READ(EDRV_REGB_COMMAND));
// set pointer for receive buffer in controller // set pointer for receive buffer in controller
printk("%s set pointer to Rx buffer\n", __func__); printk("%s set pointer to Rx buffer\n", __func__);
...@@ -1098,7 +1098,7 @@ static int EdrvInitOne(struct pci_dev *pPciDev, const struct pci_device_id *pId) ...@@ -1098,7 +1098,7 @@ static int EdrvInitOne(struct pci_dev *pPciDev, const struct pci_device_id *pId)
EDRV_REGB_WRITE(EDRV_REGB_COMMAND, EDRV_REGB_WRITE(EDRV_REGB_COMMAND,
(EDRV_REGB_COMMAND_RE | EDRV_REGB_COMMAND_TE)); (EDRV_REGB_COMMAND_RE | EDRV_REGB_COMMAND_TE));
printk(" Command = 0x%02X\n", printk(" Command = 0x%02X\n",
(WORD) EDRV_REGB_READ(EDRV_REGB_COMMAND)); (u16) EDRV_REGB_READ(EDRV_REGB_COMMAND));
// clear missed packet counter to enable Rx/Tx process // clear missed packet counter to enable Rx/Tx process
EDRV_REGDW_WRITE(EDRV_REGDW_MPC, 0); EDRV_REGDW_WRITE(EDRV_REGDW_MPC, 0);
...@@ -1123,7 +1123,7 @@ static int EdrvInitOne(struct pci_dev *pPciDev, const struct pci_device_id *pId) ...@@ -1123,7 +1123,7 @@ static int EdrvInitOne(struct pci_dev *pPciDev, const struct pci_device_id *pId)
// enable transmitter and receiver // enable transmitter and receiver
printk("%s enable Tx and Rx", __func__); printk("%s enable Tx and Rx", __func__);
EDRV_REGB_WRITE(EDRV_REGB_COMMAND, (EDRV_REGB_COMMAND_RE | EDRV_REGB_COMMAND_TE)); EDRV_REGB_WRITE(EDRV_REGB_COMMAND, (EDRV_REGB_COMMAND_RE | EDRV_REGB_COMMAND_TE));
printk(" Command = 0x%02X\n", (WORD) EDRV_REGB_READ(EDRV_REGB_COMMAND)); printk(" Command = 0x%02X\n", (u16) EDRV_REGB_READ(EDRV_REGB_COMMAND));
*/ */
// disable early interrupts // disable early interrupts
EDRV_REGW_WRITE(EDRV_REGW_MULINT, 0); EDRV_REGW_WRITE(EDRV_REGW_MULINT, 0);
......
...@@ -96,8 +96,8 @@ ...@@ -96,8 +96,8 @@
// Rx and Tx buffer descriptor format // Rx and Tx buffer descriptor format
typedef struct { typedef struct {
WORD m_wStatus; // control / status --- used by edrv, do not change in application u16 m_wStatus; // control / status --- used by edrv, do not change in application
WORD m_wLength; // transfer length u16 m_wLength; // transfer length
u8 *m_pbData; // buffer address u8 *m_pbData; // buffer address
} tBufferDescr; } tBufferDescr;
......
...@@ -84,6 +84,6 @@ ...@@ -84,6 +84,6 @@
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void EdrvRxInterruptHandler(u8 bBufferInFrame_p, u8 * pbEthernetData_p, void EdrvRxInterruptHandler(u8 bBufferInFrame_p, u8 * pbEthernetData_p,
WORD wDataLen_p); u16 wDataLen_p);
#endif // #ifndef _EDRVSIM_H_ #endif // #ifndef _EDRVSIM_H_
...@@ -89,7 +89,7 @@ typedef struct { ...@@ -89,7 +89,7 @@ typedef struct {
unsigned int m_uiNodeId; unsigned int m_uiNodeId;
tEplNmtState m_NmtState; tEplNmtState m_NmtState;
tEplNmtNodeEvent m_NodeEvent; tEplNmtNodeEvent m_NodeEvent;
WORD m_wErrorCode; // EPL error code if m_NodeEvent == kEplNmtNodeEventError u16 m_wErrorCode; // EPL error code if m_NodeEvent == kEplNmtNodeEventError
BOOL m_fMandatory; BOOL m_fMandatory;
} tEplApiEventNode; } tEplApiEventNode;
...@@ -97,7 +97,7 @@ typedef struct { ...@@ -97,7 +97,7 @@ typedef struct {
typedef struct { typedef struct {
tEplNmtState m_NmtState; // local NMT state tEplNmtState m_NmtState; // local NMT state
tEplNmtBootEvent m_BootEvent; tEplNmtBootEvent m_BootEvent;
WORD m_wErrorCode; // EPL error code if m_BootEvent == kEplNmtBootEventError u16 m_wErrorCode; // EPL error code if m_BootEvent == kEplNmtBootEventError
} tEplApiEventBoot; } tEplApiEventBoot;
......
...@@ -110,9 +110,9 @@ extern "C" { ...@@ -110,9 +110,9 @@ extern "C" {
#define AmiSetByteToBe(pAddr_p, bByteVal_p) {*(u8 *)(pAddr_p) = (bByteVal_p);} #define AmiSetByteToBe(pAddr_p, bByteVal_p) {*(u8 *)(pAddr_p) = (bByteVal_p);}
#define AmiSetByteToLe(pAddr_p, bByteVal_p) {*(u8 *)(pAddr_p) = (bByteVal_p);} #define AmiSetByteToLe(pAddr_p, bByteVal_p) {*(u8 *)(pAddr_p) = (bByteVal_p);}
void AmiSetWordToBe(void *pAddr_p, WORD wWordVal_p); void AmiSetWordToBe(void *pAddr_p, u16 wWordVal_p);
void AmiSetDwordToBe(void *pAddr_p, u32 dwDwordVal_p); void AmiSetDwordToBe(void *pAddr_p, u32 dwDwordVal_p);
void AmiSetWordToLe(void *pAddr_p, WORD wWordVal_p); void AmiSetWordToLe(void *pAddr_p, u16 wWordVal_p);
void AmiSetDwordToLe(void *pAddr_p, u32 dwDwordVal_p); void AmiSetDwordToLe(void *pAddr_p, u32 dwDwordVal_p);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -126,9 +126,9 @@ void AmiSetDwordToLe(void *pAddr_p, u32 dwDwordVal_p); ...@@ -126,9 +126,9 @@ void AmiSetDwordToLe(void *pAddr_p, u32 dwDwordVal_p);
#define AmiGetByteFromBe(pAddr_p) (*(u8 *)(pAddr_p)) #define AmiGetByteFromBe(pAddr_p) (*(u8 *)(pAddr_p))
#define AmiGetByteFromLe(pAddr_p) (*(u8 *)(pAddr_p)) #define AmiGetByteFromLe(pAddr_p) (*(u8 *)(pAddr_p))
WORD AmiGetWordFromBe(void *pAddr_p); u16 AmiGetWordFromBe(void *pAddr_p);
u32 AmiGetDwordFromBe(void *pAddr_p); u32 AmiGetDwordFromBe(void *pAddr_p);
WORD AmiGetWordFromLe(void *pAddr_p); u16 AmiGetWordFromLe(void *pAddr_p);
u32 AmiGetDwordFromLe(void *pAddr_p); u32 AmiGetDwordFromLe(void *pAddr_p);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
...@@ -183,11 +183,11 @@ static tEplKernel EplApiCbSdoCon(tEplSdoComFinished *pSdoComFinished_p); ...@@ -183,11 +183,11 @@ static tEplKernel EplApiCbSdoCon(tEplSdoComFinished *pSdoComFinished_p);
static tEplKernel EplApiCbNodeEvent(unsigned int uiNodeId_p, static tEplKernel EplApiCbNodeEvent(unsigned int uiNodeId_p,
tEplNmtNodeEvent NodeEvent_p, tEplNmtNodeEvent NodeEvent_p,
tEplNmtState NmtState_p, tEplNmtState NmtState_p,
WORD wErrorCode_p, BOOL fMandatory_p); u16 wErrorCode_p, BOOL fMandatory_p);
static tEplKernel EplApiCbBootEvent(tEplNmtBootEvent BootEvent_p, static tEplKernel EplApiCbBootEvent(tEplNmtBootEvent BootEvent_p,
tEplNmtState NmtState_p, tEplNmtState NmtState_p,
WORD wErrorCode_p); u16 wErrorCode_p);
#endif #endif
#if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_LEDU)) != 0) #if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_LEDU)) != 0)
...@@ -1412,7 +1412,7 @@ static tEplKernel EplApiUpdateDllConfig(BOOL fUpdateIdentity_p) ...@@ -1412,7 +1412,7 @@ static tEplKernel EplApiUpdateDllConfig(BOOL fUpdateIdentity_p)
tEplDllConfigParam DllConfigParam; tEplDllConfigParam DllConfigParam;
tEplDllIdentParam DllIdentParam; tEplDllIdentParam DllIdentParam;
tEplObdSize ObdSize; tEplObdSize ObdSize;
WORD wTemp; u16 wTemp;
u8 bTemp; u8 bTemp;
// configure Dll // configure Dll
...@@ -1632,7 +1632,7 @@ static tEplKernel EplApiUpdateDllConfig(BOOL fUpdateIdentity_p) ...@@ -1632,7 +1632,7 @@ static tEplKernel EplApiUpdateDllConfig(BOOL fUpdateIdentity_p)
static tEplKernel EplApiUpdateObd(void) static tEplKernel EplApiUpdateObd(void)
{ {
tEplKernel Ret = kEplSuccessful; tEplKernel Ret = kEplSuccessful;
WORD wTemp; u16 wTemp;
u8 bTemp; u8 bTemp;
// set node id in OD // set node id in OD
...@@ -1675,14 +1675,14 @@ static tEplKernel EplApiUpdateObd(void) ...@@ -1675,14 +1675,14 @@ static tEplKernel EplApiUpdateObd(void)
} */ } */
} }
wTemp = (WORD) EplApiInstance_g.m_InitParam.m_uiIsochrTxMaxPayload; wTemp = (u16) EplApiInstance_g.m_InitParam.m_uiIsochrTxMaxPayload;
Ret = EplObdWriteEntry(0x1F98, 1, &wTemp, 2); Ret = EplObdWriteEntry(0x1F98, 1, &wTemp, 2);
/* if(Ret != kEplSuccessful) /* if(Ret != kEplSuccessful)
{ {
goto Exit; goto Exit;
}*/ }*/
wTemp = (WORD) EplApiInstance_g.m_InitParam.m_uiIsochrRxMaxPayload; wTemp = (u16) EplApiInstance_g.m_InitParam.m_uiIsochrRxMaxPayload;
Ret = EplObdWriteEntry(0x1F98, 2, &wTemp, 2); Ret = EplObdWriteEntry(0x1F98, 2, &wTemp, 2);
/* if(Ret != kEplSuccessful) /* if(Ret != kEplSuccessful)
{ {
...@@ -1701,7 +1701,7 @@ static tEplKernel EplApiUpdateObd(void) ...@@ -1701,7 +1701,7 @@ static tEplKernel EplApiUpdateObd(void)
if (EplApiInstance_g.m_InitParam.m_uiPreqActPayloadLimit <= if (EplApiInstance_g.m_InitParam.m_uiPreqActPayloadLimit <=
EPL_C_DLL_ISOCHR_MAX_PAYL) { EPL_C_DLL_ISOCHR_MAX_PAYL) {
wTemp = wTemp =
(WORD) EplApiInstance_g.m_InitParam.m_uiPreqActPayloadLimit; (u16) EplApiInstance_g.m_InitParam.m_uiPreqActPayloadLimit;
Ret = EplObdWriteEntry(0x1F98, 4, &wTemp, 2); Ret = EplObdWriteEntry(0x1F98, 4, &wTemp, 2);
/* if(Ret != kEplSuccessful) /* if(Ret != kEplSuccessful)
{ {
...@@ -1712,7 +1712,7 @@ static tEplKernel EplApiUpdateObd(void) ...@@ -1712,7 +1712,7 @@ static tEplKernel EplApiUpdateObd(void)
if (EplApiInstance_g.m_InitParam.m_uiPresActPayloadLimit <= if (EplApiInstance_g.m_InitParam.m_uiPresActPayloadLimit <=
EPL_C_DLL_ISOCHR_MAX_PAYL) { EPL_C_DLL_ISOCHR_MAX_PAYL) {
wTemp = wTemp =
(WORD) EplApiInstance_g.m_InitParam.m_uiPresActPayloadLimit; (u16) EplApiInstance_g.m_InitParam.m_uiPresActPayloadLimit;
Ret = EplObdWriteEntry(0x1F98, 5, &wTemp, 2); Ret = EplObdWriteEntry(0x1F98, 5, &wTemp, 2);
/* if(Ret != kEplSuccessful) /* if(Ret != kEplSuccessful)
{ {
...@@ -1740,7 +1740,7 @@ static tEplKernel EplApiUpdateObd(void) ...@@ -1740,7 +1740,7 @@ static tEplKernel EplApiUpdateObd(void)
if (EplApiInstance_g.m_InitParam.m_uiAsyncMtu <= if (EplApiInstance_g.m_InitParam.m_uiAsyncMtu <=
EPL_C_DLL_MAX_ASYNC_MTU) { EPL_C_DLL_MAX_ASYNC_MTU) {
wTemp = (WORD) EplApiInstance_g.m_InitParam.m_uiAsyncMtu; wTemp = (u16) EplApiInstance_g.m_InitParam.m_uiAsyncMtu;
Ret = EplObdWriteEntry(0x1F98, 8, &wTemp, 2); Ret = EplObdWriteEntry(0x1F98, 8, &wTemp, 2);
/* if(Ret != kEplSuccessful) /* if(Ret != kEplSuccessful)
{ {
...@@ -1749,7 +1749,7 @@ static tEplKernel EplApiUpdateObd(void) ...@@ -1749,7 +1749,7 @@ static tEplKernel EplApiUpdateObd(void)
} }
if (EplApiInstance_g.m_InitParam.m_uiPrescaler <= 1000) { if (EplApiInstance_g.m_InitParam.m_uiPrescaler <= 1000) {
wTemp = (WORD) EplApiInstance_g.m_InitParam.m_uiPrescaler; wTemp = (u16) EplApiInstance_g.m_InitParam.m_uiPrescaler;
Ret = EplObdWriteEntry(0x1F98, 9, &wTemp, 2); Ret = EplObdWriteEntry(0x1F98, 9, &wTemp, 2);
// ignore return code // ignore return code
Ret = kEplSuccessful; Ret = kEplSuccessful;
...@@ -1944,7 +1944,7 @@ static tEplKernel EplApiCbSdoCon(tEplSdoComFinished *pSdoComFinished_p) ...@@ -1944,7 +1944,7 @@ static tEplKernel EplApiCbSdoCon(tEplSdoComFinished *pSdoComFinished_p)
static tEplKernel EplApiCbNodeEvent(unsigned int uiNodeId_p, static tEplKernel EplApiCbNodeEvent(unsigned int uiNodeId_p,
tEplNmtNodeEvent NodeEvent_p, tEplNmtNodeEvent NodeEvent_p,
tEplNmtState NmtState_p, tEplNmtState NmtState_p,
WORD wErrorCode_p, BOOL fMandatory_p) u16 wErrorCode_p, BOOL fMandatory_p)
{ {
tEplKernel Ret; tEplKernel Ret;
tEplApiEventArg EventArg; tEplApiEventArg EventArg;
...@@ -1987,7 +1987,7 @@ static tEplKernel EplApiCbNodeEvent(unsigned int uiNodeId_p, ...@@ -1987,7 +1987,7 @@ static tEplKernel EplApiCbNodeEvent(unsigned int uiNodeId_p,
static tEplKernel EplApiCbBootEvent(tEplNmtBootEvent BootEvent_p, static tEplKernel EplApiCbBootEvent(tEplNmtBootEvent BootEvent_p,
tEplNmtState NmtState_p, tEplNmtState NmtState_p,
WORD wErrorCode_p) u16 wErrorCode_p)
{ {
tEplKernel Ret; tEplKernel Ret;
tEplApiEventArg EventArg; tEplApiEventArg EventArg;
......
...@@ -192,8 +192,8 @@ typedef struct { ...@@ -192,8 +192,8 @@ typedef struct {
typedef struct { typedef struct {
unsigned int m_uiNodeId; unsigned int m_uiNodeId;
WORD m_wPreqPayloadLimit; // object 0x1F8B: NMT_MNPReqPayloadLimitList_AU16 u16 m_wPreqPayloadLimit; // object 0x1F8B: NMT_MNPReqPayloadLimitList_AU16
WORD m_wPresPayloadLimit; // object 0x1F8D: NMT_PResPayloadLimitList_AU16 u16 m_wPresPayloadLimit; // object 0x1F8D: NMT_PResPayloadLimitList_AU16
u32 m_dwPresTimeout; // object 0x1F92: NMT_MNCNPResTimeout_AU32 u32 m_dwPresTimeout; // object 0x1F92: NMT_MNCNPResTimeout_AU32
} tEplDllNodeInfo; } tEplDllNodeInfo;
......
...@@ -720,18 +720,18 @@ tEplKernel EplDllkProcess(tEplEvent * pEvent_p) ...@@ -720,18 +720,18 @@ tEplKernel EplDllkProcess(tEplEvent * pEvent_p)
// MTU // MTU
AmiSetWordToLe(&pTxFrame->m_Data.m_Asnd.m_Payload. AmiSetWordToLe(&pTxFrame->m_Data.m_Asnd.m_Payload.
m_IdentResponse.m_le_wMtu, m_IdentResponse.m_le_wMtu,
(WORD) EplDllkInstance_g. (u16) EplDllkInstance_g.
m_DllConfigParam.m_uiAsyncMtu); m_DllConfigParam.m_uiAsyncMtu);
// PollInSize // PollInSize
AmiSetWordToLe(&pTxFrame->m_Data.m_Asnd.m_Payload. AmiSetWordToLe(&pTxFrame->m_Data.m_Asnd.m_Payload.
m_IdentResponse.m_le_wPollInSize, m_IdentResponse.m_le_wPollInSize,
(WORD) EplDllkInstance_g. (u16) EplDllkInstance_g.
m_DllConfigParam. m_DllConfigParam.
m_uiPreqActPayloadLimit); m_uiPreqActPayloadLimit);
// PollOutSize // PollOutSize
AmiSetWordToLe(&pTxFrame->m_Data.m_Asnd.m_Payload. AmiSetWordToLe(&pTxFrame->m_Data.m_Asnd.m_Payload.
m_IdentResponse.m_le_wPollOutSize, m_IdentResponse.m_le_wPollOutSize,
(WORD) EplDllkInstance_g. (u16) EplDllkInstance_g.
m_DllConfigParam. m_DllConfigParam.
m_uiPresActPayloadLimit); m_uiPresActPayloadLimit);
// ResponseTime / PresMaxLatency // ResponseTime / PresMaxLatency
...@@ -935,7 +935,7 @@ tEplKernel EplDllkProcess(tEplEvent * pEvent_p) ...@@ -935,7 +935,7 @@ tEplKernel EplDllkProcess(tEplEvent * pEvent_p)
// EplDllkInstance_g.m_aNodeInfo[uiIndex].m_uiNodeId = uiIndex + 1; // EplDllkInstance_g.m_aNodeInfo[uiIndex].m_uiNodeId = uiIndex + 1;
EplDllkInstance_g.m_aNodeInfo[uiIndex]. EplDllkInstance_g.m_aNodeInfo[uiIndex].
m_wPresPayloadLimit = m_wPresPayloadLimit =
(WORD) EplDllkInstance_g. (u16) EplDllkInstance_g.
m_DllConfigParam. m_DllConfigParam.
m_uiIsochrRxMaxPayload; m_uiIsochrRxMaxPayload;
} }
...@@ -3484,7 +3484,7 @@ static tEplKernel EplDllkCheckFrame(tEplFrame * pFrame_p, ...@@ -3484,7 +3484,7 @@ static tEplKernel EplDllkCheckFrame(tEplFrame * pFrame_p,
unsigned int uiFrameSize_p) unsigned int uiFrameSize_p)
{ {
tEplMsgType MsgType; tEplMsgType MsgType;
WORD wEtherType; u16 wEtherType;
// check frame // check frame
if (pFrame_p != NULL) { if (pFrame_p != NULL) {
......
...@@ -146,7 +146,7 @@ typedef struct { ...@@ -146,7 +146,7 @@ typedef struct {
// Offset 21 // Offset 21
u8 m_le_bRes2; // reserved u8 m_le_bRes2; // reserved
// Offset 22 // Offset 22
WORD m_le_wSize; u16 m_le_wSize;
// Offset 24 // Offset 24
u8 m_le_abPayload[256 /*D_NMT_IsochrRxMaxPayload_U16 */ ]; u8 m_le_abPayload[256 /*D_NMT_IsochrRxMaxPayload_U16 */ ];
...@@ -164,7 +164,7 @@ typedef struct { ...@@ -164,7 +164,7 @@ typedef struct {
// Offset 21 // Offset 21
u8 m_le_bRes2; // reserved u8 m_le_bRes2; // reserved
// Offset 22 // Offset 22
WORD m_le_wSize; u16 m_le_wSize;
// Offset 24 // Offset 24
u8 m_le_abPayload[256 /*D_NMT_IsochrRxMaxPayload_U16 u8 m_le_abPayload[256 /*D_NMT_IsochrRxMaxPayload_U16
/ D_NMT_IsochrTxMaxPayload_U16 */ ]; / D_NMT_IsochrTxMaxPayload_U16 */ ];
...@@ -188,8 +188,8 @@ typedef struct { ...@@ -188,8 +188,8 @@ typedef struct {
} PACK_STRUCT tEplSoaFrame; } PACK_STRUCT tEplSoaFrame;
typedef struct { typedef struct {
WORD m_wEntryType; u16 m_wEntryType;
WORD m_wErrorCode; u16 m_wErrorCode;
tEplNetTime m_TimeStamp; tEplNetTime m_TimeStamp;
u8 m_abAddInfo[8]; u8 m_abAddInfo[8];
...@@ -215,11 +215,11 @@ typedef struct { ...@@ -215,11 +215,11 @@ typedef struct {
u8 m_le_bEplProfileVersion; u8 m_le_bEplProfileVersion;
u8 m_le_bRes1; u8 m_le_bRes1;
u32 m_le_dwFeatureFlags; // NMT_FeatureFlags_U32 u32 m_le_dwFeatureFlags; // NMT_FeatureFlags_U32
WORD m_le_wMtu; // NMT_CycleTiming_REC.AsyncMTU_U16: C_IP_MIN_MTU - C_IP_MAX_MTU u16 m_le_wMtu; // NMT_CycleTiming_REC.AsyncMTU_U16: C_IP_MIN_MTU - C_IP_MAX_MTU
WORD m_le_wPollInSize; // NMT_CycleTiming_REC.PReqActPayload_U16 u16 m_le_wPollInSize; // NMT_CycleTiming_REC.PReqActPayload_U16
WORD m_le_wPollOutSize; // NMT_CycleTiming_REC.PResActPayload_U16 u16 m_le_wPollOutSize; // NMT_CycleTiming_REC.PResActPayload_U16
u32 m_le_dwResponseTime; // NMT_CycleTiming_REC.PResMaxLatency_U32 u32 m_le_dwResponseTime; // NMT_CycleTiming_REC.PResMaxLatency_U32
WORD m_le_wRes2; u16 m_le_wRes2;
u32 m_le_dwDeviceType; // NMT_DeviceType_U32 u32 m_le_dwDeviceType; // NMT_DeviceType_U32
u32 m_le_dwVendorId; // NMT_IdentityObject_REC.VendorId_U32 u32 m_le_dwVendorId; // NMT_IdentityObject_REC.VendorId_U32
u32 m_le_dwProductCode; // NMT_IdentityObject_REC.ProductCode_U32 u32 m_le_dwProductCode; // NMT_IdentityObject_REC.ProductCode_U32
...@@ -251,8 +251,8 @@ typedef struct { ...@@ -251,8 +251,8 @@ typedef struct {
u8 m_le_bTransactionId; u8 m_le_bTransactionId;
u8 m_le_bFlags; u8 m_le_bFlags;
u8 m_le_bCommandId; u8 m_le_bCommandId;
WORD m_le_wSegmentSize; u16 m_le_wSegmentSize;
WORD m_le_wReserved; u16 m_le_wReserved;
u8 m_le_abCommandData[8]; // just reserve a minimum number of bytes as a placeholder u8 m_le_abCommandData[8]; // just reserve a minimum number of bytes as a placeholder
} PACK_STRUCT tEplAsySdoCom; } PACK_STRUCT tEplAsySdoCom;
...@@ -310,7 +310,7 @@ typedef struct { ...@@ -310,7 +310,7 @@ typedef struct {
// Offset 6 // Offset 6
u8 m_be_abSrcMac[6]; // MAC address of the transmitting node u8 m_be_abSrcMac[6]; // MAC address of the transmitting node
// Offset 12 // Offset 12
WORD m_be_wEtherType; // Ethernet message type (big endian) u16 m_be_wEtherType; // Ethernet message type (big endian)
// Offset 14 // Offset 14
u8 m_le_bMessageType; // EPL message type u8 m_le_bMessageType; // EPL message type
// Offset 15 // Offset 15
......
...@@ -185,7 +185,7 @@ typedef struct { ...@@ -185,7 +185,7 @@ typedef struct {
typedef struct { typedef struct {
unsigned int m_uiNodeId; // NodeId unsigned int m_uiNodeId; // NodeId
tEplNmtState m_NmtState; // NMT state (remember distinguish between MN / CN) tEplNmtState m_NmtState; // NMT state (remember distinguish between MN / CN)
WORD m_wErrorCode; // EPL error code in case of NMT state NotActive u16 m_wErrorCode; // EPL error code in case of NMT state NotActive
} tEplHeartbeatEvent; } tEplHeartbeatEvent;
......
...@@ -212,7 +212,7 @@ typedef struct { ...@@ -212,7 +212,7 @@ typedef struct {
tEplTimerHdl m_TimerHdlLonger; // 2nd timer for NMT command EnableReadyToOp and CheckCommunication tEplTimerHdl m_TimerHdlLonger; // 2nd timer for NMT command EnableReadyToOp and CheckCommunication
tEplNmtMnuNodeState m_NodeState; // internal node state (kind of sub state of NMT state) tEplNmtMnuNodeState m_NodeState; // internal node state (kind of sub state of NMT state)
u32 m_dwNodeCfg; // subindex from 0x1F81 u32 m_dwNodeCfg; // subindex from 0x1F81
WORD m_wFlags; // flags: CN is being accessed isochronously u16 m_wFlags; // flags: CN is being accessed isochronously
} tEplNmtMnuNodeInfo; } tEplNmtMnuNodeInfo;
...@@ -224,7 +224,7 @@ typedef struct { ...@@ -224,7 +224,7 @@ typedef struct {
unsigned long m_ulStatusRequestDelay; // in [ms] (object 0x1006 * EPL_C_NMT_STATREQ_CYCLE) unsigned long m_ulStatusRequestDelay; // in [ms] (object 0x1006 * EPL_C_NMT_STATREQ_CYCLE)
unsigned long m_ulTimeoutReadyToOp; // in [ms] (object 0x1F89/5) unsigned long m_ulTimeoutReadyToOp; // in [ms] (object 0x1F89/5)
unsigned long m_ulTimeoutCheckCom; // in [ms] (object 0x1006 * MultiplexedCycleCount) unsigned long m_ulTimeoutCheckCom; // in [ms] (object 0x1006 * MultiplexedCycleCount)
WORD m_wFlags; // global flags u16 m_wFlags; // global flags
u32 m_dwNmtStartup; // object 0x1F80 NMT_StartUp_U32 u32 m_dwNmtStartup; // object 0x1F80 NMT_StartUp_U32
tEplNmtMnuCbNodeEvent m_pfnCbNodeEvent; tEplNmtMnuCbNodeEvent m_pfnCbNodeEvent;
tEplNmtMnuCbBootEvent m_pfnCbBootEvent; tEplNmtMnuCbBootEvent m_pfnCbBootEvent;
...@@ -252,7 +252,7 @@ static tEplKernel EplNmtMnuCbStatusResponse(unsigned int uiNodeId_p, ...@@ -252,7 +252,7 @@ static tEplKernel EplNmtMnuCbStatusResponse(unsigned int uiNodeId_p,
static tEplKernel EplNmtMnuCheckNmtState(unsigned int uiNodeId_p, static tEplKernel EplNmtMnuCheckNmtState(unsigned int uiNodeId_p,
tEplNmtMnuNodeInfo * pNodeInfo_p, tEplNmtMnuNodeInfo * pNodeInfo_p,
tEplNmtState NodeNmtState_p, tEplNmtState NodeNmtState_p,
WORD wErrorCode_p, u16 wErrorCode_p,
tEplNmtState LocalNmtState_p); tEplNmtState LocalNmtState_p);
static tEplKernel EplNmtMnuStartBootStep1(void); static tEplKernel EplNmtMnuStartBootStep1(void);
...@@ -271,7 +271,7 @@ static tEplKernel EplNmtMnuStartNodes(void); ...@@ -271,7 +271,7 @@ static tEplKernel EplNmtMnuStartNodes(void);
static tEplKernel EplNmtMnuProcessInternalEvent(unsigned int uiNodeId_p, static tEplKernel EplNmtMnuProcessInternalEvent(unsigned int uiNodeId_p,
tEplNmtState NodeNmtState_p, tEplNmtState NodeNmtState_p,
WORD wErrorCode_p, u16 wErrorCode_p,
tEplNmtMnuIntNodeEvent tEplNmtMnuIntNodeEvent
NodeEvent_p); NodeEvent_p);
...@@ -573,7 +573,7 @@ tEplKernel EplNmtMnuTriggerStateChange(unsigned int uiNodeId_p, ...@@ -573,7 +573,7 @@ tEplKernel EplNmtMnuTriggerStateChange(unsigned int uiNodeId_p,
tEplNmtMnuIntNodeEvent NodeEvent; tEplNmtMnuIntNodeEvent NodeEvent;
tEplObdSize ObdSize; tEplObdSize ObdSize;
u8 bNmtState; u8 bNmtState;
WORD wErrorCode = EPL_E_NO_ERROR; u16 wErrorCode = EPL_E_NO_ERROR;
if ((uiNodeId_p == 0) || (uiNodeId_p >= EPL_C_ADR_BROADCAST)) { if ((uiNodeId_p == 0) || (uiNodeId_p >= EPL_C_ADR_BROADCAST)) {
Ret = kEplInvalidNodeId; Ret = kEplInvalidNodeId;
...@@ -1257,7 +1257,7 @@ EPLDLLEXPORT tEplKernel EplNmtMnuProcessEvent(tEplEvent *pEvent_p) ...@@ -1257,7 +1257,7 @@ EPLDLLEXPORT tEplKernel EplNmtMnuProcessEvent(tEplEvent *pEvent_p)
tEplKernel EplNmtMnuGetDiagnosticInfo(unsigned int *puiMandatorySlaveCount_p, tEplKernel EplNmtMnuGetDiagnosticInfo(unsigned int *puiMandatorySlaveCount_p,
unsigned int *puiSignalSlaveCount_p, unsigned int *puiSignalSlaveCount_p,
WORD *pwFlags_p) u16 *pwFlags_p)
{ {
tEplKernel Ret = kEplSuccessful; tEplKernel Ret = kEplSuccessful;
...@@ -1377,7 +1377,7 @@ static tEplKernel EplNmtMnuCbIdentResponse(unsigned int uiNodeId_p, ...@@ -1377,7 +1377,7 @@ static tEplKernel EplNmtMnuCbIdentResponse(unsigned int uiNodeId_p,
} else { // node answered IdentRequest } else { // node answered IdentRequest
tEplObdSize ObdSize; tEplObdSize ObdSize;
u32 dwDevType; u32 dwDevType;
WORD wErrorCode = EPL_E_NO_ERROR; u16 wErrorCode = EPL_E_NO_ERROR;
tEplNmtState NmtState = tEplNmtState NmtState =
(tEplNmtState) (AmiGetByteFromLe (tEplNmtState) (AmiGetByteFromLe
(&pIdentResponse_p-> (&pIdentResponse_p->
...@@ -1909,7 +1909,7 @@ static tEplKernel EplNmtMnuStartNodes(void) ...@@ -1909,7 +1909,7 @@ static tEplKernel EplNmtMnuStartNodes(void)
static tEplKernel EplNmtMnuProcessInternalEvent(unsigned int uiNodeId_p, static tEplKernel EplNmtMnuProcessInternalEvent(unsigned int uiNodeId_p,
tEplNmtState NodeNmtState_p, tEplNmtState NodeNmtState_p,
WORD wErrorCode_p, u16 wErrorCode_p,
tEplNmtMnuIntNodeEvent tEplNmtMnuIntNodeEvent
NodeEvent_p) NodeEvent_p)
{ {
...@@ -2623,7 +2623,7 @@ static tEplKernel EplNmtMnuProcessInternalEvent(unsigned int uiNodeId_p, ...@@ -2623,7 +2623,7 @@ static tEplKernel EplNmtMnuProcessInternalEvent(unsigned int uiNodeId_p,
static tEplKernel EplNmtMnuCheckNmtState(unsigned int uiNodeId_p, static tEplKernel EplNmtMnuCheckNmtState(unsigned int uiNodeId_p,
tEplNmtMnuNodeInfo * pNodeInfo_p, tEplNmtMnuNodeInfo * pNodeInfo_p,
tEplNmtState NodeNmtState_p, tEplNmtState NodeNmtState_p,
WORD wErrorCode_p, u16 wErrorCode_p,
tEplNmtState LocalNmtState_p) tEplNmtState LocalNmtState_p)
{ {
tEplKernel Ret = kEplSuccessful; tEplKernel Ret = kEplSuccessful;
...@@ -2699,7 +2699,7 @@ static tEplKernel EplNmtMnuCheckNmtState(unsigned int uiNodeId_p, ...@@ -2699,7 +2699,7 @@ static tEplKernel EplNmtMnuCheckNmtState(unsigned int uiNodeId_p,
} else if ((ExpNmtState != NodeNmtState_p) } else if ((ExpNmtState != NodeNmtState_p)
&& !((ExpNmtState == kEplNmtCsPreOperational1) && !((ExpNmtState == kEplNmtCsPreOperational1)
&& (NodeNmtState_p == kEplNmtCsPreOperational2))) { // CN is not in expected NMT state (without the exceptions above) && (NodeNmtState_p == kEplNmtCsPreOperational2))) { // CN is not in expected NMT state (without the exceptions above)
WORD wbeErrorCode; u16 wbeErrorCode;
if ((pNodeInfo_p-> if ((pNodeInfo_p->
m_wFlags & EPL_NMTMNU_NODE_FLAG_NOT_SCANNED) != 0) { m_wFlags & EPL_NMTMNU_NODE_FLAG_NOT_SCANNED) != 0) {
......
...@@ -1080,7 +1080,7 @@ EPLDLLEXPORT tEplKernel EplObdReadEntryToLe(EPL_MCO_DECL_INSTANCE_PTR_ unsigned ...@@ -1080,7 +1080,7 @@ EPLDLLEXPORT tEplKernel EplObdReadEntryToLe(EPL_MCO_DECL_INSTANCE_PTR_ unsigned
case kEplObdTypInt16: case kEplObdTypInt16:
case kEplObdTypUInt16: case kEplObdTypUInt16:
{ {
AmiSetWordToLe(pDstData_p, *((WORD *) pSrcData)); AmiSetWordToLe(pDstData_p, *((u16 *) pSrcData));
break; break;
} }
...@@ -1230,7 +1230,7 @@ EPLDLLEXPORT tEplKernel EplObdWriteEntryFromLe(EPL_MCO_DECL_INSTANCE_PTR_ unsign ...@@ -1230,7 +1230,7 @@ EPLDLLEXPORT tEplKernel EplObdWriteEntryFromLe(EPL_MCO_DECL_INSTANCE_PTR_ unsign
case kEplObdTypInt16: case kEplObdTypInt16:
case kEplObdTypUInt16: case kEplObdTypUInt16:
{ {
*((WORD *) pBuffer) = AmiGetWordFromLe(pSrcData_p); *((u16 *) pBuffer) = AmiGetWordFromLe(pSrcData_p);
break; break;
} }
...@@ -2094,7 +2094,7 @@ static tEplKernel EplObdWriteEntryPost(EPL_MCO_DECL_INSTANCE_PTR_ tEplObdEntryPt ...@@ -2094,7 +2094,7 @@ static tEplKernel EplObdWriteEntryPost(EPL_MCO_DECL_INSTANCE_PTR_ tEplObdEntryPt
// Function: EplObdGetObjectSize() // Function: EplObdGetObjectSize()
// //
// Description: function to get size of object // Description: function to get size of object
// The function determines if an object type an fixed data type (u8, WORD, ...) // The function determines if an object type an fixed data type (u8, u16, ...)
// or non fixed object (string, domain). This information is used to decide // or non fixed object (string, domain). This information is used to decide
// if download data are stored temporary or not. For objects with fixed data length // if download data are stored temporary or not. For objects with fixed data length
// and types a value range checking can process. // and types a value range checking can process.
......
...@@ -206,7 +206,7 @@ typedef unsigned int tEplObdSize; // For all objects as objects size are used an ...@@ -206,7 +206,7 @@ typedef unsigned int tEplObdSize; // For all objects as objects size are used an
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
// types of objects in object dictionary // types of objects in object dictionary
// DS-301 defines these types as WORD // DS-301 defines these types as u16
typedef enum { typedef enum {
// types which are always supported // types which are always supported
kEplObdTypBool = 0x0001, kEplObdTypBool = 0x0001,
...@@ -431,7 +431,7 @@ typedef struct { ...@@ -431,7 +431,7 @@ typedef struct {
unsigned int m_uiUpperObjIndex; // upper limit of ObjIndex unsigned int m_uiUpperObjIndex; // upper limit of ObjIndex
tInitTabEntryCallback m_fpInitTabEntry; // will be called if ObjIndex was found tInitTabEntryCallback m_fpInitTabEntry; // will be called if ObjIndex was found
void *m_pTabBase; // base address of table void *m_pTabBase; // base address of table
unsigned int m_uiEntrySize; // size of table entry // 25-feb-2005 r.d.: expansion from u8 to WORD necessary for PDO bit mapping unsigned int m_uiEntrySize; // size of table entry // 25-feb-2005 r.d.: expansion from u8 to u16 necessary for PDO bit mapping
unsigned int m_uiMaxEntries; // max. tabel entries unsigned int m_uiMaxEntries; // max. tabel entries
} tEplObdModulTabParam; } tEplObdModulTabParam;
......
...@@ -90,8 +90,8 @@ ...@@ -90,8 +90,8 @@
typedef struct { typedef struct {
void *m_pVar; void *m_pVar;
WORD m_wOffset; // in Bits u16 m_wOffset; // in Bits
WORD m_wSize; // in Bits u16 m_wSize; // in Bits
BOOL m_fNumeric; // numeric value -> use AMI functions BOOL m_fNumeric; // numeric value -> use AMI functions
} tEplPdoMapping; } tEplPdoMapping;
......
...@@ -314,16 +314,16 @@ tEplKernel EplPdokCbSoa(tEplFrameInfo * pFrameInfo_p) ...@@ -314,16 +314,16 @@ tEplKernel EplPdokCbSoa(tEplFrameInfo * pFrameInfo_p)
tEplKernel EplPdokProcess(tEplEvent * pEvent_p) tEplKernel EplPdokProcess(tEplEvent * pEvent_p)
{ {
tEplKernel Ret = kEplSuccessful; tEplKernel Ret = kEplSuccessful;
WORD wPdoSize; u16 wPdoSize;
WORD wBitOffset; u16 wBitOffset;
WORD wBitSize; u16 wBitSize;
WORD wVarSize; u16 wVarSize;
u64 qwObjectMapping; u64 qwObjectMapping;
u8 bMappSubindex; u8 bMappSubindex;
u8 bObdSubindex; u8 bObdSubindex;
WORD wObdMappIndex; u16 wObdMappIndex;
WORD wObdCommIndex; u16 wObdCommIndex;
WORD wPdoId; u16 wPdoId;
u8 bObdData; u8 bObdData;
u8 bObjectCount; u8 bObjectCount;
u8 bFrameData; u8 bFrameData;
...@@ -438,16 +438,16 @@ tEplKernel EplPdokProcess(tEplEvent * pEvent_p) ...@@ -438,16 +438,16 @@ tEplKernel EplPdokProcess(tEplEvent * pEvent_p)
} }
// decode object mapping // decode object mapping
wObdCommIndex = wObdCommIndex =
(WORD) (qwObjectMapping & (u16) (qwObjectMapping &
0x000000000000FFFFLL); 0x000000000000FFFFLL);
bObdSubindex = bObdSubindex =
(u8) ((qwObjectMapping & (u8) ((qwObjectMapping &
0x0000000000FF0000LL) >> 16); 0x0000000000FF0000LL) >> 16);
wBitOffset = wBitOffset =
(WORD) ((qwObjectMapping & (u16) ((qwObjectMapping &
0x0000FFFF00000000LL) >> 32); 0x0000FFFF00000000LL) >> 32);
wBitSize = wBitSize =
(WORD) ((qwObjectMapping & (u16) ((qwObjectMapping &
0xFFFF000000000000LL) >> 48); 0xFFFF000000000000LL) >> 48);
// check if object exceeds PDO size // check if object exceeds PDO size
...@@ -568,21 +568,21 @@ tEplKernel EplPdokProcess(tEplEvent * pEvent_p) ...@@ -568,21 +568,21 @@ tEplKernel EplPdokProcess(tEplEvent * pEvent_p)
} }
// decode object mapping // decode object mapping
wObdCommIndex = wObdCommIndex =
(WORD) (qwObjectMapping & (u16) (qwObjectMapping &
0x000000000000FFFFLL); 0x000000000000FFFFLL);
bObdSubindex = bObdSubindex =
(u8) ((qwObjectMapping & (u8) ((qwObjectMapping &
0x0000000000FF0000LL) >> 16); 0x0000000000FF0000LL) >> 16);
wBitOffset = wBitOffset =
(WORD) ((qwObjectMapping & (u16) ((qwObjectMapping &
0x0000FFFF00000000LL) >> 32); 0x0000FFFF00000000LL) >> 32);
wBitSize = wBitSize =
(WORD) ((qwObjectMapping & (u16) ((qwObjectMapping &
0xFFFF000000000000LL) >> 48); 0xFFFF000000000000LL) >> 48);
// calculate max PDO size // calculate max PDO size
ObdSize = wBitSize >> 3; ObdSize = wBitSize >> 3;
wVarSize = (wBitOffset >> 3) + (WORD) ObdSize; wVarSize = (wBitOffset >> 3) + (u16) ObdSize;
if ((unsigned int)(wVarSize + 24) > pFrameInfo->m_uiFrameSize) { // TPDO is too short if ((unsigned int)(wVarSize + 24) > pFrameInfo->m_uiFrameSize) { // TPDO is too short
// $$$ raise PDO error, set Ret // $$$ raise PDO error, set Ret
goto Exit; goto Exit;
......
...@@ -237,7 +237,7 @@ tEplKernel EplPdouCbObdAccess(tEplObdCbParam *pParam_p) ...@@ -237,7 +237,7 @@ tEplKernel EplPdouCbObdAccess(tEplObdCbParam *pParam_p)
tEplObdAccess AccessType; tEplObdAccess AccessType;
u8 bMappSubindex; u8 bMappSubindex;
unsigned int uiCurPdoSize; unsigned int uiCurPdoSize;
WORD wMaxPdoSize; u16 wMaxPdoSize;
unsigned int uiSubIndex; unsigned int uiSubIndex;
// fetch PDO ID // fetch PDO ID
......
...@@ -2422,8 +2422,8 @@ static tEplKernel EplSdoAsyReadFromHistory(tEplAsySdoSeqCon * pAsySdoSeqCon_p, ...@@ -2422,8 +2422,8 @@ static tEplKernel EplSdoAsyReadFromHistory(tEplAsySdoSeqCon * pAsySdoSeqCon_p,
// check if entries are available for reading // check if entries are available for reading
if ((pHistory->m_bFreeEntries < EPL_SDO_HISTORY_SIZE) if ((pHistory->m_bFreeEntries < EPL_SDO_HISTORY_SIZE)
&& (pHistory->m_bWrite != pHistory->m_bRead)) { && (pHistory->m_bWrite != pHistory->m_bRead)) {
// PRINTF4("EplSdoAsyReadFromHistory(): init = %d, read = %u, write = %u, ack = %u", (int) fInitRead_p, (WORD)pHistory->m_bRead, (WORD)pHistory->m_bWrite, (WORD)pHistory->m_bAck); // PRINTF4("EplSdoAsyReadFromHistory(): init = %d, read = %u, write = %u, ack = %u", (int) fInitRead_p, (u16)pHistory->m_bRead, (u16)pHistory->m_bWrite, (u16)pHistory->m_bAck);
// PRINTF2(", free entries = %u, next frame size = %u\n", (WORD)pHistory->m_bFreeEntries, pHistory->m_auiFrameSize[pHistory->m_bRead]); // PRINTF2(", free entries = %u, next frame size = %u\n", (u16)pHistory->m_bFreeEntries, pHistory->m_auiFrameSize[pHistory->m_bRead]);
// return pointer to stored frame // return pointer to stored frame
*ppFrame_p = *ppFrame_p =
...@@ -2439,7 +2439,7 @@ static tEplKernel EplSdoAsyReadFromHistory(tEplAsySdoSeqCon * pAsySdoSeqCon_p, ...@@ -2439,7 +2439,7 @@ static tEplKernel EplSdoAsyReadFromHistory(tEplAsySdoSeqCon * pAsySdoSeqCon_p,
} }
} else { } else {
// PRINTF3("EplSdoAsyReadFromHistory(): read = %u, ack = %u, free entries = %u, no frame\n", (WORD)pHistory->m_bRead, (WORD)pHistory->m_bAck, (WORD)pHistory->m_bFreeEntries); // PRINTF3("EplSdoAsyReadFromHistory(): read = %u, ack = %u, free entries = %u, no frame\n", (u16)pHistory->m_bRead, (u16)pHistory->m_bAck, (u16)pHistory->m_bFreeEntries);
// no more frames to send // no more frames to send
// return null pointer // return null pointer
......
...@@ -814,7 +814,7 @@ tEplKernel EplSdoComReceiveCb(tEplSdoSeqConHdl SdoSeqConHdl_p, ...@@ -814,7 +814,7 @@ tEplKernel EplSdoComReceiveCb(tEplSdoSeqConHdl SdoSeqConHdl_p,
EPL_DBGLVL_SDO_TRACE3 EPL_DBGLVL_SDO_TRACE3
("EplSdoComReceiveCb SdoSeqConHdl: 0x%X, First Byte of pAsySdoCom_p: 0x%02X, uiDataSize_p: 0x%04X\n", ("EplSdoComReceiveCb SdoSeqConHdl: 0x%X, First Byte of pAsySdoCom_p: 0x%02X, uiDataSize_p: 0x%04X\n",
SdoSeqConHdl_p, (WORD) pAsySdoCom_p->m_le_abCommandData[0], SdoSeqConHdl_p, (u16) pAsySdoCom_p->m_le_abCommandData[0],
uiDataSize_p); uiDataSize_p);
return Ret; return Ret;
...@@ -2166,7 +2166,7 @@ static tEplKernel EplSdoComServerSendFrameIntern(tEplSdoComCon * pSdoComCon_p, ...@@ -2166,7 +2166,7 @@ static tEplKernel EplSdoComServerSendFrameIntern(tEplSdoComCon * pSdoComCon_p,
// set size of frame // set size of frame
AmiSetWordToLe(&pCommandFrame-> AmiSetWordToLe(&pCommandFrame->
m_le_wSegmentSize, m_le_wSegmentSize,
(WORD) pSdoComCon_p-> (u16) pSdoComCon_p->
m_uiTransSize); m_uiTransSize);
// correct byte-counter // correct byte-counter
...@@ -2296,7 +2296,7 @@ static tEplKernel EplSdoComServerSendFrameIntern(tEplSdoComCon * pSdoComCon_p, ...@@ -2296,7 +2296,7 @@ static tEplKernel EplSdoComServerSendFrameIntern(tEplSdoComCon * pSdoComCon_p,
// set segment size // set segment size
AmiSetWordToLe(&pCommandFrame-> AmiSetWordToLe(&pCommandFrame->
m_le_wSegmentSize, m_le_wSegmentSize,
(WORD) pSdoComCon_p-> (u16) pSdoComCon_p->
m_uiTransSize); m_uiTransSize);
// send frame // send frame
...@@ -2679,7 +2679,7 @@ static tEplKernel EplSdoComClientSend(tEplSdoComCon * pSdoComCon_p) ...@@ -2679,7 +2679,7 @@ static tEplKernel EplSdoComClientSend(tEplSdoComCon * pSdoComCon_p)
// create command header // create command header
AmiSetWordToLe(pbPayload, AmiSetWordToLe(pbPayload,
(WORD) pSdoComCon_p-> (u16) pSdoComCon_p->
m_uiTargetIndex); m_uiTargetIndex);
pbPayload += 2; pbPayload += 2;
AmiSetByteToLe(pbPayload, AmiSetByteToLe(pbPayload,
...@@ -2720,7 +2720,7 @@ static tEplKernel EplSdoComClientSend(tEplSdoComCon * pSdoComCon_p) ...@@ -2720,7 +2720,7 @@ static tEplKernel EplSdoComClientSend(tEplSdoComCon * pSdoComCon_p)
bFlags); bFlags);
// create command header // create command header
AmiSetWordToLe(pbPayload, AmiSetWordToLe(pbPayload,
(WORD) (u16)
pSdoComCon_p-> pSdoComCon_p->
m_uiTargetIndex); m_uiTargetIndex);
pbPayload += 2; pbPayload += 2;
...@@ -2759,7 +2759,7 @@ static tEplKernel EplSdoComClientSend(tEplSdoComCon * pSdoComCon_p) ...@@ -2759,7 +2759,7 @@ static tEplKernel EplSdoComClientSend(tEplSdoComCon * pSdoComCon_p)
// create command header // create command header
AmiSetWordToLe(pbPayload, AmiSetWordToLe(pbPayload,
(WORD) (u16)
pSdoComCon_p-> pSdoComCon_p->
m_uiTargetIndex); m_uiTargetIndex);
pbPayload += 2; pbPayload += 2;
...@@ -2783,7 +2783,7 @@ static tEplKernel EplSdoComClientSend(tEplSdoComCon * pSdoComCon_p) ...@@ -2783,7 +2783,7 @@ static tEplKernel EplSdoComClientSend(tEplSdoComCon * pSdoComCon_p)
// fill rest of header // fill rest of header
AmiSetWordToLe(&pCommandFrame-> AmiSetWordToLe(&pCommandFrame->
m_le_wSegmentSize, m_le_wSegmentSize,
(WORD) (4 + (u16) (4 +
pSdoComCon_p-> pSdoComCon_p->
m_uiTransSize)); m_uiTransSize));
...@@ -2854,7 +2854,7 @@ static tEplKernel EplSdoComClientSend(tEplSdoComCon * pSdoComCon_p) ...@@ -2854,7 +2854,7 @@ static tEplKernel EplSdoComClientSend(tEplSdoComCon * pSdoComCon_p)
AmiSetWordToLe AmiSetWordToLe
(&pCommandFrame-> (&pCommandFrame->
m_le_wSegmentSize, m_le_wSegmentSize,
(WORD) (u16)
pSdoComCon_p-> pSdoComCon_p->
m_uiTransSize); m_uiTransSize);
bFlags = 0x30; bFlags = 0x30;
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
typedef struct { typedef struct {
WORD m_wWord; u16 m_wWord;
} twStruct; } twStruct;
...@@ -125,15 +125,15 @@ void AmiSetByteToBe (void *pAddr_p, u8 bByteVal_p) ...@@ -125,15 +125,15 @@ void AmiSetByteToBe (void *pAddr_p, u8 bByteVal_p)
} }
*/ */
//------------< write WORD in big endian >-------------------------- //------------< write u16 in big endian >--------------------------
void AmiSetWordToBe(void * pAddr_p, WORD wWordVal_p) void AmiSetWordToBe(void * pAddr_p, u16 wWordVal_p)
{ {
twStruct *pwStruct; twStruct *pwStruct;
twStruct wValue; twStruct wValue;
wValue.m_wWord = (WORD) ((wWordVal_p & 0x00FF) << 8); //LSB to MSB wValue.m_wWord = (u16) ((wWordVal_p & 0x00FF) << 8); //LSB to MSB
wValue.m_wWord |= (WORD) ((wWordVal_p & 0xFF00) >> 8); //MSB to LSB wValue.m_wWord |= (u16) ((wWordVal_p & 0xFF00) >> 8); //MSB to LSB
pwStruct = (twStruct *) pAddr_p; pwStruct = (twStruct *) pAddr_p;
pwStruct->m_wWord = wValue.m_wWord; pwStruct->m_wWord = wValue.m_wWord;
...@@ -183,9 +183,9 @@ void AmiSetByteToLe (void *pAddr_p, u8 bByteVal_p) ...@@ -183,9 +183,9 @@ void AmiSetByteToLe (void *pAddr_p, u8 bByteVal_p)
} }
*/ */
//------------< write WORD in little endian >-------------------------- //------------< write u16 in little endian >--------------------------
void AmiSetWordToLe(void *pAddr_p, WORD wWordVal_p) void AmiSetWordToLe(void *pAddr_p, u16 wWordVal_p)
{ {
twStruct *pwStruct; twStruct *pwStruct;
...@@ -230,17 +230,17 @@ u8 AmiGetByteFromBe (void *pAddr_p) ...@@ -230,17 +230,17 @@ u8 AmiGetByteFromBe (void *pAddr_p)
} }
*/ */
//------------< read WORD in big endian >--------------------------- //------------< read u16 in big endian >---------------------------
WORD AmiGetWordFromBe(void *pAddr_p) u16 AmiGetWordFromBe(void *pAddr_p)
{ {
twStruct *pwStruct; twStruct *pwStruct;
twStruct wValue; twStruct wValue;
pwStruct = (twStruct *) pAddr_p; pwStruct = (twStruct *) pAddr_p;
wValue.m_wWord = (WORD) ((pwStruct->m_wWord & 0x00FF) << 8); //LSB to MSB wValue.m_wWord = (u16) ((pwStruct->m_wWord & 0x00FF) << 8); //LSB to MSB
wValue.m_wWord |= (WORD) ((pwStruct->m_wWord & 0xFF00) >> 8); //MSB to LSB wValue.m_wWord |= (u16) ((pwStruct->m_wWord & 0xFF00) >> 8); //MSB to LSB
return (wValue.m_wWord); return (wValue.m_wWord);
...@@ -289,9 +289,9 @@ u8 AmiGetByteFromLe (void *pAddr_p) ...@@ -289,9 +289,9 @@ u8 AmiGetByteFromLe (void *pAddr_p)
} }
*/ */
//------------< read WORD in little endian >--------------------------- //------------< read u16 in little endian >---------------------------
WORD AmiGetWordFromLe(void *pAddr_p) u16 AmiGetWordFromLe(void *pAddr_p)
{ {
twStruct *pwStruct; twStruct *pwStruct;
...@@ -649,7 +649,7 @@ void AmiSetQword48ToLe(void *pAddr_p, u64 qwQwordVal_p) ...@@ -649,7 +649,7 @@ void AmiSetQword48ToLe(void *pAddr_p, u64 qwQwordVal_p)
{ {
((u32 *) pAddr_p)[0] = ((u32 *) & qwQwordVal_p)[0]; ((u32 *) pAddr_p)[0] = ((u32 *) & qwQwordVal_p)[0];
((WORD *) pAddr_p)[2] = ((WORD *) & qwQwordVal_p)[2]; ((u16 *) pAddr_p)[2] = ((u16 *) & qwQwordVal_p)[2];
} }
...@@ -752,7 +752,7 @@ void AmiSetQword56ToLe(void *pAddr_p, u64 qwQwordVal_p) ...@@ -752,7 +752,7 @@ void AmiSetQword56ToLe(void *pAddr_p, u64 qwQwordVal_p)
{ {
((u32 *) pAddr_p)[0] = ((u32 *) & qwQwordVal_p)[0]; ((u32 *) pAddr_p)[0] = ((u32 *) & qwQwordVal_p)[0];
((WORD *) pAddr_p)[2] = ((WORD *) & qwQwordVal_p)[2]; ((u16 *) pAddr_p)[2] = ((u16 *) & qwQwordVal_p)[2];
((u8 *) pAddr_p)[6] = ((u8 *) & qwQwordVal_p)[6]; ((u8 *) pAddr_p)[6] = ((u8 *) & qwQwordVal_p)[6];
} }
......
...@@ -810,7 +810,7 @@ tEplKernel AppCbSync(void) ...@@ -810,7 +810,7 @@ tEplKernel AppCbSync(void)
bVarOut1Old_l = bVarOut1_l; bVarOut1Old_l = bVarOut1_l;
// set LEDs // set LEDs
// printk("bVarIn = 0x%02X bVarOut = 0x%02X\n", (WORD) bVarIn_l, (WORD) bVarOut_l); // printk("bVarIn = 0x%02X bVarOut = 0x%02X\n", (u16) bVarIn_l, (u16) bVarOut_l);
} }
if (uiNodeId_g != EPL_C_ADR_MN_DEF_NODE_ID) { if (uiNodeId_g != EPL_C_ADR_MN_DEF_NODE_ID) {
bVarIn1_l++; bVarIn1_l++;
......
...@@ -120,7 +120,7 @@ typedef struct _tEdrvRxBuffer { ...@@ -120,7 +120,7 @@ typedef struct _tEdrvRxBuffer {
} tEdrvRxBuffer; } tEdrvRxBuffer;
//typedef void (*tEdrvRxHandler) (u8 bBufferInFrame_p, tBufferDescr * pbBuffer_p); //typedef void (*tEdrvRxHandler) (u8 bBufferInFrame_p, tBufferDescr * pbBuffer_p);
//typedef void (*tEdrvRxHandler) (u8 bBufferInFrame_p, u8 * pbEthernetData_p, WORD wDataLen_p); //typedef void (*tEdrvRxHandler) (u8 bBufferInFrame_p, u8 * pbEthernetData_p, u16 wDataLen_p);
typedef void (*tEdrvRxHandler) (tEdrvRxBuffer * pRxBuffer_p); typedef void (*tEdrvRxHandler) (tEdrvRxBuffer * pRxBuffer_p);
typedef void (*tEdrvTxHandler) (tEdrvTxBuffer * pTxBuffer_p); typedef void (*tEdrvTxHandler) (tEdrvTxBuffer * pTxBuffer_p);
...@@ -130,7 +130,7 @@ typedef struct { ...@@ -130,7 +130,7 @@ typedef struct {
// u8 m_bNoOfRxBuffDescr; // number of entries in rx bufferdescriptor table // u8 m_bNoOfRxBuffDescr; // number of entries in rx bufferdescriptor table
// tBufferDescr * m_pRxBuffDescrTable; // rx bufferdescriptor table // tBufferDescr * m_pRxBuffDescrTable; // rx bufferdescriptor table
// WORD m_wRxBufferSize; // size of the whole rx buffer // u16 m_wRxBufferSize; // size of the whole rx buffer
tEdrvRxHandler m_pfnRxHandler; tEdrvRxHandler m_pfnRxHandler;
tEdrvTxHandler m_pfnTxHandler; tEdrvTxHandler m_pfnTxHandler;
......
...@@ -26,9 +26,6 @@ ...@@ -26,9 +26,6 @@
#define TRACE printk #define TRACE printk
// --- logic types --- // --- logic types ---
#ifndef WORD
#define WORD unsigned short int
#endif
#ifndef BOOL #ifndef BOOL
#define BOOL unsigned char #define BOOL unsigned char
#endif #endif
......
...@@ -99,7 +99,7 @@ struct _tEplDllkNodeInfo { ...@@ -99,7 +99,7 @@ struct _tEplDllkNodeInfo {
u32 m_dwPresTimeout; u32 m_dwPresTimeout;
unsigned long m_ulDllErrorEvents; unsigned long m_ulDllErrorEvents;
tEplNmtState m_NmtState; tEplNmtState m_NmtState;
WORD m_wPresPayloadLimit; u16 m_wPresPayloadLimit;
u8 m_be_abMacAddr[6]; u8 m_be_abMacAddr[6];
u8 m_bSoaFlag1; u8 m_bSoaFlag1;
BOOL m_fSoftDelete; // delete node after error and ignore error BOOL m_fSoftDelete; // delete node after error and ignore error
......
...@@ -263,7 +263,7 @@ static int EplLinProcRead(char *pcBuffer_p, ...@@ -263,7 +263,7 @@ static int EplLinProcRead(char *pcBuffer_p,
// ---- EPL state ---- // ---- EPL state ----
nSize += snprintf(pcBuffer_p + nSize, nBufferSize_p - nSize, nSize += snprintf(pcBuffer_p + nSize, nBufferSize_p - nSize,
"NMT state: 0x%04X\n", "NMT state: 0x%04X\n",
(WORD) EplNmtkGetNmtState()); (u16) EplNmtkGetNmtState());
EplDllkCalGetStatistics(&pDllkCalStats); EplDllkCalGetStatistics(&pDllkCalStats);
...@@ -286,7 +286,7 @@ static int EplLinProcRead(char *pcBuffer_p, ...@@ -286,7 +286,7 @@ static int EplLinProcRead(char *pcBuffer_p,
{ {
unsigned int uiMandatorySlaveCount; unsigned int uiMandatorySlaveCount;
unsigned int uiSignalSlaveCount; unsigned int uiSignalSlaveCount;
WORD wFlags; u16 wFlags;
EplNmtMnuGetDiagnosticInfo(&uiMandatorySlaveCount, EplNmtMnuGetDiagnosticInfo(&uiMandatorySlaveCount,
&uiSignalSlaveCount, &wFlags); &uiSignalSlaveCount, &wFlags);
......
...@@ -148,7 +148,7 @@ typedef struct { ...@@ -148,7 +148,7 @@ typedef struct {
u32 m_dwCntObjectInDcf; // number of Objects in DCF u32 m_dwCntObjectInDcf; // number of Objects in DCF
tEplCfgMaIndexType m_SkipCfg; // TRUE if a adsitional Configurationprocess tEplCfgMaIndexType m_SkipCfg; // TRUE if a adsitional Configurationprocess
// have to insert e.g. PDO-mapping // have to insert e.g. PDO-mapping
WORD m_wTimeOutCnt; // Timeout Counter, break configuration is u16 m_wTimeOutCnt; // Timeout Counter, break configuration is
// m_wTimeOutCnt == CFGMA_MAX_TIMEOUT // m_wTimeOutCnt == CFGMA_MAX_TIMEOUT
} tEplCfgMaNode; } tEplCfgMaNode;
......
...@@ -84,12 +84,12 @@ ...@@ -84,12 +84,12 @@
typedef tEplKernel(* tEplNmtMnuCbNodeEvent) (unsigned int uiNodeId_p, typedef tEplKernel(* tEplNmtMnuCbNodeEvent) (unsigned int uiNodeId_p,
tEplNmtNodeEvent NodeEvent_p, tEplNmtNodeEvent NodeEvent_p,
tEplNmtState NmtState_p, tEplNmtState NmtState_p,
WORD wErrorCode_p, u16 wErrorCode_p,
BOOL fMandatory_p); BOOL fMandatory_p);
typedef tEplKernel(* tEplNmtMnuCbBootEvent) (tEplNmtBootEvent BootEvent_p, typedef tEplKernel(* tEplNmtMnuCbBootEvent) (tEplNmtBootEvent BootEvent_p,
tEplNmtState NmtState_p, tEplNmtState NmtState_p,
WORD wErrorCode_p); u16 wErrorCode_p);
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// function prototypes // function prototypes
...@@ -122,7 +122,7 @@ tEplKernel EplNmtMnuGetDiagnosticInfo(unsigned int ...@@ -122,7 +122,7 @@ tEplKernel EplNmtMnuGetDiagnosticInfo(unsigned int
*puiMandatorySlaveCount_p, *puiMandatorySlaveCount_p,
unsigned int unsigned int
*puiSignalSlaveCount_p, *puiSignalSlaveCount_p,
WORD * pwFlags_p); u16 * pwFlags_p);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment