| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2011, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: $ |
|---|
| 11 | * $brcm_Revision: $ |
|---|
| 12 | * $brcm_Date: $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: UDTA message storage interface. |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: $ |
|---|
| 19 | * |
|---|
| 20 | * |
|---|
| 21 | ***************************************************************************/ |
|---|
| 22 | #if !defined(__umstore_h__) |
|---|
| 23 | #define __umstore_h__ |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | #define BUMS_OK 0 |
|---|
| 27 | #define BUMS_ERROR 1 |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | #define BUMS_ID_START 100 |
|---|
| 31 | #define BUMS_ID_CA_SYS_ID BUMS_ID_START |
|---|
| 32 | /* must point to the last defined id */ |
|---|
| 33 | #define BUMS_ID_LAST BUMS_ID_CA_SYS_ID |
|---|
| 34 | |
|---|
| 35 | typedef struct bums_data_t * bums_handle; |
|---|
| 36 | |
|---|
| 37 | /*************************************************************************** |
|---|
| 38 | Summary: |
|---|
| 39 | Open flash database and initialize it for access. |
|---|
| 40 | Description: |
|---|
| 41 | Database will be positioned on the first valid record; |
|---|
| 42 | Input: |
|---|
| 43 | Output: |
|---|
| 44 | Returns: |
|---|
| 45 | SeeAlso: |
|---|
| 46 | None |
|---|
| 47 | ***************************************************************************/ |
|---|
| 48 | void bums_open(void); |
|---|
| 49 | |
|---|
| 50 | /*************************************************************************** |
|---|
| 51 | Summary: |
|---|
| 52 | Close flash database and free data structures |
|---|
| 53 | Description: |
|---|
| 54 | Database is closed and all allocated memory is freed. |
|---|
| 55 | Input: |
|---|
| 56 | Output: |
|---|
| 57 | Returns: |
|---|
| 58 | SeeAlso: |
|---|
| 59 | None |
|---|
| 60 | ***************************************************************************/ |
|---|
| 61 | void bums_close(void); |
|---|
| 62 | |
|---|
| 63 | /*************************************************************************** |
|---|
| 64 | Summary: |
|---|
| 65 | Read data with given ID from the database. |
|---|
| 66 | Description: |
|---|
| 67 | Read data from the database and place it in the provided memory. |
|---|
| 68 | If there is no record in the database return error. |
|---|
| 69 | Input: |
|---|
| 70 | Output: |
|---|
| 71 | Returns: |
|---|
| 72 | SeeAlso: |
|---|
| 73 | None |
|---|
| 74 | ***************************************************************************/ |
|---|
| 75 | int bums_read_data(unsigned char data_id, char * data, size_t size); |
|---|
| 76 | |
|---|
| 77 | /*************************************************************************** |
|---|
| 78 | Summary: |
|---|
| 79 | Write data with given ID in to the database. |
|---|
| 80 | Description: |
|---|
| 81 | Write data in to the database. |
|---|
| 82 | Previous data with the same ID will be replaced with the new data. |
|---|
| 83 | Input: |
|---|
| 84 | Output: |
|---|
| 85 | Returns: |
|---|
| 86 | SeeAlso: |
|---|
| 87 | None |
|---|
| 88 | ***************************************************************************/ |
|---|
| 89 | int bums_write_data(unsigned char data_id, char * data, size_t size); |
|---|
| 90 | |
|---|
| 91 | /*************************************************************************** |
|---|
| 92 | Summary: |
|---|
| 93 | Erase data with given ID from the database. |
|---|
| 94 | Description: |
|---|
| 95 | Erase data from the database. |
|---|
| 96 | Previous data with the same ID will be replaced with the new data. |
|---|
| 97 | Input: |
|---|
| 98 | Output: |
|---|
| 99 | Returns: |
|---|
| 100 | SeeAlso: |
|---|
| 101 | None |
|---|
| 102 | ***************************************************************************/ |
|---|
| 103 | int bums_delete_data(unsigned char data_id); |
|---|
| 104 | |
|---|
| 105 | #endif |
|---|