|
From: johann d. <jd...@us...> - 2002-07-07 10:22:56
|
Update of /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick/iforce
In directory usw-pr-cvs1:/tmp/cvs-serv21328
Modified Files:
iforce-main.c iforce-packets.c iforce.h
Log Message:
IFORCE_{USB,232} are used as values for iforce::bus.
CONFIG_JOYSTICK_IFORCE_{USB,232} are used for config-dependant blocks of code.
Index: iforce-main.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick/iforce/iforce-main.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- iforce-main.c 9 Jun 2002 11:03:03 -0000 1.18
+++ iforce-main.c 7 Jul 2002 10:22:50 -0000 1.19
@@ -248,7 +248,7 @@
struct iforce *iforce = dev->private;
switch (iforce->bus) {
-#ifdef IFORCE_USB
+#ifdef CONFIG_JOYSTICK_IFORCE_USB
case IFORCE_USB:
iforce->irq->dev = iforce->usbdev;
if (usb_submit_urb(iforce->irq, GFP_KERNEL))
@@ -305,7 +305,7 @@
iforce_send_packet(iforce, FF_CMD_ENABLE, "\001");
switch (iforce->bus) {
-#ifdef IFORCE_USB
+#ifdef CONFIG_JOYSTICK_IFORCE_USB
case IFORCE_USB:
usb_unlink_urb(iforce->irq);
@@ -323,12 +323,12 @@
void iforce_delete_device(struct iforce *iforce)
{
switch (iforce->bus) {
-#ifdef IFORCE_USB
+#ifdef CONFIG_JOYSTICK_IFORCE_USB
case IFORCE_USB:
iforce_usb_delete(iforce);
break;
#endif
-#ifdef IFORCE_232
+#ifdef CONFIG_JOYSTICK_IFORCE_232
case IFORCE_232:
//TODO: Wait for the last packets to be sent
break;
@@ -520,10 +520,10 @@
static int __init iforce_init(void)
{
-#ifdef IFORCE_USB
+#ifdef CONFIG_JOYSTICK_IFORCE_USB
usb_register(&iforce_usb_driver);
#endif
-#ifdef IFORCE_232
+#ifdef CONFIG_JOYSTICK_IFORCE_232
serio_register_device(&iforce_serio_dev);
#endif
return 0;
@@ -531,10 +531,10 @@
static void __exit iforce_exit(void)
{
-#ifdef IFORCE_USB
+#ifdef CONFIG_JOYSTICK_IFORCE_USB
usb_deregister(&iforce_usb_driver);
#endif
-#ifdef IFORCE_232
+#ifdef CONFIG_JOYSTICK_IFORCE_232
serio_unregister_device(&iforce_serio_dev);
#endif
}
Index: iforce-packets.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick/iforce/iforce-packets.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- iforce-packets.c 9 Jun 2002 11:08:04 -0000 1.15
+++ iforce-packets.c 7 Jul 2002 10:22:50 -0000 1.16
@@ -101,13 +101,13 @@
*/
switch (iforce->bus) {
-#ifdef IFORCE_232
+#ifdef CONFIG_JOYSTICK_IFORCE_232
case IFORCE_232:
if (empty)
iforce_serial_xmit(iforce);
break;
#endif
-#ifdef IFORCE_USB
+#ifdef CONFIG_JOYSTICK_IFORCE_USB
case IFORCE_USB:
if (iforce->usbdev && empty &&
@@ -161,7 +161,7 @@
printk(KERN_WARNING "iforce-packets.c: re-entrant call to iforce_process %d\n", being_used);
being_used++;
-#ifdef IFORCE_232
+#ifdef CONFIG_JOYSTICK_IFORCE_232
if (HI(iforce->expect_packet) == HI(cmd)) {
iforce->expect_packet = 0;
iforce->ecmd = cmd;
@@ -251,7 +251,7 @@
case IFORCE_USB:
-#ifdef IFORCE_USB
+#ifdef CONFIG_JOYSTICK_IFORCE_USB
iforce->cr.bRequest = packet[0];
iforce->ctrl->dev = iforce->usbdev;
@@ -281,7 +281,7 @@
case IFORCE_232:
-#ifdef IFORCE_232
+#ifdef CONFIG_JOYSTICK_IFORCE_232
iforce->expect_packet = FF_CMD_QUERY;
iforce_send_packet(iforce, FF_CMD_QUERY, packet);
Index: iforce.h
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/joystick/iforce/iforce.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- iforce.h 9 Jun 2002 11:08:04 -0000 1.12
+++ iforce.h 7 Jul 2002 10:22:50 -0000 1.13
@@ -39,7 +39,7 @@
#include <linux/circ_buf.h>
#include <asm/semaphore.h>
-/* FF: This module provides arbitrary resource management routines.
+/* This module provides arbitrary resource management routines.
* I use it to manage the device's memory.
* Despite the name of this module, I am *not* going to access the ioports.
*/
@@ -47,12 +47,9 @@
#define IFORCE_MAX_LENGTH 16
-#if defined(CONFIG_JOYSTICK_IFORCE_232)
+/* iforce::bus */
#define IFORCE_232 1
-#endif
-#if defined(CONFIG_JOYSTICK_IFORCE_USB)
#define IFORCE_USB 2
-#endif
#define FALSE 0
#define TRUE 1
@@ -129,12 +126,12 @@
u16 ecmd;
u16 expect_packet;
-#ifdef IFORCE_232
+#ifdef CONFIG_JOYSTICK_IFORCE_232
struct serio *serio; /* RS232 transfer */
int idx, pkt, len, id;
unsigned char csum;
#endif
-#ifdef IFORCE_USB
+#ifdef CONFIG_JOYSTICK_IFORCE_USB
struct usb_device *usbdev; /* USB transfer */
struct urb *irq, *out, *ctrl;
struct usb_ctrlrequest cr;
|