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

📄 sm_media.h

📁 <B>SMSC USB2.0 Flash硬盘驱动源码</B>
💻 H
字号:

/*============================================================================
  ____________________________________________________________________________
                                ______________________________________________
   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.
  ____________________________________________________________________________
  ____________________________________________________________________________

  lun.h - defines the root object for the media class hierarchy

    media
     +-sm_media
     +-ms_media
  ____________________________________________________________________________

  comments tbd
  ____________________________________________________________________________

  Revision History
  Date      Who  Comment
  ________  ___  _____________________________________________________________
  03/01/02  cds  initial version
  04/19/02  cds  overrode media_resolve_conflict() 
  05/30/02  cds  overrode media_copy_sector()
  06/21/02  cds  removed #if k_log_lun_sm < k_max_log_lun guard around 
                 sm_media overrides so that the derived nand_media can still
                 make use of the sm code, even if a sm lun is not included
                 in the build options.
  06/27/02  cds  overrode media_set_read/write/erase_addr() methods
  10/29/02  cds  overrode media_block_has_bad_data() method
  11/03/02  cds  overrode media_is_phyblock_reserved() method
  
                 
==============================================================================*/
#ifndef __sm_media_dot_h__
#define __sm_media_dot_h__


//+-----------------------------------------------------------------------------
// Name:
//   sm_media_erase_block()
//
// Declaration:
//   t_result sm_media_erase_block(void) reentrant
//
// Purpose:
//   TBD
//
// Arguments:
//   TBD   
//  
// Return:
//   TBD
//
// Notes:
//   TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result sm_media_erase_block(void) reentrant;
#undef _v_media_erase_block
#define _v_media_erase_block sm_media_erase_block

//+-----------------------------------------------------------------------------
// Name:
//   sm_media_read_sector()
//
// Declaration:
//   t_result sm_media_read_sector(void) reentrant
//
// Purpose:
//   TBD
//
// Arguments:
//   TBD   
//  
// Return:
//   TBD
//
// Notes:
//   TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result  sm_media_read_sector(void) reentrant ; 
#undef _v_media_read_sector
#define _v_media_read_sector sm_media_read_sector

//+-----------------------------------------------------------------------------
// Name:
//   sm_media_write_sector()
//
// Declaration:
//   t_result sm_media_write_sector(void) reentrant
//
// Purpose:
//   TBD
//
// Arguments:
//   TBD   
//  
// Return:
//   TBD
//
// Notes:
//   TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result  sm_media_write_sector(void) reentrant ;
#undef _v_media_write_sector
#define _v_media_write_sector sm_media_write_sector

//+-----------------------------------------------------------------------------
// Name:
//   sm_media_copy_sector()
//
// Declaration:
//   t_result sm_media_copy_sector(void) reentrant
//
// Purpose:
//   TBD
//
// Arguments:
//   TBD   
//  
// Return:
//   TBD
//
// Notes:
//   TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result sm_media_copy_sector(void) reentrant ;
#undef _v_media_copy_sector
#define _v_media_copy_sector sm_media_copy_sector

//+-----------------------------------------------------------------------------
// Name:
//   sm_media_phy2log()
//
// Declaration:
//   t_result sm_media_phy2log(void) reentrant
//
// Purpose:
//   TBD
//
// Arguments:
//   TBD   
//  
// Return:
//   TBD
//
// Notes:
//   TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result  sm_media_phy2log(void) reentrant ;
#undef _v_media_phy2log
#define _v_media_phy2log sm_media_phy2log

//+-----------------------------------------------------------------------------
// Name:
//   sm_media_bind_log2phy()
//
// Declaration:
//   t_result sm_media_bind_log2phy(void) reentrant
//
// Purpose:
//   TBD
//
// Arguments:
//   TBD   
//  
// Return:
//   TBD
//
// Notes:
//   TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result  sm_media_bind_log2phy(void) reentrant ;
#undef _v_media_bind_log2phy
#define _v_media_bind_log2phy sm_media_bind_log2phy

//+-----------------------------------------------------------------------------
// Name:
//   sm_media_set_phyblock_failed()
//
// Declaration:
//   t_result sm_media_set_phyblock_failed(void) reentrant
//
// Purpose:
//   TBD
//
// Arguments:
//   TBD   
//  
// Return:
//   TBD
//
// Notes:
//   TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result  sm_media_set_phyblock_failed(void) reentrant ;
#undef _v_media_set_phyblock_failed
#define _v_media_set_phyblock_failed sm_media_set_phyblock_failed

//+-----------------------------------------------------------------------------
// Name:
//   sm_media_is_phyblock_reserved()
//
// Declaration:
//   t_result sm_media_is_phyblock_reserved(void) reentrant
//
// Purpose:
//   TBD
//
// Arguments:
//   TBD   
//  
// Return:
//   TBD
//
// Notes:
//   TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result sm_media_is_phyblock_reserved(void) reentrant;
#undef _v_media_is_phyblock_reserved
#define _v_media_is_phyblock_reserved sm_media_is_phyblock_reserved

//+-----------------------------------------------------------------------------
// Name:
//   sm_media_is_phyblock_ok()
//
// Declaration:
//   t_result sm_media_is_phyblock_ok(void) reentrant
//
// Purpose:
//   TBD
//
// Arguments:
//   TBD   
//  
// Return:
//   TBD
//
// Notes:
//   TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result  sm_media_is_phyblock_ok(void) reentrant ;
#undef _v_media_is_phyblock_ok
#define _v_media_is_phyblock_ok sm_media_is_phyblock_ok

//+-----------------------------------------------------------------------------
// Name:
//   sm_media_is_phyblock_blank()
//
// Declaration:
//   t_result sm_media_is_phyblock_blank(void) reentrant
//
// Purpose:
//   TBD
//
// Arguments:
//   TBD   
//  
// Return:
//   TBD
//
// Notes:
//   TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result  sm_media_is_phyblock_blank(void) reentrant ;
#undef _v_media_is_phyblock_blank
#define _v_media_is_phyblock_blank sm_media_is_phyblock_blank

//+-----------------------------------------------------------------------------
// Name:
//   sm_media_read_extra_data()
//
// Declaration:
//   t_result sm_media_read_extra_data(void) reentrant
//
// Purpose:
//   TBD
//
// Arguments:
//   TBD   
//  
// Return:
//   TBD
//
// Notes:
//   TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result  sm_media_read_extra_data(void) reentrant ;
#undef _v_media_read_extra_data
#define _v_media_read_extra_data sm_media_read_extra_data

//+-----------------------------------------------------------------------------
// Name:
//   sm_media_write_extra_data()
//
// Declaration:
//   t_result sm_media_write_extra_data(void) reentrant
//
// Purpose:
//   TBD
//
// Arguments:
//   TBD   
//  
// Return:
//   TBD
//
// Notes:
//   TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result  sm_media_write_extra_data(void) reentrant ;
#undef _v_media_write_extra_data
#define _v_media_write_extra_data sm_media_write_extra_data

//+-----------------------------------------------------------------------------
// Name:
//   sm_media_clear_extra_data()
//
// Declaration:
//   t_result sm_media_clear_extra_data(void) reentrant
//
// Purpose:
//   TBD
//
// Arguments:
//   TBD   
//  
// Return:
//   TBD
//
// Notes:
//   TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result  sm_media_clear_extra_data(void) reentrant ;
#undef _v_media_clear_extra_data
#define _v_media_clear_extra_data sm_media_clear_extra_data

//+-----------------------------------------------------------------------------
// Name:
//   sm_media_resolve_conflict()
//
// Declaration:
//   t_result sm_media_resolve_conflict(void) reentrant
//
// Purpose:
//   TBD
//
// Arguments:
//   TBD   
//  
// Return:
//   TBD
//
// Notes:
//   TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result sm_media_resolve_conflict(void) reentrant ;
#undef _v_media_resolve_conflict
#define _v_media_resolve_conflict sm_media_resolve_conflict


//+-----------------------------------------------------------------------------
// Name:
//   media_set_read_addr()
//
// Declaration:
//   t_result media_erase_card() reentrant
//               media_set_read_addr
// Purpose:
//   set media-specific address from internal zone/rd_phy_blk/sector addres
//
// Arguments:
//  TBD
//
// Return:
//  k_success always
//
// Notes:
//  TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result sm_media_set_read_addr() reentrant ;
#undef _v_media_set_read_addr
#define _v_media_set_read_addr sm_media_set_read_addr

//+-----------------------------------------------------------------------------
// Name:
//   media_set_write_addr()
//
// Declaration:
//   t_result media_set_write_addr() reentrant
//
// Purpose:
//   set media-specific address from internal zone/wr_phy_blk/sector addres
//
// Arguments:
//  TBD
//
// Return:
//  k_success always
//
// Notes:
//  TBD
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result sm_media_set_write_addr() reentrant ;
#undef _v_media_set_write_addr
#define _v_media_set_write_addr sm_media_set_write_addr

//+-----------------------------------------------------------------------------
// Name:
//   media_set_erase_addr()
//
// Declaration:
//   t_result media_set_erase_addr() reentrant
//
// Purpose:
//   set media-specific address from internal zone/wr_phy_blk
//
// Arguments:
//  TBD
//
// Return:
//  k_success always
//
// Notes:
//  The block to be erased should be in g_addr_wr_phy_blk before this 
//  function is called
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result sm_media_set_erase_addr() reentrant ;
#undef _v_media_set_erase_addr
#define _v_media_set_erase_addr sm_media_set_erase_addr

//+-----------------------------------------------------------------------------
// Name:
//   media_block_has_bad_data()
//
// Declaration:
//   t_result media_block_has_bad_data() reentrant
//
// Purpose:
//   scan blocks to find out whether or not a block contains a page that has 
//   a bad data flag.  This is used for smart media controller who must detect
//   data-gone-bad flag which can't do so at run-time
//
// Arguments:
//
// Return:
//  k_true  if a page between 0 and g_addr_rd_page contains extra data with 
//          'failed' status
//
//  k_false if all pages have good data status
//
// Notes:
//
// Since:
//   fmc-1.0
//------------------------------------------------------------------------------
t_result sm_media_block_has_bad_data() reentrant ;
#undef _v_media_block_has_bad_data
#define _v_media_block_has_bad_data sm_media_block_has_bad_data


//------------------------------------------------------------------------------
// virtual method table
typedef uint8 t_sm_media_vtbl_ix ;
typedef enum e_sm_media_vtbl_entry
{
  k_sm_media_vtbl_sz = k_media_vtbl_sz
} ;

// sm class definition:
#define _v_sm_media _v_media

// sm class vtable declaration & vtable size declaration
extern code  _vtbl_decl(sm_media) ;

#else
#error "warning: header included too many times!"
#endif  // __sm_media_dot_h__

//---eof------------------------------------------------------------------------

⌨️ 快捷键说明

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