+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/mutex.h>
//----- host_info() ---------------------
static const char* host_info(struct Scsi_Host *host)
{
- //printk("scsiglue --- host_info\n");
+ /* pr_info("scsiglue --- host_info\n"); */
return "SCSI emulation for USB Mass Storage devices";
}
{
struct us_data *us = host_to_us(sdev->host);
- //printk("scsiglue --- slave_alloc\n");
+ /* pr_info("scsiglue --- slave_alloc\n"); */
sdev->inquiry_len = 36;
blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1));
{
struct us_data *us = host_to_us(sdev->host);
- //printk("scsiglue --- slave_configure\n");
+ /* pr_info("scsiglue --- slave_configure\n"); */
if (us->fflags & (US_FL_MAX_SECTORS_64 | US_FL_MAX_SECTORS_MIN))
{
unsigned int max_sectors = 64;
{
struct us_data *us = host_to_us(srb->device->host);
- //printk("scsiglue --- queuecommand\n");
+ /* pr_info("scsiglue --- queuecommand\n"); */
/* check for state-transition errors */
if (us->srb != NULL)
{
- printk("Error in %s: us->srb = %p\n", __FUNCTION__, us->srb);
+ /* pr_info("Error in %s: us->srb = %p\n"
+ __FUNCTION__, us->srb); */
return SCSI_MLQUEUE_HOST_BUSY;
}
/* fail the command if we are disconnecting */
if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags))
{
- printk("Fail command during disconnect\n");
+ pr_info("Fail command during disconnect\n");
srb->result = DID_NO_CONNECT << 16;
done(srb);
return 0;
{
struct us_data *us = host_to_us(srb->device->host);
- //printk("scsiglue --- command_abort\n");
+ /* pr_info("scsiglue --- command_abort\n"); */
scsi_lock(us_to_host(us));
if (us->srb != srb)
struct us_data *us = host_to_us(srb->device->host);
int result;
- //printk("scsiglue --- device_reset\n");
+ /* pr_info("scsiglue --- device_reset\n"); */
/* lock the device pointers and do the reset */
mutex_lock(&(us->dev_mutex));
struct us_data *us = host_to_us(srb->device->host);
int result;
- //printk("scsiglue --- bus_reset\n");
+ /* pr_info("scsiglue --- bus_reset\n"); */
result = usb_stor_port_reset(us);
return result < 0 ? FAILED : SUCCESS;
}
int i;
struct Scsi_Host *host = us_to_host(us);
- //printk("scsiglue --- usb_stor_report_device_reset\n");
+ /* pr_info("scsiglue --- usb_stor_report_device_reset\n"); */
scsi_report_device_reset(host, 0, 0);
if (us->fflags & US_FL_SCM_MULT_TARG)
{
{
struct Scsi_Host *host = us_to_host(us);
- //printk("scsiglue --- usb_stor_report_bus_reset\n");
+ /* pr_info("scsiglue --- usb_stor_report_bus_reset\n"); */
scsi_lock(host);
scsi_report_bus_reset(host, 0);
scsi_unlock(host);
char *pos = buffer;
const char *string;
- //printk("scsiglue --- proc_info\n");
+ /* pr_info("scsiglue --- proc_info\n"); */
if (inout)
return length;
{
struct scsi_device *sdev = to_scsi_device(dev);
- //printk("scsiglue --- ssize_t show_max_sectors\n");
+ /* pr_info("scsiglue --- ssize_t show_max_sectors\n"); */
return sprintf(buf, "%u\n", queue_max_sectors(sdev->request_queue));
}
struct scsi_device *sdev = to_scsi_device(dev);
unsigned short ms;
- //printk("scsiglue --- ssize_t store_max_sectors\n");
+ /* pr_info("scsiglue --- ssize_t store_max_sectors\n"); */
if (sscanf(buf, "%hu", &ms) > 0 && ms <= SCSI_DEFAULT_MAX_SECTORS)
{
blk_queue_max_hw_sectors(sdev->request_queue, ms);
{
unsigned int cnt;
- //printk("transport --- usb_stor_access_xfer_buf\n");
+ /* pr_info("transport --- usb_stor_access_xfer_buf\n"); */
struct scatterlist *sg = *sgptr;
if (!sg)
unsigned int offset = 0;
struct scatterlist *sg = NULL;
- //printk("transport --- usb_stor_set_xfer_buf\n");
+ /* pr_info("transport --- usb_stor_set_xfer_buf\n"); */
// TO_XFER_BUF = 0, FROM_XFER_BUF = 1
buflen = min(buflen, scsi_bufflen(srb));
buflen = usb_stor_access_xfer_buf(us, buffer, buflen, srb, &sg, &offset, dir);