1*0996e64eSFredrik Modeen /* 2*0996e64eSFredrik Modeen * Copyright 2008 Haiku. 3*0996e64eSFredrik Modeen * Distributed under the terms of the MIT License. 4*0996e64eSFredrik Modeen * 5*0996e64eSFredrik Modeen * Authors: 6*0996e64eSFredrik Modeen * Alexander Coers Alexander.Coers@gmx.de 7*0996e64eSFredrik Modeen * Fredrik Modéen fredrik@modeen.se 8*0996e64eSFredrik Modeen */ 9*0996e64eSFredrik Modeen 10*0996e64eSFredrik Modeen #ifndef DRIVER_H 11*0996e64eSFredrik Modeen #define DRIVER_H 12*0996e64eSFredrik Modeen 13*0996e64eSFredrik Modeen #include <KernelExport.h> 14*0996e64eSFredrik Modeen #include <PCI.h> 15*0996e64eSFredrik Modeen 16*0996e64eSFredrik Modeen #include "joystick_driver.h" 17*0996e64eSFredrik Modeen 18*0996e64eSFredrik Modeen #define VENDOR_ID_CREATIVE 0x1102 19*0996e64eSFredrik Modeen #define DEVICE_ID_CREATIVE_EMU10K1 0x0002 20*0996e64eSFredrik Modeen #define SBLIVE_ID 0x7002 /*EMU10000*/ 21*0996e64eSFredrik Modeen #define AUDIGY_ID 0x7003 /*EMU10K2*/ 22*0996e64eSFredrik Modeen #define SBLIVE_DELL_ID 0x7004 /* Game port for SB Live!, Dell OEM gameport*/ 23*0996e64eSFredrik Modeen #define DRIVER_NAME "emuxkigameport" 24*0996e64eSFredrik Modeen #define AREA_NAME "SB_GAME" 25*0996e64eSFredrik Modeen #define MAX_CARDS 2 26*0996e64eSFredrik Modeen 27*0996e64eSFredrik Modeen /* NB global variables are valid only while driver is loaded */ 28*0996e64eSFredrik Modeen static volatile ulong vaddr; /* PCI */ 29*0996e64eSFredrik Modeen 30*0996e64eSFredrik Modeen // use pci manager 31*0996e64eSFredrik Modeen static char pci_name[] = B_PCI_MODULE_NAME; 32*0996e64eSFredrik Modeen static pci_module_info *pci; 33*0996e64eSFredrik Modeen 34*0996e64eSFredrik Modeen // use generic_gameport_module... 35*0996e64eSFredrik Modeen static char gameport_name [] = "generic/gameport/v2"; 36*0996e64eSFredrik Modeen static generic_gameport_module *gameport; 37*0996e64eSFredrik Modeen 38*0996e64eSFredrik Modeen #define HCFG 0x14 /* Hardware Configuration Register of SB-Live */ 39*0996e64eSFredrik Modeen #define HCFG_JOYENABLE 0x00000200 /* Mask for enabling Joystick */ 40*0996e64eSFredrik Modeen 41*0996e64eSFredrik Modeen struct joystick_dev { 42*0996e64eSFredrik Modeen void * driver; 43*0996e64eSFredrik Modeen char name1[64]; 44*0996e64eSFredrik Modeen }; 45*0996e64eSFredrik Modeen 46*0996e64eSFredrik Modeen struct gameport_info { 47*0996e64eSFredrik Modeen char name[60]; /* used for resources */ 48*0996e64eSFredrik Modeen pci_info info; 49*0996e64eSFredrik Modeen joystick_dev joy; 50*0996e64eSFredrik Modeen }; 51*0996e64eSFredrik Modeen 52*0996e64eSFredrik Modeen #endif /* DRIVER_H */ 53