2014-07-12 09:46:14 +02:00
|
|
|
#include "stdafx.h"
|
2015-02-22 09:50:26 +01:00
|
|
|
#include "Emu/Memory/Memory.h"
|
|
|
|
|
#include "Emu/System.h"
|
|
|
|
|
#include "Emu/SysCalls/Modules.h"
|
|
|
|
|
#include "cellUsbd.h"
|
2013-09-28 04:36:57 +02:00
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
extern Module cellUsbd;
|
2013-09-28 04:36:57 +02:00
|
|
|
|
2015-02-22 15:50:11 +01:00
|
|
|
struct cellUsbdInternal
|
|
|
|
|
{
|
|
|
|
|
bool m_bInitialized;
|
|
|
|
|
|
|
|
|
|
cellUsbdInternal()
|
|
|
|
|
: m_bInitialized(false)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
cellUsbdInternal cellUsbdInstance;
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdInit()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
2015-02-22 15:50:11 +01:00
|
|
|
cellUsbd.Log("cellUsbdInit()");
|
|
|
|
|
|
|
|
|
|
if (cellUsbdInstance.m_bInitialized)
|
|
|
|
|
return CELL_USBD_ERROR_ALREADY_INITIALIZED;
|
|
|
|
|
|
|
|
|
|
cellUsbdInstance.m_bInitialized = true;
|
|
|
|
|
|
2013-09-28 04:36:57 +02:00
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdEnd()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
2015-02-22 15:50:11 +01:00
|
|
|
cellUsbd.Log("cellUsbdEnd()");
|
|
|
|
|
|
|
|
|
|
if (!cellUsbdInstance.m_bInitialized)
|
|
|
|
|
return CELL_USBD_ERROR_NOT_INITIALIZED;
|
|
|
|
|
|
|
|
|
|
cellUsbdInstance.m_bInitialized = false;
|
|
|
|
|
|
2013-09-28 04:36:57 +02:00
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdSetThreadPriority()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdSetThreadPriority2()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdGetThreadPriority()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdRegisterLdd()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdRegisterExtraLdd()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdRegisterExtraLdd2()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdUnregisterLdd()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdUnregisterExtraLdd()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdOpenPipe()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdClosePipe()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdControlTransfer()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdBulkTransfer()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdInterruptTransfer()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdIsochronousTransfer()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdHSIsochronousTransfer()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdScanStaticDescriptor()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdGetDeviceSpeed()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdGetDeviceLocation()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdSetPrivateData()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdGetPrivateData()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdAllocateMemory()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
s32 cellUsbdFreeMemory()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED_FUNC(cellUsbd);
|
|
|
|
|
return CELL_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-22 09:50:26 +01:00
|
|
|
Module cellUsbd("cellUsbd", []()
|
2013-09-28 04:36:57 +02:00
|
|
|
{
|
2015-02-23 16:09:52 +01:00
|
|
|
cellUsbdInstance.m_bInitialized = false;
|
|
|
|
|
|
2015-02-20 14:58:40 +01:00
|
|
|
REG_FUNC(cellUsbd, cellUsbdInit);
|
|
|
|
|
REG_FUNC(cellUsbd, cellUsbdEnd);
|
2013-09-28 04:36:57 +02:00
|
|
|
|
2015-02-20 14:58:40 +01:00
|
|
|
REG_FUNC(cellUsbd, cellUsbdSetThreadPriority);
|
|
|
|
|
REG_FUNC(cellUsbd, cellUsbdSetThreadPriority2);
|
|
|
|
|
REG_FUNC(cellUsbd, cellUsbdGetThreadPriority);
|
2013-09-28 04:36:57 +02:00
|
|
|
|
2015-02-20 14:58:40 +01:00
|
|
|
REG_FUNC(cellUsbd, cellUsbdRegisterLdd);
|
|
|
|
|
REG_FUNC(cellUsbd, cellUsbdRegisterExtraLdd);
|
|
|
|
|
REG_FUNC(cellUsbd, cellUsbdRegisterExtraLdd2);
|
|
|
|
|
REG_FUNC(cellUsbd, cellUsbdUnregisterLdd);
|
|
|
|
|
REG_FUNC(cellUsbd, cellUsbdUnregisterExtraLdd);
|
2013-09-28 04:36:57 +02:00
|
|
|
|
2015-02-20 14:58:40 +01:00
|
|
|
REG_FUNC(cellUsbd, cellUsbdOpenPipe);
|
|
|
|
|
REG_FUNC(cellUsbd, cellUsbdClosePipe);
|
2013-09-28 04:36:57 +02:00
|
|
|
|
2015-02-20 14:58:40 +01:00
|
|
|
REG_FUNC(cellUsbd, cellUsbdControlTransfer);
|
|
|
|
|
REG_FUNC(cellUsbd, cellUsbdBulkTransfer);
|
|
|
|
|
REG_FUNC(cellUsbd, cellUsbdInterruptTransfer);
|
|
|
|
|
REG_FUNC(cellUsbd, cellUsbdIsochronousTransfer);
|
|
|
|
|
REG_FUNC(cellUsbd, cellUsbdHSIsochronousTransfer);
|
2013-09-28 04:36:57 +02:00
|
|
|
|
2015-02-20 14:58:40 +01:00
|
|
|
REG_FUNC(cellUsbd, cellUsbdScanStaticDescriptor);
|
|
|
|
|
REG_FUNC(cellUsbd, cellUsbdGetDeviceSpeed);
|
|
|
|
|
REG_FUNC(cellUsbd, cellUsbdGetDeviceLocation);
|
2013-09-28 04:36:57 +02:00
|
|
|
|
2015-02-20 14:58:40 +01:00
|
|
|
REG_FUNC(cellUsbd, cellUsbdSetPrivateData);
|
|
|
|
|
REG_FUNC(cellUsbd, cellUsbdGetPrivateData);
|
2013-09-28 04:36:57 +02:00
|
|
|
|
2015-02-20 14:58:40 +01:00
|
|
|
REG_FUNC(cellUsbd, cellUsbdAllocateMemory);
|
|
|
|
|
REG_FUNC(cellUsbd, cellUsbdFreeMemory);
|
2015-02-22 12:38:14 +01:00
|
|
|
});
|