aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_transport_spi.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2005-10-02 12:45:08 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-10-28 15:23:02 -0400
commit9ccfc756a70d454dfa82f48897e2883560c01a0e (patch)
tree9a6d3b10b1ec0e5fe7a63252a21598a03e93ad4e /drivers/scsi/scsi_transport_spi.c
parent9a41a62b74388827998253d62c58707e63cc5874 (diff)
[SCSI] move the mid-layer printk's over to shost/starget/sdev_printk
This should eliminate (at least in the mid layer) to make numeric assumptions about any of the enumeration variables. As a side effect, it will also make all the messages consistent and line us up nicely for the error logging strategy (if it ever shows itself again). Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_spi.c')
-rw-r--r--drivers/scsi/scsi_transport_spi.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c
index ef577c8c2182..718a2bc4ed5e 100644
--- a/drivers/scsi/scsi_transport_spi.c
+++ b/drivers/scsi/scsi_transport_spi.c
@@ -33,8 +33,6 @@
33#include <scsi/scsi_transport.h> 33#include <scsi/scsi_transport.h>
34#include <scsi/scsi_transport_spi.h> 34#include <scsi/scsi_transport_spi.h>
35 35
36#define SPI_PRINTK(x, l, f, a...) dev_printk(l, &(x)->dev, f , ##a)
37
38#define SPI_NUM_ATTRS 14 /* increase this if you add attributes */ 36#define SPI_NUM_ATTRS 14 /* increase this if you add attributes */
39#define SPI_OTHER_ATTRS 1 /* Increase this if you add "always 37#define SPI_OTHER_ATTRS 1 /* Increase this if you add "always
40 * on" attributes */ 38 * on" attributes */
@@ -618,7 +616,7 @@ spi_dv_device_echo_buffer(struct scsi_device *sdev, u8 *buffer,
618 return SPI_COMPARE_SKIP_TEST; 616 return SPI_COMPARE_SKIP_TEST;
619 617
620 618
621 SPI_PRINTK(sdev->sdev_target, KERN_ERR, "Write Buffer failure %x\n", result); 619 sdev_printk(KERN_ERR, sdev, "Write Buffer failure %x\n", result);
622 return SPI_COMPARE_FAILURE; 620 return SPI_COMPARE_FAILURE;
623 } 621 }
624 622
@@ -702,10 +700,10 @@ spi_dv_retrain(struct scsi_device *sdev, u8 *buffer, u8 *ptr,
702 * IU, then QAS (if we can control them), then finally 700 * IU, then QAS (if we can control them), then finally
703 * fall down the periods */ 701 * fall down the periods */
704 if (i->f->set_iu && spi_iu(starget)) { 702 if (i->f->set_iu && spi_iu(starget)) {
705 SPI_PRINTK(starget, KERN_ERR, "Domain Validation Disabing Information Units\n"); 703 starget_printk(KERN_ERR, starget, "Domain Validation Disabing Information Units\n");
706 DV_SET(iu, 0); 704 DV_SET(iu, 0);
707 } else if (i->f->set_qas && spi_qas(starget)) { 705 } else if (i->f->set_qas && spi_qas(starget)) {
708 SPI_PRINTK(starget, KERN_ERR, "Domain Validation Disabing Quick Arbitration and Selection\n"); 706 starget_printk(KERN_ERR, starget, "Domain Validation Disabing Quick Arbitration and Selection\n");
709 DV_SET(qas, 0); 707 DV_SET(qas, 0);
710 } else { 708 } else {
711 newperiod = spi_period(starget); 709 newperiod = spi_period(starget);
@@ -717,11 +715,11 @@ spi_dv_retrain(struct scsi_device *sdev, u8 *buffer, u8 *ptr,
717 715
718 if (unlikely(period > 0xff || period == prevperiod)) { 716 if (unlikely(period > 0xff || period == prevperiod)) {
719 /* Total failure; set to async and return */ 717 /* Total failure; set to async and return */
720 SPI_PRINTK(starget, KERN_ERR, "Domain Validation Failure, dropping back to Asynchronous\n"); 718 starget_printk(KERN_ERR, starget, "Domain Validation Failure, dropping back to Asynchronous\n");
721 DV_SET(offset, 0); 719 DV_SET(offset, 0);
722 return SPI_COMPARE_FAILURE; 720 return SPI_COMPARE_FAILURE;
723 } 721 }
724 SPI_PRINTK(starget, KERN_ERR, "Domain Validation detected failure, dropping back\n"); 722 starget_printk(KERN_ERR, starget, "Domain Validation detected failure, dropping back\n");
725 DV_SET(period, period); 723 DV_SET(period, period);
726 prevperiod = period; 724 prevperiod = period;
727 } 725 }
@@ -788,7 +786,7 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer)
788 786
789 if (spi_dv_device_compare_inquiry(sdev, buffer, buffer, DV_LOOPS) 787 if (spi_dv_device_compare_inquiry(sdev, buffer, buffer, DV_LOOPS)
790 != SPI_COMPARE_SUCCESS) { 788 != SPI_COMPARE_SUCCESS) {
791 SPI_PRINTK(starget, KERN_ERR, "Domain Validation Initial Inquiry Failed\n"); 789 starget_printk(KERN_ERR, starget, "Domain Validation Initial Inquiry Failed\n");
792 /* FIXME: should probably offline the device here? */ 790 /* FIXME: should probably offline the device here? */
793 return; 791 return;
794 } 792 }
@@ -802,7 +800,7 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer)
802 buffer + len, 800 buffer + len,
803 DV_LOOPS) 801 DV_LOOPS)
804 != SPI_COMPARE_SUCCESS) { 802 != SPI_COMPARE_SUCCESS) {
805 SPI_PRINTK(starget, KERN_ERR, "Wide Transfers Fail\n"); 803 starget_printk(KERN_ERR, starget, "Wide Transfers Fail\n");
806 i->f->set_width(starget, 0); 804 i->f->set_width(starget, 0);
807 } 805 }
808 } 806 }
@@ -844,14 +842,14 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer)
844 } 842 }
845 843
846 if (len == 0) { 844 if (len == 0) {
847 SPI_PRINTK(starget, KERN_INFO, "Domain Validation skipping write tests\n"); 845 starget_printk(KERN_INFO, starget, "Domain Validation skipping write tests\n");
848 spi_dv_retrain(sdev, buffer, buffer + len, 846 spi_dv_retrain(sdev, buffer, buffer + len,
849 spi_dv_device_compare_inquiry); 847 spi_dv_device_compare_inquiry);
850 return; 848 return;
851 } 849 }
852 850
853 if (len > SPI_MAX_ECHO_BUFFER_SIZE) { 851 if (len > SPI_MAX_ECHO_BUFFER_SIZE) {
854 SPI_PRINTK(starget, KERN_WARNING, "Echo buffer size %d is too big, trimming to %d\n", len, SPI_MAX_ECHO_BUFFER_SIZE); 852 starget_printk(KERN_WARNING, starget, "Echo buffer size %d is too big, trimming to %d\n", len, SPI_MAX_ECHO_BUFFER_SIZE);
855 len = SPI_MAX_ECHO_BUFFER_SIZE; 853 len = SPI_MAX_ECHO_BUFFER_SIZE;
856 } 854 }
857 855
@@ -902,11 +900,11 @@ spi_dv_device(struct scsi_device *sdev)
902 spi_dv_pending(starget) = 1; 900 spi_dv_pending(starget) = 1;
903 down(&spi_dv_sem(starget)); 901 down(&spi_dv_sem(starget));
904 902
905 SPI_PRINTK(starget, KERN_INFO, "Beginning Domain Validation\n"); 903 starget_printk(KERN_INFO, starget, "Beginning Domain Validation\n");
906 904
907 spi_dv_device_internal(sdev, buffer); 905 spi_dv_device_internal(sdev, buffer);
908 906
909 SPI_PRINTK(starget, KERN_INFO, "Ending Domain Validation\n"); 907 starget_printk(KERN_INFO, starget, "Ending Domain Validation\n");
910 908
911 up(&spi_dv_sem(starget)); 909 up(&spi_dv_sem(starget));
912 spi_dv_pending(starget) = 0; 910 spi_dv_pending(starget) = 0;