PSP2SDK  dirty-f9e4f2d
The free SDK for PSP2
Functions
include/psp2/io/devctl.h File Reference

Header file which defines device control options. More...

#include <psp2/types.h>
Include dependency graph for devctl.h:

Go to the source code of this file.

Functions

int sceIoDevctl (const char *dev, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen)
int sceIoAssign (const char *dev1, const char *dev2, const char *dev3, int mode, void *unk1, long unk2)
int sceIoUnassign (const char *dev)
int sceIoIoctl (SceUID fd, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen)
int sceIoIoctlAsync (SceUID fd, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen)

Detailed Description

Header file which defines device control options.

Copyright (C) 2015 PSP2SDK Project

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.


Function Documentation

int sceIoAssign ( const char *  dev1,
const char *  dev2,
const char *  dev3,
int  mode,
void *  unk1,
long  unk2 
)

Assigns one IO device to another (I guess)

Parameters:
dev1- The device name to assign.
dev2- The block device to assign from.
dev3- The filesystem device to mape the block device to dev1
mode- Read/Write mode. One of IoAssignPerms.
unk1- Unknown, set to NULL.
unk2- Unknown, set to 0.
Returns:
< 0 on error.
Example: Reassign flash0 in read/write mode.
    sceIoUnassign("flash0");
 sceIoAssign("flash0", "lflash0:0,0", "flashfat0:", IOASSIGN_RDWR, NULL, 0);
int sceIoDevctl ( const char *  dev,
unsigned int  cmd,
void *  indata,
int  inlen,
void *  outdata,
int  outlen 
)

Send a devctl command to a device.

Example: Sending a simple command to a device (not a real devctl)
 sceIoDevctl("ms0:", 0x200000, indata, 4, NULL, NULL);
Parameters:
dev- String for the device to send the devctl to (e.g. "ms0:")
cmd- The command to send to the device
indata- A data block to send to the device, if NULL sends no data
inlen- Length of indata, if 0 sends no data
outdata- A data block to receive the result of a command, if NULL receives no data
outlen- Length of outdata, if 0 receives no data
Returns:
0 on success, < 0 on error
int sceIoIoctl ( SceUID  fd,
unsigned int  cmd,
void *  indata,
int  inlen,
void *  outdata,
int  outlen 
)

Perform an ioctl on a device.

Parameters:
fd- Opened file descriptor to ioctl to
cmd- The command to send to the device
indata- A data block to send to the device, if NULL sends no data
inlen- Length of indata, if 0 sends no data
outdata- A data block to receive the result of a command, if NULL receives no data
outlen- Length of outdata, if 0 receives no data
Returns:
0 on success, < 0 on error
int sceIoIoctlAsync ( SceUID  fd,
unsigned int  cmd,
void *  indata,
int  inlen,
void *  outdata,
int  outlen 
)

Perform an ioctl on a device. (asynchronous)

Parameters:
fd- Opened file descriptor to ioctl to
cmd- The command to send to the device
indata- A data block to send to the device, if NULL sends no data
inlen- Length of indata, if 0 sends no data
outdata- A data block to receive the result of a command, if NULL receives no data
outlen- Length of outdata, if 0 receives no data
Returns:
0 on success, < 0 on error
int sceIoUnassign ( const char *  dev)

Unassign an IO device.

Parameters:
dev- The device to unassign.
Returns:
< 0 on error
Example: See ::sceIoAssign
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines