⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 drv_intf.h

📁 用于TM1300/PNX1300系列DSP(主要用于视频处理)的操作系统pSOS。包括全部源码
💻 H
📖 第 1 页 / 共 2 页
字号:
#define FLP_MINOR 0x100A0001  /* Invalid minor device # */#define FLP_NINIT 0x100A0002  /* Device not initialized */#define FLP_SEM   0x100A0003  /* Semaphore error */#define FLP_QUEUE 0x100A0004  /* Can not create a message queue */#define FLP_TASK  0x100A0005  /* Can not create the motor control task */#define FLP_RD    0x100A0006  /* Floppy drive read failure */#define FLP_WR    0x100A0007  /* Floppy drive write failure */#define FLP_DATA  0x100A0008  /* Unable to allocate driver data area */#define FLP_DRV   0x100AF000  /* Drive related error in the last byte *//*=====================================================================*//* Interface to the serial driver de_cntrl() function - parameters     *//* that are ON/OFF use 0 for OFF, non-zero for ON.  "Binary mode"      *//* causes the driver to ignore the delete and end-of-record characters *//* The "default_console" controls which minor device that minor device *//* 0 remaps to.                                                        *//*=====================================================================*/struct cnsl_ci_map_parms    {    int (*pna_recv)(int, char *, int ,int);    int (*pna_send)(int, char *, int ,int);    int (*pna_select)(int, void *, void *, void *, void *);    int (*pna_close)(int);    unsigned long (*phile_read)(unsigned long, void *, unsigned long, unsigned long *);    unsigned long (*phile_write)(unsigned long, void *, unsigned long);    };struct cnsl_tn_map_parms    {    unsigned short flag;    unsigned short fd;    unsigned long  tid;    int   (*read)();    int   (*write)();    int   (*close)();    };struct cnsl_io_map_parms    {    unsigned char  direction;    unsigned char  type;    unsigned short fd;    unsigned long  tid;    };struct cnsl_parms    {    char echo;     /* Echoing of input characters - ON or OFF */    char delchar;  /* Delete char */    char eorchar;  /* End-of-record character */    char binmode;  /* Binary mode - ON or OFF */    char nlconv;   /* Convert NL to NL/CR on output, and convert CR */                   /*  to NL on input (ON or OFF) */    char nonblock; /* Non-blocking read mode - ON or OFF */    char reserved[2]; /* Reserved for future use */    long timeout;  /* Read timeout in ticks (0 = none) */    long baudrate; /* Baud rate */    };struct cnsl_ctl_iopb    {    long function;     /* Function code - values defined below */    union        {        struct cnsl_ci_map_parms ci_parms;        struct cnsl_tn_map_parms tn_parms;        struct cnsl_io_map_parms io_parms;        struct cnsl_parms parms;        unsigned short default_console;        } u;    };/*---------------------------------------------------------------------*//* Values for io-type code                                             *//*---------------------------------------------------------------------*/#define CNSL_IO_SOCKET    0#define CNSL_IO_FILE      1#define CNSL_IO_REG       15#define CNSL_RAW          0x01#define CNSL_NOECHO       0x02#define CNSL_NOMAPLF      0x04/*---------------------------------------------------------------------*//* Values for function code                                            *//*---------------------------------------------------------------------*/#define CNSL_GET_PARMS      1  /* Get current parameter values */#define CNSL_SET_PARMS      2  /* Set the parameter values */#define CNSL_GET_DEFCNSL    3  /* Get minor # of default console */#define CNSL_SET_DEFCNSL    4  /* Set minor # of default console */#define CNSL_TN_MAPALLIO    5  /* Redirect all I/O to a telnet session */#define CNSL_TN_MAPTASKIO   6  /* Redirect per task I/O to a telnet */                               /* session */#define CNSL_IO_MAP         7  /* Redirect per task I/O */#define CNSL_CI_MAP         8  /* Entry points for pna, OpEN & phile *//*=====================================================================*//* Interface to the SCSI de_cntrl() function                           *//*=====================================================================*/#define SCSI_VENDOR_SIZE 9#define SCSI_PRODUCT_SIZE 17/*---------------------------------------------------------------------*//* Number of partitions allowed per drive (must be set to 4 if the     *//* device drive,  is also used on a PC                                 *//*---------------------------------------------------------------------*/#define NUMBER_OF_PARTITIONS 4typedef struct    {    int begin;                      /* beginning logical block */    int size;                       /* size in blocks */    unsigned char partition_wp;     /* write protected */    } PARTITION_INFO;struct scsi_info   {   unsigned char devtype;           /* Type of device */   unsigned char scsi_id;           /* Device address on the SCSI bus */   unsigned char lun;               /* Device's LUN */   unsigned char removeable;        /* Removeable media */   unsigned char loaded;            /* set to 1 if loaded */   char vendor[SCSI_VENDOR_SIZE];   /* Device's manufacturer */   char product[SCSI_PRODUCT_SIZE]; /* Model name */   long blocks;                     /* Capacity in blocks */   long blocksize;                  /* Size of each block in bytes */   PARTITION_INFO partition_info[NUMBER_OF_PARTITIONS]; /* Partition table */   };struct scsi_cmd   {   int target_id;             /* target id of SCSI device      */   unsigned char *data_ptr;   /* pointer to in/out data area   */   unsigned int data_in_len;  /* max data to take in           */   unsigned int data_out_len; /* actual ammount of data to send*/   unsigned int command_len;  /* length of SCSI CDB            */   unsigned char *cdb;        /* pointer to SCSI CDB           */   };typedef struct    {    int begin;                      /* beginning logical block */    int size;                       /* size in blocks */    } PARTITION_ENTRY;              /* used with SCSI_CTL_PARTITION */struct scsi_ctl_iopb    {    long function;      /* Function code - values defined below */    union        {        void *arg;        struct scsi_info info;        struct scsi_cmd cmd;        } u;    };struct scsi_open_iopb    {    unsigned char  exclusive;  /* set to 1 if open for only 1 task */    unsigned char  rewind;     /* set to 1 if rewind to be done at close */    };typedef struct scsi_rw_iopb    {    unsigned long b_device;        /* device number */    unsigned long b_bcount;        /* data length in characters */    void *b_bufptr;                /* data area     */    } TAPE_BUFFER_HEADER;/*---------------------------------------------------------------------*//* Values for function code                                            *//*---------------------------------------------------------------------*/#define SCSI_CTL_FORMAT          1 /* Format the disk */#define SCSI_CTL_INFO            2 /* Get information about a device */#define SCSI_CTL_CMD             3 /* Issue a scsi command */#define SCSI_CTL_TEST_UNIT_READY 4 /* Test for ready */#define SCSI_CTL_PARTITION       5 /* Partition drive */#define SCSI_CTL_READ_ONLY_P     6 /* Write Protect a Partition */#define SCSI_CTL_READ_WRITE_P    7 /* Read and Write a Partition */#define SCSI_CTL_START_DEVICE    8 /* Start the drive */#define SCSI_CTL_STOP_DEVICE     9 /* Stop the drive */#define SCSI_CTL_STOP_COMMANDS  10 /* Stop Commands being sent to bus */#define SCSI_CTL_START_COMMANDS 11 /* Start Commands being sent to bus */#define SCSI_CTL_SKIP           12 /* Skip to next file mark */#define SCSI_CTL_REWIND         13 /* Rewind tape */#define SCSI_CTL_UNLOAD         14 /* Unload tape */#define SCSI_CTL_ERASE          15 /* Erase tape */#define SCSI_CTL_WRITE_FILE_MARK 16 /* Write file mark on tape */#define SCSI_CTL_SET_BLOCK_MODE 17 /* Set block mode and size *//*---------------------------------------------------------------------*//* Values for info.devtype                                             *//*---------------------------------------------------------------------*/#define SCSI_TYPE_DIRECT      0x00   /* direct access (disk)           */#define SCSI_TYPE_SEQUENTIAL  0x01   /* sequential access (tape)       */#define SCSI_TYPE_PRINTER     0x02   /* printer                        */#define SCSI_TYPE_PROCESSOR   0x03   /* processor board                */#define SCSI_TYPE_WORM        0x04   /* write once (optical disk)      */#define SCSI_TYPE_CDROM       0x05   /* cd rom                         */#define SCSI_TYPE_SCANNER     0x06   /* scanner                        */#define SCSI_TYPE_OMEM        0x07   /* optical memory (some disks)    */#define SCSI_TYPE_CHANGER     0x08   /* medium changer (jukeboxes)     */#define SCSI_TYPE_COMM        0x09   /* communication device           */#define SCSI_TYPE_UNKNOWN     0x1F   /* unknown device type            */#define SCSI_TYPE_HOST        0xFF   /* ID is of HOST system           *//*=====================================================================*//* Interface to the TFTP                                               *//*=====================================================================*//* The TFTP driver provides the capability to handle up to eight       *//* simultaneous open channels transferring data over network from a    *//* remote host using TFTP protocol.  The channel numbers are coded     *//* in the minor part of the device number.  There are four entry       *//* points to the driver - init, open, close and read.  The user shall  *//* initialize pNA+ (by calling pna_init()) in the application code     *//* before accessing the device driver.  A call to de_open() shall be   *//* made before de_read().  The de_open() shall be called with an IOPB  *//* of the following:                                                   *//*---------------------------------------------------------------------*/typedef struct    {    unsigned long   ip_addr;     /* IP Address of the host */    char           *filename;    /* Filename to transfer */    } TFTP_IOPB;/*---------------------------------------------------------------------*//* The data can be read by calling de_read() with the following IOPB:  *//*---------------------------------------------------------------------*/typedef struct    {    unsigned long    count;    void        *address;    } TFTP_READ_IOPB;#endif /* _DRV_INTF_H */#if defined(__cplusplus)}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -