Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Oct 2015 11:25:29 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r290095 - projects/mpsutil/usr.sbin/mpsutil
Message-ID:  <201510281125.t9SBPTOw030834@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510281125.t9SBPTOw030834>