Deleted Added
full compact
mfiutil.h (249257) mfiutil.h (251516)
1/*-
2 * Copyright (c) 2008, 2009 Yahoo!, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*-
2 * Copyright (c) 2008, 2009 Yahoo!, Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: head/usr.sbin/mfiutil/mfiutil.h 249257 2013-04-08 17:46:45Z markj $
29 * $FreeBSD: head/usr.sbin/mfiutil/mfiutil.h 251516 2013-06-08 02:54:59Z sbruno $
30 */
31
32#ifndef __MFIUTIL_H__
33#define __MFIUTIL_H__
34
35#include <sys/cdefs.h>
36#include <sys/linker_set.h>
37

--- 81 unchanged lines hidden (view full) ---

119#define MFI_DNAME_ES 0x0001 /* E%u:S%u */
120#define MFI_DNAME_DEVICE_ID 0x0002 /* %u */
121#define MFI_DNAME_HONOR_OPTS 0x8000 /* Allow cmd line to override default */
122
123extern int mfi_unit;
124
125extern u_int mfi_opts;
126
30 */
31
32#ifndef __MFIUTIL_H__
33#define __MFIUTIL_H__
34
35#include <sys/cdefs.h>
36#include <sys/linker_set.h>
37

--- 81 unchanged lines hidden (view full) ---

119#define MFI_DNAME_ES 0x0001 /* E%u:S%u */
120#define MFI_DNAME_DEVICE_ID 0x0002 /* %u */
121#define MFI_DNAME_HONOR_OPTS 0x8000 /* Allow cmd line to override default */
122
123extern int mfi_unit;
124
125extern u_int mfi_opts;
126
127/* We currently don't know the full details of the following struct */
128struct mfi_foreign_scan_cfg {
129 char data[24];
130};
131
132struct mfi_foreign_scan_info {
133 uint32_t count; /* Number of foreign configs found */
134 struct mfi_foreign_scan_cfg cfgs[8];
135};
136
127void mbox_store_ldref(uint8_t *mbox, union mfi_ld_ref *ref);
128void mbox_store_pdref(uint8_t *mbox, union mfi_pd_ref *ref);
129void mfi_display_progress(const char *label, struct mfi_progress *prog);
130int mfi_table_handler(struct mfiutil_command **start,
131 struct mfiutil_command **end, int ac, char **av);
132const char *mfi_raid_level(uint8_t primary_level, uint8_t secondary_level);
133const char *mfi_ldstate(enum mfi_ld_state state);
134const char *mfi_pdstate(enum mfi_pd_state state);
135const char *mfi_pd_inq_string(struct mfi_pd_info *info);
136const char *mfi_volume_name(int fd, uint8_t target_id);
137int mfi_volume_busy(int fd, uint8_t target_id);
138int mfi_config_read(int fd, struct mfi_config_data **configp);
137void mbox_store_ldref(uint8_t *mbox, union mfi_ld_ref *ref);
138void mbox_store_pdref(uint8_t *mbox, union mfi_pd_ref *ref);
139void mfi_display_progress(const char *label, struct mfi_progress *prog);
140int mfi_table_handler(struct mfiutil_command **start,
141 struct mfiutil_command **end, int ac, char **av);
142const char *mfi_raid_level(uint8_t primary_level, uint8_t secondary_level);
143const char *mfi_ldstate(enum mfi_ld_state state);
144const char *mfi_pdstate(enum mfi_pd_state state);
145const char *mfi_pd_inq_string(struct mfi_pd_info *info);
146const char *mfi_volume_name(int fd, uint8_t target_id);
147int mfi_volume_busy(int fd, uint8_t target_id);
148int mfi_config_read(int fd, struct mfi_config_data **configp);
149int mfi_config_read_opcode(int fd, uint32_t opcode,
150 struct mfi_config_data **configp, uint8_t *mbox, size_t mboxlen);
139int mfi_lookup_drive(int fd, char *drive, uint16_t *device_id);
140int mfi_lookup_volume(int fd, const char *name, uint8_t *target_id);
141int mfi_dcmd_command(int fd, uint32_t opcode, void *buf, size_t bufsize,
142 uint8_t *mbox, size_t mboxlen, uint8_t *statusp);
143int mfi_open(int unit, int acs);
144int mfi_ctrl_get_info(int fd, struct mfi_ctrl_info *info, uint8_t *statusp);
145int mfi_ld_get_info(int fd, uint8_t target_id, struct mfi_ld_info *info,
146 uint8_t *statusp);
147int mfi_ld_get_list(int fd, struct mfi_ld_list *list, uint8_t *statusp);
148int mfi_pd_get_info(int fd, uint16_t device_id, struct mfi_pd_info *info,
149 uint8_t *statusp);
150int mfi_pd_get_list(int fd, struct mfi_pd_list **listp, uint8_t *statusp);
151int mfi_reconfig_supported(void);
152const char *mfi_status(u_int status_code);
153const char *mfi_drive_name(struct mfi_pd_info *pinfo, uint16_t device_id,
154 uint32_t def);
151int mfi_lookup_drive(int fd, char *drive, uint16_t *device_id);
152int mfi_lookup_volume(int fd, const char *name, uint8_t *target_id);
153int mfi_dcmd_command(int fd, uint32_t opcode, void *buf, size_t bufsize,
154 uint8_t *mbox, size_t mboxlen, uint8_t *statusp);
155int mfi_open(int unit, int acs);
156int mfi_ctrl_get_info(int fd, struct mfi_ctrl_info *info, uint8_t *statusp);
157int mfi_ld_get_info(int fd, uint8_t target_id, struct mfi_ld_info *info,
158 uint8_t *statusp);
159int mfi_ld_get_list(int fd, struct mfi_ld_list *list, uint8_t *statusp);
160int mfi_pd_get_info(int fd, uint16_t device_id, struct mfi_pd_info *info,
161 uint8_t *statusp);
162int mfi_pd_get_list(int fd, struct mfi_pd_list **listp, uint8_t *statusp);
163int mfi_reconfig_supported(void);
164const char *mfi_status(u_int status_code);
165const char *mfi_drive_name(struct mfi_pd_info *pinfo, uint16_t device_id,
166 uint32_t def);
167void format_stripe(char *buf, size_t buflen, uint8_t stripe);
168void print_ld(struct mfi_ld_info *info, int state_len);
169void print_pd(struct mfi_pd_info *info, int state_len);
170void dump_config(int fd, struct mfi_config_data *config, const char *msg_prefix);
155int mfi_bbu_get_props(int fd, struct mfi_bbu_properties *props,
156 uint8_t *statusp);
157int mfi_bbu_set_props(int fd, struct mfi_bbu_properties *props,
158 uint8_t *statusp);
159void mfi_autolearn_period(uint32_t, char *, size_t);
160void mfi_next_learn_time(uint32_t, char *, size_t);
161void mfi_autolearn_mode(uint8_t, char *, size_t);
162
163void scan_firmware(struct mfi_info_component *comp);
164void display_firmware(struct mfi_info_component *comp, const char *tag);
165
171int mfi_bbu_get_props(int fd, struct mfi_bbu_properties *props,
172 uint8_t *statusp);
173int mfi_bbu_set_props(int fd, struct mfi_bbu_properties *props,
174 uint8_t *statusp);
175void mfi_autolearn_period(uint32_t, char *, size_t);
176void mfi_next_learn_time(uint32_t, char *, size_t);
177void mfi_autolearn_mode(uint8_t, char *, size_t);
178
179void scan_firmware(struct mfi_info_component *comp);
180void display_firmware(struct mfi_info_component *comp, const char *tag);
181
182int display_format(int ac, char **av, int diagnostic, mfi_dcmd_t display_cmd);
166#endif /* !__MFIUTIL_H__ */
183#endif /* !__MFIUTIL_H__ */