3 * Denis Peter, MPL AG Switzerland
5 * SPDX-License-Identifier: GPL-2.0+
14 #include <asm/processor.h>
19 #ifdef CONFIG_SCSI_DEV_LIST
20 #define SCSI_DEV_LIST CONFIG_SCSI_DEV_LIST
22 #ifdef CONFIG_SCSI_SYM53C8XX
23 #define SCSI_VEND_ID 0x1000
24 #ifndef CONFIG_SCSI_DEV_ID
25 #define SCSI_DEV_ID 0x0001
27 #define SCSI_DEV_ID CONFIG_SCSI_DEV_ID
29 #elif defined CONFIG_SATA_ULI5288
31 #define SCSI_VEND_ID 0x10b9
32 #define SCSI_DEV_ID 0x5288
34 #elif !defined(CONFIG_SCSI_AHCI_PLAT)
35 #error no scsi device defined
37 #define SCSI_DEV_LIST {SCSI_VEND_ID, SCSI_DEV_ID}
40 #if defined(CONFIG_PCI) && !defined(CONFIG_SCSI_AHCI_PLAT)
41 const struct pci_device_id scsi_device_list[] = { SCSI_DEV_LIST };
43 static ccb tempccb; /* temporary scsi command buffer */
45 static unsigned char tempbuff[512]; /* temporary data buffer */
47 static int scsi_max_devs; /* number of highest available scsi device */
49 static int scsi_curr_dev; /* current device */
51 static struct blk_desc scsi_dev_desc[CONFIG_SYS_SCSI_MAX_DEVICE];
53 /********************************************************************************
54 * forward declerations of some Setup Routines
56 void scsi_setup_test_unit_ready(ccb * pccb);
57 void scsi_setup_read6(ccb * pccb, lbaint_t start, unsigned short blocks);
58 void scsi_setup_read_ext(ccb * pccb, lbaint_t start, unsigned short blocks);
59 void scsi_setup_read16(ccb * pccb, lbaint_t start, unsigned long blocks);
61 static void scsi_setup_write_ext(ccb *pccb, lbaint_t start,
62 unsigned short blocks);
63 void scsi_setup_inquiry(ccb * pccb);
64 void scsi_ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len);
67 static int scsi_read_capacity(ccb *pccb, lbaint_t *capacity,
68 unsigned long *blksz);
69 static ulong scsi_read(struct blk_desc *block_dev, lbaint_t blknr,
70 lbaint_t blkcnt, void *buffer);
71 static ulong scsi_write(struct blk_desc *block_dev, lbaint_t blknr,
72 lbaint_t blkcnt, const void *buffer);
75 /*********************************************************************************
76 * (re)-scan the scsi bus and reports scsi device info
77 * to the user if mode = 1
79 void scsi_scan(int mode)
81 unsigned char i,perq,modi,lun;
84 ccb* pccb=(ccb *)&tempccb;
87 printf("scanning bus for devices...\n");
89 for(i=0;i<CONFIG_SYS_SCSI_MAX_DEVICE;i++) {
90 scsi_dev_desc[i].target=0xff;
91 scsi_dev_desc[i].lun=0xff;
92 scsi_dev_desc[i].lba=0;
93 scsi_dev_desc[i].blksz=0;
94 scsi_dev_desc[i].log2blksz =
95 LOG2_INVALID(typeof(scsi_dev_desc[i].log2blksz));
96 scsi_dev_desc[i].type=DEV_TYPE_UNKNOWN;
97 scsi_dev_desc[i].vendor[0]=0;
98 scsi_dev_desc[i].product[0]=0;
99 scsi_dev_desc[i].revision[0]=0;
100 scsi_dev_desc[i].removable = false;
101 scsi_dev_desc[i].if_type=IF_TYPE_SCSI;
102 scsi_dev_desc[i].devnum = i;
103 scsi_dev_desc[i].part_type=PART_TYPE_UNKNOWN;
104 scsi_dev_desc[i].block_read=scsi_read;
105 scsi_dev_desc[i].block_write = scsi_write;
108 for(i=0;i<CONFIG_SYS_SCSI_MAX_SCSI_ID;i++) {
110 for(lun=0;lun<CONFIG_SYS_SCSI_MAX_LUN;lun++) {
112 pccb->pdata=(unsigned char *)&tempbuff;
114 scsi_setup_inquiry(pccb);
115 if (scsi_exec(pccb) != true) {
116 if(pccb->contr_stat==SCSI_SEL_TIME_OUT) {
117 debug ("Selection timeout ID %d\n",pccb->target);
118 continue; /* selection timeout => assuming no device present */
120 scsi_print_error(pccb);
125 if((perq & 0x1f)==0x1f) {
126 continue; /* skip unknown devices */
128 if((modi&0x80)==0x80) /* drive is removable */
129 scsi_dev_desc[scsi_max_devs].removable=true;
130 /* get info for this device */
131 scsi_ident_cpy((unsigned char *)&scsi_dev_desc[scsi_max_devs].vendor[0],
133 scsi_ident_cpy((unsigned char *)&scsi_dev_desc[scsi_max_devs].product[0],
135 scsi_ident_cpy((unsigned char *)&scsi_dev_desc[scsi_max_devs].revision[0],
137 scsi_dev_desc[scsi_max_devs].target=pccb->target;
138 scsi_dev_desc[scsi_max_devs].lun=pccb->lun;
141 scsi_setup_test_unit_ready(pccb);
142 if (scsi_exec(pccb) != true) {
143 if (scsi_dev_desc[scsi_max_devs].removable == true) {
144 scsi_dev_desc[scsi_max_devs].type=perq;
147 scsi_print_error(pccb);
150 if (scsi_read_capacity(pccb, &capacity, &blksz)) {
151 scsi_print_error(pccb);
154 scsi_dev_desc[scsi_max_devs].lba=capacity;
155 scsi_dev_desc[scsi_max_devs].blksz=blksz;
156 scsi_dev_desc[scsi_max_devs].log2blksz =
157 LOG2(scsi_dev_desc[scsi_max_devs].blksz);
158 scsi_dev_desc[scsi_max_devs].type=perq;
159 part_init(&scsi_dev_desc[scsi_max_devs]);
162 printf (" Device %d: ", scsi_max_devs);
163 dev_print(&scsi_dev_desc[scsi_max_devs]);
173 printf("Found %d device(s).\n", scsi_max_devs);
174 #ifndef CONFIG_SPL_BUILD
175 setenv_ulong("scsidevs", scsi_max_devs);
179 int scsi_get_disk_count(void)
181 return scsi_max_devs;
184 #if defined(CONFIG_PCI) && !defined(CONFIG_SCSI_AHCI_PLAT)
190 * Find a device from the list, this driver will support a single
193 for (i = 0; i < ARRAY_SIZE(scsi_device_list); i++) {
194 /* get PCI Device ID */
199 ret = dm_pci_find_device(scsi_device_list[i].vendor,
200 scsi_device_list[i].device, 0, &dev);
202 busdevfunc = dm_pci_get_bdf(dev);
206 busdevfunc = pci_find_device(scsi_device_list[i].vendor,
207 scsi_device_list[i].device,
210 if (busdevfunc != -1)
214 if (busdevfunc == -1) {
215 printf("Error: SCSI Controller(s) ");
216 for (i = 0; i < ARRAY_SIZE(scsi_device_list); i++) {
218 scsi_device_list[i].vendor,
219 scsi_device_list[i].device);
221 printf("not found\n");
226 printf("SCSI Controller (%04X,%04X) found (%d:%d:%d)\n",
227 scsi_device_list[i].vendor,
228 scsi_device_list[i].device,
229 (busdevfunc >> 16) & 0xFF,
230 (busdevfunc >> 11) & 0x1F,
231 (busdevfunc >> 8) & 0x7);
234 bootstage_start(BOOTSTAGE_ID_ACCUM_SCSI, "ahci");
235 scsi_low_level_init(busdevfunc);
237 bootstage_accum(BOOTSTAGE_ID_ACCUM_SCSI);
241 #ifdef CONFIG_PARTITIONS
242 struct blk_desc *scsi_get_dev(int dev)
244 return (dev < CONFIG_SYS_SCSI_MAX_DEVICE) ? &scsi_dev_desc[dev] : NULL;
248 #ifndef CONFIG_SPL_BUILD
249 /******************************************************************************
250 * scsi boot command intepreter. Derived from diskboot
252 int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
254 return common_diskboot(cmdtp, "scsi", argc, argv);
257 /*********************************************************************************
258 * scsi command intepreter
260 int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
265 return CMD_RET_USAGE;
268 if (strncmp(argv[1],"res",3) == 0) {
269 printf("\nReset SCSI\n");
274 if (strncmp(argv[1],"inf",3) == 0) {
276 for (i=0; i<CONFIG_SYS_SCSI_MAX_DEVICE; ++i) {
277 if(scsi_dev_desc[i].type==DEV_TYPE_UNKNOWN)
278 continue; /* list only known devices */
279 printf ("SCSI dev. %d: ", i);
280 dev_print(&scsi_dev_desc[i]);
284 if (strncmp(argv[1],"dev",3) == 0) {
285 if ((scsi_curr_dev < 0) || (scsi_curr_dev >= CONFIG_SYS_SCSI_MAX_DEVICE)) {
286 printf("\nno SCSI devices available\n");
289 printf ("\n Device %d: ", scsi_curr_dev);
290 dev_print(&scsi_dev_desc[scsi_curr_dev]);
293 if (strncmp(argv[1],"scan",4) == 0) {
297 if (strncmp(argv[1],"part",4) == 0) {
299 for (ok=0, dev=0; dev<CONFIG_SYS_SCSI_MAX_DEVICE; ++dev) {
300 if (scsi_dev_desc[dev].type!=DEV_TYPE_UNKNOWN) {
304 debug ("print_part of %x\n",dev);
305 part_print(&scsi_dev_desc[dev]);
309 printf("\nno SCSI devices available\n");
312 return CMD_RET_USAGE;
314 if (strncmp(argv[1],"dev",3) == 0) {
315 int dev = (int)simple_strtoul(argv[2], NULL, 10);
316 printf ("\nSCSI device %d: ", dev);
317 if (dev >= CONFIG_SYS_SCSI_MAX_DEVICE) {
318 printf("unknown device\n");
321 printf ("\n Device %d: ", dev);
322 dev_print(&scsi_dev_desc[dev]);
323 if(scsi_dev_desc[dev].type == DEV_TYPE_UNKNOWN) {
327 printf("... is now current device\n");
330 if (strncmp(argv[1],"part",4) == 0) {
331 int dev = (int)simple_strtoul(argv[2], NULL, 10);
332 if(scsi_dev_desc[dev].type != DEV_TYPE_UNKNOWN) {
333 part_print(&scsi_dev_desc[dev]);
336 printf ("\nSCSI device %d not available\n", dev);
340 return CMD_RET_USAGE;
342 /* at least 4 args */
343 if (strcmp(argv[1],"read") == 0) {
344 ulong addr = simple_strtoul(argv[2], NULL, 16);
345 ulong blk = simple_strtoul(argv[3], NULL, 16);
346 ulong cnt = simple_strtoul(argv[4], NULL, 16);
348 printf ("\nSCSI read: device %d block # %ld, count %ld ... ",
349 scsi_curr_dev, blk, cnt);
350 n = scsi_read(&scsi_dev_desc[scsi_curr_dev],
351 blk, cnt, (ulong *)addr);
352 printf ("%ld blocks read: %s\n",n,(n==cnt) ? "OK" : "ERROR");
354 } else if (strcmp(argv[1], "write") == 0) {
355 ulong addr = simple_strtoul(argv[2], NULL, 16);
356 ulong blk = simple_strtoul(argv[3], NULL, 16);
357 ulong cnt = simple_strtoul(argv[4], NULL, 16);
359 printf("\nSCSI write: device %d block # %ld, "
361 scsi_curr_dev, blk, cnt);
362 n = scsi_write(&scsi_dev_desc[scsi_curr_dev],
363 blk, cnt, (ulong *)addr);
364 printf("%ld blocks written: %s\n", n,
365 (n == cnt) ? "OK" : "ERROR");
369 return CMD_RET_USAGE;
375 "reset - reset SCSI controller\n"
376 "scsi info - show available SCSI devices\n"
377 "scsi scan - (re-)scan SCSI bus\n"
378 "scsi device [dev] - show or set current device\n"
379 "scsi part [dev] - print partition table of one or all SCSI devices\n"
380 "scsi read addr blk# cnt - read `cnt' blocks starting at block `blk#'\n"
381 " to memory address `addr'\n"
382 "scsi write addr blk# cnt - write `cnt' blocks starting at block\n"
383 " `blk#' from memory address `addr'"
387 scsiboot, 3, 1, do_scsiboot,
388 "boot from SCSI device",
393 /****************************************************************************************
397 /* almost the maximum amount of the scsi_ext command.. */
398 #define SCSI_MAX_READ_BLK 0xFFFF
399 #define SCSI_LBA48_READ 0xFFFFFFF
401 static ulong scsi_read(struct blk_desc *block_dev, lbaint_t blknr,
402 lbaint_t blkcnt, void *buffer)
404 int device = block_dev->devnum;
405 lbaint_t start, blks;
407 unsigned short smallblks = 0;
408 ccb* pccb=(ccb *)&tempccb;
412 pccb->target=scsi_dev_desc[device].target;
413 pccb->lun=scsi_dev_desc[device].lun;
414 buf_addr=(unsigned long)buffer;
417 debug("\nscsi_read: dev %d startblk " LBAF
418 ", blccnt " LBAF " buffer %lx\n",
419 device, start, blks, (unsigned long)buffer);
421 pccb->pdata=(unsigned char *)buf_addr;
422 #ifdef CONFIG_SYS_64BIT_LBA
423 if (start > SCSI_LBA48_READ) {
424 unsigned long blocks;
425 blocks = min_t(lbaint_t, blks, SCSI_MAX_READ_BLK);
426 pccb->datalen = scsi_dev_desc[device].blksz * blocks;
427 scsi_setup_read16(pccb, start, blocks);
432 if (blks > SCSI_MAX_READ_BLK) {
433 pccb->datalen=scsi_dev_desc[device].blksz * SCSI_MAX_READ_BLK;
434 smallblks=SCSI_MAX_READ_BLK;
435 scsi_setup_read_ext(pccb,start,smallblks);
436 start+=SCSI_MAX_READ_BLK;
437 blks-=SCSI_MAX_READ_BLK;
440 pccb->datalen=scsi_dev_desc[device].blksz * blks;
441 smallblks=(unsigned short) blks;
442 scsi_setup_read_ext(pccb,start,smallblks);
446 debug("scsi_read_ext: startblk " LBAF
447 ", blccnt %x buffer %" PRIXPTR "\n",
448 start, smallblks, buf_addr);
449 if (scsi_exec(pccb) != true) {
450 scsi_print_error(pccb);
454 buf_addr+=pccb->datalen;
456 debug("scsi_read_ext: end startblk " LBAF
457 ", blccnt %x buffer %" PRIXPTR "\n", start, smallblks, buf_addr);
461 /*******************************************************************************
465 /* Almost the maximum amount of the scsi_ext command.. */
466 #define SCSI_MAX_WRITE_BLK 0xFFFF
468 static ulong scsi_write(struct blk_desc *block_dev, lbaint_t blknr,
469 lbaint_t blkcnt, const void *buffer)
471 int device = block_dev->devnum;
472 lbaint_t start, blks;
474 unsigned short smallblks;
475 ccb* pccb = (ccb *)&tempccb;
479 pccb->target = scsi_dev_desc[device].target;
480 pccb->lun = scsi_dev_desc[device].lun;
481 buf_addr = (unsigned long)buffer;
484 debug("\n%s: dev %d startblk " LBAF ", blccnt " LBAF " buffer %lx\n",
485 __func__, device, start, blks, (unsigned long)buffer);
487 pccb->pdata = (unsigned char *)buf_addr;
488 if (blks > SCSI_MAX_WRITE_BLK) {
489 pccb->datalen = (scsi_dev_desc[device].blksz *
491 smallblks = SCSI_MAX_WRITE_BLK;
492 scsi_setup_write_ext(pccb, start, smallblks);
493 start += SCSI_MAX_WRITE_BLK;
494 blks -= SCSI_MAX_WRITE_BLK;
496 pccb->datalen = scsi_dev_desc[device].blksz * blks;
497 smallblks = (unsigned short)blks;
498 scsi_setup_write_ext(pccb, start, smallblks);
502 debug("%s: startblk " LBAF ", blccnt %x buffer %" PRIXPTR "\n",
503 __func__, start, smallblks, buf_addr);
504 if (scsi_exec(pccb) != true) {
505 scsi_print_error(pccb);
509 buf_addr += pccb->datalen;
511 debug("%s: end startblk " LBAF ", blccnt %x buffer %" PRIXPTR "\n",
512 __func__, start, smallblks, buf_addr);
516 /* copy src to dest, skipping leading and trailing blanks
517 * and null terminate the string
519 void scsi_ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len)
535 for( ; start<=end; start++) {
542 /* Trim trailing blanks, and NUL-terminate string
544 void scsi_trim_trail (unsigned char *str, unsigned int len)
546 unsigned char *p = str + len - 1;
556 int scsi_read_capacity(ccb *pccb, lbaint_t *capacity, unsigned long *blksz)
560 memset(pccb->cmd, 0, sizeof(pccb->cmd));
561 pccb->cmd[0] = SCSI_RD_CAPAC10;
562 pccb->cmd[1] = pccb->lun << 5;
564 pccb->msgout[0] = SCSI_IDENTIFY; /* NOT USED */
567 if (scsi_exec(pccb) != true)
570 *capacity = ((lbaint_t)pccb->pdata[0] << 24) |
571 ((lbaint_t)pccb->pdata[1] << 16) |
572 ((lbaint_t)pccb->pdata[2] << 8) |
573 ((lbaint_t)pccb->pdata[3]);
575 if (*capacity != 0xffffffff) {
576 /* Read capacity (10) was sufficient for this drive. */
577 *blksz = ((unsigned long)pccb->pdata[4] << 24) |
578 ((unsigned long)pccb->pdata[5] << 16) |
579 ((unsigned long)pccb->pdata[6] << 8) |
580 ((unsigned long)pccb->pdata[7]);
584 /* Read capacity (10) was insufficient. Use read capacity (16). */
586 memset(pccb->cmd, 0, sizeof(pccb->cmd));
587 pccb->cmd[0] = SCSI_RD_CAPAC16;
590 pccb->msgout[0] = SCSI_IDENTIFY; /* NOT USED */
593 if (scsi_exec(pccb) != true)
596 *capacity = ((uint64_t)pccb->pdata[0] << 56) |
597 ((uint64_t)pccb->pdata[1] << 48) |
598 ((uint64_t)pccb->pdata[2] << 40) |
599 ((uint64_t)pccb->pdata[3] << 32) |
600 ((uint64_t)pccb->pdata[4] << 24) |
601 ((uint64_t)pccb->pdata[5] << 16) |
602 ((uint64_t)pccb->pdata[6] << 8) |
603 ((uint64_t)pccb->pdata[7]);
605 *blksz = ((uint64_t)pccb->pdata[8] << 56) |
606 ((uint64_t)pccb->pdata[9] << 48) |
607 ((uint64_t)pccb->pdata[10] << 40) |
608 ((uint64_t)pccb->pdata[11] << 32) |
609 ((uint64_t)pccb->pdata[12] << 24) |
610 ((uint64_t)pccb->pdata[13] << 16) |
611 ((uint64_t)pccb->pdata[14] << 8) |
612 ((uint64_t)pccb->pdata[15]);
618 /************************************************************************************
619 * Some setup (fill-in) routines
621 void scsi_setup_test_unit_ready(ccb * pccb)
623 pccb->cmd[0]=SCSI_TST_U_RDY;
624 pccb->cmd[1]=pccb->lun<<5;
630 pccb->msgout[0]=SCSI_IDENTIFY; /* NOT USED */
633 #ifdef CONFIG_SYS_64BIT_LBA
634 void scsi_setup_read16(ccb * pccb, lbaint_t start, unsigned long blocks)
636 pccb->cmd[0] = SCSI_READ16;
637 pccb->cmd[1] = pccb->lun<<5;
638 pccb->cmd[2] = ((unsigned char) (start >> 56)) & 0xff;
639 pccb->cmd[3] = ((unsigned char) (start >> 48)) & 0xff;
640 pccb->cmd[4] = ((unsigned char) (start >> 40)) & 0xff;
641 pccb->cmd[5] = ((unsigned char) (start >> 32)) & 0xff;
642 pccb->cmd[6] = ((unsigned char) (start >> 24)) & 0xff;
643 pccb->cmd[7] = ((unsigned char) (start >> 16)) & 0xff;
644 pccb->cmd[8] = ((unsigned char) (start >> 8)) & 0xff;
645 pccb->cmd[9] = ((unsigned char) (start)) & 0xff;
647 pccb->cmd[11] = ((unsigned char) (blocks >> 24)) & 0xff;
648 pccb->cmd[12] = ((unsigned char) (blocks >> 16)) & 0xff;
649 pccb->cmd[13] = ((unsigned char) (blocks >> 8)) & 0xff;
650 pccb->cmd[14] = (unsigned char) blocks & 0xff;
653 pccb->msgout[0] = SCSI_IDENTIFY; /* NOT USED */
654 debug ("scsi_setup_read16: cmd: %02X %02X "
655 "startblk %02X%02X%02X%02X%02X%02X%02X%02X "
656 "blccnt %02X%02X%02X%02X\n",
657 pccb->cmd[0], pccb->cmd[1],
658 pccb->cmd[2], pccb->cmd[3], pccb->cmd[4], pccb->cmd[5],
659 pccb->cmd[6], pccb->cmd[7], pccb->cmd[8], pccb->cmd[9],
660 pccb->cmd[11], pccb->cmd[12], pccb->cmd[13], pccb->cmd[14]);
664 void scsi_setup_read_ext(ccb * pccb, lbaint_t start, unsigned short blocks)
666 pccb->cmd[0]=SCSI_READ10;
667 pccb->cmd[1]=pccb->lun<<5;
668 pccb->cmd[2]=((unsigned char) (start>>24))&0xff;
669 pccb->cmd[3]=((unsigned char) (start>>16))&0xff;
670 pccb->cmd[4]=((unsigned char) (start>>8))&0xff;
671 pccb->cmd[5]=((unsigned char) (start))&0xff;
673 pccb->cmd[7]=((unsigned char) (blocks>>8))&0xff;
674 pccb->cmd[8]=(unsigned char) blocks & 0xff;
677 pccb->msgout[0]=SCSI_IDENTIFY; /* NOT USED */
678 debug ("scsi_setup_read_ext: cmd: %02X %02X startblk %02X%02X%02X%02X blccnt %02X%02X\n",
679 pccb->cmd[0],pccb->cmd[1],
680 pccb->cmd[2],pccb->cmd[3],pccb->cmd[4],pccb->cmd[5],
681 pccb->cmd[7],pccb->cmd[8]);
684 void scsi_setup_write_ext(ccb *pccb, lbaint_t start, unsigned short blocks)
686 pccb->cmd[0] = SCSI_WRITE10;
687 pccb->cmd[1] = pccb->lun << 5;
688 pccb->cmd[2] = ((unsigned char) (start>>24)) & 0xff;
689 pccb->cmd[3] = ((unsigned char) (start>>16)) & 0xff;
690 pccb->cmd[4] = ((unsigned char) (start>>8)) & 0xff;
691 pccb->cmd[5] = ((unsigned char) (start)) & 0xff;
693 pccb->cmd[7] = ((unsigned char) (blocks>>8)) & 0xff;
694 pccb->cmd[8] = (unsigned char)blocks & 0xff;
697 pccb->msgout[0] = SCSI_IDENTIFY; /* NOT USED */
698 debug("%s: cmd: %02X %02X startblk %02X%02X%02X%02X blccnt %02X%02X\n",
700 pccb->cmd[0], pccb->cmd[1],
701 pccb->cmd[2], pccb->cmd[3], pccb->cmd[4], pccb->cmd[5],
702 pccb->cmd[7], pccb->cmd[8]);
705 void scsi_setup_read6(ccb * pccb, lbaint_t start, unsigned short blocks)
707 pccb->cmd[0]=SCSI_READ6;
708 pccb->cmd[1]=pccb->lun<<5 | (((unsigned char)(start>>16))&0x1f);
709 pccb->cmd[2]=((unsigned char) (start>>8))&0xff;
710 pccb->cmd[3]=((unsigned char) (start))&0xff;
711 pccb->cmd[4]=(unsigned char) blocks & 0xff;
714 pccb->msgout[0]=SCSI_IDENTIFY; /* NOT USED */
715 debug ("scsi_setup_read6: cmd: %02X %02X startblk %02X%02X blccnt %02X\n",
716 pccb->cmd[0],pccb->cmd[1],
717 pccb->cmd[2],pccb->cmd[3],pccb->cmd[4]);
721 void scsi_setup_inquiry(ccb * pccb)
723 pccb->cmd[0]=SCSI_INQUIRY;
724 pccb->cmd[1]=pccb->lun<<5;
727 if(pccb->datalen>255)
730 pccb->cmd[4]=(unsigned char)pccb->datalen;
733 pccb->msgout[0]=SCSI_IDENTIFY; /* NOT USED */