1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
  | 
/*********************************************************************
*
*   Copyright (C) 2012 Motorola, Inc.
*
**********************************************************************
File    : MemMapDownload.h
Purpose :
**********************************************************************/
#ifndef __MEMMAP_DOWNLOAD_H__
#define __MEMMAP_DOWNLOAD_H__
/****************************** Defines *******************************/
/* These enums and defines need to match up with the enums
 * in m4sensorhub_client_ioctl.h
 */
#define M4SH_DL_FILENAME_SIZE 16
#define M4SH_DL_PACKET_SIZE 100
enum download_error_codes {
  DOWNLOAD_SUCCESS,
  DOWNLOAD_ERROR_GET_CHECKSUM,
  DOWNLOAD_ERROR_OPEN_FILE,
  DOWNLOAD_ERROR_WRITE_FILE,
  DOWNLOAD_ERROR_CLOSE_FILE,
  DOWNLOAD_ERROR_DELETE_FILE,
  DOWNLOAD_ERROR_INVALID_SIZE,
  /*internal error code for M4<==>Kernel*/
  DOWNLOAD_ERROR_SEND_CMD = 0x80,
  DOWNLOAD_ERROR_DATA_CHECKSUM,
};
enum downloadCmds {
  DOWNLOAD_CMD_GET_CHECKSUM,
  DOWNLOAD_CMD_OPEN_FILE,
  DOWNLOAD_CMD_WRITE_FILE,
  DOWNLOAD_CMD_CLOSE_FILE,
  DOWNLOAD_CMD_DELETE_FILE,
};
typedef struct memMapDownload {
  u8 version;
  u8 command;
  u8 status;
  u8 size;
  u32 checksum;
  u8 filename[M4SH_DL_FILENAME_SIZE];
  u8 packet[M4SH_DL_PACKET_SIZE];
} sDownload;
#endif /*__MEMMAP_DOWNLOAD_H__*/
  |