From owner-svn-src-projects@freebsd.org Wed Oct 28 11:25:30 2015 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6041DA1F41C for ; Wed, 28 Oct 2015 11:25:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 139DA19AE; Wed, 28 Oct 2015 11:25:30 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9SBPTlb030836; Wed, 28 Oct 2015 11:25:29 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9SBPTOw030834; Wed, 28 Oct 2015 11:25:29 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201510281125.t9SBPTOw030834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 28 Oct 2015 11:25:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r290095 - projects/mpsutil/usr.sbin/mpsutil X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Oct 2015 11:25:30 -0000 Author: bapt Date: Wed Oct 28 11:25:28 2015 New Revision: 290095 URL: https://svnweb.freebsd.org/changeset/base/290095 Log: Remove some unused code from the mptutil(8) The code from mptutil living in the same source tree the day those functions will be implemented in the mpsutil(8) it can be copy/paste easily Sponsored by: Gandi.net Modified: projects/mpsutil/usr.sbin/mpsutil/mps_cmd.c projects/mpsutil/usr.sbin/mpsutil/mpsutil.h Modified: projects/mpsutil/usr.sbin/mpsutil/mps_cmd.c ============================================================================== --- projects/mpsutil/usr.sbin/mpsutil/mps_cmd.c Wed Oct 28 11:22:30 2015 (r290094) +++ projects/mpsutil/usr.sbin/mpsutil/mps_cmd.c Wed Oct 28 11:25:28 2015 (r290095) @@ -559,87 +559,6 @@ mps_read_extended_config_page(int fd, U8 } #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) { Modified: projects/mpsutil/usr.sbin/mpsutil/mpsutil.h ============================================================================== --- projects/mpsutil/usr.sbin/mpsutil/mpsutil.h Wed Oct 28 11:22:30 2015 (r290094) +++ projects/mpsutil/usr.sbin/mpsutil/mpsutil.h Wed Oct 28 11:25:28 2015 (r290095) @@ -122,30 +122,6 @@ void *mps_read_extended_config_page(int 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)