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

📄 protocol.c

📁 <B>SMSC USB2.0 Flash硬盘驱动源码</B>
💻 C
📖 第 1 页 / 共 3 页
字号:
};
#endif
#if 0
code t_sense sense_write_protect_sw_lun =
{
  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
  0x02,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
#endif
#if 0
code t_sense sense_write_protect_assoc =
{
  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
  0x03,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
#endif
#if 0
code t_sense sense_write_protect_persist =
{
  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
  0x04,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
#endif
#if 0
code t_sense sense_write_protect_perm =
{
  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
  0x04,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
#endif
code t_sense sense_illegal_cmdpkt =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x05,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x24,                           // AdditionalSenseCode
  0x00,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
#if 0
code t_sense sense_saving_not_support =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x05,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x39,                           // AdditionalSenseCode
  0x00,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
#endif
code t_sense sense_illegal_length =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x05,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x1A,                           // AdditionalSenseCode
  0x00,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
code t_sense sense_illegal_address =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x05,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x21,                           // AdditionalSenseCode
  0x00,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};
code t_sense sense_illegal_opcode =
{
  0x70,                           // ErrorCode
  0x00,                           // Reserved
  0x05,                           // SenseKey
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificA[4]
  sizeof(t_sense) - 8,            // AdditionalLength
  0x00, 0x00, 0x00, 0x00,         // VendorSpecificB[4]
  0x20,                           // AdditionalSenseCode
  0x00,                           // AscQualifier
  0x00,                           // FieldReplacableUnitCode
  0x00, 0x00, 0x00                // SenseKeySpecific[3]
};


//------------------------------------------------------------------------------
// mode pages
// read-write-error recovery page
#if 0
code t_buf_mode_page_rw_err mode_page_rw_err =
{
  k_mode_page_rw_err_recovery,    // page code
  k_mode_page_rw_err_recovery_page_length,  // page length
  0x00,                           // awre, arre, tb, rc, eer, per, dte, dcr
  0x00,                           // read retry count
  0x00,                           // correction span
  0x00,                           // head offset count
  0x00,                           // data strobe offset count
  0x00,                           // reserved
  0x00,                           // write retry count
  0x00,                           // reserved
  0x00, 0x00                      // recovery time limit
};
// -- Disconnect-Reconnect Page
code t_buf_mode_page_dct_rct mode_page_dct_rct =
{
  k_mode_page_dct_rct,            // page code
  k_mode_page_dct_rct_page_length,  // page length
  0x00,                           // buffer full ratio
  0x00,                           // buffer empty ratio
  0x00, 0x00,                     // bus inactivity limit
  0x00, 0x00,                     // disconnect time limit
  0x00, 0x00,                     // connect time limit
  0x00, 0x00,                     // maximum burst size (in 512 byte increments)
  0x00,                           // EmdpFardFawrtFastatDimmDtdc
  0x00,                           // reserved
  0x00, 0x00                      // first burst size
};
// format device page
code t_buf_mode_page_format_device mode_page_format_device =
{
  k_mode_page_format_device,      // page code
  k_mode_page_format_device_page_length,  // page length
  0x00, 0x00,                     // tracks per zone
  0x00, 0x00,                     // alternate sectors per zone
  0x00, 0x00,                     // alternate tracks per zone
  0x00, 0x00,                     // alternate tracks per logical unit
  0x00, 0x00,                     // sectors per track
  0x00, 0x00,                     // data bytes per physical sector
  0x00, 0x00,                     // interleave
  0x00, 0x00,                     // track skew factor
  0x00, 0x00,                     // cylinder skew factor
  0x00,                           // ssec, hsec, rmb, surf
  0x00, 0x00                      // reserved [2]
};
// rigid disk page
code t_buf_mode_page_rigid_disk mode_page_rigid_disk =
{
  k_mode_page_rigid_disk,         // page code
  k_mode_page_rigid_disk_page_length,  // length of page in bytes
  0x00, 0x00,                     // number of cylinders
  0x00,                           // number of heads
  0x00, 0x00,                     // starting cylinder-write precompensation
  0x00, 0x00,                     // starting cylinder-reduced write current
  0x00, 0x00,                     // device step rate
  0x00, 0x00,                     // landing zone cylinder
  0x00,                           // rpl
  0x00,                           // rotational offset
  0x00,                           // reserved
  0x00, 0x00,                     // medium rotation rate
  0x00, 0x00                      // reserved [2]
};
// flexible disk page
#if 0
code t_buf_flex_disk_page mode_page_flex_disk =
{
  k_mode_page_flex_disk_page,
  k_mode_page_flex_disk_page_length,
  0x00, 0x00,                     // transfer rate
  0x00,                           // number of heads
  0x00,                           // sectors per track
  0x00, 0x00,                     // bytes per sector
  0x00, 0x00,                     // number of cylinders
  0x00, 0x00,                     // start cylinder-write precompensation
  0x00, 0x00,                     // start cylinder-reduced write current
  0x00, 0x00,                     // device step rate
  0x00,                           // device step pulse width
  0x00, 0x00,                     // head settle delay
  0x00,                           // motor on delay
  0x00,                           // motor off delay
  0x00,                           // options
  0x00,                           // spc
  0x00,                           // write recompensation
  0x00,                           // head_load_delay
  0x00,                           // head unload delay
  0x00,                           // Pin34 | Pin 2
  0x00,                           // Pin4  | Pin 1
  0x00, 0x00,                     // medium rotation rate
  0x00, 0x00                      // reserved
} t_str_flex_disk_page;
#endif
// verify error recovery page
code t_buf_verify_error_recovery_page mode_page_verify_error_recovery =
{
  k_mode_page_verify_error_recovery,  // page code
  k_mode_page_verify_error_recovery_page_length,  // parameter length
  0x00,                           // eer, per, dte, dcr
  0x00,                           // verify retry count
  0x00,                           // verify correction span
  0x00, 0x00, 0x00, 0x00, 0x00,   // reserved[5]
  0x00, 0x00                      // verify recovery time-limit
};
// caching page
code t_buf_mode_page_caching mode_page_caching =
{
  k_mode_page_caching,            // page code
  k_mode_page_caching_page_length,  // page length
  0x00,                           // ic, abpf, cap, disc, size, wce, mf, rcd
  0x00,                           // demand retention priority, write retention priority
  0x00, 0x00,                     // disable pre-fetch transfer length

⌨️ 快捷键说明

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