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

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

?? scsi.lst

?? HIGH_SPEED_USB_To_ATA(IDE)Firmware相關代碼(EZ USB FX2芯片)
?? LST
?? 第 1 頁 / 共 5 頁
字號:
C51 COMPILER V7.50   SCSI                                                                  11/07/2006 14:52:10 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE SCSI
OBJECT MODULE PLACED IN scsi.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE scsi.c ROM(COMPACT) OPTIMIZE(9,SPEED) REGFILE(.\fx2_ata.ORC) BROWSE ORDER I
                    -NCDIR(c:\cypress\usb\target\inc) DEFINE(GPIF=0,FLASH=0,DEVICE_TYPE_IS_SCSI=1,DEVICE_TYPE_IS_IDE=1,VBUS_DETECT=1) DEBUG O
                    -BJECTEXTEND CODE

line level    source

   1          //-----------------------------------------------------------------------------
   2          //   File:      scsi.c
   3          //   Contents:   Functions to handle a scsi device.
   4          //
   5          // indent 3.  NO TABS!
   6          //
   7          // Description:
   8          //    SCSI devices differ from IDE device as follows:
   9          //    - SCSI devices may accept or return data according to the value of
  10          //       its byte count registers which may differ from the host request
  11          //       indicated in the CBW variable 'dataTransferlen'. 
  12          //
  13          //       If the host requests to write a greater amount than the byte count 
  14          //       registers indicate, the extra data is processed by throwing it on 
  15          //       the floor and reporting it as a residue.
  16          //
  17          //       If the host requests a read greater than what is indicated in the 
  18          //       byte count registers, and the last packet is a full packet, a short 
  19          //       packet is sent to terminate the transfer.
  20          //
  21          //    - generalSCSIInCommand() and generalSCSIOutCommand() are called from
  22          //       periph.c.  Their conditional compile flags are kept inside the function
  23          //       to maintain original code for periph.c.  All other functions in this
  24          //       module are specific for SCSI and are static to this file.  They are
  25          //       under one conditional compile flag.
  26          //
  27          //-----------------------------------------------------------------------------
  28          // $Archive: /USB/atapifx2/software/scsi.c $
  29          // $Date: 1/21/02 2:38p $
  30          // $Revision: 41 $
  31          //
  32          //-----------------------------------------------------------------------------
  33          //  Copyright (c) 1999 Cypress Semiconductor, Inc. All rights reserved
  34          //-----------------------------------------------------------------------------
  35          #include "fx2.h"
  36          #include "fx2regs.h"
  37          #include "scsi.h"
  38          #include "gpif.h"
  39          
  40          static BYTE scsiWrite(void);
  41          static BYTE scsiWriteUdma();
  42          static void prepareForATAPICommand();
  43          static bit inDataFromDriveUdma();
  44          
  45          
  46          // this bit determines if the current transfer is to be carried out using UDMA (1) or
  47          // PIO (0)
  48          bit useUdma;
  49          bit bShortPacketSent;
  50          BYTE udmaErrorCount;
  51          
  52          #define SENSE_LEN 18
  53          
C51 COMPILER V7.50   SCSI                                                                  11/07/2006 14:52:10 PAGE 2   

  54          //-----------------------------------------------------------------------------
  55          // Function:  generalSCSIInCommand()
  56          //
  57          // Input:   none
  58          // Output:  bit flag
  59          //          0 = success, 1 = failure
  60          //
  61          // Global data:
  62          //    CBW from EP2FIFOBUF.
  63          //
  64          // Description:
  65          //    Top level handler for scsi read.  The scsi command packet is 
  66          //    a 12-byte packet extracted from the CBW contained in EP2FIFOBUF 
  67          //    starting from byte 15.  If the command fails, the IN endpoint buffer
  68          //    is stalled and the transaction is failed.
  69          //
  70          //    If the command was processed successfully, data is extracted from the 
  71          //    drive till the byte count from the drive is exhausted.  If the byte count
  72          //    indicated by the drive is less than what is requested by the host, the IN
  73          //    endpoint is stalled, but the transaction is passed.  The remainder of bytes
  74          //    the host still expects is reported as a residue.
  75          //-----------------------------------------------------------------------------
  76          BYTE generalSCSIInCommand()
  77          {
  78   1      #if DEVICE_TYPE_IS_SCSI
  79   1      
  80   1         BYTE result = 0;
  81   1      
  82   1         // Clear the bit telling us if we need a STALL to terminat the IRP on the host side   
  83   1         bShortPacketSent = 0;
  84   1      
  85   1         // if the drive is configured for udma then use udma depending on the
  86   1         // scsi command
  87   1         if (udmaMode)
  88   1         {
  89   2            switch(EP2FIFOBUF[0xf])
  90   2            {
  91   3               case 0x28:
  92   3               case 0xA8:
  93   3                  useUdma = 1;     
  94   3                  break;
  95   3               default:
  96   3                  useUdma = 0;
  97   3                  break;
  98   3            }
  99   2         }
 100   1      
 101   1         result = sendSCSICommand(EP2FIFOBUF + CBW_DATA_START);
 102   1      
 103   1         // relinquish control of the bulk buffer occupied by the CBW
 104   1         EP2BCL = 0x80; 
 105   1         
 106   1         // Need to modify this code so that we know if we sent a short packet to terminate the xfer.
 107   1         // Although the STALL is required, the ScanLogic driver and Mac driver will not properly handle it.
 108   1         
 109   1         if(result != USBS_PASSED)
 110   1            {
 111   2            failedIn();    // stalls EP8 
 112   2            return(USBS_FAILED);
 113   2            }
 114   1      
 115   1         // no need to do the data xfer phase if the host isn't expecting any data.
C51 COMPILER V7.50   SCSI                                                                  11/07/2006 14:52:10 PAGE 3   

 116   1         if (!dataTransferLenLSW && !dataTransferLenMSW)
 117   1            {
 118   2            // Make sure the status is correct
 119   2            while (readATAPI_STATUS_REG() & ATAPI_STATUS_BUSY_BIT)
 120   2               ;
 121   2      
 122   2            if (readATAPI_STATUS_REG() & ATAPI_STATUS_DRQ_BIT)
 123   2               return(USBS_PHASE_ERROR);       // USBS_PHASE_ERROR -- Hn < Di (case 2)
 124   2            else
 125   2               return(USBS_PASSED);
 126   2            }
 127   1      
 128   1         //////////////////////////////////////////////////////////////////
 129   1         // Start of data xfer phase
 130   1         //////////////////////////////////////////////////////////////////
 131   1         if (useUdma) 
 132   1         {
 133   2            result = inDataFromDriveUdma();
 134   2         }
 135   1         else
 136   1         {
 137   2            result = inDataFromDrive();
 138   2         }
 139   1      
 140   1         if (dataTransferLen)    
 141   1            {
 142   2            // Case H(i) > D(i) or H(i) > D(n)
 143   2            // "terminate the transfer with a short packet, then STALL the IN endpoint"
 144   2            failedIn();       // only stalls EP8, does not return error
 145   2           
 146   2            // Pass the result to the next layer up.
 147   2            return(result);  
 148   2            }
 149   1      
 150   1         else
 151   1            return(result);       // No residue, just return status
 152   1      
 153   1      #else
                 return(0);
              #endif
 156   1      }   
 157          
 158          
 159          //-----------------------------------------------------------------------------
 160          // Function:  generalSCSIOutCommand()
 161          //
 162          // Input:   none
 163          // Output:  bit flag
 164          //          0 = success, 1 = failure
 165          //
 166          // Global data:
 167          //    CBW from EP2FIFOBUF.
 168          //
 169          // Local data:
 170          //    cmd      - command op code from CBW
 171          //    result   - return status
 172          //
 173          // Description:
 174          //    The scsi command packet is a 12-byte packet extracted from the CBW 
 175          //    contained in EP2FIFOBUF starting from byte 15.  If the command fails, 
 176          //    the OUT endpoint buffer is stalled and the transaction is failed.
 177          //
C51 COMPILER V7.50   SCSI                                                                  11/07/2006 14:52:10 PAGE 4   

 178          //    If the command is successful, data is sent to the drive.
 179          //    When the write encounters an error, the endpoint is stalled and the
 180          //    transaction is failed.
 181          //
 182          //-----------------------------------------------------------------------------
 183          BYTE generalSCSIOutCommand()
 184          {
 185   1      #if DEVICE_TYPE_IS_SCSI
 186   1         // Init local vars.
 187   1      
 188   1         BYTE result = USBS_FAILED;
 189   1      
 190   1         useUdma = 0;
 191   1      
 192   1         // if the drive is configured for udma then use udma depending on the
 193   1         // scsi command
 194   1         if (udmaMode)
 195   1         {
 196   2            switch(EP2FIFOBUF[0xf])
 197   2            {
 198   3               case 0x2A:
 199   3               case 0xAA:
 200   3                  useUdma = 1;   //syk
 201   3                  break;
 202   3               default:
 203   3                  useUdma = 0;
 204   3                  break;
 205   3            }
 206   2         }
 207   1      
 208   1         result = sendSCSICommand(EP2FIFOBUF + CBW_DATA_START);
 209   1      
 210   1         // relinquish control of the bulk buffer occupied by the CBW
 211   1         EP2BCL = 0x80;     
 212   1      
 213   1         // If the command failed, stall the endpoint and get out
 214   1         if (result != USBS_PASSED)
 215   1         {
 216   2            // If the transfer still contains data, and the xfer has not been terminated by a short packet
 217   2            // then we must stop the transfer with a STALL.
 218   2            if (dataTransferLen > 0)
 219   2            {
 220   3               // We may want to stall the endpoint here, but we must be careful to make sure that 
 221   3               // we don't set the stall bit when the xfer has completed!
 222   3                stallEP2OUT();
 223   3            }
 224   2            return(USBS_FAILED);
 225   2         }
 226   1      
 227   1         if (!dataTransferLen)
 228   1            return(result);
 229   1      
 230   1         if (useUdma)
 231   1         {
 232   2            result = scsiWriteUdma();
 233   2         }
 234   1         else
 235   1         {
 236   2            result = scsiWrite();
 237   2         }
 238   1      
 239   1         return(result);
C51 COMPILER V7.50   SCSI                                                                  11/07/2006 14:52:10 PAGE 5   

 240   1      #endif
 241   1      
 242   1      #if DEVICE_TYPE_IS_IDE
 243   1         return(0);
 244   1      #endif
 245   1      }
 246          
 247          
 248          
 249          #define SENSE_LEN 18
 250          const char code testUnitReady[12] = { 0x00, 0x00, 0x00, 0x00, 00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
             -};
 251          const char code requestSense[12] = {  0x03, 0x00, 0x00, 0x00, SENSE_LEN, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0
             -0, 0x00};
 252          // Send a TestUnitReady command to the device.
 253          // If the device fails the testUnitReady command, return the sense code, else return 0
 254          BYTE SCSITestUnitReady()
 255          {
 256   1      
 257   1         bit result = 0;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品一区二区三区视频播放| 午夜精品一区二区三区电影天堂| 成人深夜视频在线观看| www日韩大片| 国产精品99久久久久| 国产女人18水真多18精品一级做| 岛国精品在线播放| 中文字幕第一区二区| 91免费精品国自产拍在线不卡| 亚洲精品伦理在线| 欧美精品 日韩| 国产在线看一区| 国产精品久久久一本精品| 91香蕉视频污| 日韩制服丝袜av| 国产午夜久久久久| 91麻豆视频网站| 视频一区中文字幕国产| 久久影音资源网| 色婷婷久久久久swag精品| 免费观看久久久4p| 久久久国产一区二区三区四区小说| jvid福利写真一区二区三区| 亚洲精品高清在线| 欧美成va人片在线观看| 99久久久国产精品免费蜜臀| 偷拍日韩校园综合在线| 中文字幕精品一区二区精品绿巨人| 91麻豆国产精品久久| 蜜臀av一区二区在线观看| 国产精品视频线看| 7777精品伊人久久久大香线蕉 | 亚洲第四色夜色| 欧美videos中文字幕| 91在线云播放| 精油按摩中文字幕久久| 亚洲乱码中文字幕| 久久亚洲综合av| 欧美日韩国产在线观看| 成人网在线播放| 久久国产精品第一页| 伊人开心综合网| 日本一区二区成人| 欧美成人一区二区三区在线观看 | 91欧美一区二区| 韩国中文字幕2020精品| 亚洲成在线观看| 国产精品久久久99| 久久综合久久99| 欧美一区二区三区视频在线观看| 99精品偷自拍| 成人一级片在线观看| 久久电影网站中文字幕| 婷婷六月综合亚洲| 亚洲一本大道在线| 最新国产成人在线观看| 欧美高清在线一区| 国产亚洲一二三区| 日韩免费视频一区| 欧美精品tushy高清| 91精品福利视频| 91在线观看免费视频| 成人国产亚洲欧美成人综合网| 国产一区在线观看视频| 九九九久久久精品| 另类专区欧美蜜桃臀第一页| 亚洲mv在线观看| 五月婷婷激情综合| 日韩1区2区日韩1区2区| 亚洲成人精品在线观看| 亚洲综合精品久久| 一区二区三区色| 一区二区三区四区激情| 亚洲免费观看高清完整版在线| 国产精品久久精品日日| 国产精品传媒视频| 亚洲欧洲韩国日本视频| 中文字幕在线不卡一区| 日韩久久一区二区| 亚洲你懂的在线视频| 亚洲激情图片小说视频| 亚洲精品一二三区| 亚洲国产日韩综合久久精品| 亚洲高清免费在线| 秋霞电影网一区二区| 美女免费视频一区| 国产精品亚洲综合一区在线观看| 国产露脸91国语对白| 国产成人免费在线视频| 成人免费高清在线| 色婷婷狠狠综合| 欧美人伦禁忌dvd放荡欲情| 欧美一卡二卡在线观看| 欧美精品一区视频| 国产精品嫩草99a| 一区二区三区欧美激情| 婷婷丁香激情综合| 国产在线播放一区| 91小视频免费观看| 3d动漫精品啪啪1区2区免费| 欧美成人精品3d动漫h| 久久蜜桃一区二区| 中文字幕永久在线不卡| 亚洲一区二区三区四区中文字幕 | 日韩视频一区在线观看| 国产午夜亚洲精品羞羞网站| 亚洲欧洲美洲综合色网| 亚洲电影视频在线| 韩国一区二区在线观看| 成人av资源在线观看| 欧美日韩一区二区三区在线 | 精品无人码麻豆乱码1区2区| 成人黄色av网站在线| 欧美欧美午夜aⅴ在线观看| 久久精品欧美一区二区三区不卡| 中文字幕在线一区二区三区| 亚洲福利视频一区| 国产成人小视频| 欧美日韩国产天堂| 国产日韩亚洲欧美综合| 亚洲一区二区三区爽爽爽爽爽| 麻豆成人av在线| 99久久国产综合色|国产精品| 欧美精品免费视频| 中文字幕人成不卡一区| 久草这里只有精品视频| 在线看一区二区| 国产欧美日韩中文久久| 三级不卡在线观看| 91色婷婷久久久久合中文| 日韩免费观看高清完整版| 亚洲综合色噜噜狠狠| 国产一区二区不卡老阿姨| 欧美日韩国产电影| 亚洲日本丝袜连裤袜办公室| 精品一区二区三区在线观看 | 日本视频一区二区| 99re热这里只有精品视频| 欧美va在线播放| 丝袜诱惑亚洲看片| 日本高清成人免费播放| 日本一区二区三区dvd视频在线| 亚洲国产综合人成综合网站| 成人aa视频在线观看| 久久先锋影音av鲁色资源网| 午夜成人免费电影| 在线欧美小视频| 亚洲日本va在线观看| 国产成人在线视频播放| 日韩美女主播在线视频一区二区三区| 亚洲综合色噜噜狠狠| 91啪九色porn原创视频在线观看| 国产婷婷色一区二区三区四区 | 久久久国产精品午夜一区ai换脸| 久久精品国产成人一区二区三区| 欧美日韩国产免费一区二区| 亚洲毛片av在线| 91美女在线视频| 亚洲天堂a在线| 成人精品在线视频观看| 久久久91精品国产一区二区精品| 久久99精品久久久久| 欧美成人性战久久| 裸体一区二区三区| 日韩精品中文字幕在线一区| 日韩av在线发布| 欧美一卡二卡在线观看| 美女精品自拍一二三四| 精品乱人伦小说| 国产一二三精品| 中文天堂在线一区| 99精品视频在线播放观看| 亚洲人成人一区二区在线观看| av欧美精品.com| 一区二区三区欧美在线观看| 欧美三级乱人伦电影| 日韩精品国产欧美| 欧美va亚洲va| 国产精选一区二区三区| 国产欧美视频一区二区| 波多野结衣在线aⅴ中文字幕不卡| 亚洲国产高清不卡| 91小视频在线| 图片区小说区国产精品视频| 日韩一区二区精品葵司在线| 国内精品免费**视频| 欧美国产日韩在线观看| 91亚洲精品久久久蜜桃| 亚洲午夜精品17c| 欧美成人性福生活免费看| 国产成人精品亚洲午夜麻豆| 一色桃子久久精品亚洲| 欧美日韩中文另类| 国内精品久久久久影院色| 国产精品免费免费| 欧美三级在线看| 国产酒店精品激情| 亚洲一区二区三区四区的| 欧美成人性福生活免费看| 99国产欧美久久久精品|