original files of m241

This commit is contained in:
neelimap
2026-07-30 11:19:44 +05:30
parent 170c2b3f3a
commit afc7070c1f
12254 changed files with 7655111 additions and 0 deletions
@@ -0,0 +1,52 @@
/* visionTmdDrv.h - header file for Wind River Transparent Mode Driver */
/* Copyright 1986-2002 Wind River Systems Inc. */
/*
modification history
--------------------
01f,21dec01,g_h Rename to visionTmdDrv.h
01e,01dec01,g_h Cleaning for T2.2
01d,05may01,g_h renaming module name to visionTMDrv.h and cleaning
01c,09apr01,rnr Changed to be a small I/O subsystem
01b,07feb01,g_h renaming module name and cleaning
01a,15may97,est written.
*/
#ifndef __INCvisionTmdDrvh
#define __INCvisionTmdDrvh
#ifdef __cplusplus
extern "C" {
#endif
/* defines */
#define TX_BUF_EMPTY 0x0000
#define TX_READY TX_BUF_EMPTY
#define TX_BUF_NOT_EMPTY 0x8000
#define TX_NOT_READY TX_BUF_NOT_EMPTY
#define RX_BUF_EMPTY 0x0000
#define RX_READY RX_BUF_NOT_EMPTY
#define RX_BUF_NOT_EMPTY 0x8000
#define RX_NOT_READY RX_BUF_EMPTY
/* typedefs */
typedef struct
{
u_short status;
u_short count;
u_char buf[VISION_PKT_MTU];
} TMD_DESCRIPTOR;
#ifdef __cplusplus
}
#endif
#endif /* __INCvisionTmdDrvh */
@@ -0,0 +1,132 @@
/* wdbVisionDrv.h - header file for Wind River Generic Vision Driver */
/* Copyright 1986-2005, 2010 Wind River Systems Inc. */
/*
modification history
--------------------
01d,29apr10,pad Moved extern C statement after include statements.
01c,11may05,j_b add return value to CREATE_CRITSECT (SPR# 107058)
01b,05may01,g_h renaming to wdbVisionDrv.h and cleaning
01a,09apr01,rnr written.
*/
#ifndef __INCwdbVisionDrvh
#define __INCwdbVisionDrvh
/* includes */
#include "vxWorks.h"
#include "semLib.h"
#ifdef __cplusplus
extern "C" {
#endif
/* defines */
#define VISION_DEFAULT_POLL_PRI 200 /* Rx polling task priority */
#define VISION_DEFAULT_POLL_DELAY 2 /* Polling Task delay tick */
#define VISION_PKT_MTU 1488 /* Maximum Transmission Unit */
#define VISION_MAX_PTASK_DELAY 50 /* Maximum poll loop delay */
#define VISION_MIN_PTASK_PRIOR 5 /* Maximum polltask priority */
#define VISION_MAX_PTASK_PRIOR 255 /* Minimum polltask priority */
/* (MIN/MAX reversed,0 is high) */
#define TX_BUFFER_SIZE (VISION_PKT_MTU * 2) /* default queue sizes */
#define RX_BUFFER_SIZE (VISION_PKT_MTU * 2) /* changed with ioctl() */
#define LOOP_BUFFER_SIZE (VISION_PKT_MTU * 10) /* Loopback space */
/* Tx/Rx Modes: used in ioctl() case statements */
#define VISION_POLL_MODE 0x0001 /* Polled / Pseudo Interrupt */
#define VISION_PINTR_MODE 0x0002
#define VISION_PISR_MODE 0x0004
#define VISION_BLOCKED_MODE 0x0008 /* Blocking / Non-Blocking */
#define VISION_NONBLOCKED_MODE 0x0010
#define VISION_BUFFERED_MODE 0x0020 /* Buffered / Non-Buffered */
#define VISION_NONBUFFERED_MODE 0x0040
#define VISION_LPBK_MODE 0x0080 /* Normal / Loopback Mode */
#define VISION_NORMAL_MODE 0x0100
#define VISION_TX_QUEUE_SIZE 0x0200 /* Tx/Rx Queue Sizes */
#define VISION_RX_QUEUE_SIZE 0x0400
#define VISION_PTASK_PRIORITY 0x0800 /* Change pTask Priority */
#define VISION_PTASK_DELAY 0x1000 /* Change pTask Loop Delay */
/* Driver States */
#define VISION_STATE_CLOSED 0
#define VISION_STATE_OPEN 1
/* Tx/Rx Buffering Queues */
typedef struct
{
int nofChars; /* Number of bytes currently stored */
int size; /* Maximum size of the queue */
int head; /* Current start of data in queue buffer */
int tail; /* Current end of data in queue buffer */
char *pData; /* Buffer where data is stored */
} VISION_QUEUE;
/* MACRO definitions for operating system specific calls */
#define MEMCOPY(d, s, c) memcpy(d, s, c)
typedef SEM_ID CRITSECT;
#define CREATE_CRITSECT(s) (s = semMCreate(SEM_Q_FIFO))
#define REMOVE_CRITSECT(s) semDelete(s)
#define ENTER_CRITSECT(s) semTake(s,WAIT_FOREVER)
#define EXIT_CRITSECT(s) semGive(s)
/*
* DELAY_TASK - places the current task or thread to sleep for c msecs/ticks
*/
#define DELAY_TASK(c) taskDelay(c)
/* VDRIV_DEV - Wind River Vision Device descriptor */
typedef struct
{
DEV_HDR devHdr; /* DEV_HDR must com first */
char state; /* State of the driver */
char *pDeviceName; /* device name: etd/0 */
int opMode; /* Poll/Pseudo Interrupt Mode */
int rdWrMode; /* read/write mode */
int bufferMode; /* Buffering mode */
int blockMode; /* Blocking mode */
int loopMode; /* Diagnostic loopback */
int pollDelay; /* Polling Task Delay */
int pollTaskId; /* Polling Task Id */
VISION_QUEUE txQueue; /* Transmit buffer */
VISION_QUEUE rxQueue; /* Receive buffer */
VISION_QUEUE loopQueue; /* Loopback queue */
CRITSECT txCrSection; /* Xmit Queue protection */
CRITSECT rxCrSection; /* Recv Queue protection */
CRITSECT loopCrSection; /* Loopback Queue protection */
V_DRIVER_INTERFACE inter; /* Interface structure */
} VDRIV_DEV ;
/* function prototypes */
#if defined(__STDC__)
IMPORT int visionDriverInit (void);
IMPORT int visionDriverCreate (char *, int, int, int, int, int);
#else /* __STDC__ */
IMPORT int visionDriverInit ();
IMPORT int visionDriverCreate ();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* __INCwdbVisionDrvh */
@@ -0,0 +1,116 @@
/* wdbVisionDrvIF.h - Interface definitions/declations for vision DRIVER */
/* Copyright 1986-2002 Wind River Systems Inc. */
/*
modification history
--------------------
01c,01dec01,g_h Cleaning for T2.2
01b,05may01,g_h rename to wdbVisionDrvIF.h
01a,09apr01,rnr written.
*/
#ifndef __INCwdbVisionDrvIFh
#define __INCwdbVisionDrvIFh
#ifdef __cplusplus
extern "C" {
#endif
/* defines */
#define VDR_SUCCESS 0 /* Indicates success of requested operation */
#define VDR_FAILURE 1 /* Indicates failure of requested operation */
/* */
#define VDR_WRITE_COMPLETE 0 /* Previously requested WRITE is done */
#define VDR_WRITE_PENDING 1 /* Previously requested WRITE is not done */
/* */
#define VDR_DATA_FOUND 0 /* Data is pending on the receive channel */
#define VDR_DATA_NONE 1 /* Data is NOT pending on the receive channel */
/* typedefs */
typedef unsigned char VDR_UCHAR; /* Host independent unsigned 1-byte unit */
typedef unsigned long VDR_ULONG; /* Host independent unsigned 4-byte unit */
typedef void * VDR_PDATA; /* Host independent void 4-byte unit */
#if defined(__STDC__)
/* Open/Close prototypes */
typedef VDR_ULONG (*VDR_OPEN_PTR) (VDR_PDATA priv);
typedef VDR_ULONG (*VDR_CLOSE_PTR) (VDR_PDATA priv);
/* Read/Write prototypes */
typedef VDR_ULONG (*VDR_READ_STATUS_PTR) (VDR_PDATA priv, VDR_ULONG * status);
typedef VDR_ULONG (*VDR_WRITE_STATUS_PTR) (VDR_PDATA priv, VDR_ULONG * status);
/* ReadStatus/WriteStatus prototypes */
typedef VDR_ULONG (*VDR_READ_PTR) (VDR_PDATA priv, VDR_UCHAR * pData,
VDR_ULONG maxSize, VDR_ULONG * rcvBytes);
typedef VDR_ULONG (*VDR_WRITE_PTR) (VDR_PDATA priv, VDR_UCHAR * pData, VDR_ULONG size);
#else /* __STDC__ */
/* Open/Close prototypes */
typedef VDR_ULONG (*VDR_OPEN_PTR)();
typedef VDR_ULONG (*VDR_CLOSE_PTR)();
/* Read/Write prototypes */
typedef VDR_ULONG (*VDR_READ_STATUS_PTR )();
typedef VDR_ULONG (*VDR_WRITE_STATUS_PTR)();
/* ReadStatus/WriteStatus prototypes */
typedef VDR_ULONG (*VDR_READ_PTR)();
typedef VDR_ULONG (*VDR_WRITE_PTR)();
#endif /* __STDC__ */
/*
* This data structure represent the interface exchange between
* the High-Level Vision driver ( wdbVisioDrv ) and the Low-Level I/O
* subsystem driver. vDriver code will make an initialization
* call into the Low-Level code. The Low-Level code will setup
* the function pointer fields with the addresses of routines
* that perform that particular operation. Also the Low-Level
* I/O will fill in the PrivateData field with a value which is
* of meaining to the Low-Level driver. This data will be given
* back to the Low-Level driver on every request.
*/
typedef struct vDriverInterface
{
VDR_OPEN_PTR openFunc; /* Addr of OPEN routine */
VDR_CLOSE_PTR closeFunc; /* Addr of CLOSE routine */
VDR_READ_PTR readFunc; /* Addr of the READ routine */
VDR_WRITE_PTR writeFunc; /* Addr of the WRITE routine */
VDR_READ_STATUS_PTR readStatusFunc; /* Addr of the READ STATUS routine */
VDR_WRITE_STATUS_PTR writeStatusFunc; /* Addr of the WRITE STATUS routine */
VDR_PDATA privateData; /* Private data space */
} V_DRIVER_INTERFACE;
/* function prototypes */
/* Prototype for the Initialization call */
#if defined(__STDC__)
typedef VDR_ULONG (*VDR_INIT_PTR) (V_DRIVER_INTERFACE * interfaceData);
#else /* __STDC__ */
typedef VDR_ULONG (*VDR_INIT_PTR)();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* __INCwdbVisionDrvIFh */
@@ -0,0 +1,96 @@
/* wdbVisionPktDrv.h - header file for Wind River Vision Driver WDB agent packet driver */
/*
* Copyright (c) 1995-2005, 2010 Wind River Systems, Inc.
*
* The right to copy, distribute, modify or otherwise make use of this
* software may be licensed only pursuant to the terms of an applicable Wind
* River license agreement.
*/
/*
modification history
--------------------
01j,29apr10,pad Moved extern C statement after include statements.
01i,07dec05,dbt Replaced bool_t with BOOL.
01h,12jan02,g_h Renaming filed name in WDB_VISION_PKT_DEV struct
01g,01dec01,g_h Cleaning for T2.2
01f,07may01,g_h add the FIX_IP_VH macro
01e,06may01,g_h add support for visionPORT
01d,05may01,g_h renaming moulde name to wdbVisionPktDrv.h and cleaning
01c,07feb01,g_h renaming module name and cleaning
01b,03may97,est adapted for EST Background mode emulator
01a,23aug95,ms written.
*/
#ifndef __INCwdbVisionPktDrvh
#define __INCwdbVisionPktDrvh
/* includes */
#include "sioLib.h"
#include "wdb/wdb.h"
#include "wdb/wdbCommIfLib.h"
#include "wdb/wdbMbufLib.h"
#ifdef __cplusplus
extern "C" {
#endif
/* defines */
/* Patch for TMD/usrWdb.c structure problem (SENS) */
#define FIX_IP_VH
#define WDB_VISION_PKT_MTU 1488 /* MUST MATCH VISION_PKT_MTU */
/* in wdbVisionDrv.h */
/* lower WDB_MTU to WDB_VISION_PKT_MTU for Wind River Vision Connections */
#if (WDB_MTU > WDB_VISION_PKT_MTU)
#undef WDB_MTU
#define WDB_MTU WDB_VISION_PKT_MTU
#endif /* (WDB_MTU > WDB_VISION_PKT_MTU) */
#define VISION_DUMMY_PORT ((u_short)0x1237) /* port number for wdb packet */
#define VISION_DUMMY_IP_ADRS 0x12345678 /* ip address for wdb packet */
#define IP_HDR_SIZE 20 /* UDP/IP Header Information */
#define UDP_HDR_SIZE 8
#define UDP_IP_HDR_SIZE (IP_HDR_SIZE + UDP_HDR_SIZE)
/* data types */
typedef struct
{
WDB_DRV_IF wdbDrvIf; /* This must be first */
int fileFd; /* Vision Driver file descriptor from open() */
int pollTaskId; /* Polling Task Id */
int mode; /* current mode - poll or int (not used) */
BOOL inputBusy;
BOOL outputBusy;
char * pRxBuffer; /* Input Buffer, loaned to agent on receipt */
int bytesRead;
char * pTxBuffer; /* Output Buffer, chain of mbufs */
int bytesWritten;
} WDB_VISION_PKT_DEV;
/* function prototypes */
#if defined(__STDC__)
IMPORT int wdbVisionPktDevInit (WDB_VISION_PKT_DEV *pPktDev, void (*stackRcv)());
#else /* __STDC__ */
IMPORT int wdbVisionPktDevInit ();
#endif /* __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* __INCwdbVisionPktDrvh */