Example #1
0
static int PCILx_Expunge(LIBBASETYPEPTR LIBBASE)
{
    BOOL ret = TRUE;
    
    D(bug("[PCILinux] expunge\n"));

    /* Try to open PCI subsystem */
    OOP_Object *pci = OOP_NewObject(NULL, CLID_Hidd_PCI, NULL);
    if (pci)
    {
	/* If PCI successed to open, remove your driver from subsystem */
	struct pHidd_PCI_RemHardwareDriver msg;

	msg.driverClass = LIBBASE->psd.driverClass;
	msg.mID = OOP_GetMethodID(IID_Hidd_PCI, moHidd_PCI_RemHardwareDriver);

	D(bug("[PCILinux] Removing driver\n"));
	if (OOP_DoMethod(pci, (OOP_Msg)&msg) == FALSE)
	{
	    ret = FALSE;
	    D(bug("[PCILinux] PCI class refused to remove driver for some reason. Delaying expunge then\n"));
	}
	OOP_DisposeObject(pci);
    }

    return ret;
}
Example #2
0
BOOL DriverInit( struct DriverBase* AHIsubBase )
{
    struct ac97Base* ac97Base = (struct ac97Base*) AHIsubBase;

    ac97Base->dosbase = OpenLibrary( DOSNAME, 37 );
    ac97Base->sysbase = SysBase;

    D(bug("[ac97] Init\n"));

    if(DOSBase)
    {
	ac97Base->oopbase = OpenLibrary(AROSOOP_NAME, 0);
	if (ac97Base)
	{
	    __IHidd_PCIDev = OOP_ObtainAttrBase(IID_Hidd_PCIDevice);

	    D(bug("[ac97] Libraries opened\n"));

	    if (__IHidd_PCIDev)
	    {
		OOP_Object *pci = OOP_NewObject(NULL, CLID_Hidd_PCI, NULL);
		
		D(bug("[ac97] PCIDevice AttrBase = %x\n",__IHidd_PCIDev));
		
		if (pci)
		{
		    struct Hook FindHook = {
			h_Entry:    (IPTR(*)())Enumerator,
			h_Data:	    ac97Base,
		    };

		    struct TagItem Reqs[] = {
			{ tHidd_PCI_Class,	0x04 },
			{ tHidd_PCI_SubClass,	0x01 },
			{ TAG_DONE, 0UL },
		    };

		    struct pHidd_PCI_EnumDevices enummsg = {
			mID:		OOP_GetMethodID(CLID_Hidd_PCI, moHidd_PCI_EnumDevices),
			callback:	&FindHook,
			requirements:	(struct TagItem *)&Reqs,
		    }, *msg = &enummsg;
		    
		    D(bug("[ac97] Got PCI object\n"));
		    
		    ac97Base->cardfound = FALSE;
		    ac97Base->PCM_out = AllocMem(8*32, MEMF_PUBLIC | MEMF_CLEAR);

		    OOP_DoMethod(pci, (OOP_Msg)msg);
		    
		    OOP_DisposeObject(pci);

		    D(bug("[ac97] PCM out base %08x\n", ac97Base->PCM_out));

		    return ac97Base->cardfound;
		}
	    }
Example #3
0
UWORD HIDD_ParallelUnit_GetStatus(OOP_Object *obj)
{
    STATIC_MID;
    struct pHidd_ParallelUnit_GetStatus p, *msg = &p;

    if (!mid) mid = OOP_GetMethodID(IID_Hidd_ParallelUnit, moHidd_ParallelUnit_GetStatus);

    p.mID         = mid;

    return ((UWORD)OOP_DoMethod(obj, (OOP_Msg) msg));
}
Example #4
0
VOID HIDD_ParallelUnit_Stop (OOP_Object *obj)
{
    STATIC_MID;
    struct pHidd_ParallelUnit_Stop p, *msg = &p;
    
    if(!mid) mid = OOP_GetMethodID(IID_Hidd_ParallelUnit, moHidd_ParallelUnit_Stop);
        
    p.mID	= mid;

    ((VOID) OOP_DoMethod(obj, (OOP_Msg) msg));
}
Example #5
0
VOID HIDD_SerialUnit_Start(OOP_Object *obj)
{
    STATIC_MID;
    struct pHidd_SerialUnit_Start p, *msg = &p;

    if (!mid) mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_Start);

    p.mID         = mid;

    OOP_DoMethod(obj, (OOP_Msg) msg);
}
Example #6
0
VOID HIDD_Parallel_DisposeUnit(OOP_Object *obj, OOP_Object *unit)
{
    STATIC_MID;
    struct pHidd_Parallel_DisposeUnit p, *msg = &p;
    
    if(!mid) mid = OOP_GetMethodID(IID_Hidd_Parallel, moHidd_Parallel_DisposeUnit);
        
    p.mID    = mid;
    p.unit   = unit;

    OOP_DoMethod(obj, (OOP_Msg) msg);
}
Example #7
0
OOP_Object * HIDD_Parallel_NewUnit(OOP_Object *obj, ULONG unitnum)
{
    STATIC_MID;
    struct pHidd_Parallel_NewUnit p, *msg = &p;
    
    if(!mid) mid = OOP_GetMethodID(IID_Hidd_Parallel, moHidd_Parallel_NewUnit);
        
    p.mID      = mid;
    p.unitnum  = unitnum;

    return((OOP_Object *) OOP_DoMethod(obj, (OOP_Msg) msg));
}
Example #8
0
VOID Hidd_SDLMouse_HandleEvent(OOP_Object *o, SDL_Event *e) {
    struct pHidd_SDLMouse_HandleEvent msg;
    static OOP_MethodID mid;

    if (!mid)
        mid = OOP_GetMethodID(IID_Hidd_SDLMouse, moHidd_SDLMouse_HandleEvent);

    msg.mID = mid;
    msg.e = e;

    OOP_DoMethod(o, (OOP_Msg) &msg);
}
Example #9
0
VOID HIDD_SerialUnit_GetCapabilities(OOP_Object *obj, struct TagItem * tags)
{
    STATIC_MID;
    struct pHidd_SerialUnit_GetCapabilities p, *msg = &p;

    if (!mid) mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_GetCapabilities);

    p.mID         = mid;
    p.taglist     = tags;

    OOP_DoMethod(obj, (OOP_Msg) msg);
}
Example #10
0
BYTE HIDD_SerialUnit_SendBreak(OOP_Object *obj, int duration)
{
    STATIC_MID;
    struct pHidd_SerialUnit_SendBreak p, *msg = &p;
    
    if(!mid) mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_SendBreak);
        
    p.mID	= mid;
    p.duration  = duration;

    return ((BYTE)OOP_DoMethod(obj, (OOP_Msg) msg));
}
Example #11
0
BOOL HIDD_SerialUnit_SetParameters(OOP_Object *obj, struct TagItem * tags)
{
    STATIC_MID;
    struct pHidd_SerialUnit_SetParameters p, *msg = &p;
    
    if(!mid) mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_SetParameters);
        
    p.mID	= mid;
    p.tags      = tags;

    return ((BOOL) OOP_DoMethod(obj, (OOP_Msg) msg));
}
Example #12
0
BOOL HIDD_SerialUnit_SetBaudrate(OOP_Object *obj, ULONG baudrate)
{
    STATIC_MID;
    struct pHidd_SerialUnit_SetBaudrate p, *msg = &p;
    
    if(!mid) mid = OOP_GetMethodID(IID_Hidd_SerialUnit, moHidd_SerialUnit_SetBaudrate);
        
    p.mID	= mid;
    p.baudrate  = baudrate;

    return ((BOOL) OOP_DoMethod(obj, (OOP_Msg) msg));
}
Example #13
0
VOID HIDD_LinuxMouse_HandleEvent(OOP_Object *o, struct pHidd_Mouse_Event *mouseEvent)
{
    static OOP_MethodID mid = 0;
    struct pHidd_LinuxMouse_HandleEvent p;
    
    if (!mid)
	mid = OOP_GetMethodID(IID_Hidd_LinuxMouse, moHidd_LinuxMouse_HandleEvent);
	
    p.mID		= mid;
    p.mouseEvent	= mouseEvent;
    
    OOP_DoMethod(o, (OOP_Msg)&p);
}
Example #14
0
ULONG HIDD_ParallelUnit_Write (OOP_Object *obj, UBYTE * data, ULONG length)
{
    STATIC_MID;
    struct pHidd_ParallelUnit_Write p, *msg = &p;
    
    if(!mid) mid = OOP_GetMethodID(IID_Hidd_ParallelUnit, moHidd_ParallelUnit_Write);
        
    p.mID	= mid;
    p.Length	= length;
    p.Outbuffer	= data; 

    return ((ULONG) OOP_DoMethod(obj, (OOP_Msg) msg));
}
Example #15
0
BOOL HIDD_ParallelUnit_Init(OOP_Object *obj, VOID * DataReceived, VOID * DataReceivedUserData, VOID * WriteData, VOID * WriteDataUserData)
{
    STATIC_MID;
    struct pHidd_ParallelUnit_Init p, *msg = &p;
    
    if(!mid) mid = OOP_GetMethodID(IID_Hidd_ParallelUnit, moHidd_ParallelUnit_Init);
        
    p.mID      		   = mid;
    p.DataReceived 	   = DataReceived;
    p.DataReceivedUserData = DataReceivedUserData;
    p.WriteData    	   = WriteData;
    p.WriteDataUserData	   = WriteDataUserData;

    return((BOOL) OOP_DoMethod(obj, (OOP_Msg) msg));
}
Example #16
0
static int PCPCI_Expunge(LIBBASETYPEPTR LIBBASE)
{
    int ok;
	
    OOP_Object *pci = OOP_NewObject(NULL, CLID_Hidd_PCI, NULL);
    if (pci)
    {
	struct pHidd_PCI_RemHardwareDriver msg, *pmsg=&msg;
	
	msg.mID = OOP_GetMethodID(IID_Hidd_PCI, moHidd_PCI_RemHardwareDriver);
	msg.driverClass = LIBBASE->psd.driverClass;

	ok = OOP_DoMethod(pci, (OOP_Msg)pmsg);

	OOP_DisposeObject(pci);
    }
    else
	ok = FALSE;

    return ok;
}