[SCSI] Add spi_populate_*_msg functions
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / scsi / aha152x.c
index 9df23b654cec1aa929cb3d7f5eb7ae4b3b089c67..67d78ed7119af2d7eccf661b0b242ce12ff3b6fb 100644 (file)
 #include "scsi.h"
 #include <scsi/scsi_dbg.h>
 #include <scsi/scsi_host.h>
+#include <scsi/scsi_transport_spi.h>
 #include "aha152x.h"
 
 
@@ -1707,12 +1708,7 @@ static void seldo_run(struct Scsi_Host *shpnt)
                ADDMSGO(BUS_DEVICE_RESET);
        } else if (SYNCNEG==0 && SYNCHRONOUS) {
                CURRENT_SC->SCp.phase |= syncneg;
-               ADDMSGO(EXTENDED_MESSAGE);
-               ADDMSGO(3);
-               ADDMSGO(EXTENDED_SDTR);
-               ADDMSGO(50);            /* 200ns */
-               ADDMSGO(8);             /* 8 byte req/ack offset */
-
+               MSGOLEN += spi_populate_sync_msg(&MSGO(MSGOLEN), 50, 8);
                SYNCNEG=1;              /* negotiation in progress */
        }
 
@@ -1845,7 +1841,7 @@ static void msgi_run(struct Scsi_Host *shpnt)
 #if defined(AHA152X_DEBUG)
                if (HOSTDATA(shpnt)->debug & debug_msgi) {
                        printk(INFO_LEAD "inbound message %02x ", CMDINFO(CURRENT_SC), MSGI(0));
-                       scsi_print_msg(&MSGI(0));
+                       spi_print_msg(&MSGI(0));
                        printk("\n");
                }
 #endif
@@ -1933,7 +1929,7 @@ static void msgi_run(struct Scsi_Host *shpnt)
                                                break;
 
                                        printk(INFO_LEAD, CMDINFO(CURRENT_SC));
-                                       scsi_print_msg(&MSGI(0));
+                                       spi_print_msg(&MSGI(0));
                                        printk("\n");
 
                                        ticks = (MSGI(3) * 4 + 49) / 50;
@@ -2031,7 +2027,7 @@ static void msgo_init(struct Scsi_Host *shpnt)
                int i;
 
                printk(DEBUG_LEAD "messages( ", CMDINFO(CURRENT_SC));
-               for (i=0; i<MSGOLEN; i+=scsi_print_msg(&MSGO(i)), printk(" "))
+               for (i=0; i<MSGOLEN; i+=spi_print_msg(&MSGO(i)), printk(" "))
                        ;
                printk(")\n");
        }