summaryrefslogtreecommitdiff
path: root/src/flash/nand.h
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-13 11:32:17 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-13 11:58:14 -0800
commit2f6e56e38320350bb300b363d0b3737fa8d1f3ea (patch)
tree18a4c4b3d39b789af7c8fe44387888c7ec4f294b /src/flash/nand.h
parent0f1163e823c6ca3c2a81fa296157f5dde0635fea (diff)
downloadopenocd+libswd-2f6e56e38320350bb300b363d0b3737fa8d1f3ea.tar.gz
openocd+libswd-2f6e56e38320350bb300b363d0b3737fa8d1f3ea.tar.bz2
openocd+libswd-2f6e56e38320350bb300b363d0b3737fa8d1f3ea.tar.xz
openocd+libswd-2f6e56e38320350bb300b363d0b3737fa8d1f3ea.zip
nand_device_t -> struct nand_device
Remove misleading typedef and redundant suffix from struct nand_device.
Diffstat (limited to 'src/flash/nand.h')
-rw-r--r--src/flash/nand.h48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/flash/nand.h b/src/flash/nand.h
index c6d40751..80963095 100644
--- a/src/flash/nand.h
+++ b/src/flash/nand.h
@@ -27,28 +27,28 @@
#include "flash.h"
-struct nand_device_s;
+struct nand_device;
#define __NAND_DEVICE_COMMAND(name) \
- COMMAND_HELPER(name, struct nand_device_s *nand)
+ COMMAND_HELPER(name, struct nand_device *nand)
struct nand_flash_controller
{
char *name;
__NAND_DEVICE_COMMAND((*nand_device_command));
int (*register_commands)(struct command_context_s *cmd_ctx);
- int (*init)(struct nand_device_s *nand);
- int (*reset)(struct nand_device_s *nand);
- int (*command)(struct nand_device_s *nand, uint8_t command);
- int (*address)(struct nand_device_s *nand, uint8_t address);
- int (*write_data)(struct nand_device_s *nand, uint16_t data);
- int (*read_data)(struct nand_device_s *nand, void *data);
- int (*write_block_data)(struct nand_device_s *nand, uint8_t *data, int size);
- int (*read_block_data)(struct nand_device_s *nand, uint8_t *data, int size);
- int (*write_page)(struct nand_device_s *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size);
- int (*read_page)(struct nand_device_s *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size);
- int (*controller_ready)(struct nand_device_s *nand, int timeout);
- int (*nand_ready)(struct nand_device_s *nand, int timeout);
+ int (*init)(struct nand_device *nand);
+ int (*reset)(struct nand_device *nand);
+ int (*command)(struct nand_device *nand, uint8_t command);
+ int (*address)(struct nand_device *nand, uint8_t address);
+ int (*write_data)(struct nand_device *nand, uint16_t data);
+ int (*read_data)(struct nand_device *nand, void *data);
+ int (*write_block_data)(struct nand_device *nand, uint8_t *data, int size);
+ int (*read_block_data)(struct nand_device *nand, uint8_t *data, int size);
+ int (*write_page)(struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size);
+ int (*read_page)(struct nand_device *nand, uint32_t page, uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size);
+ int (*controller_ready)(struct nand_device *nand, int timeout);
+ int (*nand_ready)(struct nand_device *nand, int timeout);
};
#define NAND_DEVICE_COMMAND_HANDLER(name) static __NAND_DEVICE_COMMAND(name)
@@ -73,7 +73,7 @@ struct nand_ecclayout {
struct nand_oobfree oobfree[2];
};
-typedef struct nand_device_s
+struct nand_device
{
struct nand_flash_controller *controller;
void *controller_priv;
@@ -86,8 +86,8 @@ typedef struct nand_device_s
int use_raw;
int num_blocks;
struct nand_block *blocks;
- struct nand_device_s *next;
-} nand_device_t;
+ struct nand_device *next;
+};
/* NAND Flash Manufacturer ID Codes
*/
@@ -212,18 +212,18 @@ enum oob_formats
};
-nand_device_t *get_nand_device_by_num(int num);
+struct nand_device *get_nand_device_by_num(int num);
-int nand_read_page_raw(struct nand_device_s *nand, uint32_t page,
+int nand_read_page_raw(struct nand_device *nand, uint32_t page,
uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size);
-int nand_write_page_raw(struct nand_device_s *nand, uint32_t page,
+int nand_write_page_raw(struct nand_device *nand, uint32_t page,
uint8_t *data, uint32_t data_size, uint8_t *oob, uint32_t oob_size);
-int nand_read_status(struct nand_device_s *nand, uint8_t *status);
+int nand_read_status(struct nand_device *nand, uint8_t *status);
-int nand_calculate_ecc(struct nand_device_s *nand,
+int nand_calculate_ecc(struct nand_device *nand,
const uint8_t *dat, uint8_t *ecc_code);
-int nand_calculate_ecc_kw(struct nand_device_s *nand,
+int nand_calculate_ecc_kw(struct nand_device *nand,
const uint8_t *dat, uint8_t *ecc_code);
int nand_register_commands(struct command_context_s *cmd_ctx);
@@ -231,7 +231,7 @@ int nand_init(struct command_context_s *cmd_ctx);
/// helper for parsing a nand device command argument string
int nand_command_get_device_by_num(struct command_context_s *cmd_ctx,
- const char *str, nand_device_t **nand);
+ const char *str, struct nand_device **nand);
#define ERROR_NAND_DEVICE_INVALID (-1100)