#include <sys/drives.h>
#include <pci/hd.h>
#include <isa/fdc.h>
#include <lib/kmalloc.h>

struct driveDriver *drives = 0x0;
int currentDrive = 0x0;

void addDrive(int id,char type,void *driveInfoStruct,void *read,void *write,void *reset) {
  struct driveDriver *tmp = 0x0;
  tmp = (struct driveDriver *)kmalloc(sizeof(struct driveDriver),-2);
  tmp->driveInfoStruct = driveInfoStruct;
  tmp->read      = read;
  tmp->write     = write;
  tmp->reset     = reset;
  tmp->id        = id;
  tmp->driveType = type;
  if (!drives) {
    tmp->next = 0x0;
    tmp->prev = 0x0;
    drives = tmp;
    }
  else {
    tmp->next = drives;
    tmp->prev = 0x0;
    drives = tmp;
    }
  }

struct driveDriver *findDrive(int id) {
  struct driveDriver *tmp = 0x0;
  for (tmp = drives;tmp;tmp=tmp->next) {
    if (tmp->id == id) return(tmp);
    }
  return(0x0);
  }  
