Index: uspace/drv/bus/usb/usbmast/Makefile
===================================================================
--- uspace/drv/bus/usb/usbmast/Makefile	(revision 3f08fd2b9072227f3006fed60b75c6f38e7ac5d9)
+++ uspace/drv/bus/usb/usbmast/Makefile	(revision 6430ac661819d10cb7663b8bcf52df3572827c85)
@@ -45,7 +45,7 @@
 SOURCES = \
 	cmds.c \
-	inquiry.c \
 	main.c \
-	mast.c
+	mast.c \
+	scsi_ms.c
 
 include $(USPACE_PREFIX)/Makefile.common
Index: pace/drv/bus/usb/usbmast/inquiry.c
===================================================================
--- uspace/drv/bus/usb/usbmast/inquiry.c	(revision 3f08fd2b9072227f3006fed60b75c6f38e7ac5d9)
+++ 	(revision )
@@ -1,122 +1,0 @@
-/*
- * Copyright (c) 2011 Vojtech Horky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup drvusbmast
- * @{
- */
-/**
- * @file
- * Main routines of USB mass storage driver.
- */
-#include <bitops.h>
-#include <usb/dev/driver.h>
-#include <usb/debug.h>
-#include <usb/classes/classes.h>
-#include <usb/classes/massstor.h>
-#include <errno.h>
-#include <str_error.h>
-#include <str.h>
-#include <ctype.h>
-#include <scsi/spc.h>
-#include "cmds.h"
-#include "mast.h"
-
-/** Get string representation for SCSI peripheral device type.
- *
- * @param type SCSI peripheral device type code.
- * @return String representation.
- */
-const char *usb_str_masstor_scsi_peripheral_device_type(unsigned type)
-{
-	return scsi_get_dev_type_str(type);
-}
-
-/** Perform SCSI INQUIRY command on USB mass storage device.
- *
- * @param dev USB device.
- * @param bulk_in_idx Index (in dev->pipes) of bulk in pipe.
- * @param bulk_out_idx Index of bulk out pipe.
- * @param inquiry_result Where to store parsed inquiry result.
- * @return Error code.
- */
-int usb_massstor_inquiry(usb_device_t *dev,
-    usb_massstor_inquiry_result_t *inquiry_result)
-{
-	scsi_std_inquiry_data_t inq_data;
-	size_t response_len;
-	scsi_cdb_inquiry_t inquiry = {
-		.op_code = SCSI_CMD_INQUIRY,
-		.evpd = 0,
-		.page_code = 0,
-		.alloc_len = host2uint16_t_be(sizeof(inq_data)),
-		.control = 0
-	};
-
-	int rc;
-
-	rc = usb_massstor_data_in(dev, 0xDEADBEEF, 0, (uint8_t *) &inquiry,
-	    sizeof(inquiry), &inq_data, sizeof(inq_data), &response_len);
-
-	if (rc != EOK) {
-		usb_log_error("Failed to probe device %s using %s: %s.\n",
-		   dev->ddf_dev->name, "SCSI:INQUIRY", str_error(rc));
-		return rc;
-	}
-
-	if (response_len < SCSI_STD_INQUIRY_DATA_MIN_SIZE) {
-		usb_log_error("The SCSI inquiry response is too short.\n");
-		return EIO;
-	}
-
-	/*
-	 * Parse inquiry data and fill in the result structure.
-	 */
-
-	bzero(inquiry_result, sizeof(*inquiry_result));
-
-	inquiry_result->device_type = BIT_RANGE_EXTRACT(uint8_t,
-	    inq_data.pqual_devtype, SCSI_PQDT_DEV_TYPE_h, SCSI_PQDT_DEV_TYPE_l);
-
-	inquiry_result->removable = BIT_RANGE_EXTRACT(uint8_t,
-	    inq_data.rmb, SCSI_RMB_RMB, SCSI_RMB_RMB);
-
-	spascii_to_str(inquiry_result->vendor, SCSI_INQ_VENDOR_STR_BUFSIZE,
-	    inq_data.vendor, sizeof(inq_data.vendor));
-
-	spascii_to_str(inquiry_result->product, SCSI_INQ_PRODUCT_STR_BUFSIZE,
-	    inq_data.product, sizeof(inq_data.product));
-
-	spascii_to_str(inquiry_result->revision, SCSI_INQ_REVISION_STR_BUFSIZE,
-	    inq_data.revision, sizeof(inq_data.revision));
-
-	return EOK;
-}
-
-/**
- * @}
- */
Index: uspace/drv/bus/usb/usbmast/main.c
===================================================================
--- uspace/drv/bus/usb/usbmast/main.c	(revision 3f08fd2b9072227f3006fed60b75c6f38e7ac5d9)
+++ uspace/drv/bus/usb/usbmast/main.c	(revision 6430ac661819d10cb7663b8bcf52df3572827c85)
@@ -42,4 +42,5 @@
 #include "cmds.h"
 #include "mast.h"
+#include "scsi_ms.h"
 
 #define NAME "usbmast"
@@ -107,6 +108,6 @@
 
 	usb_log_debug("Inquire...\n");
-	usb_massstor_inquiry_result_t inquiry;
-	rc = usb_massstor_inquiry(dev, &inquiry);
+	usbmast_inquiry_data_t inquiry;
+	rc = usbmast_inquiry(dev, &inquiry);
 	if (rc != EOK) {
 		usb_log_warning("Failed to inquire device `%s': %s.\n",
@@ -121,5 +122,5 @@
 	    inquiry.vendor,
 	    inquiry.revision,
-	    usb_str_masstor_scsi_peripheral_device_type(inquiry.device_type),
+	    usbmast_scsi_dev_type_str(inquiry.device_type),
 	    inquiry.removable ? "removable" : "non-removable",
 	    lun_count);
Index: uspace/drv/bus/usb/usbmast/mast.h
===================================================================
--- uspace/drv/bus/usb/usbmast/mast.h	(revision 3f08fd2b9072227f3006fed60b75c6f38e7ac5d9)
+++ uspace/drv/bus/usb/usbmast/mast.h	(revision 6430ac661819d10cb7663b8bcf52df3572827c85)
@@ -46,21 +46,4 @@
 #define BULK_OUT_EP 1
 
-/** Result of SCSI INQUIRY command.
- * This is already parsed structure, not the original buffer returned by
- * the device.
- */
-typedef struct {
-	/** SCSI peripheral device type */
-	unsigned device_type;
-	/** Whether the device is removable */
-	bool removable;
-	/** Vendor ID string */
-	char vendor[SCSI_INQ_VENDOR_STR_BUFSIZE];
-	/** Product ID string */
-	char product[SCSI_INQ_PRODUCT_STR_BUFSIZE];
-	/** Revision string */
-	char revision[SCSI_INQ_REVISION_STR_BUFSIZE];
-} usb_massstor_inquiry_result_t;
-
 int usb_massstor_data_in(usb_device_t *dev, uint32_t, uint8_t, void *,
     size_t, void *, size_t, size_t *);
@@ -69,6 +52,4 @@
 int usb_massstor_get_max_lun(usb_device_t *);
 size_t usb_masstor_get_lun_count(usb_device_t *);
-int usb_massstor_inquiry(usb_device_t *, usb_massstor_inquiry_result_t *);
-const char *usb_str_masstor_scsi_peripheral_device_type(unsigned);
 
 #endif
Index: uspace/drv/bus/usb/usbmast/scsi_ms.c
===================================================================
--- uspace/drv/bus/usb/usbmast/scsi_ms.c	(revision 6430ac661819d10cb7663b8bcf52df3572827c85)
+++ uspace/drv/bus/usb/usbmast/scsi_ms.c	(revision 6430ac661819d10cb7663b8bcf52df3572827c85)
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2011 Vojtech Horky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup drvusbmast
+ * @{
+ */
+/**
+ * @file
+ * SCSI functions for USB mass storage driver.
+ */
+#include <bitops.h>
+#include <usb/dev/driver.h>
+#include <usb/debug.h>
+#include <usb/classes/classes.h>
+#include <usb/classes/massstor.h>
+#include <errno.h>
+#include <str_error.h>
+#include <str.h>
+#include <ctype.h>
+#include <scsi/spc.h>
+#include "cmds.h"
+#include "mast.h"
+#include "scsi_ms.h"
+
+/** Get string representation for SCSI peripheral device type.
+ *
+ * @param type		SCSI peripheral device type code.
+ * @return		String representation.
+ */
+const char *usbmast_scsi_dev_type_str(unsigned type)
+{
+	return scsi_get_dev_type_str(type);
+}
+
+/** Perform SCSI INQUIRY command on USB mass storage device.
+ *
+ * @param dev		USB device.
+ * @param inquiry_result Where to store parsed inquiry result.
+ * @return		Error code.
+ */
+int usbmast_inquiry(usb_device_t *dev, usbmast_inquiry_data_t *inq_res)
+{
+	scsi_std_inquiry_data_t inq_data;
+	size_t response_len;
+	scsi_cdb_inquiry_t inquiry = {
+		.op_code = SCSI_CMD_INQUIRY,
+		.evpd = 0,
+		.page_code = 0,
+		.alloc_len = host2uint16_t_be(sizeof(inq_data)),
+		.control = 0
+	};
+
+	int rc;
+
+	rc = usb_massstor_data_in(dev, 0xDEADBEEF, 0, (uint8_t *) &inquiry,
+	    sizeof(inquiry), &inq_data, sizeof(inq_data), &response_len);
+
+	if (rc != EOK) {
+		usb_log_error("Failed to probe device %s using %s: %s.\n",
+		   dev->ddf_dev->name, "SCSI:INQUIRY", str_error(rc));
+		return rc;
+	}
+
+	if (response_len < SCSI_STD_INQUIRY_DATA_MIN_SIZE) {
+		usb_log_error("The SCSI inquiry response is too short.\n");
+		return EIO;
+	}
+
+	/*
+	 * Parse inquiry data and fill in the result structure.
+	 */
+
+	bzero(inq_res, sizeof(*inq_res));
+
+	inq_res->device_type = BIT_RANGE_EXTRACT(uint8_t,
+	    inq_data.pqual_devtype, SCSI_PQDT_DEV_TYPE_h, SCSI_PQDT_DEV_TYPE_l);
+
+	inq_res->removable = BIT_RANGE_EXTRACT(uint8_t,
+	    inq_data.rmb, SCSI_RMB_RMB, SCSI_RMB_RMB);
+
+	spascii_to_str(inq_res->vendor, SCSI_INQ_VENDOR_STR_BUFSIZE,
+	    inq_data.vendor, sizeof(inq_data.vendor));
+
+	spascii_to_str(inq_res->product, SCSI_INQ_PRODUCT_STR_BUFSIZE,
+	    inq_data.product, sizeof(inq_data.product));
+
+	spascii_to_str(inq_res->revision, SCSI_INQ_REVISION_STR_BUFSIZE,
+	    inq_data.revision, sizeof(inq_data.revision));
+
+	return EOK;
+}
+
+/**
+ * @}
+ */
Index: uspace/drv/bus/usb/usbmast/scsi_ms.h
===================================================================
--- uspace/drv/bus/usb/usbmast/scsi_ms.h	(revision 6430ac661819d10cb7663b8bcf52df3572827c85)
+++ uspace/drv/bus/usb/usbmast/scsi_ms.h	(revision 6430ac661819d10cb7663b8bcf52df3572827c85)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2011 Vojtech Horky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup drvusbmast
+ * @{
+ */
+/** @file
+ * SCSI functions for USB mass storage.
+ */
+
+#ifndef USB_USBMAST_SCSI_MS_H_
+#define USB_USBMAST_SCSI_MS_H_
+
+#include <scsi/spc.h>
+#include <sys/types.h>
+#include <usb/usb.h>
+#include <usb/dev/driver.h>
+
+/** Result of SCSI Inquiry command.
+ * This is already parsed structure, not the original buffer returned by
+ * the device.
+ */
+typedef struct {
+	/** SCSI peripheral device type */
+	unsigned device_type;
+	/** Whether the device is removable */
+	bool removable;
+	/** Vendor ID string */
+	char vendor[SCSI_INQ_VENDOR_STR_BUFSIZE];
+	/** Product ID string */
+	char product[SCSI_INQ_PRODUCT_STR_BUFSIZE];
+	/** Revision string */
+	char revision[SCSI_INQ_REVISION_STR_BUFSIZE];
+} usbmast_inquiry_data_t;
+
+int usbmast_inquiry(usb_device_t *, usbmast_inquiry_data_t *);
+const char *usbmast_scsi_dev_type_str(unsigned);
+
+#endif
+
+/**
+ * @}
+ */
