ata patch testing...

John-Mark Gurney gurney_j at resnet.uoregon.edu
Sun Mar 13 18:01:54 PST 2005


I recently discovered a problem with struct ata_params when I was getting
ata running on my arm board.  Soren is going to integrate this change
into mkIII, but I would like people to test the attached patch on various
platforms and ensure that your ata drives are properly probed...  send
me email with success/failure and the platform you tried it on.

This simply marks the various structures as __packed, and fixed the
reserved count of one of the fields..

Thanks for your help.

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."
-------------- next part --------------
--- //depot/user/jmg/arm/src/sys/sys/ata.h	2005/02/25 18:50:07
+++ //depot/user/jmg/arm/src/sys/sys/ata.h	2005/03/11 18:34:24
@@ -155,7 +155,7 @@
 #define ATA_SUPPORT_FLUSHCACHE48	0x2000
 
 /*084/087*/ u_int16_t	extension;
-	} support, enabled;
+	} __packed support, enabled;
 
 /*088*/	u_int16_t	udmamodes;		/* UltraDMA modes */
 /*089*/	u_int16_t	erase_time;
@@ -182,11 +182,11 @@
 /*128*/	u_int16_t	security_status;
 	u_int16_t	reserved129[31];
 /*160*/	u_int16_t	cfa_powermode1;
-	u_int16_t	reserved161[14];
+	u_int16_t	reserved161[15];
 /*176*/	u_int16_t	media_serial[30];
 	u_int16_t	reserved206[49];
 /*255*/	u_int16_t	integrity;
-};
+} __packed;
 
 /* ATA transfer modes */
 #define ATA_MODE_MASK		0x0f
--- //depot/user/jmg/arm/src/sys/dev/ata/ata-all.c	2005/02/25 18:50:07
+++ //depot/user/jmg/arm/src/sys/dev/ata/ata-all.c	2005/03/11 19:16:57
@@ -642,6 +642,7 @@
     return error;
 }
 
+CTASSERT(sizeof(struct ata_params) == 512);
 /*
  * device probe functions
  */


More information about the freebsd-current mailing list