⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 protocol.c

📁 <B>SMSC USB2.0 Flash硬盘驱动源码</B>
💻 C
📖 第 1 页 / 共 3 页
字号:
/*============================================================================
  ____________________________________________________________________________
                                ______________________________________________
   SSSS  M   M          CCCC          Standard Microsystems Corporation
  S      MM MM   SSSS  C                    Austin Design Center
   SSS   M M M  S      C                 11000 N. Mopac Expressway
      S  M   M   SSS   C                Stonelake Bldg. 6, Suite 500
  SSSS   M   M      S   CCCC                Austin, Texas 78759
                SSSS            ______________________________________________
  ____________________________________________________________________________
  Copyright(C) 1999, Standard Microsystems Corporation
  All Rights Reserved.
  This program code listing is proprietary to SMSC and may not be copied,
  distributed, or used without a license to do so.  Such license may have
  Limited or Restricted Rights. Please refer to the license for further
  clarification.
  ____________________________________________________________________________
  Notice: The program contained in this listing is a proprietary trade
  secret of SMSC, Hauppauge, New York, and is copyrighted
  under the United States Copyright Act of 1976 as an unpublished work,
  pursuant to Section 104 and Section 408 of Title XVII of the United
  States code. Unauthorized copying, adaption, distribution, use, or
  display is prohibited by this law.
  ____________________________________________________________________________
  Use, duplication, or disclosure by the Government is subject to
  restrictions as set forth in subparagraph(c)(1)(ii) of the Rights
  in Technical Data and Computer Software clause at DFARS 52.227-7013.
  Contractor/Manufacturer is Standard Microsystems Corporation,
  80 Arkay Drive, Hauppauge, New York, 1178-8847.
  ____________________________________________________________________________
  ____________________________________________________________________________
  scsi.c - things required for scsi
  ____________________________________________________________________________
  comments tbd
  ____________________________________________________________________________
  Revision History
  Date      Who  Comment
  ________  ___  _____________________________________________________________
  12/06/01  tbh  initial version, munged from atapi.c
  09/22/02  tbh  eliminated unused code on 242 builds
============================================================================*/
#include "project.h"

//------------------------------------------------------------------------------
// compile options
#define k_dma_data_in
#define k_dma_data_out

//------------------------------------------------------------------------------
// module globals
static bit _doing_dma ;

//------------------------------------------------------------------------------
// sense codes
code t_sense sense_none =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x00,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x00,                           // AdditionalSenseCode
  0x00,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
#if 0
code t_sense sense_bad_lun =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x05,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x25,                           // AdditionalSenseCode
  0x00,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
#endif
code t_sense sense_media_change =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x06,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x28,                           // AdditionalSenseCode
  0x00,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
code t_sense sense_no_media =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x02,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x3A,                           // AdditionalSenseCode
  0x00,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
#if 0
code t_sense sense_becoming_ready =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x02,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x04,                           // AdditionalSenseCode
  0x01,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
#endif
code t_sense sense_read_error =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x03,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x11,                           // AdditionalSenseCode
  0x00,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
#if 0
code t_sense sense_fmt_failed =  // format failed
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x03,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x31,                           // AdditionalSenseCode
  0x01,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
#endif
#if 0
code t_sense sense_no_seek =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x03,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x02,                           // AdditionalSenseCode
  0x00,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
#endif
code t_sense sense_por =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x06,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x29,                           // AdditionalSenseCode
  0x00,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
code t_sense sense_illegal_request =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x05,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x26,                           // AdditionalSenseCode
  0x00,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
code t_sense sense_write_error =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x03,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x03,                           // AdditionalSenseCode
  0x00,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
#if 0
code t_sense sense_no_fmt =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x03,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x30,                           // AdditionalSenseCode
  0x01,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
#endif
code t_sense sense_write_protect =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x07,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x27,                           // AdditionalSenseCode
  0x00,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
#if 0
code t_sense sense_write_protect_hw =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x07,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x27,                           // AdditionalSenseCode
  0x01,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -