Subversion Repositories shark

Rev

Rev 3 | Rev 1063 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/*
 *
 *
 *
 */


#ifndef __IDEREQ_H__
#define __IDEREQ_H__

#include "bqueue.h"
#include "glue.h"
#include "ll/sys/cdefs.h"

__BEGIN_DECLS

#define MAXIDEREQUEST 64

/* -------- */

typedef struct TAGidereq_t {

  request_prologue_t info;

  int next;
 
  __uint8_t  resetonerror; /*+ request/reply soft reset on error (see code) +*/
 
  __uint8_t  cmd;
  __b_sem_t  wait;
  int        result;

  __uint8_t  features;
  __uint8_t  cyllow;
  __uint8_t  cylhig;
  __uint8_t  seccou;
  __uint8_t  secnum;
  __uint8_t  devhead;
 
  __uint8_t  *buffer;
} idereq_t;

extern idereq_t idereq[];

/* initialization */
void init_idereq(void);

/* get a request from the free queue */
int get_idereq(void);
/* insert a request into the free queue */
void free_idereq(int req);

/* insert a request into an ide interface struct */
int insert_idereq(int ideif, int drive, int req);
/* release a blocked queue of an ide interface*/
int releasequeue_idereq(int ideif);

/* get the first request to serve */
int first_idereq(int ideif);
/* get the actual request that we are serving */
int actual_idereq(int ideif);
/* remove the request that we have served */
int remove_idereq(int ideif);
/* remove the request that we have served blocking the queue*/
int remove_idereq_blocking(int ideif);

__END_DECLS
#endif