📄 ethdown.h
字号:
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Copyright (c) 1995, 1996, 1997, 1998 Microsoft Corporation
*/
/*
** INTEL CONFIDENTIAL
** Copyright 2000-2003 Intel Corporation All Rights Reserved.
**
** The source code contained or described herein and all documents
** related to the source code (Material) are owned by Intel Corporation
** or its suppliers or licensors. Title to the Material remains with
** Intel Corporation or its suppliers and licensors. The Material contains
** trade secrets and proprietary and confidential information of Intel
** or its suppliers and licensors. The Material is protected by worldwide
** copyright and trade secret laws and treaty provisions. No part of the
** Material may be used, copied, reproduced, modified, published, uploaded,
** posted, transmitted, distributed, or disclosed in any way without Intel抯
** prior express written permission.
** No license under any patent, copyright, trade secret or other intellectual
** property right is granted to or conferred upon you by disclosure or
** delivery of the Materials, either expressly, by implication, inducement,
** estoppel or otherwise. Any license under such intellectual property rights
** must be express and approved by Intel in writing.
*/
/*
Module Name:
ethdown.h
Abstract:
This contains the ethdown.c specific data structure declarations.
Functions:
Notes:
Revision History:
--*/
#ifndef ETHDOWN_H
#define ETHDOWN_H
// In order to parse the BIN file as it is handed to the EthDown() routine, I need a state machine because
// the record headers can be broken across packets. The state of the state machine indicates the value
// that the routine is trying to extract from the packet.
typedef enum {
BIN_PHYSADDR, // Record header physical address field
BIN_PHYSLEN, // Record header physical length field
BIN_CHECKSUM, // Record header checksum field
BIN_DATA // Record data
} BINFileParseStates;
// These are the commands that can be sent to the EraseFlash() and WriteFlash() routines. The EthDown()
// call back will invoke WriteFlash() for each DWORD that is written to the memory.
typedef enum {
FLASH_START_ERASE, // Begin the erase process.
FLASH_CONT_ERASE // Continue erasing flash pages from the current position. If all flash pages have
// been erased, just return.
} FlashCommands;
// These are the possible states that a flash block can be in. The state of a flash block is stored in
// the global EraseStatus array and can be changed by either FlashErase() or FlashWrite().
typedef enum {
BLOCK_DIRTY, // The block contains unknown data and has not been erased
BLOCK_PENDING, // An erase command has been issued for the block but it has not yet completed
BLOCK_ERASED, // The block has been erased and is ready for programming
BLOCK_FLASHED // The block has been programmed and is ready for use
} EraseStatusType;
extern DWORD fWriteToFlash;
extern DWORD dwPhysStart; // image physical starting address
extern DWORD dwPhysLen; // image physical length
UINT16 EthDown( char *pszFileName, TFtpdCallBackOps Operation, BYTE *pbData, UINT16 *cwLength, char **ppszErrorMsg );
UINT16 FlashWrite( DWORD dwPhysStart, DWORD dwPhysLen);
UINT16 IsFlash( DWORD dwPhysStart, DWORD dwPhysLen );
UINT16 FlashErase(DWORD dwPhysStart, DWORD dwPhysLen);
UINT16 FlashError( volatile DWORD *pdwBSR, char **ppszErrorMsg );
UINT16 FlashPageWrite( volatile DWORD *pdwFlash, DWORD *pdwFlashCache, DWORD dwDWORDsLeft, char **ppszErrorMsg );
UINT16 FlashClose( DWORD dwPhysStart, DWORD dwPhysLen, char **ppszErrorMsg );
void UploadDeviceInfo( DWORD dwBank );
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -