diff --git a/usr.sbin/mpsutil/mps_cmd.c b/usr.sbin/mpsutil/mps_cmd.c index 436992b94bd1..2701773a8118 100644 --- a/usr.sbin/mpsutil/mps_cmd.c +++ b/usr.sbin/mpsutil/mps_cmd.c @@ -559,87 +559,6 @@ mps_read_extended_config_page(int fd, U8 ExtPageType, U8 PageVersion, } #endif -#if 0 -int -mpt_write_config_page(int fd, void *buf, U16 *IOCStatus) -{ - CONFIG_PAGE_HEADER *hdr; - struct mpt_cfg_page_req req; - - if (IOCStatus != NULL) - *IOCStatus = MPI_IOCSTATUS_SUCCESS; - bzero(&req, sizeof(req)); - req.buf = buf; - hdr = buf; - req.len = hdr->PageLength * 4; - if (ioctl(fd, MPTIO_WRITE_CFG_PAGE, &req) < 0) - return (errno); - if (!IOC_STATUS_SUCCESS(req.ioc_status)) { - if (IOCStatus != NULL) { - *IOCStatus = req.ioc_status; - return (0); - } - warnx("Writing config page failed: %s", - mpt_ioc_status(req.ioc_status)); - return (EIO); - } - return (0); -} - -int -mpt_raid_action(int fd, U8 Action, U8 VolumeBus, U8 VolumeID, U8 PhysDiskNum, - U32 ActionDataWord, void *buf, int len, RAID_VOL0_STATUS *VolumeStatus, - U32 *ActionData, int datalen, U16 *IOCStatus, U16 *ActionStatus, int write) -{ - struct mpt_raid_action raid_act; - - if (IOCStatus != NULL) - *IOCStatus = MPI_IOCSTATUS_SUCCESS; - if (datalen < 0 || (unsigned)datalen > sizeof(raid_act.action_data)) - return (EINVAL); - bzero(&raid_act, sizeof(raid_act)); - raid_act.action = Action; - raid_act.volume_bus = VolumeBus; - raid_act.volume_id = VolumeID; - raid_act.phys_disk_num = PhysDiskNum; - raid_act.action_data_word = ActionDataWord; - if (buf != NULL && len != 0) { - raid_act.buf = buf; - raid_act.len = len; - raid_act.write = write; - } - - if (ioctl(fd, MPTIO_RAID_ACTION, &raid_act) < 0) - return (errno); - - if (!IOC_STATUS_SUCCESS(raid_act.ioc_status)) { - if (IOCStatus != NULL) { - *IOCStatus = raid_act.ioc_status; - return (0); - } - warnx("RAID action failed: %s", - mpt_ioc_status(raid_act.ioc_status)); - return (EIO); - } - - if (ActionStatus != NULL) - *ActionStatus = raid_act.action_status; - if (raid_act.action_status != MPI_RAID_ACTION_ASTATUS_SUCCESS) { - if (ActionStatus != NULL) - return (0); - warnx("RAID action failed: %s", - mpt_raid_status(raid_act.action_status)); - return (EIO); - } - - if (VolumeStatus != NULL) - *((U32 *)VolumeStatus) = raid_act.volume_status; - if (ActionData != NULL) - bcopy(raid_act.action_data, ActionData, datalen); - return (0); -} -#endif - int mps_open(int unit) { diff --git a/usr.sbin/mpsutil/mpsutil.h b/usr.sbin/mpsutil/mpsutil.h index 393095102200..184238406af4 100644 --- a/usr.sbin/mpsutil/mpsutil.h +++ b/usr.sbin/mpsutil/mpsutil.h @@ -122,30 +122,6 @@ void *mps_read_extended_config_page(int fd, U8 ExtPageType, U8 PageVersion, int mps_map_btdh(int fd, uint16_t *devhandle, uint16_t *bus, uint16_t *target); const char *mps_ioc_status(U16 IOCStatus); -#if 0 -int mpt_write_config_page(int fd, void *buf, U16 *IOCStatus); -int mpt_raid_action(int fd, U8 Action, U8 VolumeBus, U8 VolumeID, - U8 PhysDiskNum, U32 ActionDataWord, void *buf, int len, - RAID_VOL0_STATUS *VolumeStatus, U32 *ActionData, int datalen, - U16 *IOCStatus, U16 *ActionStatus, int write); -const char *mpt_raid_status(U16 ActionStatus); -const char *mpt_raid_level(U8 VolumeType); -const char *mpt_volstate(U8 State); -const char *mpt_pdstate(CONFIG_PAGE_RAID_PHYS_DISK_0 *info); -const char *mpt_pd_inq_string(CONFIG_PAGE_RAID_PHYS_DISK_0 *pd_info); -struct mpt_drive_list *mpt_pd_list(int fd); -void mpt_free_pd_list(struct mpt_drive_list *list); -int mpt_query_disk(U8 VolumeBus, U8 VolumeID, struct mpt_query_disk *qd); -const char *mpt_volume_name(U8 VolumeBus, U8 VolumeID); -int mpt_fetch_disks(int fd, int *ndisks, - struct mpt_standalone_disk **disksp); -int mpt_lock_volume(U8 VolumeBus, U8 VolumeID); -int mpt_lookup_drive(struct mpt_drive_list *list, const char *drive, - U8 *PhysDiskNum); -int mpt_lookup_volume(int fd, const char *name, U8 *VolumeBus, - U8 *VolumeID); -int mpt_rescan_bus(int bus, int id); -#endif static __inline void * mps_read_man_page(int fd, U8 PageNumber, U16 *IOCStatus)