亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? scsi.h

?? linux操作系統1.0版本
?? H
字號:
/*
 *	scsi.h Copyright (C) 1992 Drew Eckhardt 
 *	generic SCSI package header file by
 *		Drew Eckhardt 
 *
 *	<drew@colorado.edu>
 *
 *       Modified by Eric Youngdale eric@tantalus.nrl.navy.mil to
 *       add scatter-gather, multiple outstanding request, and other
 *       enhancements.
 */

#ifndef _SCSI_H
#define _SCSI_H

/*
	$Header: /usr/src/linux/kernel/blk_drv/scsi/RCS/scsi.h,v 1.3 1993/09/24 12:20:33 drew Exp $

	For documentation on the OPCODES, MESSAGES, and SENSE values,
	please consult the SCSI standard.

*/

/*
	SCSI opcodes
*/

#define TEST_UNIT_READY 	0x00
#define REZERO_UNIT		0x01
#define REQUEST_SENSE		0x03
#define FORMAT_UNIT		0x04
#define READ_BLOCK_LIMITS	0x05
#define REASSIGN_BLOCKS		0x07
#define READ_6			0x08
#define WRITE_6			0x0a
#define SEEK_6			0x0b
#define READ_REVERSE		0x0f
#define WRITE_FILEMARKS		0x10
#define SPACE			0x11
#define INQUIRY			0x12
#define RECOVER_BUFFERED_DATA	0x14
#define MODE_SELECT		0x15
#define RESERVE			0x16
#define RELEASE			0x17
#define COPY			0x18
#define ERASE			0x19
#define MODE_SENSE		0x1a
#define START_STOP		0x1b
#define RECEIVE_DIAGNOSTIC	0x1c
#define SEND_DIAGNOSTIC		0x1d
#define ALLOW_MEDIUM_REMOVAL	0x1e

#define READ_CAPACITY		0x25
#define READ_10			0x28
#define WRITE_10		0x2a
#define SEEK_10			0x2b
#define WRITE_VERIFY		0x2e
#define VERIFY			0x2f
#define SEARCH_HIGH		0x30
#define SEARCH_EQUAL		0x31
#define SEARCH_LOW		0x32
#define SET_LIMITS		0x33
#define PRE_FETCH		0x34
#define READ_POSITION		0x34
#define SYNCRONIZE_CACHE	0x35
#define LOCK_UNLOCK_CACHE	0x36
#define READ_DEFECT_DATA	0x37
#define COMPARE			0x39
#define COPY_VERIFY		0x3a
#define WRITE_BUFFER		0x3b
#define READ_BUFFER		0x3c
#define READ_LONG		0x3e
#define CHANGE_DEFINITION	0x40
#define LOG_SELECT		0x4c
#define LOG_SENSE		0x4d
#define MODE_SELECT_10		0x55
#define MODE_SENSE_10		0x5a

extern const unsigned char scsi_command_size[8];
#define COMMAND_SIZE(opcode) scsi_command_size[((opcode) >> 5) & 7]

/*
	MESSAGE CODES
*/

#define COMMAND_COMPLETE	0x00
#define EXTENDED_MESSAGE	0x01
#define SAVE_POINTERS		0x02
#define RESTORE_POINTERS 	0x03
#define DISCONNECT		0x04
#define INITIATOR_ERROR		0x05
#define ABORT			0x06
#define MESSAGE_REJECT		0x07
#define NOP			0x08
#define MSG_PARITY_ERROR	0x09
#define LINKED_CMD_COMPLETE	0x0a
#define LINKED_FLG_CMD_COMPLETE	0x0b
#define BUS_DEVICE_RESET	0x0c

#define SIMPLE_QUEUE_TAG	0x20
#define HEAD_OF_QUEUE_TAG	0x21
#define ORDERED_QUEUE_TAG	0x22

#define IDENTIFY_BASE		0x80
#define IDENTIFY(can_disconnect, lun)   (IDENTIFY_BASE |\
					 ((can_disconnect) ?  0x40 : 0) |\
					 ((lun) & 0x07)) 

				 
/*
	Status codes
*/

#define GOOD			0x00
#define CHECK_CONDITION		0x01
#define CONDITION_GOOD		0x02
#define BUSY			0x04
#define INTERMEDIATE_GOOD	0x08
#define INTERMEDIATE_C_GOOD	0x0a
#define RESERVATION_CONFLICT	0x0c

#define STATUS_MASK		0x1e
	
/*
	the return of the status word will be in the following format :
	The low byte is the status returned by the SCSI command, 
	with vendor specific bits masked.

	The next byte is the message which followed the SCSI status.
	This allows a stos to be used, since the Intel is a little
	endian machine.

	The final byte is a host return code, which is one of the following.

	IE 
	lsb		msb
	status	msg	host code	

        Our errors returned by OUR driver, NOT SCSI message.  Orr'd with
        SCSI message passed back to driver <IF any>.
*/

/* 	NO error							*/
#define DID_OK 			0x00
/* 	Couldn't connect before timeout period				*/
#define DID_NO_CONNECT		0x01
/*	BUS stayed busy through time out period				*/
#define DID_BUS_BUSY		0x02
/*	TIMED OUT for other reason					*/
#define DID_TIME_OUT		0x03
/*	BAD target.							*/
#define DID_BAD_TARGET		0x04
/*	Told to abort for some other reason				*/
#define	DID_ABORT		0x05
/*
	Parity error
*/
#define DID_PARITY		0x06
/*
	Internal error
*/
#define DID_ERROR 		0x07	
/*
	Reset by somebody.
*/
#define DID_RESET 		0x08
/*
	Got an interrupt we weren't expecting.
*/
#define	DID_BAD_INTR		0x09

/*
	Driver status
*/ 
#define DRIVER_OK		0x00

/*
	These indicate the error that occured, and what is available.
*/

#define DRIVER_BUSY		0x01
#define DRIVER_SOFT		0x02
#define DRIVER_MEDIA		0x03
#define DRIVER_ERROR		0x04	

#define DRIVER_INVALID		0x05
#define DRIVER_TIMEOUT		0x06
#define DRIVER_HARD		0x07

#define SUGGEST_RETRY		0x10
#define SUGGEST_ABORT		0x20 
#define SUGGEST_REMAP		0x30
#define SUGGEST_DIE		0x40
#define SUGGEST_SENSE		0x80
#define SUGGEST_IS_OK		0xff

#define DRIVER_SENSE		0x08

#define DRIVER_MASK 0x0f
#define SUGGEST_MASK 0xf0

/*

	SENSE KEYS
*/

#define NO_SENSE 		0x00
#define RECOVERED_ERROR		0x01
#define NOT_READY		0x02
#define MEDIUM_ERROR		0x03
#define	HARDWARE_ERROR		0x04
#define ILLEGAL_REQUEST		0x05
#define UNIT_ATTENTION		0x06
#define DATA_PROTECT		0x07
#define BLANK_CHECK		0x08
#define COPY_ABORTED		0x0a
#define ABORTED_COMMAND		0x0b
#define	VOLUME_OVERFLOW		0x0d
#define MISCOMPARE		0x0e


/*
	DEVICE TYPES

*/

#define TYPE_DISK	0x00
#define TYPE_TAPE	0x01
#define TYPE_WORM	0x04	/* Treated as ROM by our system */
#define TYPE_ROM	0x05
#define TYPE_MOD	0x07  /* Magneto-optical disk - treated as TYPE_DISK */
#define TYPE_NO_LUN	0x7f


#define MAX_COMMAND_SIZE 12
/*
	SCSI command sets

*/

#define SCSI_UNKNOWN	0
#define	SCSI_1		1
#define	SCSI_1_CCS	2
#define	SCSI_2		3

/*
	Every SCSI command starts with a one byte OP-code.
	The next byte's high three bits are the LUN of the
	device.  Any multi-byte quantities are stored high byte
	first, and may have a 5 bit MSB in the same byte
	as the LUN.
*/


/*
	The scsi_device struct contains what we know about each given scsi
	device.
*/

typedef struct scsi_device {
	unsigned char id, lun, index;
	int access_count;	/* Count of open channels/mounts */
	struct wait_queue * device_wait;  /* Used to wait if device is busy */
	struct Scsi_Host * host;
	char type;
	char scsi_level;
	unsigned writeable:1;
	unsigned removable:1; 
	unsigned random:1;
	unsigned changed:1;	/* Data invalid due to media change */
	unsigned busy:1;	/* Used to prevent races */
	unsigned lockable:1;    /* Able to prevent media removal */
	unsigned borken:1;	/* Tell the Seagate driver to be 
				   painfully slow on this device */ 
	unsigned tagged_supported:1; /* Supports SCSI-II tagged queing */
	unsigned tagged_queue:1;   /*SCSI-II tagged queing enabled */
	unsigned disconnect:1;     /* can disconnect */
	unsigned char current_tag; /* current tag */
} Scsi_Device;
/*
	Use these to separate status msg and our bytes
*/

#define status_byte(result) (((result) >> 1) & 0xf)
#define msg_byte(result) (((result) >> 8) & 0xff)
#define host_byte(result) (((result) >> 16) & 0xff)
#define driver_byte(result) (((result) >> 24) & 0xff)
#define sugestion(result) (driver_byte(result) & SUGGEST_MASK)

#define sense_class(sense) (((sense) >> 4) & 0x7)
#define sense_error(sense) ((sense) & 0xf)
#define sense_valid(sense) ((sense) & 0x80);

/*
	These are the SCSI devices available on the system.
*/

extern int NR_SCSI_DEVICES;
extern Scsi_Device * scsi_devices;
/*
	Initializes all SCSI devices.  This scans all scsi busses.
*/

extern unsigned long scsi_dev_init (unsigned long, unsigned long);

struct scatterlist {
     char *  address; /* Location data is to be transferred to */
     char * alt_address; /* Location of actual if address is a 
			    dma indirect buffer.  NULL otherwise */
     unsigned short length;
     };

#define ISA_DMA_THRESHOLD (0x00ffffff)

void *   scsi_malloc(unsigned int);
int      scsi_free(void *, unsigned int);
extern unsigned int dma_free_sectors;   /* How much room do we have left */
extern unsigned int need_isa_buffer;   /* True if some devices need indirection
				 buffers */

/*
	The Scsi_Cmnd structure is used by scsi.c internally, and for communication with
	low level drivers that support multiple outstanding commands.
*/
typedef struct scsi_pointer {
  char * ptr;                     /* data pointer */
  int this_residual;              /* left in this buffer */
  struct scatterlist *buffer;     /* which buffer */
  int buffers_residual;           /* how many buffers left */

  volatile int Status;
  volatile int Message;
  volatile int have_data_in;
  volatile int sent_command;
  volatile int phase;
} Scsi_Pointer;

typedef struct scsi_cmnd {
	struct Scsi_Host * host;
	unsigned char target, lun,  index;
	struct scsi_cmnd *next, *prev;	

/* These elements define the operation we are about to perform */
	unsigned char cmnd[12];
	unsigned request_bufflen; /* Actual request size */

	void * request_buffer;  /* Actual requested buffer */

/* These elements define the operation we ultimately want to perform */
	unsigned char data_cmnd[12];
	unsigned short old_use_sg;  /* We save  use_sg here when requesting
				       sense info */
	unsigned short use_sg;  /* Number of pieces of scatter-gather */
	unsigned short sglist_len;  /* size of malloc'd scatter-gather list */
	unsigned bufflen;     /* Size of data buffer */
	void *buffer;   /* Data buffer */

	unsigned underflow;	/* Return error if less than this amount is 
				   transfered */

	unsigned transfersize;	/* How much we are guranteed to transfer with
				   each SCSI transfer (ie, between disconnect /
				   reconnects.   Probably == sector size */
	
	
	
	struct request request;  /* A copy of the command we are working on*/

	unsigned char sense_buffer[16];	 /* Sense for this command, if needed*/


	int retries;
	int allowed;
	int timeout_per_command, timeout_total, timeout;
/*
 *	We handle the timeout differently if it happens when a reset, 
 *	abort, etc are in process. 
 */

	unsigned volatile char internal_timeout;

	unsigned flags;
		
/* These variables are for the cdrom only.  Once we have variable size buffers
   in the buffer cache, they will go away. */
	int this_count; 
/* End of special cdrom variables */
	
	/* Low-level done function - can be used by low-level driver to point
	 to completion function.  Not used by mid/upper level code. */
	void (*scsi_done)(struct scsi_cmnd *);  

	void (*done)(struct scsi_cmnd *);  /* Mid-level done function */

/* The following fields can be written to by the host specific code. 
   Everything else should be left alone. */

	Scsi_Pointer SCp;   /* Scratchpad used by some host adapters */

	unsigned char * host_scribble; /* The host adapter is allowed to
					  call scsi_malloc and get some memory
					  and hang it here.  The host adapter
					  is also expected to call scsi_free
					  to release this memory.  (The memory
					  obtained by scsi_malloc is guaranteed
					  to be at an address < 16Mb). */

	int result;                   /* Status code from lower level driver */

	unsigned char tag;		/* SCSI-II queued command tag */
	} Scsi_Cmnd;		 

/*
	scsi_abort aborts the current command that is executing on host host.
	The error code, if non zero is returned in the host byte, otherwise 
	DID_ABORT is returned in the hostbyte.
*/

extern int scsi_abort (Scsi_Cmnd *, int code);

extern void scsi_do_cmd (Scsi_Cmnd *, const void *cmnd ,
                  void *buffer, unsigned bufflen, void (*done)(struct scsi_cmnd *),
                  int timeout, int retries);


extern Scsi_Cmnd * allocate_device(struct request **, int, int);

extern Scsi_Cmnd * request_queueable(struct request *, int);

extern int scsi_reset (Scsi_Cmnd *);

extern int max_scsi_hosts;
extern int MAX_SD, NR_SD, MAX_ST, NR_ST, MAX_SR, NR_SR, NR_SG, MAX_SG;
extern unsigned long sd_init(unsigned long, unsigned long);
extern unsigned long sd_init1(unsigned long, unsigned long);
extern void sd_attach(Scsi_Device *);

extern unsigned long sr_init(unsigned long, unsigned long);
extern unsigned long sr_init1(unsigned long, unsigned long);
extern void sr_attach(Scsi_Device *);

extern unsigned long st_init(unsigned long, unsigned long);
extern unsigned long st_init1(unsigned long, unsigned long);
extern void st_attach(Scsi_Device *);

extern unsigned long sg_init(unsigned long, unsigned long);
extern unsigned long sg_init1(unsigned long, unsigned long);
extern void sg_attach(Scsi_Device *);

#if defined(MAJOR_NR) && (MAJOR_NR != SCSI_TAPE_MAJOR)
static void end_scsi_request(Scsi_Cmnd * SCpnt, int uptodate, int sectors)
{
	struct request * req;
	struct buffer_head * bh;
	struct task_struct * p;

	req = &SCpnt->request;
	req->errors = 0;
	if (!uptodate) {
		printk(DEVICE_NAME " I/O error: dev %04x, sector %lu\n",
		       req->dev,req->sector);
	}

	do {
	  if ((bh = req->bh) != NULL) {
	    req->bh = bh->b_reqnext;
	    req->nr_sectors -= bh->b_size >> 9;
	    req->sector += bh->b_size >> 9;
	    bh->b_reqnext = NULL;
	    bh->b_uptodate = uptodate;
	    unlock_buffer(bh);
	    sectors -= bh->b_size >> 9;
	    if ((bh = req->bh) != NULL) {
	      req->current_nr_sectors = bh->b_size >> 9;
	      if (req->nr_sectors < req->current_nr_sectors) {
		req->nr_sectors = req->current_nr_sectors;
		printk("end_scsi_request: buffer-list destroyed\n");
	      }
	    }
	  }
	} while(sectors && bh);
	if (req->bh){
	  req->buffer = bh->b_data;
	  return;
	};
	DEVICE_OFF(req->dev);
	if ((p = req->waiting) != NULL) {
		req->waiting = NULL;
		p->state = TASK_RUNNING;
		if (p->counter > current->counter)
			need_resched = 1;
	}
	req->dev = -1;
	wake_up(&scsi_devices[SCpnt->index].device_wait);
	return;
}


/* This is just like INIT_REQUEST, but we need to be aware of the fact
   that an interrupt may start another request, so we run this with interrupts
   turned off */

#define INIT_SCSI_REQUEST \
	if (!CURRENT) {\
		CLEAR_INTR; \
		sti();   \
		return; \
	} \
	if (MAJOR(CURRENT->dev) != MAJOR_NR) \
		panic(DEVICE_NAME ": request list destroyed"); \
	if (CURRENT->bh) { \
		if (!CURRENT->bh->b_lock) \
			panic(DEVICE_NAME ": block not locked"); \
	}
#endif

#define SCSI_SLEEP(QUEUE, CONDITION) {				\
	if (CONDITION) {					\
                struct wait_queue wait = { current, NULL};      \
		add_wait_queue(QUEUE, &wait);			\
sleep_repeat:							\
		current->state = TASK_UNINTERRUPTIBLE;		\
		if (CONDITION) {				\
			schedule();				\
			goto sleep_repeat;			\
		}						\
		remove_wait_queue(QUEUE, &wait);		\
		current->state = TASK_RUNNING;			\
	}; }

#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产a视频精品免费观看| 日本一区二区成人在线| 国产成人aaa| 久久久久久久久久久电影| 国产欧美中文在线| 日韩电影在线免费观看| 色呦呦日韩精品| 久久久久国产精品麻豆| 免费人成网站在线观看欧美高清| 成人在线综合网站| 精品美女在线观看| 午夜视频在线观看一区二区| 99精品视频中文字幕| 久久欧美中文字幕| 美腿丝袜在线亚洲一区| 欧美精品99久久久**| 亚洲免费视频中文字幕| 不卡一区二区中文字幕| 欧美激情在线看| 国产精品一区三区| 精品国产乱码久久久久久1区2区| 亚洲国产精品久久一线不卡| 99久久99久久精品免费观看| 国产欧美一区二区精品性| 激情成人综合网| 欧美精品一区二区三区在线播放| 奇米一区二区三区| 欧美sm极限捆绑bd| 久久不见久久见免费视频1| 欧美一区二区免费视频| 日本一区中文字幕| 精品日韩在线一区| 久久成人久久鬼色| 国产午夜一区二区三区| 懂色中文一区二区在线播放| 国产欧美精品一区| 波波电影院一区二区三区| 国产精品女主播av| 日本电影亚洲天堂一区| 亚洲一区二区精品3399| 在线播放/欧美激情| 不卡高清视频专区| 综合久久综合久久| 欧美手机在线视频| 美国十次综合导航| 久久综合九色欧美综合狠狠| 懂色中文一区二区在线播放| 日韩美女啊v在线免费观看| 91成人看片片| 免费一级欧美片在线观看| 欧美成人精品福利| 波多野结衣一区二区三区 | 久久久久国产免费免费| 国产成人亚洲综合a∨猫咪| 亚洲欧洲韩国日本视频 | 99久久伊人久久99| 亚洲成a人片在线观看中文| 日韩免费电影一区| 99这里只有久久精品视频| 午夜私人影院久久久久| 久久免费视频一区| 在线观看亚洲精品视频| 麻豆国产一区二区| 国产精品不卡一区二区三区| 欧美日韩五月天| 国产 欧美在线| 日韩精品国产精品| 国产精品美日韩| 555夜色666亚洲国产免| 成人97人人超碰人人99| 婷婷激情综合网| 亚洲图片激情小说| 2020国产精品| 欧美日韩成人一区| 不卡的av电影| 久久66热re国产| 亚洲成人动漫精品| 国产精品女上位| 久久综合成人精品亚洲另类欧美| 在线亚洲高清视频| 成人中文字幕电影| 久久99精品久久久久久动态图| 亚洲日本免费电影| 国产欧美精品一区二区色综合朱莉| 欧美日韩夫妻久久| 93久久精品日日躁夜夜躁欧美| 久久99久久99| 日本午夜精品一区二区三区电影 | 正在播放亚洲一区| av在线播放成人| 国产精品一级在线| 免费在线观看一区二区三区| 亚洲伦在线观看| 中文字幕久久午夜不卡| 日韩三级视频中文字幕| 欧美酷刑日本凌虐凌虐| 99re这里只有精品首页| 成人一区在线看| 国产乱对白刺激视频不卡| 蜜臀av在线播放一区二区三区| 亚洲乱码国产乱码精品精小说 | 久久久三级国产网站| 欧美群妇大交群中文字幕| 一本色道**综合亚洲精品蜜桃冫| 国产99一区视频免费| 国产美女精品人人做人人爽| 久久99久久99| 国产一区二区三区国产| 久草在线在线精品观看| 美女久久久精品| 久久精品国产一区二区| 看片网站欧美日韩| 另类小说综合欧美亚洲| 美女尤物国产一区| 蓝色福利精品导航| 激情综合色播激情啊| 国产乱码精品一品二品| 国产91在线观看丝袜| 成人一区二区视频| 91色porny| 在线这里只有精品| 欧美日韩国产经典色站一区二区三区| 欧美色图第一页| 4438x成人网最大色成网站| 欧美一区二区三区视频免费播放| 欧美疯狂做受xxxx富婆| 日韩欧美亚洲国产另类| 欧美videos中文字幕| 国产日韩欧美高清| 亚洲色图在线视频| 午夜av电影一区| 久久国产福利国产秒拍| 国产91精品一区二区麻豆网站| 成人黄色电影在线| 欧美午夜精品久久久久久孕妇| 5566中文字幕一区二区电影| 久久亚洲二区三区| 亚洲欧美日韩国产综合| 日韩激情视频网站| 国产白丝精品91爽爽久久| 一本一道久久a久久精品综合蜜臀| 97se亚洲国产综合自在线观| 欧美日韩精品欧美日韩精品| 日韩欧美国产系列| 国产精品乱码一区二区三区软件| 亚洲一区二区视频在线| 国产综合成人久久大片91| 91麻豆蜜桃一区二区三区| 欧美日韩电影一区| 国产人妖乱国产精品人妖| 一区二区三区欧美亚洲| 美腿丝袜亚洲色图| 日本韩国欧美三级| 国产亚洲一区二区在线观看| 亚洲精品美腿丝袜| 国产呦萝稀缺另类资源| 欧美三级视频在线播放| 久久免费偷拍视频| 偷拍日韩校园综合在线| 不卡av电影在线播放| 91精品国产色综合久久不卡电影| 日本一二三不卡| 蜜桃久久av一区| 欧美优质美女网站| 久久精品亚洲国产奇米99| 丝袜a∨在线一区二区三区不卡| 国产高清无密码一区二区三区| 欧美午夜精品免费| 国产精品久久久久久福利一牛影视| 午夜精品视频在线观看| 91丨porny丨中文| 久久久欧美精品sm网站| 午夜视频一区二区| 在线中文字幕不卡| 国产一区二区三区黄视频| 欧美日韩国产片| 一区二区不卡在线视频 午夜欧美不卡在| 久草在线在线精品观看| 91精品国产欧美一区二区18 | 精品污污网站免费看| 国产精品白丝在线| 粉嫩aⅴ一区二区三区四区五区 | 欧美日韩成人综合| 亚洲人成精品久久久久| 丁香另类激情小说| 亚洲国产成人一区二区三区| 久久99国产精品久久99| 日韩欧美黄色影院| 蜜臀久久99精品久久久久久9| 69堂成人精品免费视频| 日韩精品一二三| 欧美三日本三级三级在线播放| 亚洲三级小视频| 色视频成人在线观看免| 亚洲天堂网中文字| 91啪亚洲精品| 一级精品视频在线观看宜春院| 色综合久久88色综合天天| 亚洲精品福利视频网站| 在线观看日韩国产|