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 @@
extern "C" {
#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
} // von extern "C"
#endif
#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
#define DEBUG_DUMP_DATA(lvl,str,ptr,siz)
......
......@@ -464,9 +464,9 @@ tEplKernel EdrvDefineRxMacAddrEntry(u8 * pbMacAddr_p)
dwData = ether_crc(6, pbMacAddr_p);
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],
(WORD) pbMacAddr_p[3], (WORD) pbMacAddr_p[4], (WORD) pbMacAddr_p[5],
(WORD) bHash, (WORD) (dwData >> 26), dwData);
(u16) pbMacAddr_p[0], (u16) pbMacAddr_p[1], (u16) pbMacAddr_p[2],
(u16) pbMacAddr_p[3], (u16) pbMacAddr_p[4], (u16) pbMacAddr_p[5],
(u16) bHash, (u16) (dwData >> 26), dwData);
*/
if (bHash > 31) {
dwData = EDRV_REGDW_READ(EDRV_REGDW_MAR4);
......@@ -624,7 +624,7 @@ tEplKernel EdrvSendTxMsg(tEdrvTxBuffer * pBuffer_p)
printk("%s InvOp TSD%u = 0x%08X", __func__,
EdrvInstance_l.m_uiCurTxDesc, dwTemp);
printk(" Cmd = 0x%02X\n",
(WORD) EDRV_REGB_READ(EDRV_REGB_COMMAND));
(u16) EDRV_REGB_READ(EDRV_REGB_COMMAND));
goto Exit;
}
// save pointer to buffer structure for TxHandler
......@@ -761,10 +761,10 @@ static int TgtEthIsr(int nIrqNum_p, void *ppDevInstData_p,
// EdrvInterruptHandler();
tEdrvRxBuffer RxBuffer;
tEdrvTxBuffer *pTxBuffer;
WORD wStatus;
u16 wStatus;
u32 dwTxStatus;
u32 dwRxStatus;
WORD wCurRx;
u16 wCurRx;
u8 *pbRxBuf;
unsigned int uiLength;
int iHandled = IRQ_HANDLED;
......@@ -898,7 +898,7 @@ static int TgtEthIsr(int nIrqNum_p, void *ppDevInstData_p,
// calulate new offset (u32 aligned)
wCurRx =
(WORD) ((wCurRx + uiLength + sizeof(dwRxStatus) +
(u16) ((wCurRx + uiLength + sizeof(dwRxStatus) +
3) & ~0x3);
EDRV_TRACE_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)
dwTemp = EDRV_REGDW_READ(EDRV_REGDW_TSAD3);
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
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)
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));
(u16) EDRV_REGB_READ(EDRV_REGB_COMMAND));
// clear missed packet counter to enable Rx/Tx process
EDRV_REGDW_WRITE(EDRV_REGDW_MPC, 0);
......@@ -1123,7 +1123,7 @@ static int EdrvInitOne(struct pci_dev *pPciDev, const struct pci_device_id *pId)
// enable transmitter and receiver
printk("%s enable Tx and Rx", __func__);
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
EDRV_REGW_WRITE(EDRV_REGW_MULINT, 0);
......
......@@ -96,8 +96,8 @@
// Rx and Tx buffer descriptor format
typedef struct {
WORD m_wStatus; // control / status --- used by edrv, do not change in application
WORD m_wLength; // transfer length
u16 m_wStatus; // control / status --- used by edrv, do not change in application
u16 m_wLength; // transfer length
u8 *m_pbData; // buffer address
} tBufferDescr;
......
......@@ -84,6 +84,6 @@
//---------------------------------------------------------------------------
void EdrvRxInterruptHandler(u8 bBufferInFrame_p, u8 * pbEthernetData_p,
WORD wDataLen_p);
u16 wDataLen_p);
#endif // #ifndef _EDRVSIM_H_
......@@ -89,7 +89,7 @@ typedef struct {
unsigned int m_uiNodeId;
tEplNmtState m_NmtState;
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;
} tEplApiEventNode;
......@@ -97,7 +97,7 @@ typedef struct {
typedef struct {
tEplNmtState m_NmtState; // local NMT state
tEplNmtBootEvent m_BootEvent;
WORD m_wErrorCode; // EPL error code if m_BootEvent == kEplNmtBootEventError
u16 m_wErrorCode; // EPL error code if m_BootEvent == kEplNmtBootEventError
} tEplApiEventBoot;
......
......@@ -110,9 +110,9 @@ extern "C" {
#define AmiSetByteToBe(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 AmiSetWordToLe(void *pAddr_p, WORD wWordVal_p);
void AmiSetWordToLe(void *pAddr_p, u16 wWordVal_p);
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 AmiGetByteFromLe(pAddr_p) (*(u8 *)(pAddr_p))
WORD AmiGetWordFromBe(void *pAddr_p);
u16 AmiGetWordFromBe(void *pAddr_p);
u32 AmiGetDwordFromBe(void *pAddr_p);
WORD AmiGetWordFromLe(void *pAddr_p);
u16 AmiGetWordFromLe(void *pAddr_p);
u32 AmiGetDwordFromLe(void *pAddr_p);
//---------------------------------------------------------------------------
......
......@@ -183,11 +183,11 @@ static tEplKernel EplApiCbSdoCon(tEplSdoComFinished *pSdoComFinished_p);
static tEplKernel EplApiCbNodeEvent(unsigned int uiNodeId_p,
tEplNmtNodeEvent NodeEvent_p,
tEplNmtState NmtState_p,
WORD wErrorCode_p, BOOL fMandatory_p);
u16 wErrorCode_p, BOOL fMandatory_p);
static tEplKernel EplApiCbBootEvent(tEplNmtBootEvent BootEvent_p,
tEplNmtState NmtState_p,
WORD wErrorCode_p);
u16 wErrorCode_p);
#endif
#if (((EPL_MODULE_INTEGRATION) & (EPL_MODULE_LEDU)) != 0)
......@@ -1412,7 +1412,7 @@ static tEplKernel EplApiUpdateDllConfig(BOOL fUpdateIdentity_p)
tEplDllConfigParam DllConfigParam;
tEplDllIdentParam DllIdentParam;
tEplObdSize ObdSize;
WORD wTemp;
u16 wTemp;
u8 bTemp;
// configure Dll
......@@ -1632,7 +1632,7 @@ static tEplKernel EplApiUpdateDllConfig(BOOL fUpdateIdentity_p)
static tEplKernel EplApiUpdateObd(void)
{
tEplKernel Ret = kEplSuccessful;
WORD wTemp;
u16 wTemp;
u8 bTemp;
// set node id in OD
......@@ -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);
/* if(Ret != kEplSuccessful)
{
goto Exit;
}*/
wTemp = (WORD) EplApiInstance_g.m_InitParam.m_uiIsochrRxMaxPayload;
wTemp = (u16) EplApiInstance_g.m_InitParam.m_uiIsochrRxMaxPayload;
Ret = EplObdWriteEntry(0x1F98, 2, &wTemp, 2);
/* if(Ret != kEplSuccessful)
{
......@@ -1701,7 +1701,7 @@ static tEplKernel EplApiUpdateObd(void)
if (EplApiInstance_g.m_InitParam.m_uiPreqActPayloadLimit <=
EPL_C_DLL_ISOCHR_MAX_PAYL) {
wTemp =
(WORD) EplApiInstance_g.m_InitParam.m_uiPreqActPayloadLimit;
(u16) EplApiInstance_g.m_InitParam.m_uiPreqActPayloadLimit;
Ret = EplObdWriteEntry(0x1F98, 4, &wTemp, 2);
/* if(Ret != kEplSuccessful)
{
......@@ -1712,7 +1712,7 @@ static tEplKernel EplApiUpdateObd(void)
if (EplApiInstance_g.m_InitParam.m_uiPresActPayloadLimit <=
EPL_C_DLL_ISOCHR_MAX_PAYL) {
wTemp =
(WORD) EplApiInstance_g.m_InitParam.m_uiPresActPayloadLimit;
(u16) EplApiInstance_g.m_InitParam.m_uiPresActPayloadLimit;
Ret = EplObdWriteEntry(0x1F98, 5, &wTemp, 2);
/* if(Ret != kEplSuccessful)
{
......@@ -1740,7 +1740,7 @@ static tEplKernel EplApiUpdateObd(void)
if (EplApiInstance_g.m_InitParam.m_uiAsyncMtu <=
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);
/* if(Ret != kEplSuccessful)
{
......@@ -1749,7 +1749,7 @@ static tEplKernel EplApiUpdateObd(void)
}
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);
// ignore return code
Ret = kEplSuccessful;
......@@ -1944,7 +1944,7 @@ static tEplKernel EplApiCbSdoCon(tEplSdoComFinished *pSdoComFinished_p)
static tEplKernel EplApiCbNodeEvent(unsigned int uiNodeId_p,
tEplNmtNodeEvent NodeEvent_p,
tEplNmtState NmtState_p,
WORD wErrorCode_p, BOOL fMandatory_p)
u16 wErrorCode_p, BOOL fMandatory_p)
{
tEplKernel Ret;
tEplApiEventArg EventArg;
......@@ -1987,7 +1987,7 @@ static tEplKernel EplApiCbNodeEvent(unsigned int uiNodeId_p,
static tEplKernel EplApiCbBootEvent(tEplNmtBootEvent BootEvent_p,
tEplNmtState NmtState_p,
WORD wErrorCode_p)
u16 wErrorCode_p)
{
tEplKernel Ret;
tEplApiEventArg EventArg;
......
......@@ -192,8 +192,8 @@ typedef struct {
typedef struct {
unsigned int m_uiNodeId;
WORD m_wPreqPayloadLimit; // object 0x1F8B: NMT_MNPReqPayloadLimitList_AU16
WORD m_wPresPayloadLimit; // object 0x1F8D: NMT_PResPayloadLimitList_AU16
u16 m_wPreqPayloadLimit; // object 0x1F8B: NMT_MNPReqPayloadLimitList_AU16
u16 m_wPresPayloadLimit; // object 0x1F8D: NMT_PResPayloadLimitList_AU16
u32 m_dwPresTimeout; // object 0x1F92: NMT_MNCNPResTimeout_AU32
} tEplDllNodeInfo;
......
......@@ -720,18 +720,18 @@ tEplKernel EplDllkProcess(tEplEvent * pEvent_p)
// MTU
AmiSetWordToLe(&pTxFrame->m_Data.m_Asnd.m_Payload.
m_IdentResponse.m_le_wMtu,
(WORD) EplDllkInstance_g.
(u16) EplDllkInstance_g.
m_DllConfigParam.m_uiAsyncMtu);
// PollInSize
AmiSetWordToLe(&pTxFrame->m_Data.m_Asnd.m_Payload.
m_IdentResponse.m_le_wPollInSize,
(WORD) EplDllkInstance_g.
(u16) EplDllkInstance_g.
m_DllConfigParam.
m_uiPreqActPayloadLimit);
// PollOutSize
AmiSetWordToLe(&pTxFrame->m_Data.m_Asnd.m_Payload.
m_IdentResponse.m_le_wPollOutSize,
(WORD) EplDllkInstance_g.
(u16) EplDllkInstance_g.
m_DllConfigParam.
m_uiPresActPayloadLimit);
// ResponseTime / PresMaxLatency
......@@ -935,7 +935,7 @@ tEplKernel EplDllkProcess(tEplEvent * pEvent_p)
// EplDllkInstance_g.m_aNodeInfo[uiIndex].m_uiNodeId = uiIndex + 1;
EplDllkInstance_g.m_aNodeInfo[uiIndex].
m_wPresPayloadLimit =
(WORD) EplDllkInstance_g.
(u16) EplDllkInstance_g.
m_DllConfigParam.
m_uiIsochrRxMaxPayload;
}
......@@ -3484,7 +3484,7 @@ static tEplKernel EplDllkCheckFrame(tEplFrame * pFrame_p,
unsigned int uiFrameSize_p)
{
tEplMsgType MsgType;
WORD wEtherType;
u16 wEtherType;
// check frame
if (pFrame_p != NULL) {
......
......@@ -146,7 +146,7 @@ typedef struct {
// Offset 21
u8 m_le_bRes2; // reserved
// Offset 22
WORD m_le_wSize;
u16 m_le_wSize;
// Offset 24
u8 m_le_abPayload[256 /*D_NMT_IsochrRxMaxPayload_U16 */ ];
......@@ -164,7 +164,7 @@ typedef struct {
// Offset 21
u8 m_le_bRes2; // reserved
// Offset 22
WORD m_le_wSize;
u16 m_le_wSize;
// Offset 24
u8 m_le_abPayload[256 /*D_NMT_IsochrRxMaxPayload_U16
/ D_NMT_IsochrTxMaxPayload_U16 */ ];
......@@ -188,8 +188,8 @@ typedef struct {
} PACK_STRUCT tEplSoaFrame;
typedef struct {
WORD m_wEntryType;
WORD m_wErrorCode;
u16 m_wEntryType;
u16 m_wErrorCode;
tEplNetTime m_TimeStamp;
u8 m_abAddInfo[8];
......@@ -215,11 +215,11 @@ typedef struct {
u8 m_le_bEplProfileVersion;
u8 m_le_bRes1;
u32 m_le_dwFeatureFlags; // NMT_FeatureFlags_U32
WORD 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
WORD m_le_wPollOutSize; // NMT_CycleTiming_REC.PResActPayload_U16
u16 m_le_wMtu; // NMT_CycleTiming_REC.AsyncMTU_U16: C_IP_MIN_MTU - C_IP_MAX_MTU
u16 m_le_wPollInSize; // NMT_CycleTiming_REC.PReqActPayload_U16
u16 m_le_wPollOutSize; // NMT_CycleTiming_REC.PResActPayload_U16
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_dwVendorId; // NMT_IdentityObject_REC.VendorId_U32
u32 m_le_dwProductCode; // NMT_IdentityObject_REC.ProductCode_U32
......@@ -251,8 +251,8 @@ typedef struct {
u8 m_le_bTransactionId;
u8 m_le_bFlags;
u8 m_le_bCommandId;
WORD m_le_wSegmentSize;
WORD m_le_wReserved;
u16 m_le_wSegmentSize;
u16 m_le_wReserved;
u8 m_le_abCommandData[8]; // just reserve a minimum number of bytes as a placeholder
} PACK_STRUCT tEplAsySdoCom;
......@@ -310,7 +310,7 @@ typedef struct {
// Offset 6
u8 m_be_abSrcMac[6]; // MAC address of the transmitting node
// Offset 12
WORD m_be_wEtherType; // Ethernet message type (big endian)
u16 m_be_wEtherType; // Ethernet message type (big endian)
// Offset 14
u8 m_le_bMessageType; // EPL message type
// Offset 15
......
......@@ -185,7 +185,7 @@ typedef struct {
typedef struct {
unsigned int m_uiNodeId; // NodeId
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;
......
......@@ -212,7 +212,7 @@ typedef struct {
tEplTimerHdl m_TimerHdlLonger; // 2nd timer for NMT command EnableReadyToOp and CheckCommunication
tEplNmtMnuNodeState m_NodeState; // internal node state (kind of sub state of NMT state)
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;
......@@ -224,7 +224,7 @@ typedef struct {
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_ulTimeoutCheckCom; // in [ms] (object 0x1006 * MultiplexedCycleCount)
WORD m_wFlags; // global flags
u16 m_wFlags; // global flags
u32 m_dwNmtStartup; // object 0x1F80 NMT_StartUp_U32
tEplNmtMnuCbNodeEvent m_pfnCbNodeEvent;
tEplNmtMnuCbBootEvent m_pfnCbBootEvent;
......@@ -252,7 +252,7 @@ static tEplKernel EplNmtMnuCbStatusResponse(unsigned int uiNodeId_p,
static tEplKernel EplNmtMnuCheckNmtState(unsigned int uiNodeId_p,
tEplNmtMnuNodeInfo * pNodeInfo_p,
tEplNmtState NodeNmtState_p,
WORD wErrorCode_p,
u16 wErrorCode_p,
tEplNmtState LocalNmtState_p);
static tEplKernel EplNmtMnuStartBootStep1(void);
......@@ -271,7 +271,7 @@ static tEplKernel EplNmtMnuStartNodes(void);
static tEplKernel EplNmtMnuProcessInternalEvent(unsigned int uiNodeId_p,
tEplNmtState NodeNmtState_p,
WORD wErrorCode_p,
u16 wErrorCode_p,
tEplNmtMnuIntNodeEvent
NodeEvent_p);
......@@ -573,7 +573,7 @@ tEplKernel EplNmtMnuTriggerStateChange(unsigned int uiNodeId_p,
tEplNmtMnuIntNodeEvent NodeEvent;
tEplObdSize ObdSize;
u8 bNmtState;
WORD wErrorCode = EPL_E_NO_ERROR;
u16 wErrorCode = EPL_E_NO_ERROR;
if ((uiNodeId_p == 0) || (uiNodeId_p >= EPL_C_ADR_BROADCAST)) {
Ret = kEplInvalidNodeId;
......@@ -1257,7 +1257,7 @@ EPLDLLEXPORT tEplKernel EplNmtMnuProcessEvent(tEplEvent *pEvent_p)
tEplKernel EplNmtMnuGetDiagnosticInfo(unsigned int *puiMandatorySlaveCount_p,
unsigned int *puiSignalSlaveCount_p,
WORD *pwFlags_p)
u16 *pwFlags_p)
{
tEplKernel Ret = kEplSuccessful;
......@@ -1377,7 +1377,7 @@ static tEplKernel EplNmtMnuCbIdentResponse(unsigned int uiNodeId_p,
} else { // node answered IdentRequest
tEplObdSize ObdSize;
u32 dwDevType;
WORD wErrorCode = EPL_E_NO_ERROR;
u16 wErrorCode = EPL_E_NO_ERROR;
tEplNmtState NmtState =
(tEplNmtState) (AmiGetByteFromLe
(&pIdentResponse_p->
......@@ -1909,7 +1909,7 @@ static tEplKernel EplNmtMnuStartNodes(void)
static tEplKernel EplNmtMnuProcessInternalEvent(unsigned int uiNodeId_p,
tEplNmtState NodeNmtState_p,
WORD wErrorCode_p,
u16 wErrorCode_p,
tEplNmtMnuIntNodeEvent
NodeEvent_p)
{
......@@ -2623,7 +2623,7 @@ static tEplKernel EplNmtMnuProcessInternalEvent(unsigned int uiNodeId_p,
static tEplKernel EplNmtMnuCheckNmtState(unsigned int uiNodeId_p,
tEplNmtMnuNodeInfo * pNodeInfo_p,
tEplNmtState NodeNmtState_p,
WORD wErrorCode_p,
u16 wErrorCode_p,
tEplNmtState LocalNmtState_p)
{
tEplKernel Ret = kEplSuccessful;
......@@ -2699,7 +2699,7 @@ static tEplKernel EplNmtMnuCheckNmtState(unsigned int uiNodeId_p,
} else if ((ExpNmtState != NodeNmtState_p)
&& !((ExpNmtState == kEplNmtCsPreOperational1)
&& (NodeNmtState_p == kEplNmtCsPreOperational2))) { // CN is not in expected NMT state (without the exceptions above)
WORD wbeErrorCode;
u16 wbeErrorCode;
if ((pNodeInfo_p->
m_wFlags & EPL_NMTMNU_NODE_FLAG_NOT_SCANNED) != 0) {
......
......@@ -1080,7 +1080,7 @@ EPLDLLEXPORT tEplKernel EplObdReadEntryToLe(EPL_MCO_DECL_INSTANCE_PTR_ unsigned
case kEplObdTypInt16:
case kEplObdTypUInt16:
{
AmiSetWordToLe(pDstData_p, *((WORD *) pSrcData));
AmiSetWordToLe(pDstData_p, *((u16 *) pSrcData));
break;
}
......@@ -1230,7 +1230,7 @@ EPLDLLEXPORT tEplKernel EplObdWriteEntryFromLe(EPL_MCO_DECL_INSTANCE_PTR_ unsign
case kEplObdTypInt16:
case kEplObdTypUInt16:
{
*((WORD *) pBuffer) = AmiGetWordFromLe(pSrcData_p);
*((u16 *) pBuffer) = AmiGetWordFromLe(pSrcData_p);
break;
}
......@@ -2094,7 +2094,7 @@ static tEplKernel EplObdWriteEntryPost(EPL_MCO_DECL_INSTANCE_PTR_ tEplObdEntryPt
// Function: EplObdGetObjectSize()
//
// 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
// if download data are stored temporary or not. For objects with fixed data length
// 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
// -------------------------------------------------------------------------
// types of objects in object dictionary
// DS-301 defines these types as WORD
// DS-301 defines these types as u16
typedef enum {
// types which are always supported
kEplObdTypBool = 0x0001,
......@@ -431,7 +431,7 @@ typedef struct {
unsigned int m_uiUpperObjIndex; // upper limit of ObjIndex
tInitTabEntryCallback m_fpInitTabEntry; // will be called if ObjIndex was found
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
} tEplObdModulTabParam;
......
......@@ -90,8 +90,8 @@
typedef struct {
void *m_pVar;
WORD m_wOffset; // in Bits
WORD m_wSize; // in Bits
u16 m_wOffset; // in Bits
u16 m_wSize; // in Bits
BOOL m_fNumeric; // numeric value -> use AMI functions
} tEplPdoMapping;
......
......@@ -314,16 +314,16 @@ tEplKernel EplPdokCbSoa(tEplFrameInfo * pFrameInfo_p)
tEplKernel EplPdokProcess(tEplEvent * pEvent_p)
{
tEplKernel Ret = kEplSuccessful;
WORD wPdoSize;
WORD wBitOffset;
WORD wBitSize;
WORD wVarSize;
u16 wPdoSize;
u16 wBitOffset;
u16 wBitSize;
u16 wVarSize;
u64 qwObjectMapping;
u8 bMappSubindex;
u8 bObdSubindex;
WORD wObdMappIndex;
WORD wObdCommIndex;
WORD wPdoId;
u16 wObdMappIndex;
u16 wObdCommIndex;
u16 wPdoId;
u8 bObdData;
u8 bObjectCount;
u8 bFrameData;
......@@ -438,16 +438,16 @@ tEplKernel EplPdokProcess(tEplEvent * pEvent_p)
}
// decode object mapping
wObdCommIndex =
(WORD) (qwObjectMapping &
(u16) (qwObjectMapping &
0x000000000000FFFFLL);
bObdSubindex =
(u8) ((qwObjectMapping &
0x0000000000FF0000LL) >> 16);
wBitOffset =
(WORD) ((qwObjectMapping &
(u16) ((qwObjectMapping &
0x0000FFFF00000000LL) >> 32);
wBitSize =
(WORD) ((qwObjectMapping &
(u16) ((qwObjectMapping &
0xFFFF000000000000LL) >> 48);
// check if object exceeds PDO size
......@@ -568,21 +568,21 @@ tEplKernel EplPdokProcess(tEplEvent * pEvent_p)
}
// decode object mapping
wObdCommIndex =
(WORD) (qwObjectMapping &
(u16) (qwObjectMapping &
0x000000000000FFFFLL);
bObdSubindex =
(u8) ((qwObjectMapping &
0x0000000000FF0000LL) >> 16);
wBitOffset =
(WORD) ((qwObjectMapping &
(u16) ((qwObjectMapping &
0x0000FFFF00000000LL) >> 32);
wBitSize =
(WORD) ((qwObjectMapping &
(u16) ((qwObjectMapping &
0xFFFF000000000000LL) >> 48);
// calculate max PDO size
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
// $$$ raise PDO error, set Ret
goto Exit;
......
......@@ -237,7 +237,7 @@ tEplKernel EplPdouCbObdAccess(tEplObdCbParam *pParam_p)
tEplObdAccess AccessType;
u8 bMappSubindex;
unsigned int uiCurPdoSize;
WORD wMaxPdoSize;
u16 wMaxPdoSize;
unsigned int uiSubIndex;
// fetch PDO ID
......
......@@ -2422,8 +2422,8 @@ static tEplKernel EplSdoAsyReadFromHistory(tEplAsySdoSeqCon * pAsySdoSeqCon_p,
// check if entries are available for reading
if ((pHistory->m_bFreeEntries < EPL_SDO_HISTORY_SIZE)
&& (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);
// PRINTF2(", free entries = %u, next frame size = %u\n", (WORD)pHistory->m_bFreeEntries, pHistory->m_auiFrameSize[pHistory->m_bRead]);
// 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", (u16)pHistory->m_bFreeEntries, pHistory->m_auiFrameSize[pHistory->m_bRead]);
// return pointer to stored frame
*ppFrame_p =
......@@ -2439,7 +2439,7 @@ static tEplKernel EplSdoAsyReadFromHistory(tEplAsySdoSeqCon * pAsySdoSeqCon_p,
}
} 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
// return null pointer
......
......@@ -814,7 +814,7 @@ tEplKernel EplSdoComReceiveCb(tEplSdoSeqConHdl SdoSeqConHdl_p,
EPL_DBGLVL_SDO_TRACE3
("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);
return Ret;
......@@ -2166,7 +2166,7 @@ static tEplKernel EplSdoComServerSendFrameIntern(tEplSdoComCon * pSdoComCon_p,
// set size of frame
AmiSetWordToLe(&pCommandFrame->
m_le_wSegmentSize,
(WORD) pSdoComCon_p->
(u16) pSdoComCon_p->
m_uiTransSize);
// correct byte-counter
......@@ -2296,7 +2296,7 @@ static tEplKernel EplSdoComServerSendFrameIntern(tEplSdoComCon * pSdoComCon_p,
// set segment size
AmiSetWordToLe(&pCommandFrame->
m_le_wSegmentSize,
(WORD) pSdoComCon_p->
(u16) pSdoComCon_p->
m_uiTransSize);
// send frame
......@@ -2679,7 +2679,7 @@ static tEplKernel EplSdoComClientSend(tEplSdoComCon * pSdoComCon_p)
// create command header
AmiSetWordToLe(pbPayload,
(WORD) pSdoComCon_p->
(u16) pSdoComCon_p->
m_uiTargetIndex);
pbPayload += 2;
AmiSetByteToLe(pbPayload,
......@@ -2720,7 +2720,7 @@ static tEplKernel EplSdoComClientSend(tEplSdoComCon * pSdoComCon_p)
bFlags);
// create command header
AmiSetWordToLe(pbPayload,
(WORD)
(u16)
pSdoComCon_p->
m_uiTargetIndex);
pbPayload += 2;
......@@ -2759,7 +2759,7 @@ static tEplKernel EplSdoComClientSend(tEplSdoComCon * pSdoComCon_p)
// create command header
AmiSetWordToLe(pbPayload,
(WORD)
(u16)
pSdoComCon_p->
m_uiTargetIndex);
pbPayload += 2;
......@@ -2783,7 +2783,7 @@ static tEplKernel EplSdoComClientSend(tEplSdoComCon * pSdoComCon_p)
// fill rest of header
AmiSetWordToLe(&pCommandFrame->
m_le_wSegmentSize,
(WORD) (4 +
(u16) (4 +
pSdoComCon_p->
m_uiTransSize));
......@@ -2854,7 +2854,7 @@ static tEplKernel EplSdoComClientSend(tEplSdoComCon * pSdoComCon_p)
AmiSetWordToLe
(&pCommandFrame->
m_le_wSegmentSize,
(WORD)
(u16)
pSdoComCon_p->
m_uiTransSize);
bFlags = 0x30;
......
......@@ -79,7 +79,7 @@
//---------------------------------------------------------------------------
typedef struct {
WORD m_wWord;
u16 m_wWord;
} twStruct;
......@@ -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 wValue;
wValue.m_wWord = (WORD) ((wWordVal_p & 0x00FF) << 8); //LSB to MSB
wValue.m_wWord |= (WORD) ((wWordVal_p & 0xFF00) >> 8); //MSB to LSB
wValue.m_wWord = (u16) ((wWordVal_p & 0x00FF) << 8); //LSB to MSB
wValue.m_wWord |= (u16) ((wWordVal_p & 0xFF00) >> 8); //MSB to LSB
pwStruct = (twStruct *) pAddr_p;
pwStruct->m_wWord = wValue.m_wWord;
......@@ -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;
......@@ -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 wValue;
pwStruct = (twStruct *) pAddr_p;
wValue.m_wWord = (WORD) ((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 & 0x00FF) << 8); //LSB to MSB
wValue.m_wWord |= (u16) ((pwStruct->m_wWord & 0xFF00) >> 8); //MSB to LSB
return (wValue.m_wWord);
......@@ -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;
......@@ -649,7 +649,7 @@ void AmiSetQword48ToLe(void *pAddr_p, u64 qwQwordVal_p)
{
((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)
{
((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];
}
......
......@@ -810,7 +810,7 @@ tEplKernel AppCbSync(void)
bVarOut1Old_l = bVarOut1_l;
// 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) {
bVarIn1_l++;
......
......@@ -120,7 +120,7 @@ typedef struct _tEdrvRxBuffer {
} tEdrvRxBuffer;
//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 (*tEdrvTxHandler) (tEdrvTxBuffer * pTxBuffer_p);
......@@ -130,7 +130,7 @@ typedef struct {
// u8 m_bNoOfRxBuffDescr; // number of entries in 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;
tEdrvTxHandler m_pfnTxHandler;
......
......@@ -26,9 +26,6 @@
#define TRACE printk
// --- logic types ---
#ifndef WORD
#define WORD unsigned short int
#endif
#ifndef BOOL
#define BOOL unsigned char
#endif
......
......@@ -99,7 +99,7 @@ struct _tEplDllkNodeInfo {
u32 m_dwPresTimeout;
unsigned long m_ulDllErrorEvents;
tEplNmtState m_NmtState;
WORD m_wPresPayloadLimit;
u16 m_wPresPayloadLimit;
u8 m_be_abMacAddr[6];
u8 m_bSoaFlag1;
BOOL m_fSoftDelete; // delete node after error and ignore error
......
......@@ -263,7 +263,7 @@ static int EplLinProcRead(char *pcBuffer_p,
// ---- EPL state ----
nSize += snprintf(pcBuffer_p + nSize, nBufferSize_p - nSize,
"NMT state: 0x%04X\n",
(WORD) EplNmtkGetNmtState());
(u16) EplNmtkGetNmtState());
EplDllkCalGetStatistics(&pDllkCalStats);
......@@ -286,7 +286,7 @@ static int EplLinProcRead(char *pcBuffer_p,
{
unsigned int uiMandatorySlaveCount;
unsigned int uiSignalSlaveCount;
WORD wFlags;
u16 wFlags;
EplNmtMnuGetDiagnosticInfo(&uiMandatorySlaveCount,
&uiSignalSlaveCount, &wFlags);
......
......@@ -148,7 +148,7 @@ typedef struct {
u32 m_dwCntObjectInDcf; // number of Objects in DCF
tEplCfgMaIndexType m_SkipCfg; // TRUE if a adsitional Configurationprocess
// 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
} tEplCfgMaNode;
......
......@@ -84,12 +84,12 @@
typedef tEplKernel(* tEplNmtMnuCbNodeEvent) (unsigned int uiNodeId_p,
tEplNmtNodeEvent NodeEvent_p,
tEplNmtState NmtState_p,
WORD wErrorCode_p,
u16 wErrorCode_p,
BOOL fMandatory_p);
typedef tEplKernel(* tEplNmtMnuCbBootEvent) (tEplNmtBootEvent BootEvent_p,
tEplNmtState NmtState_p,
WORD wErrorCode_p);
u16 wErrorCode_p);
//---------------------------------------------------------------------------
// function prototypes
......@@ -122,7 +122,7 @@ tEplKernel EplNmtMnuGetDiagnosticInfo(unsigned int
*puiMandatorySlaveCount_p,
unsigned int
*puiSignalSlaveCount_p,
WORD * pwFlags_p);
u16 * pwFlags_p);
#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