mirror of
https://github.com/joel16/uofw.git
synced 2025-02-20 02:42:43 +00:00
mediaman: This commit corrects the sceUmd_040A7090() function in src/mediaman.c. Previously, it was using wrong error code values (which have also been fixed in this commit) and one error code check was missing. In addition, several spelling mistakes introduced with the previous mediaman commit were corrected.
include/common/errors.h: As noted above, several error code defines were corrected and a 1.50 mistake-error-code list has been added.
This commit is contained in:
parent
182875e1a4
commit
fd5e4d8495
@ -58,29 +58,44 @@
|
||||
#define SCE_ERROR_ERRNO_DEVICE_NO_FREE_SPACE 0x8001001C
|
||||
#define SCE_ERROR_ERRNO_READ_ONLY 0x8001001E
|
||||
#define SCE_ERROR_ERRNO_CLOSED 0x80010020
|
||||
#define SCE_ERROR_ERRNO_FILE_PATH_TOO_LONG 0x80010024
|
||||
// #define SCE_ERROR_ERRNO_EIDRM 0x80010024 -- Note: Keep this undefined.
|
||||
#define SCE_ERROR_ERRNO_FILE_PROTOCOL 0x80010047
|
||||
#define SCE_ERROR_ERRNO_DIRECTORY_IS_NOT_EMPTY 0x8001005A
|
||||
#define SCE_ERROR_ERRNO_NAME_TOO_LONG 0x8001005B /* File name or path name too long */
|
||||
#define SCE_ERROR_ERRNO_TOO_MANY_SYMBOLIC_LINKS 0x8001005C
|
||||
#define SCE_ERROR_ERRNO_FILE_ADDR_IN_USE 0x80010062
|
||||
#define SCE_ERROR_ERRNO_CONNECTION_ABORTED 0x80010067
|
||||
#define SCE_ERROR_ERRNO_CONNECTION_RESET 0x80010068
|
||||
#define SCE_ERROR_ERRNO_NO_FREE_BUF_SPACE 0x80010069
|
||||
#define SCE_ERROR_ERRNO_FILE_TIMEOUT 0x8001006E
|
||||
#define SCE_ERROR_ERRNO_ESHUTDOWN 0x8001006E /* Error sending package after socket was shutdown */
|
||||
#define SCE_ERROR_ERRNO_EADDRINUSE 0x80010070 /* The address is already in use. */
|
||||
#define SCE_ERROR_ERRNO_CONNECTION_ABORTED 0x80010071 /* Connection was aborted by software. */
|
||||
#define SCE_ERROR_ERRNO_ETIMEDOUT 0x80010074 /* Operation timed out. */
|
||||
#define SCE_ERROR_ERRNO_IN_PROGRESS 0x80010077
|
||||
#define SCE_ERROR_ERRNO_ALREADY 0x80010078
|
||||
#define SCE_ERROR_ERRNO_NO_MEDIA 0x8001007B
|
||||
#define SCE_ERROR_ERRNO_INVALID_MEDIUM 0x8001007C
|
||||
#define SCE_ERROR_ERRNO_INVALID_PROTOCOL 0x8001007B /* Protocol is not supported. */
|
||||
#define SCE_ERROR_ERRNO_INVALID_SOCKET_TYPE 0x8001007C /* Unsupported socket type. */
|
||||
#define SCE_ERROR_ERRNO_ADDRESS_NOT_AVAILABLE 0x8001007D
|
||||
#define SCE_ERROR_ERRNO_IS_ALREADY_CONNECTED 0x8001007F
|
||||
#define SCE_ERROR_ERRNO_NOT_CONNECTED 0x80010080
|
||||
#define SCE_ERROR_ERRNO_FILE_QUOTA_EXCEEDED 0x80010084
|
||||
#define SCE_ERROR_ERRNO_FUNCTION_NOT_SUPPORTED 0x8001B000
|
||||
#define SCE_ERROR_ERRNO_NOT_SUPPORTED 0x80010086
|
||||
#define SCE_ERROR_ERRNO_ENOMEDIUM 0x80010087 /* No medium was found. */
|
||||
|
||||
/* Non-standard error code definitions */
|
||||
#define SCE_ERROR_ERRNO_ADDR_OUT_OF_MAIN_MEM 0x8001B001
|
||||
#define SCE_ERROR_ERRNO_INVALID_UNIT_NUM 0x8001B002
|
||||
#define SCE_ERROR_ERRNO_INVALID_FILE_SIZE 0x8001B003
|
||||
#define SCE_ERROR_ERRNO_INVALID_FLAG 0x8001B004
|
||||
#define SCE_ERROR_ERRNO_NO_CACHE 0x8001B005
|
||||
#define SCE_ERROR_ERRNO_WRONG_MEDIUM_TYPE 0x8001B006
|
||||
|
||||
/* Flash memory (UMD, MS) up to 1.5.0 mistakenly had returned these values. */
|
||||
#define SCE_ERROR_ERRNO150_ENAMETOOLONG 0x80010024
|
||||
#define SCE_ERROR_ERRNO150_EADDRINUSE 0x80010062
|
||||
#define SCE_ERROR_ERRNO150_ECONNABORTED 0x80010067
|
||||
#define SCE_ERROR_ERRNO150_ETIMEDOUT 0x8001006E
|
||||
#define SCE_ERROR_ERRNO150_ENOMEDIUM 0x8001007B
|
||||
#define SCE_ERROR_ERRNO150_EMEDIUMTYPE 0x8001007C
|
||||
#define SCE_ERROR_ERRNO150_ENOTSUP 0x8001B000
|
||||
|
||||
#define SCE_ERROR_KERNEL_ERROR 0x80020001
|
||||
#define SCE_ERROR_KERNEL_NOT_IMPLEMENTED 0x80020002
|
||||
|
@ -4,14 +4,14 @@
|
||||
|
||||
#include "common_header.h"
|
||||
|
||||
/** @defgroup UMDDriveManagment UMD Drive Managment
|
||||
/** @defgroup UMDDriveManagement UMD Drive Management
|
||||
* Manages the UMD drive and accessing data on it.
|
||||
*/
|
||||
|
||||
/** @defgroup Mediaman Mediaman
|
||||
* @ingroup UMDDriveManagment
|
||||
* @ingroup UMDDriveManagement
|
||||
*
|
||||
* Mediaman enables users to access the UMD drive. The drive can be accessed through files or sectors. \n\n
|
||||
* Mediaman enables users to access the UMD drive. The drive can be accessed through files or sectors. \n
|
||||
*
|
||||
* To access the UMD drive via a file, the PSP provides the ISO-9660 file system. A file can be accessed \n
|
||||
* by standard I/O functions as in sceIoOpen(), sceIoClose() and sceIoRead(). The general path format is the \n
|
||||
@ -22,14 +22,14 @@
|
||||
*
|
||||
* To access the UMD drive by sectors, the PSP provides a UMD block device driver. You can read the sectors \n
|
||||
* by using standard I/O functions (i.e. sceIoOpen(), sceIoClose() and sceIoRead()). The general path format \n
|
||||
* is the follwoing: "block device name" + "unit number" + ':'. Note that the block device is set by the \n
|
||||
* is the following: "block device name" + "unit number" + ':'. Note that the block device is set by the \n
|
||||
* sceUmdActivate() function to "umd0:". \n
|
||||
* To open a phyisical device as a device file, consider this example: \n
|
||||
* sceIoOpen("UMD0:...."); \n
|
||||
* By default, opening a new physical device sets the first sector to read at sector_0. \n
|
||||
*
|
||||
* A sector contains 2048 bytes and reading is performed sector wise. That is, in sceIoRead() the read size \n
|
||||
* has to be specifized in the number of sectors you want to read. \n
|
||||
* has to be specified in the number of sectors you want to read. \n
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
@ -73,6 +73,7 @@ enum SceUmdDiscStates {
|
||||
enum SceUmdDevicePowerModes {
|
||||
/** Set the UMD drive's power state to ON. */
|
||||
SCE_UMD_MODE_POWER_ON = (1 << 0),
|
||||
/** Set the UMD drive's power state to the cuurent power state. */
|
||||
SCE_UMD_MODE_POWER_CUR = (1 << 1),
|
||||
};
|
||||
|
||||
|
@ -18,6 +18,14 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Get corresponding 1.50 error code used by the UMD drivers. On 1.50, a bunch of error codes were \n
|
||||
* mistakenly returned by the UMD modules.
|
||||
*
|
||||
* @param errorState Get the 1.50 version of this error code.
|
||||
*
|
||||
* @return The error code used on 1.50.
|
||||
*/
|
||||
s32 sceUmd_040A7090(s32 errorState);
|
||||
|
||||
SceUID sceUmdGetUserEventFlagId(void);
|
||||
@ -62,7 +70,7 @@ u32 sceUmd_76D356F9(s32 (*arg0)(void));
|
||||
* Activate the UMD drive. This includes assigning the file system, the block device (set to "umd0:")
|
||||
* and setting the alias name for the file system access.
|
||||
*
|
||||
* @param mode The initial UMD device power mode. One of ::SceUmdDevicePowerModes.
|
||||
* @param mode The initial UMD drive power mode. One of ::SceUmdDevicePowerModes.
|
||||
* @param aliasName The alias name for the mounted filesystem device name. Pass ::SCE_UMD_ALIAS_NAME.
|
||||
*
|
||||
* @return SCE_ERROR_OK on success, otherwise SCE_ERROR_ERRNO_INVALID_ARGUMENT.
|
||||
@ -72,7 +80,7 @@ s32 sceUmdActivate(s32 mode, const char *aliasName);
|
||||
/**
|
||||
* Deactivate the UMD drive.
|
||||
*
|
||||
* @param mode The new UMD device power mode? One of ::SceUmdDevicePowerModes.
|
||||
* @param mode The new UMD drive power mode. One of ::SceUmdDevicePowerModes.
|
||||
* @param aliasName aliasName The alias name for the mounted filesystem device name. Pass ::SCE_UMD_ALIAS_NAME.
|
||||
*
|
||||
* @return SCE_ERROR_OK on success, otherwise SCE_ERROR_ERRNO_INVALID_ARGUMENT.
|
||||
@ -122,7 +130,7 @@ s32 sceUmdCheckMedium(void);
|
||||
*
|
||||
* @param umdState The state to wait for until it occurs. One of ::SceUmdDiscStates.
|
||||
*
|
||||
* @return SCE_ERROR_OK, otherwise SCE_ERROR_ERRNO_INVALID_ARGUMENT if the given umd state
|
||||
* @return SCE_ERROR_OK, otherwise SCE_ERROR_ERRNO_INVALID_ARGUMENT if the given UMD state
|
||||
* isn't one of the following: SCE_UMD_MEDIA_OUT, SCE_UMD_MEDIA_IN, SCE_UMD_NOT_READY,
|
||||
* SCE_UMD_READY, SCE_UMD_READABLE
|
||||
* Other errors indicate a thread synchronization error.
|
||||
@ -135,7 +143,7 @@ s32 sceUmdWaitDriveStat(s32 umdState);
|
||||
* @param umdState The state to wait for until it occurs. One of ::SceUmdDiscStates.
|
||||
* @param timeout Timeout value in microseconds for the wait.
|
||||
*
|
||||
* @return SCE_ERROR_OK, otherwise SCE_ERROR_ERRNO_INVALID_ARGUMENT if the given umd state
|
||||
* @return SCE_ERROR_OK, otherwise SCE_ERROR_ERRNO_INVALID_ARGUMENT if the given UMD state
|
||||
* isn't one of the following: SCE_UMD_MEDIA_OUT, SCE_UMD_MEDIA_IN, SCE_UMD_NOT_READY,
|
||||
* SCE_UMD_READY, SCE_UMD_READABLE.
|
||||
* Other errors indicate a thread synchronization error.
|
||||
@ -148,7 +156,7 @@ s32 sceUmdWaitDriveStatWithTimer(u32 umdState, u32 timeout);
|
||||
* @param umdState The state to wait for until it occurs. One of ::SceUmdDiscStates.
|
||||
* @param timeout Timeout value in microseconds for the wait.
|
||||
*
|
||||
* @return SCE_ERROR_OK, otherwise SCE_ERROR_ERRNO_INVALID_ARGUMENT if the given umd state
|
||||
* @return SCE_ERROR_OK, otherwise SCE_ERROR_ERRNO_INVALID_ARGUMENT if the given UMD state
|
||||
* isn't one of the following: SCE_UMD_MEDIA_OUT, SCE_UMD_MEDIA_IN, SCE_UMD_NOT_READY,
|
||||
* SCE_UMD_READY, SCE_UMD_READABLE
|
||||
* Other errors indicate a thread synchronization error.
|
||||
|
@ -23,7 +23,7 @@ extern "C" {
|
||||
* Activate the UMD drive. This includes assigning the file system, the block device (set to "umd0:")
|
||||
* and setting the alias name for the file system access.
|
||||
*
|
||||
* @param mode The initial UMD device power mode. One of ::SceUmdDevicePowerModes.
|
||||
* @param mode The initial UMD drive power mode. One of ::SceUmdDevicePowerModes.
|
||||
* @param aliasName The alias name for the mounted filesystem device name. Pass ::SCE_UMD_ALIAS_NAME.
|
||||
*
|
||||
* @return SCE_ERROR_OK on success, otherwise SCE_ERROR_ERRNO_INVALID_ARGUMENT.
|
||||
@ -33,7 +33,7 @@ s32 sceUmdActivate(s32 mode, const char *aliasName);
|
||||
/**
|
||||
* Deactivate the UMD drive.
|
||||
*
|
||||
* @param mode The new UMD device power mode. One of ::SceUmdDevicePowerModes.
|
||||
* @param mode The new UMD drive power mode. One of ::SceUmdDevicePowerModes.
|
||||
* @param aliasName aliasName The alias name for the mounted filesystem device name. Pass ::SCE_UMD_ALIAS_NAME.
|
||||
*
|
||||
* @return SCE_ERROR_OK on success, otherwise SCE_ERROR_ERRNO_INVALID_ARGUMENT.
|
||||
@ -83,7 +83,7 @@ s32 sceUmdCheckMedium(void);
|
||||
*
|
||||
* @param umdState The state to wait for until it occurs. One of ::SceUmdDiscStates.
|
||||
*
|
||||
* @return SCE_ERROR_OK, otherwise SCE_ERROR_ERRNO_INVALID_ARGUMENT if the given umd state
|
||||
* @return SCE_ERROR_OK, otherwise SCE_ERROR_ERRNO_INVALID_ARGUMENT if the given UMD state
|
||||
* isn't one of the following: SCE_UMD_MEDIA_OUT, SCE_UMD_MEDIA_IN, SCE_UMD_NOT_READY,
|
||||
* SCE_UMD_READY, SCE_UMD_READABLE
|
||||
* Other errors indicate a thread synchronization error.
|
||||
@ -96,7 +96,7 @@ s32 sceUmdWaitDriveStat(s32 umdState);
|
||||
* @param umdState The state to wait for until it occurs. One of ::SceUmdDiscStates.
|
||||
* @param timeout Timeout value in microseconds for the wait.
|
||||
*
|
||||
* @return SCE_ERROR_OK, otherwise SCE_ERROR_ERRNO_INVALID_ARGUMENT if the given umd state
|
||||
* @return SCE_ERROR_OK, otherwise SCE_ERROR_ERRNO_INVALID_ARGUMENT if the given UMD state
|
||||
* isn't one of the following: SCE_UMD_MEDIA_OUT, SCE_UMD_MEDIA_IN, SCE_UMD_NOT_READY,
|
||||
* SCE_UMD_READY, SCE_UMD_READABLE.
|
||||
* Other errors indicate a thread synchronization error.
|
||||
@ -109,7 +109,7 @@ s32 sceUmdWaitDriveStatWithTimer(u32 umdState, u32 timeout);
|
||||
* @param umdState The state to wait for until it occurs. One of ::SceUmdDiscStates.
|
||||
* @param timeout Timeout value in microseconds for the wait.
|
||||
*
|
||||
* @return SCE_ERROR_OK, otherwise SCE_ERROR_ERRNO_INVALID_ARGUMENT if the given umd state
|
||||
* @return SCE_ERROR_OK, otherwise SCE_ERROR_ERRNO_INVALID_ARGUMENT if the given UMD state
|
||||
* isn't one of the following: SCE_UMD_MEDIA_OUT, SCE_UMD_MEDIA_IN, SCE_UMD_NOT_READY,
|
||||
* SCE_UMD_READY, SCE_UMD_READABLE
|
||||
* Other errors indicate a thread synchronization error.
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "common_header.h"
|
||||
|
||||
/**
|
||||
* @ingroup UMDDriveManagment
|
||||
* @ingroup UMDDriveManagement
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
@ -9,7 +9,7 @@
|
||||
*
|
||||
* 1) Assigns the filesystem, the block device and the alias name for the UMD drive.
|
||||
*
|
||||
* 2) Provides fucntions to handle UMD drive media changes.
|
||||
* 2) Provides functions to handle UMD drive media changes.
|
||||
*
|
||||
*/
|
||||
|
||||
@ -217,18 +217,20 @@ s32 sceUmd_040A7090(s32 errorState)
|
||||
return errorState;
|
||||
|
||||
switch (errorState) {
|
||||
case 0x80010070:
|
||||
return SCE_ERROR_ERRNO_FILE_ADDR_IN_USE;
|
||||
case 0x80010071:
|
||||
return SCE_ERROR_ERRNO_CONNECTION_ABORTED;
|
||||
case 0x80010074:
|
||||
return SCE_ERROR_ERRNO_FILE_TIMEOUT;
|
||||
case 0x80010086:
|
||||
return SCE_ERROR_ERRNO_FUNCTION_NOT_SUPPORTED;
|
||||
case 0x80010087:
|
||||
return SCE_ERROR_ERRNO_NO_MEDIA;
|
||||
case 0x8001B006:
|
||||
return SCE_ERROR_ERRNO_INVALID_MEDIUM;
|
||||
case SCE_ERROR_ERRNO_NAME_TOO_LONG:
|
||||
return SCE_ERROR_ERRNO150_ENAMETOOLONG;
|
||||
case SCE_ERROR_ERRNO_EADDRINUSE:
|
||||
return SCE_ERROR_ERRNO150_EADDRINUSE;
|
||||
case SCE_ERROR_ERRNO_CONNECTION_ABORTED:
|
||||
return SCE_ERROR_ERRNO150_ECONNABORTED;
|
||||
case SCE_ERROR_ERRNO_ETIMEDOUT:
|
||||
return SCE_ERROR_ERRNO150_ETIMEDOUT;
|
||||
case SCE_ERROR_ERRNO_NOT_SUPPORTED:
|
||||
return SCE_ERROR_ERRNO150_ENOTSUP;
|
||||
case SCE_ERROR_ERRNO_ENOMEDIUM:
|
||||
return SCE_ERROR_ERRNO150_ENOMEDIUM;
|
||||
case SCE_ERROR_ERRNO_WRONG_MEDIUM_TYPE:
|
||||
return SCE_ERROR_ERRNO150_EMEDIUMTYPE;
|
||||
default:
|
||||
return errorState;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user