Annotation of linux/kernel/blk_drv/scsi/scsi.patch3, revision 1.1.1.1

1.1       root        1: *** aha1542.c.~1~      Sat Sep 12 15:29:26 1992
                      2: --- aha1542.c  Thu Sep 17 22:11:55 1992
                      3: ***************
                      4: *** 72,77 ****
                      5: --- 72,90 ----
                      6:       return 1;
                      7:   }
                      8: 
                      9: + static int aha1542_in(unchar *cmdp, int len)
                     10: + {
                     11: +     while (len--)
                     12: +       {
                     13: +        WAIT(STATUS, DF, DF, 0);
                     14: +        *cmdp++ = inb(DATA);
                     15: +       }
                     16: +     return 0;
                     17: +   fail:
                     18: +     printk("aha1542_in failed(%d): ", len+1); aha1542_stat();
                     19: +     return 1;
                     20: + }
                     21: +
                     22:   int makecode(unsigned hosterr, unsigned scsierr)
                     23:   {
                     24:       switch (hosterr) {
                     25: ***************
                     26: *** 259,264 ****
                     27: --- 272,278 ----
                     28:   int aha1542_queuecommand(unchar target, const void *cmnd, void *buff, int bufflen, void (*done)(int, int))
                     29:   {
                     30:       unchar ahacmd = CMD_START_SCSI;
                     31: +     unchar direction;
                     32:       unchar *cmd = (unchar *) cmnd;
                     33:       DEB(int i);
                     34: 
                     35: ***************
                     36: *** 292,300 ****
                     37: 
                     38:       ccb.cdblen = (*cmd<=0x1f)?6:10;  /* SCSI Command Descriptor Block Length */
                     39: 
                     40:       memcpy(ccb.cdb, cmd, ccb.cdblen);
                     41:       ccb.op = 0;                              /* SCSI Initiator Command */
                     42: !     ccb.idlun = (target&7)<<5;               /* SCSI Target Id */
                     43:       ccb.rsalen = 12;
                     44:       any2scsi(ccb.datalen, bufflen);
                     45:       any2scsi(ccb.dataptr, buff);
                     46: --- 306,318 ----
                     47: 
                     48:       ccb.cdblen = (*cmd<=0x1f)?6:10;  /* SCSI Command Descriptor Block Length */
                     49: 
                     50:       direction = 0;
                     51:       if (*cmd == READ_10 || *cmd == READ_6)      direction = 8;
                     52:       else if (*cmd == WRITE_10 || *cmd == WRITE_6)      direction = 16;
                     53: 
                     54:       memcpy(ccb.cdb, cmd, ccb.cdblen);
                     55:       ccb.op = 0;                              /* SCSI Initiator Command */
                     56: !     ccb.idlun = (target&7)<<5 | direction;   /* SCSI Target Id */
                     57:       ccb.rsalen = 12;
                     58:       any2scsi(ccb.datalen, bufflen);
                     59:       any2scsi(ccb.dataptr, buff);
                     60: ***************
                     61: *** 369,374 ****
                     62: --- 387,416 ----
                     63:       set_intr_gate(0x2b,&aha1542_interrupt);
                     64:   }
                     65: 
                     66: +
                     67: + /* Query the board to find out if it is a 1542 or a 1740, or whatever. */
                     68: + static void aha1542_query()
                     69: + {
                     70: +   static unchar inquiry_cmd[] = {CMD_INQUIRY };
                     71: +   static unchar inquiry_result[4];
                     72: +   int i;
                     73: +   i = inb(STATUS);
                     74: +   if (i & DF) {
                     75: +     i = inb(DATA);
                     76: +     printk("Stale data:%x ");
                     77: +   };
                     78: +   aha1542_out(inquiry_cmd, 1);
                     79: +   aha1542_in(inquiry_result, 4);
                     80: +   WAIT(INTRFLAGS, INTRMASK, HACC, 0);
                     81: +   while (0) {
                     82: +   fail:
                     83: +     printk("aha1542_detect: query card type\n");
                     84: +   }
                     85: +       aha1542_intr_reset();
                     86: +   printk("Inquiry:");
                     87: +   for(i=0;i<4;i++) printk("%x ",inquiry_result[i]);
                     88: + }
                     89: +
                     90:   /* return non-zero on detection */
                     91:   int aha1542_detect(int hostnum)
                     92:   {
                     93: ***************
                     94: *** 397,402 ****
                     95: --- 439,446 ----
                     96:        }
                     97:        aha1542_intr_reset();
                     98:       }
                     99: +
                    100: +     aha1542_query();
                    101: 
                    102:       DEB(aha1542_stat());
                    103:       setup_mailboxes();
                    104: *** scsi.c.~1~ Sat Sep 12 15:29:26 1992
                    105: --- scsi.c     Wed Sep 16 01:00:44 1992
                    106: ***************
                    107: *** 671,677 ****
                    108: --- 671,680 ----
                    109:                        sti();
                    110: 
                    111:                        if (!(last_cmnd[host].flags & WAS_RESET))
                    112: +                        {
                    113:                                reset(host);
                    114: +                              return;
                    115: +                            }
                    116:                        else
                    117:                                {
                    118:                                exit = (DRIVER_HARD | SUGGEST_ABORT);
                    119: ***************
                    120: *** 768,773 ****
                    121: --- 771,777 ----
                    122: 
                    123:                        case RESERVATION_CONFLICT:
                    124:                                reset(host);
                    125: +                              return;
                    126:                                exit = DRIVER_SOFT | SUGGEST_ABORT;
                    127:                                status = MAYREDO;
                    128:                                break;
                    129: ***************
                    130: *** 841,848 ****
                    131: --- 845,854 ----
                    132:                        {
                    133:                        if ((last_cmnd[host].retries >= (last_cmnd[host].allowed >> 1))
                    134:                            && !(last_cmnd[host].flags & WAS_RESET))
                    135: +                        {
                    136:                                reset(host);
                    137:                                break;
                    138: +                            };
                    139: 
                    140:                        }
                    141:                        else
                    142: *** sd.c.~1~   Sat Sep 12 15:29:26 1992
                    143: --- sd.c       Thu Sep 17 23:04:40 1992
                    144: ***************
                    145: *** 39,45 ****
                    146:   int NR_SD=0;
                    147:   Scsi_Disk rscsi_disks[MAX_SD];
                    148:   static int sd_sizes[MAX_SD << 4] = {0, };
                    149: ! static int this_count;
                    150:   static int the_result;
                    151: 
                    152:   static char sense_buffer[255];
                    153: --- 39,45 ----
                    154:   int NR_SD=0;
                    155:   Scsi_Disk rscsi_disks[MAX_SD];
                    156:   static int sd_sizes[MAX_SD << 4] = {0, };
                    157: ! static int this_count, total_count = 0;
                    158:   static int the_result;
                    159: 
                    160:   static char sense_buffer[255];
                    161: ***************
                    162: *** 108,113 ****
                    163: --- 108,120 ----
                    164: 
                    165:        if (!result) {
                    166:                CURRENT->nr_sectors -= this_count;
                    167: +              total_count -= this_count;
                    168: +              if(total_count){
                    169: +                CURRENT->sector += this_count;
                    170: +                CURRENT->buffer += (this_count << 9);
                    171: +                do_sd_request();
                    172: +                return;
                    173: +              };
                    174: 
                    175:   #ifdef DEBUG
                    176:                printk("sd%d : %d sectors remain.\n", MINOR(CURRENT->dev), CURRENT->nr_sectors);
                    177: ***************
                    178: *** 248,253 ****
                    179: --- 255,266 ----
                    180:                this_count = CURRENT->nr_sectors;
                    181:        else
                    182:                this_count = (BLOCK_SIZE / 512);
                    183: +
                    184: +
                    185: + /* This is a temporary hack for the AHA1742. */
                    186: +      if(total_count == 0)
                    187: +        total_count = this_count;
                    188: +      this_count = 1;  /* Take only 512 bytes at a time */
                    189: 
                    190:   #ifdef DEBUG
                    191:        printk("sd%d : %s %d/%d 512 byte blocks.\n", MINOR(CURRENT->dev),

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.