From eecb3c07e7cce24c35de97e5f895874a8a2e9126 Mon Sep 17 00:00:00 2001 From: Laura Lawniczak Date: Thu, 6 Jun 2013 18:10:49 +0200 Subject: [PATCH] keucr: moved function to other file Function usb_stor_print_cmd was declared in init.c but only used in transport.c. So it was reasonable to move it there and declare it static Signed-off-by: Laura Lawniczak Signed-off-by: Greg Kroah-Hartman --- drivers/staging/keucr/init.c | 51 ------------------------------- drivers/staging/keucr/transport.c | 50 ++++++++++++++++++++++++++++++ drivers/staging/keucr/transport.h | 1 - 3 files changed, 50 insertions(+), 52 deletions(-) diff --git a/drivers/staging/keucr/init.c b/drivers/staging/keucr/init.c index 08b6c3dfa9c7..53478e167756 100644 --- a/drivers/staging/keucr/init.c +++ b/drivers/staging/keucr/init.c @@ -322,54 +322,3 @@ int ENE_Write_Data(struct us_data *us, void *buf, unsigned int length) return USB_STOR_TRANSPORT_GOOD; } -/* - * usb_stor_print_cmd(): - */ -void usb_stor_print_cmd(struct us_data *us,struct scsi_cmnd *srb) -{ - PBYTE Cdb = srb->cmnd; - DWORD cmd = Cdb[0]; - DWORD bn = ((Cdb[2] << 24) & 0xff000000) | - ((Cdb[3] << 16) & 0x00ff0000) | - ((Cdb[4] << 8) & 0x0000ff00) | - ((Cdb[5] << 0) & 0x000000ff); - WORD blen = ((Cdb[7] << 8) & 0xff00) | ((Cdb[8] << 0) & 0x00ff); - - switch (cmd) { - case TEST_UNIT_READY: - /* dev_dbg( - &us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_TEST_UNIT_READY\n", cmd); */ - break; - case INQUIRY: - dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_INQUIRY\n", cmd); - break; - case MODE_SENSE: - dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_MODE_SENSE\n", cmd); - break; - case START_STOP: - dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_START_STOP\n", cmd); - break; - case READ_CAPACITY: - dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_READ_CAPACITY\n", cmd); - break; - case READ_10: - /* dev_dbg( - &us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_READ,bn = %X, blen = %X\n" - ,cmd, bn, blen); */ - break; - case WRITE_10: - /* dev_dbg( - &us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_WRITE, - bn = %X, blen = %X\n" , cmd, bn, blen); */ - break; - case ALLOW_MEDIUM_REMOVAL: - dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_ALLOW_MEDIUM_REMOVAL\n", cmd); - break; - default: - dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- Other cmd\n", cmd); - break; - } - bn = 0; - blen = 0; -} - diff --git a/drivers/staging/keucr/transport.c b/drivers/staging/keucr/transport.c index 1de1115eb14f..b3c25d0b2ae2 100644 --- a/drivers/staging/keucr/transport.c +++ b/drivers/staging/keucr/transport.c @@ -78,6 +78,56 @@ static int usb_stor_msg_common(struct us_data *us, int timeout) return us->current_urb->status; } +/* + * usb_stor_print_cmd(): + */ +static void usb_stor_print_cmd(struct us_data *us, struct scsi_cmnd *srb) +{ + PBYTE Cdb = srb->cmnd; + DWORD cmd = Cdb[0]; + DWORD bn = ((Cdb[2] << 24) & 0xff000000) | + ((Cdb[3] << 16) & 0x00ff0000) | + ((Cdb[4] << 8) & 0x0000ff00) | + ((Cdb[5] << 0) & 0x000000ff); + WORD blen = ((Cdb[7] << 8) & 0xff00) | ((Cdb[8] << 0) & 0x00ff); + + switch (cmd) { + case TEST_UNIT_READY: + /* dev_dbg( + &us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_TEST_UNIT_READY\n", cmd); */ + break; + case INQUIRY: + dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_INQUIRY\n", cmd); + break; + case MODE_SENSE: + dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_MODE_SENSE\n", cmd); + break; + case START_STOP: + dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_START_STOP\n", cmd); + break; + case READ_CAPACITY: + dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_READ_CAPACITY\n", cmd); + break; + case READ_10: + /* dev_dbg( + &us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_READ,bn = %X, blen = %X\n" + cmd, bn, blen); */ + break; + case WRITE_10: + /* dev_dbg( + &us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_WRITE, + bn = %X, blen = %X\n" , cmd, bn, blen); */ + break; + case ALLOW_MEDIUM_REMOVAL: + dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_ALLOW_MEDIUM_REMOVAL\n", cmd); + break; + default: + dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- Other cmd\n", cmd); + break; + } + bn = 0; +} + /* * usb_stor_control_msg() */ diff --git a/drivers/staging/keucr/transport.h b/drivers/staging/keucr/transport.h index 2cdaa4917aff..df34474ae568 100644 --- a/drivers/staging/keucr/transport.h +++ b/drivers/staging/keucr/transport.h @@ -29,7 +29,6 @@ extern int usb_stor_Bulk_transport(struct scsi_cmnd *, struct us_data*); extern int usb_stor_Bulk_max_lun(struct us_data *); extern int usb_stor_Bulk_reset(struct us_data *); -extern void usb_stor_print_cmd(struct us_data *, struct scsi_cmnd *); extern void usb_stor_invoke_transport(struct scsi_cmnd *, struct us_data*); extern void usb_stor_stop_transport(struct us_data *); extern int usb_stor_control_msg(struct us_data *us, unsigned int pipe, -- 2.39.5