Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/dev/scsipi



On Fri, Dec 01, 2006 at 08:46:32PM +0100, Manuel Bouyer wrote:
> On Fri, Dec 01, 2006 at 08:42:15PM +0100, Christian Biere wrote:
> > > 
> > > It matters on all of these structures.
> > 
> > Does __aligned__ add trailing padding?
> 
> That's what I'm wondering too. It breaks ahc on i386 too:
> ahc0:A:5:0: Ensuring async
> (ahc0:A:5:0): Sending WDTR 0
> (ahc0:A:5:0): refuses WIDE negotiation. Using 8bit transfers
> ahc0:No or incomplete CDB sent to device.
> ahc0: Issued Channel A Bus Reset. 1 SCBs aborted
> probe(ahc0:0:5:0): generic HBA error
> ahc0:A:6:0: Ensuring async
> (ahc0:A:6:0): Sending WDTR 0
> (ahc0:A:6:0): refuses WIDE negotiation. Using 8bit transfers
> ahc0:No or incomplete CDB sent to device.
> ahc0: Issued Channel A Bus Reset. 1 SCBs aborted
> probe(ahc0:0:6:0): generic HBA error
> ahc0:A:10:0: Ensuring async
> (ahc0:A:10:0): Sending WDTR 0
> (ahc0:A:10:0): Received WDTR 0 filtered to 0
> ahc0:No or incomplete CDB sent to device.
> ahc0: Issued Channel A Bus Reset. 1 SCBs aborted
> probe(ahc0:0:10:0): generic HBA error

changing aligned(4) to aligned(2) on structs where it does matters
fixes the problem

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--
Index: scsipi_all.h
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/scsipi_all.h,v
retrieving revision 1.30
diff -u -r1.30 scsipi_all.h
--- scsipi_all.h        30 Nov 2006 16:23:20 -0000      1.30
+++ scsipi_all.h        1 Dec 2006 20:00:41 -0000
@@ -62,7 +62,7 @@
        u_int8_t unused[2];
        u_int8_t length;
        u_int8_t control;
-} __attribute__((__packed__, __aligned__(4)));
+} __attribute__((__packed__, __aligned__(2)));
 
 #define START_STOP             0x1b
 struct scsipi_start_stop {
@@ -74,7 +74,7 @@
 #define SSS_START              0x01
 #define SSS_LOEJ               0x02
        u_int8_t control;
-} __attribute__((__packed__, __aligned__(4)));
+} __attribute__((__packed__, __aligned__(2)));
 
 /*
  * inquiry data format
@@ -163,6 +163,6 @@
 /*58*/ u_int8_t reserved;
 /*59*/ char    version_descriptor[8][2];
 #define        SCSIPI_INQUIRY_LENGTH_SCSI3     74
-} __attribute__((__packed__, __aligned__(4)));
+} __attribute__((__packed__, __aligned__(2)));
 
 #endif /* _DEV_SCSIPI_SCSIPI_ALL_H_ */
Index: scsipi_cd.h
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/scsipi_cd.h,v
retrieving revision 1.15
diff -u -r1.15 scsipi_cd.h
--- scsipi_cd.h 30 Nov 2006 16:23:20 -0000      1.15
+++ scsipi_cd.h 1 Dec 2006 20:00:41 -0000
@@ -44,7 +44,7 @@
        u_int8_t unused[6];
        u_int8_t resume;
        u_int8_t control;
-} __attribute__((__packed__, __aligned__(4)));
+} __attribute__((__packed__, __aligned__(2)));
 #define        PA_PAUSE        0x00
 #define PA_RESUME      0x01
 
@@ -60,7 +60,7 @@
        u_int8_t end_s;
        u_int8_t end_f;
        u_int8_t control;
-} __attribute__((__packed__, __aligned__(4)));
+} __attribute__((__packed__, __aligned__(2)));
 
 #define PLAY                   0x45    /* cdrom play  'play audio' mode */
 struct scsipi_play {
@@ -70,7 +70,7 @@
        u_int8_t unused;
        u_int8_t xfer_len[2];
        u_int8_t control;
-} __attribute__((__packed__, __aligned__(4)));
+} __attribute__((__packed__, __aligned__(2)));
 
 #define READ_HEADER            0x44    /* cdrom read header */
 struct scsipi_read_header {
@@ -80,7 +80,7 @@
        u_int8_t unused;
        u_int8_t data_len[2];
        u_int8_t control;
-} __attribute__((__packed__, __aligned__(4)));
+} __attribute__((__packed__, __aligned__(2)));
 
 #define READ_SUBCHANNEL                0x42    /* cdrom read Subchannel */
 struct scsipi_read_subchannel {
@@ -93,7 +93,7 @@
        u_int8_t track;
        u_int8_t data_len[2];
        u_int8_t control;
-} __attribute__((__packed__, __aligned__(4)));
+} __attribute__((__packed__, __aligned__(2)));
 
 #define READ_TOC               0x43    /* cdrom read TOC */
 struct scsipi_read_toc {
@@ -104,7 +104,7 @@
        u_int8_t from_track;            /* session nr in format 2 */
        u_int8_t data_len[2];
        u_int8_t control;
-} __attribute__((__packed__, __aligned__(4)));
+} __attribute__((__packed__, __aligned__(2)));
 
 struct scsipi_toc_header {
        uint8_t  length[2];
@@ -156,7 +156,7 @@
        uint8_t  unused[3];
        uint8_t  data_len[2];
        uint8_t  control;
-} __attribute__((__packed__, __aligned__(4)));
+} __attribute__((__packed__, __aligned__(2)));
 
 struct scsipi_get_conf_data {
        uint8_t  data_len[4];
@@ -181,7 +181,7 @@
        uint8_t  unused[6];
        uint8_t  data_len[2];
        uint8_t  control;
-} __attribute__((__packed__, __aligned__(4)));
+} __attribute__((__packed__, __aligned__(2)));
 
 #define READ_DISCINFO_SMALLSIZE  12
 #define READ_DISCINFO_BIGSIZE    34    /* + entries */
@@ -215,7 +215,7 @@
        uint8_t  nothing;
        uint8_t  data_len[2];
        uint8_t  control;
-} __attribute__((__packed__, __aligned__(4)));
+} __attribute__((__packed__, __aligned__(2)));
 #define READ_TRACKINFO_ADDR_LBA    0
 #define READ_TRACKINFO_ADDR_TRACK  1
 #define READ_TRACKINFO_ADDR_SESS   2
@@ -248,7 +248,7 @@
        u_int8_t addr[4];
        u_int8_t unused[3];
        u_int8_t control;
-} __attribute__((__packed__, __aligned__(4)));
+} __attribute__((__packed__, __aligned__(2)));
 
 struct scsipi_read_cd_cap_data {
        u_int8_t addr[4];
Index: scsipi_disk.h
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/scsipi_disk.h,v
retrieving revision 1.17
diff -u -r1.17 scsipi_disk.h
--- scsipi_disk.h       30 Nov 2006 16:23:20 -0000      1.17
+++ scsipi_disk.h       1 Dec 2006 20:00:41 -0000
@@ -70,7 +70,7 @@
        u_int8_t reserved;
        u_int8_t length[2];
        u_int8_t control;
-} __attribute__((__packed__, __aligned__(4)));
+} __attribute__((__packed__, __aligned__(2)));
 
 #define        READ_12                 0xa8
 #define        WRITE_12                0xaa
@@ -101,7 +101,7 @@
        u_int8_t addr[4];
        u_int8_t unused[3];
        u_int8_t control;
-} __attribute__((__packed__, __aligned__(4)));
+} __attribute__((__packed__, __aligned__(2)));
 
 /* DATAs definitions for the above commands */
 


Home | Main Index | Thread Index | Old Index