Index: c/src/ChangeLog
===================================================================
--- c/src/ChangeLog	(revision a3f1b54b6deeda525ae30a1b3ddc88a16eb7980f)
+++ c/src/ChangeLog	(revision bf4748809d07941f8467b184264ce9151db5cf44)
@@ -1,2 +1,13 @@
+2004-11-20	Thomas Doerfler <Thomas.Doerfler@imd-systems.de>:
+
+        PR 703/filesystem
+        * libchip/ide/ata_internal.h, libchip/ide/ide_ctrl_cfg.h,
+	libchip/ide/ide_ctrl_io.h, libchip/ide/ata.c,
+	libchip/ide/ide_controller.c:
+        Move definitions for ATA modes into ide_ctrl_cfg.h, to make them 
+        available for BSPS/device drivers.
+	Extend the "modes_available" and "mode_active" parameters to
+	uint16_t for UDMA support.
+
 2004-11-10	Richard Campbell <richard.campbell@oarcorp.com>
 
Index: c/src/libchip/ide/ata.c
===================================================================
--- c/src/libchip/ide/ata.c	(revision a3f1b54b6deeda525ae30a1b3ddc88a16eb7980f)
+++ c/src/libchip/ide/ata.c	(revision bf4748809d07941f8467b184264ce9151db5cf44)
@@ -1160,5 +1160,5 @@
 	    }
 	    else {
-	      ATA_DEV_INFO(ctrl_minor, dev).modes_avaible =
+	      ATA_DEV_INFO(ctrl_minor, dev).modes_available =
 		((CF_LE_W(buffer[64]) & 0x1) ? ATA_MODES_PIO3 : 0) |
 		((CF_LE_W(buffer[64]) & 0x2) ? ATA_MODES_PIO4 : 0) |
@@ -1168,5 +1168,5 @@
 		((CF_LE_W(buffer[63]) & 0x4) ?
 		 ATA_MODES_DMA0 | ATA_MODES_DMA1 | ATA_MODES_DMA2 : 0);
-	      if (ATA_DEV_INFO(ctrl_minor, dev).modes_avaible == 0)
+	      if (ATA_DEV_INFO(ctrl_minor, dev).modes_available == 0)
                 continue;
 	      /*
@@ -1176,5 +1176,5 @@
 	      status = ide_controller_config_io_speed(
                 ctrl_minor,
-                ATA_DEV_INFO(ctrl_minor, dev).modes_avaible);
+                ATA_DEV_INFO(ctrl_minor, dev).modes_available);
 	      if (status != RTEMS_SUCCESSFUL)
                 continue;
Index: c/src/libchip/ide/ata_internal.h
===================================================================
--- c/src/libchip/ide/ata_internal.h	(revision a3f1b54b6deeda525ae30a1b3ddc88a16eb7980f)
+++ c/src/libchip/ide/ata_internal.h	(revision bf4748809d07941f8467b184264ce9151db5cf44)
@@ -52,24 +52,4 @@
 
 #define ATA_MAX_CMD_REG_OFFSET          8
-
-/* ATA modes */
-#define ATA_MODES_PIO3    0x001
-#define ATA_MODES_PIO4    0x002
-
-#define ATA_MODES_PIO     0x003
-
-#define ATA_MODES_DMA0    0x004
-#define ATA_MODES_DMA1    0x008
-#define ATA_MODES_DMA2    0x010
-
-#define ATA_MODES_UDMA0   0x020
-#define ATA_MODES_UDMA1   0x040
-#define ATA_MODES_UDMA2   0x080
-#define ATA_MODES_UDMA3   0x100
-#define ATA_MODES_UDMA4   0x200
-#define ATA_MODES_UDMA5   0x400
-
-#define ATA_MODES_UDMA    0x7e0
-#define ATA_MODES_DMA     0x7fc
 
 
@@ -309,6 +289,6 @@
     uint8_t     current_multiple;
 
-    uint8_t     modes_avaible; /* OR of values for this modes */
-    uint8_t     mode_active;
+    uint16_t  modes_available; /* OR of values for this modes */
+    uint16_t  mode_active;
 } ata_dev_t;
 
Index: c/src/libchip/ide/ide_controller.c
===================================================================
--- c/src/libchip/ide/ide_controller.c	(revision a3f1b54b6deeda525ae30a1b3ddc88a16eb7980f)
+++ c/src/libchip/ide/ide_controller.c	(revision bf4748809d07941f8467b184264ce9151db5cf44)
@@ -164,6 +164,6 @@
  *
  * PARAMETERS:
- *     minor         - minor number of controller
- *     modes_avaible - speeds available
+ *     minor           - minor number of controller
+ *     modes_available - speeds available
  *
  * RETURNS:
@@ -172,8 +172,8 @@
  */
 rtems_status_code
-ide_controller_config_io_speed(int minor, uint8_t   modes_avaible)
+ide_controller_config_io_speed(int minor, uint16_t modes_available)
 {
     return IDE_Controller_Table[minor].fns->ctrl_config_io_speed(
                minor,
-               modes_avaible);
+               modes_available);
 }
Index: c/src/libchip/ide/ide_ctrl_cfg.h
===================================================================
--- c/src/libchip/ide/ide_ctrl_cfg.h	(revision a3f1b54b6deeda525ae30a1b3ddc88a16eb7980f)
+++ c/src/libchip/ide/ide_ctrl_cfg.h	(revision bf4748809d07941f8467b184264ce9151db5cf44)
@@ -2,5 +2,5 @@
  * ide_ctrl_cfg.h
  *
- * LibChip library IDE controller header file - structuers used for
+ * LibChip library IDE controller header file - structures used for 
  * configuration and plugin interface definition.
  *
@@ -30,4 +30,25 @@
     IDE_CUSTOM                /* BSP specific driver */
 } ide_ctrl_devs_t;
+
+/* ATA modes: bit masks used in ctrl_config_io_speed call */
+#define ATA_MODES_PIO3    0x001
+#define ATA_MODES_PIO4    0x002
+
+#define ATA_MODES_PIO     0x003
+
+#define ATA_MODES_DMA0    0x004
+#define ATA_MODES_DMA1    0x008
+#define ATA_MODES_DMA2    0x010
+
+#define ATA_MODES_UDMA0   0x020
+#define ATA_MODES_UDMA1   0x040
+#define ATA_MODES_UDMA2   0x080
+#define ATA_MODES_UDMA3   0x100
+#define ATA_MODES_UDMA4   0x200
+#define ATA_MODES_UDMA5   0x400
+
+#define ATA_MODES_UDMA    0x7e0
+#define ATA_MODES_DMA     0x7fc
+
 
 /*
@@ -61,5 +82,5 @@
 
     rtems_status_code (*ctrl_config_io_speed)(int minor,
-                                              uint8_t   modes_available);
+                                              uint16_t modes_available);
 } ide_ctrl_fns_t;
 
Index: c/src/libchip/ide/ide_ctrl_io.h
===================================================================
--- c/src/libchip/ide/ide_ctrl_io.h	(revision a3f1b54b6deeda525ae30a1b3ddc88a16eb7980f)
+++ c/src/libchip/ide/ide_ctrl_io.h	(revision bf4748809d07941f8467b184264ce9151db5cf44)
@@ -168,6 +168,6 @@
  *
  * PARAMETERS:
- *     minor         - minor number of controller
- *     modes_avaible - speeds available
+ *     minor           - minor number of controller
+ *     modes_available - speeds available
  *
  * RETURNS:
@@ -176,5 +176,5 @@
  */
 rtems_status_code
-ide_controller_config_io_speed(int minor, uint8_t   modes_avaible);
+ide_controller_config_io_speed(int minor, uint16_t modes_available);
 
 #ifdef __cplusplus
