Update of /cvsroot/gc-linux/linux/include/linux
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32197/include/linux
Modified Files:
exi.h
Log Message:
Initial EXI framework check-in, including BBA changes
Index: exi.h
===================================================================
RCS file: /cvsroot/gc-linux/linux/include/linux/exi.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- exi.h 19 Oct 2004 22:49:41 -0000 1.6
+++ exi.h 8 Jan 2005 22:46:48 -0000 1.7
@@ -1,9 +1,9 @@
/*
* include/linux/exi.h
*
- * Nintendo GameCube EXpansion Interface definitions
- * Copyright (C) 2004 Arthur Othieno <a.o...@bl...>
- * Copyright (C) 2004 The GameCube Linux Team
+ * Nintendo GameCube EXI driver
+ * Copyright (C) 2004-2005 The GameCube Linux Team
+ * Copyright (C) 2004,2005 Todd Jeffreys <to...@vo...>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -11,55 +11,96 @@
* of the License, or (at your option) any later version.
*
*/
-#ifndef __EXI_H
-#define __EXI_H
-#include <linux/device.h>
+#ifndef __exi_bus__
+#define __exi_bus__
-/* while the real framework gets finished, we'll use the lite version */
-#include <../drivers/exi/gcn-exi-lite.h>
+#define EXI_DMA_ALIGNMENT 32
+/* -------------------
+ exi_sub_command flags
+ ----------------- */
+#define EXI_CMD_READ (0x00000000)
+#define EXI_CMD_WRITE (0x00000005)
-struct exi_dev {
- unsigned long id;
+/* ----------------------
+ exi_command flags
+ --------------------- */
- struct device dev;
+#define EXI_DESELECT_UDELAY (0x00000001)
+
+#include <linux/device.h>
+#include <linux/list.h>
+
+struct exi_command
+{
+ unsigned int flags;
+
+ void *data;
+ unsigned int len;
+
+ void *param;
+ void (*completion_routine)(struct exi_command *cmd);
};
-#define to_exi_dev(n) container_of(n, struct exi_dev, dev)
+struct exi_command_group
+{
+ struct list_head list;
+
+ struct exi_device *dev;
+
+ unsigned int flags;
+
+ unsigned int deselect_udelay;
+
+ unsigned int num_commands;
+ struct exi_command *commands;
+};
+extern struct bus_type exi_bus_type;
-struct exi_device_id {
- unsigned long dev_id;
+struct exi_device_id
+{
+ unsigned int channel;
+ unsigned int device;
+
+ u32 id;
};
-struct exi_driver {
- char *name;
- struct exi_device_id *id_table;
+struct exi_device
+{
+ struct exi_device_id eid;
- int (*probe) (struct exi_dev *dev);
- void (*remove) (struct exi_dev *dev);
+ struct device dev;
+};
- struct device_driver driver;
+#define to_exi_device(n) container_of(n,struct exi_device,dev)
+
+struct exi_driver
+{
+ char *name;
+ struct exi_device_id eid;
+ unsigned int frequency;
+
+ int (*probe) (struct exi_device *dev);
+ void (*remove) (struct exi_device *dev);
+
+ struct device_driver driver;
};
-#define to_exi_driver(drv) container_of(drv, struct exi_driver, driver)
+typedef int (*exi_irq_handler)(int channel,void *param);
+#define to_exi_driver(n) container_of(n,struct exi_driver,driver)
-extern struct device exi_bus_dev;
-extern struct bus_type exi_bus_type;
+void exi_add_command_group(struct exi_command_group *cmd,unsigned int count);
-extern int exi_driver_register(struct exi_driver *drv);
-extern void exi_driver_unregister(struct exi_driver *drv);
+int exi_register_driver(struct exi_driver *drv);
+void exi_unregister_driver(struct exi_driver *drv);
-static inline void *exi_get_drvdata(struct exi_dev *exi_dev)
-{
- return dev_get_drvdata(&exi_dev->dev);
-}
+int exi_register_irq(int channel_irq,exi_irq_handler func,void *param);
+void exi_unregister_irq(int channel_irq);
-static inline void exi_set_drvdata(struct exi_dev *exi_dev, void *data)
-{
- dev_set_drvdata(&exi_dev->dev, data);
-}
+#define exi_get_driver_data(exi_device) dev_get_drvdata(&exi_device->dev)
+#define exi_set_driver_data(exi_device,data) dev_set_drvdata(&exi_device->dev,data)
-#endif /* !__EXI_H */
+#endif
|