zdev: Prepare for firmware configuration file support

Apply some changes to existing functions and data structures to simplify
the firmware configuration file support implementation.

 - Make qeth and dasd subtype objects non-static
 - Change the existing helper functions for reading file contents into
   memory to also support binary functions
 - Move some configuration file import functions to make them available
   for use in other source files

Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Peter Oberparleiter
2017-09-01 11:05:51 +02:00
committed by Jan Höppner
parent e14363373b
commit ab4445c261
10 changed files with 62 additions and 31 deletions

View File

@@ -11,7 +11,10 @@
#define DASD_H
struct devtype;
struct subtype;
extern struct devtype dasd_devtype;
extern struct subtype dasd_subtype_eckd;
extern struct subtype dasd_subtype_fba;
#endif /* DASD_H */

View File

@@ -94,5 +94,7 @@ void device_list_add(struct device_list *, struct device *);
struct device *device_list_find(struct device_list *, const char *,
struct device *);
void device_list_print(struct device_list *, int);
struct setting_list *device_get_setting_list(struct device *dev,
config_t config);
#endif /* DEVICE_H */

View File

@@ -31,6 +31,7 @@ struct export_object {
} ptr;
};
struct export_object *object_new(export_t type, void *ptr);
exit_code_t export_write_device(FILE *, struct device *, config_t, int *);
exit_code_t export_write_devtype(FILE *, struct devtype *, config_t, int *);
exit_code_t export_read(FILE *, const char *, struct util_list *);

View File

@@ -159,6 +159,7 @@ bool misc_read_dir(const char *, struct util_list *,
bool (*)(const char *, void *), void *);
bool file_is_devnode(const char *);
exit_code_t remove_file(const char *);
exit_code_t misc_read_fd(FILE *fd, void **buffer, size_t *size_ptr);
char *misc_read_text_file(const char *, int, err_t);
char *misc_read_cmd_output(const char *, int, err_t);
char *config_read_cmd_output(const char *, int, err_t);

View File

@@ -17,9 +17,11 @@
#define QETH_NUM_DEVS 3
struct devtype;
struct subtype;
struct namespace;
extern struct devtype qeth_devtype;
extern struct subtype qeth_subtype_qeth;
extern struct namespace qeth_namespace;
#endif /* QETH_H */