1 /* 2 * scsi.h Copyright (C) 1992 Drew Eckhardt 3 * generic SCSI package header file by 4 * Drew Eckhardt 5 * 6 * <drew@colorado.edu> 7 * 8 * Modified by Eric Youngdale eric@tantalus.nrl.navy.mil to 9 * add scatter-gather, multiple outstanding request, and other 10 * enhancements. 11 */ 12
13 #ifndef_SCSI_H 14 #define_SCSI_H 15
16 /* 17 $Header: /usr/src/linux/kernel/blk_drv/scsi/RCS/scsi.h,v 1.3 1993/09/24 12:20:33 drew Exp $ 18
19 For documentation on the OPCODES, MESSAGES, and SENSE values, 20 please consult the SCSI standard. 21
22 */ 23
24 /* 25 * SCSI opcodes 26 */ 27
28 #defineTEST_UNIT_READY 0x00
29 #defineREZERO_UNIT 0x01
30 #defineREQUEST_SENSE 0x03
31 #defineFORMAT_UNIT 0x04
32 #defineREAD_BLOCK_LIMITS 0x05
33 #defineREASSIGN_BLOCKS 0x07
34 #defineREAD_6 0x08
35 #defineWRITE_6 0x0a
36 #defineSEEK_6 0x0b
37 #define READ_REVERSE 0x0f
38 #defineWRITE_FILEMARKS 0x10
39 #defineSPACE 0x11
40 #defineINQUIRY 0x12
41 #define RECOVER_BUFFERED_DATA 0x14
42 #defineMODE_SELECT 0x15
43 #defineRESERVE 0x16
44 #define RELEASE 0x17
45 #defineCOPY 0x18
46 #defineERASE 0x19
47 #defineMODE_SENSE 0x1a
48 #defineSTART_STOP 0x1b
49 #define RECEIVE_DIAGNOSTIC 0x1c
50 #defineSEND_DIAGNOSTIC 0x1d
51 #defineALLOW_MEDIUM_REMOVAL 0x1e
52
53 #defineSET_WINDOW 0x24
54 #defineREAD_CAPACITY 0x25
55 #defineREAD_10 0x28
56 #defineWRITE_10 0x2a
57 #defineSEEK_10 0x2b
58 #defineWRITE_VERIFY 0x2e
59 #define VERIFY 0x2f
60 #defineSEARCH_HIGH 0x30
61 #defineSEARCH_EQUAL 0x31
62 #defineSEARCH_LOW 0x32
63 #define SET_LIMITS 0x33
64 #define PRE_FETCH 0x34
65 #defineREAD_POSITION 0x34
66 #define SYNCHRONIZE_CACHE 0x35
67 #define LOCK_UNLOCK_CACHE 0x36
68 #define READ_DEFECT_DATA 0x37
69 #defineMEDIUM_SCAN 0x38
70 #defineCOMPARE 0x39
71 #defineCOPY_VERIFY 0x3a
72 #defineWRITE_BUFFER 0x3b
73 #define READ_BUFFER 0x3c
74 #defineUPDATE_BLOCK 0x3d
75 #define READ_LONG 0x3e
76 #defineWRITE_LONG 0x3f
77 #defineCHANGE_DEFINITION 0x40
78 #defineWRITE_SAME 0x41
79 #defineLOG_SELECT 0x4c
80 #defineLOG_SENSE 0x4d
81 #defineMODE_SELECT_10 0x55
82 #defineMODE_SENSE_10 0x5a
83 #defineWRITE_12 0xaa
84 #defineWRITE_VERIFY_12 0xae
85 #defineSEARCH_HIGH_12 0xb0
86 #defineSEARCH_EQUAL_12 0xb1
87 #defineSEARCH_LOW_12 0xb2
88 #defineSEND_VOLUME_TAG 0xb6
89 #define WRITE_LONG_2 0xea
90
91 externvoidscsi_make_blocked_list(void);
92 externvolatileintin_scan_scsis;
93 externconstunsignedcharscsi_command_size[8];
94 #defineCOMMAND_SIZE(opcode) scsi_command_size[((opcode) >> 5) & 7]
95
96 /* 97 * MESSAGE CODES 98 */ 99
100 #defineCOMMAND_COMPLETE 0x00
101 #defineEXTENDED_MESSAGE 0x01
102 #defineEXTENDED_MODIFY_DATA_POINTER 0x00
103 #defineEXTENDED_SDTR 0x01
104 #defineEXTENDED_EXTENDED_IDENTIFY 0x02 /* SCSI-I only */ 105 #defineEXTENDED_WDTR 0x03
106 #defineSAVE_POINTERS 0x02
107 #defineRESTORE_POINTERS 0x03
108 #defineDISCONNECT 0x04
109 #define INITIATOR_ERROR 0x05
110 #defineABORT 0x06
111 #defineMESSAGE_REJECT 0x07
112 #defineNOP 0x08
113 #define MSG_PARITY_ERROR 0x09
114 #defineLINKED_CMD_COMPLETE 0x0a
115 #defineLINKED_FLG_CMD_COMPLETE 0x0b
116 #defineBUS_DEVICE_RESET 0x0c
117
118 #defineINITIATE_RECOVERY 0x0f /* SCSI-II only */ 119 #define RELEASE_RECOVERY 0x10 /* SCSI-II only */ 120
121 #defineSIMPLE_QUEUE_TAG 0x20
122 #defineHEAD_OF_QUEUE_TAG 0x21
123 #defineORDERED_QUEUE_TAG 0x22
124
125 #defineIDENTIFY_BASE 0x80
126 #defineIDENTIFY(can_disconnect, lun) (IDENTIFY_BASE |\
127 ((can_disconnect) ? 0x40 : 0) |\
128 ((lun) & 0x07))
129
130
131 /* 132 * Status codes 133 */ 134
135 #defineGOOD 0x00
136 #defineCHECK_CONDITION 0x01
137 #defineCONDITION_GOOD 0x02
138 #defineBUSY 0x04
139 #defineINTERMEDIATE_GOOD 0x08
140 #defineINTERMEDIATE_C_GOOD 0x0a
141 #defineRESERVATION_CONFLICT 0x0c
142 #defineQUEUE_FULL 0x1a
143
144 #defineSTATUS_MASK 0x1e
145
146 /* 147 * the return of the status word will be in the following format : 148 * The low byte is the status returned by the SCSI command, 149 * with vendor specific bits masked. 150 * 151 * The next byte is the message which followed the SCSI status. 152 * This allows a stos to be used, since the Intel is a little 153 * endian machine. 154 * 155 * The final byte is a host return code, which is one of the following. 156 * 157 * IE 158 * lsb msb 159 * status msg host code 160 * 161 * Our errors returned by OUR driver, NOT SCSI message. Or'd with 162 * SCSI message passed back to driver <IF any>. 163 */ 164
165
166 #defineDID_OK 0x00 /* NO error */ 167 #defineDID_NO_CONNECT 0x01 /* Couldn't connect before timeout period */ 168 #defineDID_BUS_BUSY 0x02 /* BUS stayed busy through time out period */ 169 #defineDID_TIME_OUT 0x03 /* TIMED OUT for other reason */ 170 #defineDID_BAD_TARGET 0x04 /* BAD target. */ 171 #defineDID_ABORT 0x05 /* Told to abort for some other reason */ 172 #defineDID_PARITY 0x06 /* Parity error */ 173 #defineDID_ERROR 0x07 /* Internal error */ 174 #defineDID_RESET 0x08 /* Reset by somebody. */ 175 #defineDID_BAD_INTR 0x09 /* Got an interrupt we weren't expecting. */ 176 #defineDRIVER_OK 0x00 /* Driver status */ 177
178 /* 179 * These indicate the error that occurred, and what is available. 180 */ 181
182 #define DRIVER_BUSY 0x01
183 #defineDRIVER_SOFT 0x02
184 #define DRIVER_MEDIA 0x03
185 #defineDRIVER_ERROR 0x04
186
187 #defineDRIVER_INVALID 0x05
188 #defineDRIVER_TIMEOUT 0x06
189 #defineDRIVER_HARD 0x07
190
191 #defineSUGGEST_RETRY 0x10
192 #defineSUGGEST_ABORT 0x20
193 #defineSUGGEST_REMAP 0x30
194 #defineSUGGEST_DIE 0x40
195 #defineSUGGEST_SENSE 0x80
196 #defineSUGGEST_IS_OK 0xff
197
198 #defineDRIVER_SENSE 0x08
199
200 #define DRIVER_MASK 0x0f
201 #defineSUGGEST_MASK 0xf0
202
203 /* 204 * SENSE KEYS 205 */ 206
207 #defineNO_SENSE 0x00
208 #defineRECOVERED_ERROR 0x01
209 #defineNOT_READY 0x02
210 #defineMEDIUM_ERROR 0x03
211 #defineHARDWARE_ERROR 0x04
212 #defineILLEGAL_REQUEST 0x05
213 #defineUNIT_ATTENTION 0x06
214 #defineDATA_PROTECT 0x07
215 #defineBLANK_CHECK 0x08
216 #defineCOPY_ABORTED 0x0a
217 #defineABORTED_COMMAND 0x0b
218 #defineVOLUME_OVERFLOW 0x0d
219 #defineMISCOMPARE 0x0e
220
221
222 /* 223 * DEVICE TYPES 224 */ 225
226 #defineTYPE_DISK 0x00
227 #defineTYPE_TAPE 0x01
228 #defineTYPE_PROCESSOR 0x03 /* HP scanners use this */ 229 #defineTYPE_WORM 0x04 /* Treated as ROM by our system */ 230 #defineTYPE_ROM 0x05
231 #defineTYPE_SCANNER 0x06
232 #defineTYPE_MOD 0x07 /* Magneto-optical disk - 233 * - treated as TYPE_DISK */ 234 #define TYPE_NO_LUN 0x7f
235
236
237 #defineMAX_COMMAND_SIZE 12
238
239 /* 240 * SCSI command sets 241 */ 242
243 #define SCSI_UNKNOWN 0
244 #define SCSI_1 1
245 #define SCSI_1_CCS 2
246 #defineSCSI_2 3
247
248 /* 249 * Every SCSI command starts with a one byte OP-code. 250 * The next byte's high three bits are the LUN of the 251 * device. Any multi-byte quantities are stored high byte 252 * first, and may have a 5 bit MSB in the same byte 253 * as the LUN. 254 */ 255
256 /* 257 * Manufacturers list 258 */ 259
260 #defineSCSI_MAN_UNKNOWN 0
261 #defineSCSI_MAN_NEC 1
262 #defineSCSI_MAN_TOSHIBA 2
263 #defineSCSI_MAN_NEC_OLDCDR 3
264 #defineSCSI_MAN_SONY 4
265
266 /* 267 * As the scsi do command functions are intelligent, and may need to 268 * redo a command, we need to keep track of the last command 269 * executed on each one. 270 */ 271
272 #defineWAS_RESET 0x01
273 #defineWAS_TIMEDOUT 0x02
274 #defineWAS_SENSE 0x04
275 #defineIS_RESETTING 0x08
276 #define IS_ABORTING 0x10
277 #defineASKED_FOR_SENSE 0x20
278
279 /* 280 * The scsi_device struct contains what we know about each given scsi 281 * device. 282 */ 283
284 typedefstructscsi_device{ 285 structscsi_device * next; /* Used for linked list */ 286
287 unsignedcharid, lun, channel;
288
289 unsignedintmanufacturer; /* Manufacturer of device, for using 290 * vendor-specific cmd's */ 291 intattached; /* # of high level drivers attached to 292 * this */ 293 intaccess_count; /* Count of open channels/mounts */ 294 structwait_queue * device_wait;/* Used to wait if device is busy */ 295 structScsi_Host * host;
296 void (*scsi_request_fn)(void); /* Used to jumpstart things after an 297 * ioctl */ 298 void *hostdata; /* available to low-level driver */ 299 chartype;
300 charscsi_level;
301 charvendor[8], model[16], rev[4];
302 unsignedwriteable:1;
303 unsignedremovable:1;
304 unsignedrandom:1;
305 unsignedchanged:1; /* Data invalid due to media change */ 306 unsignedbusy:1; /* Used to prevent races */ 307 unsignedlockable:1; /* Able to prevent media removal */ 308 unsignedborken:1; /* Tell the Seagate driver to be 309 * painfully slow on this device */ 310 unsignedtagged_supported:1; /* Supports SCSI-II tagged queuing */ 311 unsignedtagged_queue:1; /* SCSI-II tagged queuing enabled */ 312 unsigneddisconnect:1; /* can disconnect */ 313 unsignedsoft_reset:1; /* Uses soft reset option */ 314 unsignedsync:1; /* Negotiate for sync transfers */ 315 unsignedcharcurrent_tag; /* current tag */ 316 unsignedchar sync_min_period; /* Not less than this period */ 317 unsignedchar sync_max_offset; /* Not greater than this offset */ 318 }Scsi_Device;
319
320 /* 321 * Use these to separate status msg and our bytes 322 */ 323
324 #definestatus_byte(result) (((result) >> 1) & 0xf)
325 #definemsg_byte(result) (((result) >> 8) & 0xff)
326 #definehost_byte(result) (((result) >> 16) & 0xff)
327 #definedriver_byte(result) (((result) >> 24) & 0xff)
328 #definesuggestion(result) (driver_byte(result) & SUGGEST_MASK)
329
330 #definesense_class(sense) (((sense) >> 4) & 0x7)
331 #definesense_error(sense) ((sense) & 0xf)
332 #define sense_valid(sense) ((sense) & 0x80);
333
334 /* 335 * These are the SCSI devices available on the system. 336 */ 337
338 externScsi_Device * scsi_devices;
339
340 /* 341 * Initializes all SCSI devices. This scans all scsi busses. 342 */ 343
344 externunsignedlongscsi_dev_init (unsignedlong, unsignedlong);
345
346 structscatterlist{ 347 char * address; /* Location data is to be transferred to */ 348 char * alt_address; /* Location of actual if address is a 349 * dma indirect buffer. NULL otherwise */ 350 unsignedintlength;
351 };
352
353 #ifdef__alpha__ 354 # defineISA_DMA_THRESHOLD (~0UL)
355 #else 356 # defineISA_DMA_THRESHOLD (0x00ffffff)
357 #endif 358 #defineCONTIGUOUS_BUFFERS(X,Y) ((X->b_data+X->b_size) == Y->b_data)
359
360
361 /* 362 * These are the return codes for the abort and reset functions. The mid-level 363 * code uses these to decide what to do next. Each of the low level abort 364 * and reset functions must correctly indicate what it has done. 365 */ 366
367 /* We did not do anything. 368 * Wait some more for this command to complete, and if this does not work, 369 * try something more serious. */ 370 #defineSCSI_ABORT_SNOOZE 0
371
372 /* This means that we were able to abort the command. We have already 373 * called the mid-level done function, and do not expect an interrupt that 374 * will lead to another call to the mid-level done function for this command */ 375 #defineSCSI_ABORT_SUCCESS 1
376
377 /* We called for an abort of this command, and we should get an interrupt 378 * when this succeeds. Thus we should not restore the timer for this 379 * command in the mid-level abort function. */ 380 #defineSCSI_ABORT_PENDING 2
381
382 /* Unable to abort - command is currently on the bus. Grin and bear it. */ 383 #defineSCSI_ABORT_BUSY 3
384
385 /* The command is not active in the low level code. Command probably 386 * finished. */ 387 #defineSCSI_ABORT_NOT_RUNNING 4
388
389 /* Something went wrong. The low level driver will indicate the correct 390 * error condition when it calls scsi_done, so the mid-level abort function 391 * can simply wait until this comes through */ 392 #defineSCSI_ABORT_ERROR 5
393
394 /* We do not know how to reset the bus, or we do not want to. Bummer. 395 * Anyway, just wait a little more for the command in question, and hope that 396 * it eventually finishes. If it never finishes, the SCSI device could 397 * hang, so use this with caution. */ 398 #defineSCSI_RESET_SNOOZE 0
399
400 /* We do not know how to reset the bus, or we do not want to. Bummer. 401 * We have given up on this ever completing. The mid-level code will 402 * request sense information to decide how to proceed from here. */ 403 #defineSCSI_RESET_PUNT 1
404
405 /* This means that we were able to reset the bus. We have restarted all of 406 * the commands that should be restarted, and we should be able to continue 407 * on normally from here. We do not expect any interrupts that will return 408 * DID_RESET to any of the other commands in the host_queue, and the mid-level 409 * code does not need to do anything special to keep the commands alive. */ 410 #defineSCSI_RESET_SUCCESS 2
411
412 /* We called for a reset of this bus, and we should get an interrupt 413 * when this succeeds. Each command should get its own status 414 * passed up to scsi_done, but this has not happened yet. */ 415 #defineSCSI_RESET_PENDING 3
416
417 /* We did a reset, but do not expect an interrupt to signal DID_RESET. 418 * This tells the upper level code to request the sense info, and this 419 * should keep the command alive. */ 420 #defineSCSI_RESET_WAKEUP 4
421
422 /* Something went wrong, and we do not know how to fix it. */ 423 #defineSCSI_RESET_ERROR 5
424
425 void * scsi_malloc(unsignedint);
426 intscsi_free(void *, unsignedint);
427 externunsignedintdma_free_sectors; /* How much room do we have left */ 428 externunsignedintneed_isa_buffer; /* True if some devices need indirection 429 * buffers */ 430
431 /* 432 * The Scsi_Cmnd structure is used by scsi.c internally, and for communication 433 * with low level drivers that support multiple outstanding commands. 434 */ 435 typedefstruct scsi_pointer { 436 char * ptr; /* data pointer */ 437 intthis_residual; /* left in this buffer */ 438 structscatterlist *buffer; /* which buffer */ 439 intbuffers_residual; /* how many buffers left */ 440
441 volatileintStatus;
442 volatileintMessage;
443 volatileinthave_data_in;
444 volatileintsent_command;
445 volatileintphase;
446 }Scsi_Pointer;
447
448 typedefstructscsi_cmnd{ 449 structScsi_Host * host;
450 Scsi_Device * device;
451 unsignedchartarget, lun, channel;
452 unsignedcharcmd_len;
453 unsignedcharold_cmd_len;
454 structscsi_cmnd *next, *prev;
455
456 /* These elements define the operation we are about to perform */ 457 unsignedcharcmnd[12];
458 unsignedrequest_bufflen; /* Actual request size */ 459
460 void * request_buffer; /* Actual requested buffer */ 461
462 /* These elements define the operation we ultimately want to perform */ 463 unsignedchardata_cmnd[12];
464 unsignedshortold_use_sg; /* We save use_sg here when requesting 465 * sense info */ 466 unsignedshortuse_sg; /* Number of pieces of scatter-gather */ 467 unsignedshortsglist_len; /* size of malloc'd scatter-gather list */ 468 unsignedshortabort_reason;/* If the mid-level code requests an 469 * abort, this is the reason. */ 470 unsignedbufflen; /* Size of data buffer */ 471 void *buffer; /* Data buffer */ 472
473 unsignedunderflow; /* Return error if less than this amount is 474 * transfered */ 475
476 unsignedtransfersize; /* How much we are guaranteed to transfer with 477 * each SCSI transfer (ie, between disconnect / 478 * reconnects. Probably == sector size */ 479
480
481 structrequestrequest; /* A copy of the command we are working on */ 482
483 unsignedcharsense_buffer[16]; /* Sense for this command, if needed */ 484
485
486 intretries;
487 intallowed;
488 inttimeout_per_command, timeout_total, timeout;
489
490 /* 491 * We handle the timeout differently if it happens when a reset, 492 * abort, etc are in process. 493 */ 494 unsignedvolatilecharinternal_timeout;
495
496 unsignedflags;
497
498 /* These variables are for the cdrom only. Once we have variable size 499 * buffers in the buffer cache, they will go away. */ 500 intthis_count;
501 /* End of special cdrom variables */ 502
503 /* Low-level done function - can be used by low-level driver to point 504 * to completion function. Not used by mid/upper level code. */ 505 void (*scsi_done)(structscsi_cmnd *);
506 void (*done)(structscsi_cmnd *); /* Mid-level done function */ 507
508 /* 509 * The following fields can be written to by the host specific code. 510 * Everything else should be left alone. 511 */ 512
513 Scsi_PointerSCp; /* Scratchpad used by some host adapters */ 514
515 unsignedchar * host_scribble; /* The host adapter is allowed to 516 * call scsi_malloc and get some memory 517 * and hang it here. The host adapter 518 * is also expected to call scsi_free 519 * to release this memory. (The memory 520 * obtained by scsi_malloc is guaranteed 521 * to be at an address < 16Mb). */ 522
523 intresult; /* Status code from lower level driver */ 524
525 unsignedchartag; /* SCSI-II queued command tag */ 526 unsignedlongpid; /* Process ID, starts at 0 */ 527 }Scsi_Cmnd;
528
529 /* 530 * scsi_abort aborts the current command that is executing on host host. 531 * The error code, if non zero is returned in the host byte, otherwise 532 * DID_ABORT is returned in the hostbyte. 533 */ 534
535 externintscsi_abort (Scsi_Cmnd *, intcode, intpid);
536
537 externvoidscsi_do_cmd (Scsi_Cmnd *, constvoid *cmnd ,
538 void *buffer, unsignedbufflen,
539 void (*done)(structscsi_cmnd *),
540 inttimeout, intretries);
541
542
543 externScsi_Cmnd * allocate_device(structrequest **, Scsi_Device *, int);
544
545 externScsi_Cmnd * request_queueable(structrequest *, Scsi_Device *);
546 externintscsi_reset (Scsi_Cmnd *);
547
548 externintmax_scsi_hosts;
549
550 externvoidbuild_proc_dir_entries(void);
551
552 externintkernel_scsi_ioctl (Scsi_Device *dev, intcmd, void *arg);
553 externintscsi_ioctl (Scsi_Device *dev, intcmd, void *arg);
554 externvoidprint_command(unsignedchar *);
555 externvoidprint_sense(char *, Scsi_Cmnd *);
556
557
558 #ifdefined(MAJOR_NR) && (MAJOR_NR != SCSI_TAPE_MAJOR)
559 #include "hosts.h"
560
561 staticScsi_Cmnd * end_scsi_request(Scsi_Cmnd * SCpnt, intuptodate, intsectors)
/* */ 562 { 563 structrequest * req;
564 structbuffer_head * bh;
565
566 req = &SCpnt->request;
567 req->errors = 0;
568 if (!uptodate) { 569 printk(DEVICE_NAME " I/O error: dev %04x, sector %lu\n",
570 req->dev,req->sector);
571 } 572
573 do{ 574 if ((bh = req->bh) != NULL) { 575 req->bh = bh->b_reqnext;
576 req->nr_sectors -= bh->b_size >> 9;
577 req->sector += bh->b_size >> 9;
578 bh->b_reqnext = NULL;
579 bh->b_uptodate = uptodate;
580 unlock_buffer(bh);
581 sectors -= bh->b_size >> 9;
582 if ((bh = req->bh) != NULL) { 583 req->current_nr_sectors = bh->b_size >> 9;
584 if (req->nr_sectors < req->current_nr_sectors) { 585 req->nr_sectors = req->current_nr_sectors;
586 printk("end_scsi_request: buffer-list destroyed\n");
587 } 588 } 589 } 590 }while(sectors && bh);
591 if (req->bh){ 592 req->buffer = bh->b_data;
593 returnSCpnt;
594 };
595 DEVICE_OFF(req->dev);
596 if (req->sem != NULL) { 597 up(req->sem);
598 } 599
600 if (SCpnt->host->block) { 601 structScsi_Host * next;
602
603 for (next = SCpnt->host->block; next != SCpnt->host;
604 next = next->block)
605 wake_up(&next->host_wait);
606 } 607
608 req->dev = -1;
609 wake_up(&wait_for_request);
610 wake_up(&SCpnt->device->device_wait);
611 returnNULL;
612 } 613
614
615 /* This is just like INIT_REQUEST, but we need to be aware of the fact 616 * that an interrupt may start another request, so we run this with interrupts 617 * turned off 618 */ 619 #defineINIT_SCSI_REQUEST \
620 if (!CURRENT) {\
621 CLEAR_INTR; \
622 restore_flags(flags); \
623 return; \
624 } \
625 if (MAJOR(CURRENT->dev) != MAJOR_NR) \
626 panic(DEVICE_NAME ": request list destroyed"); \
627 if (CURRENT->bh) { \
628 if (!CURRENT->bh->b_lock) \
629 panic(DEVICE_NAME ": block not locked"); \
630 } 631 #endif 632
633 #defineSCSI_SLEEP(QUEUE, CONDITION) { \
634 if (CONDITION) { \
635 structwait_queuewait = {current, NULL}; \
636 add_wait_queue(QUEUE, &wait); \
637 for(;;) { \
638 current->state = TASK_UNINTERRUPTIBLE; \
639 if (CONDITION) { \
640 if (intr_count) \
641 panic("scsi: trying to call schedule() in interrupt" \
642 ", file %s, line %d.\n", __FILE__, __LINE__); \
643 schedule(); \
644 } \
645 else \
646 break; \
647 } \
648 remove_wait_queue(QUEUE, &wait); \
649 current->state = TASK_RUNNING; \
650 }; } 651
652 #endif 653
654 /* 655 * Overrides for Emacs so that we follow Linus's tabbing style. 656 * Emacs will notice this stuff at the end of the file and automatically 657 * adjust the settings for this buffer only. This must remain at the end 658 * of the file. 659 * --------------------------------------------------------------------------- 660 * Local variables: 661 * c-indent-level: 4 662 * c-brace-imaginary-offset: 0 663 * c-brace-offset: -4 664 * c-argdecl-indent: 4 665 * c-label-offset: -4 666 * c-continued-statement-offset: 4 667 * c-continued-brace-offset: 0 668 * indent-tabs-mode: nil 669 * tab-width: 8 670 * End: 671 */