** unset it. Unsetting will fail if the area is booked, and a transfer to that
** area is in progress. Otherwise, we will release the area and re-assign it.
****************************************************************************/
-int SetTransfer(DEVICE_EXTENSION *pdx, TRANSFERDESC __user *pTD)
+int SetTransfer(DEVICE_EXTENSION *pdx, struct transfer_area_desc __user *pTD)
{
int iReturn;
- TRANSFERDESC td;
+ struct transfer_area_desc td;
if (copy_from_user(&td, pTD, sizeof(td)))
return -EFAULT;
** booked and a transfer to that area is in progress. Otherwise, we will
** release the area and re-assign it.
****************************************************************************/
-int SetCircular(DEVICE_EXTENSION *pdx, TRANSFERDESC __user *pTD)
+int SetCircular(DEVICE_EXTENSION *pdx, struct transfer_area_desc __user *pTD)
{
int iReturn;
bool bToHost;
- TRANSFERDESC td;
+ struct transfer_area_desc td;
if (copy_from_user(&td, pTD, sizeof(td)))
return -EFAULT;
** TypeDefs
*****************************************************************************/
-typedef struct TransferDesc {
+struct transfer_area_desc {
long long lpvBuff; /* address of transfer area (for 64 or 32 bit) */
unsigned int dwLength; /* length of the area */
unsigned short wAreaNum; /* number of transfer area to set up */
short eSize; /* element size - is tohost flag for circular */
-} TRANSFERDESC;
+};
-typedef TRANSFERDESC *LPTRANSFERDESC;
typedef struct TransferEvent {
unsigned int dwStart; /* offset into the area */
#define IOCTL_CED_LINECOUNT _IO(CED_MAGIC_IOC, 7)
#define IOCTL_CED_GETSTRING(nMax) _IOC(_IOC_READ, CED_MAGIC_IOC, 8, nMax)
-#define IOCTL_CED_SETTRANSFER _IOW(CED_MAGIC_IOC, 11, TRANSFERDESC)
+#define IOCTL_CED_SETTRANSFER _IOW(CED_MAGIC_IOC, 11, struct transfer_area_desc)
#define IOCTL_CED_UNSETTRANSFER _IO(CED_MAGIC_IOC, 12)
#define IOCTL_CED_SETEVENT _IOW(CED_MAGIC_IOC, 13, TRANSFEREVENT)
#define IOCTL_CED_GETOUTBUFSPACE _IO(CED_MAGIC_IOC, 14)
#define IOCTL_CED_DBGGETDATA _IOR(CED_MAGIC_IOC, 39, TDBGBLOCK)
#define IOCTL_CED_DBGSTOPLOOP _IO(CED_MAGIC_IOC, 40)
#define IOCTL_CED_FULLRESET _IO(CED_MAGIC_IOC, 41)
-#define IOCTL_CED_SETCIRCULAR _IOW(CED_MAGIC_IOC, 42, TRANSFERDESC)
+#define IOCTL_CED_SETCIRCULAR _IOW(CED_MAGIC_IOC, 42, struct transfer_area_desc)
#define IOCTL_CED_GETCIRCBLOCK _IOWR(CED_MAGIC_IOC, 43, TCIRCBLOCK)
#define IOCTL_CED_FREECIRCBLOCK _IOWR(CED_MAGIC_IOC, 44, TCIRCBLOCK)
#define IOCTL_CED_WAITEVENT _IO(CED_MAGIC_IOC, 45)
return ioctl(fh, IOCTL_CED_GETDRIVERREVISION);
}
-inline int CED_SetTransfer(int fh, TRANSFERDESC *pTD)
+inline int CED_SetTransfer(int fh, struct transfer_area_desc *pTD)
{
return ioctl(fh, IOCTL_CED_SETTRANSFER, pTD);
}
return ioctl(fh, IOCTL_CED_FULLRESET);
}
-inline int CED_SetCircular(int fh, TRANSFERDESC *pTD)
+inline int CED_SetCircular(int fh, struct transfer_area_desc *pTD)
{
return ioctl(fh, IOCTL_CED_SETCIRCULAR, pTD);
}
return GetString(pdx, (char __user *)ulArg, _IOC_SIZE(cmd));
case _IOC_NR(IOCTL_CED_SETTRANSFER):
- return SetTransfer(pdx, (TRANSFERDESC __user *) ulArg);
+ return SetTransfer(pdx, (struct transfer_area_desc __user *) ulArg);
case _IOC_NR(IOCTL_CED_UNSETTRANSFER):
return UnsetTransfer(pdx, (int)ulArg);
break;
case _IOC_NR(IOCTL_CED_SETCIRCULAR):
- return SetCircular(pdx, (TRANSFERDESC __user *) ulArg);
+ return SetCircular(pdx, (struct transfer_area_desc __user *) ulArg);
case _IOC_NR(IOCTL_CED_GETCIRCBLOCK):
return GetCircBlock(pdx, (TCIRCBLOCK __user *) ulArg);
extern int Reset1401(DEVICE_EXTENSION *pdx);
extern int GetChar(DEVICE_EXTENSION *pdx);
extern int GetString(DEVICE_EXTENSION *pdx, char __user *pUser, int n);
-extern int SetTransfer(DEVICE_EXTENSION *pdx, TRANSFERDESC __user *pTD);
+extern int SetTransfer(DEVICE_EXTENSION *pdx, struct transfer_area_desc __user *pTD);
extern int UnsetTransfer(DEVICE_EXTENSION *pdx, int nArea);
extern int SetEvent(DEVICE_EXTENSION *pdx, TRANSFEREVENT __user *pTE);
extern int Stat1401(DEVICE_EXTENSION *pdx);
extern int DbgRampAddr(DEVICE_EXTENSION *pdx, TDBGBLOCK __user *pDB);
extern int DbgGetData(DEVICE_EXTENSION *pdx, TDBGBLOCK __user *pDB);
extern int DbgStopLoop(DEVICE_EXTENSION *pdx);
-extern int SetCircular(DEVICE_EXTENSION *pdx, TRANSFERDESC __user *pTD);
+extern int SetCircular(DEVICE_EXTENSION *pdx, struct transfer_area_desc __user *pTD);
extern int GetCircBlock(DEVICE_EXTENSION *pdx, TCIRCBLOCK __user *pCB);
extern int FreeCircBlock(DEVICE_EXTENSION *pdx, TCIRCBLOCK __user *pCB);
extern int WaitEvent(DEVICE_EXTENSION *pdx, int nArea, int msTimeOut);
typedef PARAMBLK* PPARAMBLK;
-typedef struct TransferDesc /* Structure and type for SetTransArea */
+struct transfer_area_desc /* Structure and type for SetTransArea */
{
unsigned short wArea; /* number of transfer area to set up */
void FAR *lpvBuff; /* address of transfer area */
unsigned int dwLength; /* length of area to set up */
short eSize; /* size to move (for swapping on MAC) */
-} TRANSFERDESC;
+};
-typedef TRANSFERDESC FAR *LPTRANSFERDESC;
/* This is the structure used to set up a transfer area */
typedef struct VXTransferDesc /* use1401.c and use1432x.x use only */
U14API(short) U14SetTransArea(short hand, unsigned short wArea, void *pvBuff,
unsigned int dwLength, short eSz)
{
- TRANSFERDESC td;
+ struct transfer_area_desc td;
short sErr = CheckHandle(hand);
if (sErr != U14ERR_NOERROR)
return sErr;
td.eSize = 0; // Dummy element size
if (DeviceIoControl(aHand1401[hand],(unsigned int)U14_SETTRANSFER,
- &td,sizeof(TRANSFERDESC),
+ &td,sizeof(struct transfer_area_desc),
&rWork,sizeof(PARAMBLK),&dwBytes,NULL))
{
if (dwBytes >= sizeof(PARAMBLK)) // maybe error from driver?
{
PARAMBLK rWork;
unsigned int dwBytes;
- TRANSFERDESC txDesc;
+ struct transfer_area_desc txDesc;
txDesc.wArea = wArea; /* Pure NT - put data into struct */
txDesc.lpvBuff = pvBuff;
txDesc.dwLength = dwLength;
txDesc.eSize = (short)bToHost; /* Use this for direction flag */
if (DeviceIoControl(aHand1401[hand],(unsigned int)U14_SETCIRCULAR,
- &txDesc, sizeof(TRANSFERDESC),
+ &txDesc, sizeof(struct transfer_area_desc),
&rWork, sizeof(PARAMBLK),&dwBytes,NULL))
{
if (dwBytes >= sizeof(PARAMBLK)) /* error from driver? */
#ifdef LINUX
else
{
- TRANSFERDESC td;
+ struct transfer_area_desc td;
td.lpvBuff = (long long)((unsigned long)pvBuff);
td.wAreaNum = wArea;
td.dwLength = dwLength;