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

📄 scsibus.hpp

📁 使用ASPI包装成的一些通用类
💻 HPP
字号:
////////////////////////////////////////////////////////////
//
// Module SCSIBUS.HPP
//
// ASPI class library
// SCSI interface class
//
// Project: A Programmer's Guide to SCSI
//
// Copyright (C) 1997, Brian Sawert
// Portions copyright (C) 1995, Larry Martin
// All rights reserved
//
////////////////////////////////////////////////////////////


#ifndef SCSIBUS_HPP_INCLUDED
#define SCSIBUS_HPP_INCLUDED


#ifndef SCSIDEV_HPP_INCLUDED
#include "scsidev.hpp"
#endif

#ifndef LIST_HPP_INCLUDED
#include "list.hpp"
#endif


#define MAX_HOST_ADAPTERS  10

typedef struct {
   int AdapterNum;         // adapter number
   int ScsiId;             // host SCSI ID
   int MaxUnits;           // max devices
   int Residual;           // residual byte support
   int Align;              // alignment mask
   char ManagerId[18];     // ASPI manager
   char Identifier[18];    // adapter string
} AdapterInfo;

class ScsiInterface {

   public:

   int AspiIsOpen;
   unsigned NumAdapters;
   unsigned NumDevices;

   AdapterInfo *AdapterList;

   ItemList ScsiDevList;

   ScsiInterface();
   ScsiInterface(int BuildDeviceList, int type=-1, int scan_luns=0);
   ~ScsiInterface();

   ScbError OpenAspiLayer();
   unsigned GetNumAdapters();

   unsigned GetNumDevices();
   ScsiDevice *GetDevice(unsigned i);

   int BuildDeviceList(int type=-1, int scan_luns=0);
   void ClearDeviceList();

   ScbError RescanBus(int type=-1, int scan_luns=0);

   ScbError AttachDevice(unsigned adapter, unsigned unit, unsigned lun, int type=-1);
   void RemoveDevice(unsigned adapter, unsigned unit, unsigned lun);

   ScsiDevice *FindDevice(char *name);
   ScsiDevice *FindDevice(unsigned adapter, unsigned unit, unsigned lun);

   };


#endif

⌨️ 快捷键说明

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