~ubuntu-branches/ubuntu/gutsy/linux-source-2.6.22/gutsy

« back to all changes in this revision

Viewing changes to drivers/input/joystick/xpad.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Collins, Ben Collins, Chuck Short, Fabio M. Di Nitto, Kyle McMartin, Phillip Lougher, Tim Gardner
  • Date: 2007-07-30 12:01:43 UTC
  • Revision ID: james.westby@ubuntu.com-20070730120143-ubddic2ucqu8o6dv
Tags: 2.6.22-9.20
[Ben Collins]

* tulip: Fix for Uli5261 chipsets.
* tulip: Define ULI PCI ID's
* tulip: Let dmfe handle davicom on non-sparc
* input: Allow root to inject unknown scan codes.
* irda: Default to dongle type 9 on IBM hardware
* input/mouse/alps: Do not call psmouse_reset() for alps
* pcmcia: Do not insert pcmcia cards on resume
* ide-cd: Disable verbose errors.
* block: Make CDROMEJECT more robust
* pm: Config option to disable handling of console during suspend/resume.
* version: Implement version_signature proc file.
* update toshiba_acpi to 0.19a-dev
* xpad: Update to latest version from xbox-linux.
* ubuntu: Enable setting of CONFIG_VERSION_SIGNATURE at build time
* toshiba_acpi: Don't use init_MUTEX_LOCKED

[Chuck Short]

* [USB]: add ASUS LCM to the blacklist
* [NET]: Add mcp73 to forcedeth.
* [USB]: Added support for Sanwa PC5000 multimeter usb cable (KB-USB2).
* [ATA] Add support for Sb700 AHCI nor-raid5 and raid5

[Fabio M. Di Nitto]

* drivers/char/vt.c: make promcon driver init a boot option.

[Kyle McMartin]

* Disable MMCONFIG by default

[Phillip Lougher]

* fix NFS mounting regression from Edgy->Feisty
* r8169: disable TSO by default for RTL8111/8168B chipsets.

[Tim Gardner]

* Catch nonsense keycodes and silently ignore
* Cause SoftMac to emit an association event when setting ESSID.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Xbox Controller driver for Linux - v0.1.5
 
3
 *
 
4
 *      header file containing ioctl definitions
 
5
 *
 
6
 * Copyright (c)  2003  Marko Friedemann <mfr@bmx-chemnitz.de>
 
7
 *
 
8
 *
 
9
 * This program is free software; you can redistribute it and/or
 
10
 * modify it under the terms of the GNU General Public License as
 
11
 * published by the Free Software Foundation; either version 2 of
 
12
 * the License, or (at your option) any later version.
 
13
 *
 
14
 * This program is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
 * GNU General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU General Public License
 
20
 * along with this program; if not, write to the Free Software
 
21
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
22
 */
 
23
 
 
24
#ifndef __XPAD_h
 
25
#define __XPAD_h
 
26
 
 
27
 
 
28
/*********** ioctl stuff, can be used outside of the driver ***********/
 
29
#define USB_XPAD_IOC_MAGIC      'x'
 
30
 
 
31
#define USB_XPAD_IOCRESET       _IO(  USB_XPAD_IOC_MAGIC, 0 )
 
32
#define USB_XPAD_IOCSRUMBLE     _IOW( USB_XPAD_IOC_MAGIC, 3, int )
 
33
#define USB_XPAD_IOCGRUMBLE     _IOR( USB_XPAD_IOC_MAGIC, 4, int )
 
34
 
 
35
#define USB_XPAD_IOCSIR         _IOW( USB_XPAD_IOC_MAGIC, 5, int )
 
36
#define USB_XPAD_IOCGIR         _IOR( USB_XPAD_IOC_MAGIC, 6, int )
 
37
 
 
38
#define USB_XPAD_IOC_MAXNR      6
 
39
 
 
40
/************************* driver internals ***************************/
 
41
#ifdef __KERNEL__
 
42
 
 
43
#include <linux/input.h>
 
44
#include <linux/circ_buf.h>
 
45
 
 
46
/****************** driver description and version ********************/
 
47
#define DRIVER_VERSION          "v0.1.6"
 
48
#define DRIVER_AUTHOR           "Marko Friedemann <mfr@bmx-chemnitz.de>,\
 
49
 Oliver Schwartz <Oliver.Schwartz@gmx.de>, Georg Lukas <georg@op-co.de>,\
 
50
 Thomas Pedley <Gentoox@shallax.com>, Edgar Hucek <hostmaster@ed-soft.at>"
 
51
 
 
52
#define DRIVER_DESC             "driver for Xbox controllers"
 
53
 
 
54
/****************************** constants *****************************/
 
55
#define XPAD_MAX_DEVICES        4
 
56
#define XPAD_PKT_LEN            32      /* input packet size */
 
57
#define XPAD_PKT_LEN_FF         6       /* output packet size - rumble */
 
58
 
 
59
#define XPAD_TX_BUFSIZE         XPAD_PKT_LEN_FF * 8     /* max. 8 requests */
 
60
 
 
61
/************************* the device struct **************************/
 
62
struct usb_xpad {
 
63
        struct input_dev *dev;                  /* input device interface */
 
64
        struct usb_device *udev;                /* usb device */
 
65
 
 
66
        struct urb *irq_in;                     /* urb for int. in report */
 
67
        unsigned char *idata;                   /* input data */
 
68
        dma_addr_t idata_dma;
 
69
 
 
70
        char phys[65];                          /* physical input dev path */
 
71
 
 
72
        unsigned char offsetset_compensation;
 
73
        int left_offset_x;
 
74
        int left_offset_y;
 
75
        int right_offset_x;
 
76
        int right_offset_y;
 
77
 
 
78
        int isMat;                              /* is this a dancepad/mat? */
 
79
        int is360;                              /* is this a Xbox 360 Controller */
 
80
 
 
81
#ifdef CONFIG_USB_XPAD_RUMBLE
 
82
        int rumble_enabled;                     /* ioctl can toggle rumble */
 
83
 
 
84
        int ep_out_adr;                         /* number of out endpoint */
 
85
        unsigned char tx_data[XPAD_PKT_LEN_FF]; /* output data (rumble) */
 
86
        int strong_rumble, play_strong;         /* strong rumbling */
 
87
        int weak_rumble, play_weak;             /* weak rumbling */
 
88
        struct timer_list rumble_timer;         /* timed urb out retry */
 
89
        wait_queue_head_t wait;                 /* wait for URBs on queue */
 
90
 
 
91
        spinlock_t tx_lock;
 
92
        struct circ_buf tx;
 
93
        unsigned char tx_buf[XPAD_TX_BUFSIZE];
 
94
        long tx_flags[1];                       /* transmit flags */
 
95
#endif
 
96
};
 
97
 
 
98
/* for the list of know devices */
 
99
struct xpad_device {
 
100
        u16 idVendor;
 
101
        u16 idProduct;
 
102
        u8  isMat;
 
103
        char *name;
 
104
        u8  is360;
 
105
};
 
106
 
 
107
 
 
108
/************************ rumble function stubs ***********************/
 
109
#ifndef CONFIG_USB_XPAD_RUMBLE
 
110
 #define xpad_rumble_ioctl(dev, cmd, arg) -ENOTTY
 
111
 #define xpad_rumble_open(xpad) {}
 
112
 #define xpad_rumble_probe(udev, xpad, ifnum) 0
 
113
 #define xpad_rumble_close(xpad) {}
 
114
 #define xpad_rumble_disconnect(xpad) {}
 
115
#else /* CONFIG_USB_XPAD_RUMBLE */
 
116
 
 
117
 #define XPAD_TX_RUNNING        0
 
118
 #define XPAD_TX_INC(var, n)    (var) += n; (var) %= XPAD_TX_BUFSIZE
 
119
 
 
120
 #ifndef __USB_XPAD_RUMBLE
 
121
  extern int  xpad_rumble_ioctl(struct input_dev *dev, unsigned int cmd, unsigned long arg);
 
122
  extern void xpad_rumble_open(struct usb_xpad *xpad);
 
123
  extern int  xpad_rumble_probe(struct usb_device *udev, struct usb_xpad *xpad, unsigned int ifnum);
 
124
  extern void xpad_rumble_close(struct usb_xpad *xpad);
 
125
  extern void xpad_rumble_disconnect(struct usb_xpad *xpad);
 
126
 #endif /* __USB_XPAD_RUMBLE */
 
127
#endif /* CONFIG_USB_XPAD_RUMBLE */
 
128
 
 
129
#endif /* __KERNEL__ */
 
130
 
 
131
#endif /* __XPAD_h */