OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [scsi/] [sg.h] - Diff between revs 1765 and 1782

Only display areas with differences | Details | Blame | View Log

Rev 1765 Rev 1782
/*
/*
   History:
   History:
    Started: Aug 9 by Lawrence Foard (entropy@world.std.com), to allow user
    Started: Aug 9 by Lawrence Foard (entropy@world.std.com), to allow user
     process control of SCSI devices.
     process control of SCSI devices.
    Development Sponsored by Killy Corp. NY NY
    Development Sponsored by Killy Corp. NY NY
*/
*/
 
 
#ifndef _SCSI_GENERIC_H
#ifndef _SCSI_GENERIC_H
#define _SCSI_GENERIC_H
#define _SCSI_GENERIC_H
 
 
/*
/*
 An SG device is accessed by writing "packets" to it, the replies
 An SG device is accessed by writing "packets" to it, the replies
 are then read using the read call. The same header is used for
 are then read using the read call. The same header is used for
 reply, just ignore reply_len field.
 reply, just ignore reply_len field.
*/
*/
 
 
struct sg_header
struct sg_header
 {
 {
  int pack_len;    /* length of incoming packet <4096 (including header) */
  int pack_len;    /* length of incoming packet <4096 (including header) */
  int reply_len;   /* maximum length <4096 of expected reply */
  int reply_len;   /* maximum length <4096 of expected reply */
  int pack_id;     /* id number of packet */
  int pack_id;     /* id number of packet */
  int result;      /* 0==ok, otherwise refer to errno codes */
  int result;      /* 0==ok, otherwise refer to errno codes */
  unsigned int twelve_byte:1; /* Force 12 byte command length for group 6 & 7 commands  */
  unsigned int twelve_byte:1; /* Force 12 byte command length for group 6 & 7 commands  */
  unsigned int other_flags:31;                  /* for future use */
  unsigned int other_flags:31;                  /* for future use */
  unsigned char sense_buffer[16]; /* used only by reads */
  unsigned char sense_buffer[16]; /* used only by reads */
  /* command follows then data for command */
  /* command follows then data for command */
 };
 };
 
 
/* ioctl's */
/* ioctl's */
#define SG_SET_TIMEOUT 0x2201  /* set timeout *(int *)arg==timeout */
#define SG_SET_TIMEOUT 0x2201  /* set timeout *(int *)arg==timeout */
#define SG_GET_TIMEOUT 0x2202  /* get timeout return timeout */
#define SG_GET_TIMEOUT 0x2202  /* get timeout return timeout */
 
 
#define SG_DEFAULT_TIMEOUT (60*HZ) /* 1 minute timeout */
#define SG_DEFAULT_TIMEOUT (60*HZ) /* 1 minute timeout */
#define SG_DEFAULT_RETRIES 1
#define SG_DEFAULT_RETRIES 1
 
 
#define SG_MAX_QUEUE 4 /* maximum outstanding request, arbitrary, may be
#define SG_MAX_QUEUE 4 /* maximum outstanding request, arbitrary, may be
                          changed if sufficient DMA buffer room available */
                          changed if sufficient DMA buffer room available */
 
 
#define SG_BIG_BUFF 32768
#define SG_BIG_BUFF 32768
 
 
#endif
#endif
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.