| Samsung Internal API reference 2.0

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

Functions
Teesl_udf

## Functions
int | TEES_UDF_InitDriver (char *name, struct fops *fops, unsigned int drvid, struct usr_drv_info **info)
| This function is used to initialize and register UDF driver. More...
int | TEES_UDF_Init_FS_Driver (char *name, struct fops *fops, unsigned int drvid, struct usr_drv_info **info)
| This function is used to initialize and register UDF FS driver. More...
int | TEES_UDF_FiniDriver (struct usr_drv_info *info)
| This function is used to de-initialize and stop UDF driver. More...
int | TEES_UDF_RegisterIoctlDesc (struct usr_drv_info *info, unsigned int cmd, const struct ioctl_desc *desc)
| Register an ioctl() cmd for UDF driver. More...

## Detailed Description

## Function Documentation

int TEES_UDF_FiniDriver | ( | struct usr_drv_info * | info | ) |

`#include <udf.h>`

This function is used to de-initialize and stop UDF driver.

Parameters

  [in] | info | driver handle.

Return values

  0 | on success.
  -1 | on fail and errno is set.

int TEES_UDF_Init_FS_Driver | ( | char * | name,
|  | struct fops * | fops,
|  | unsigned int | drvid,
|  | struct usr_drv_info ** | info
| ) |  |

`#include <udf.h>`

This function is used to initialize and register UDF FS driver.

Parameters

  [in] | name | name.
  [in] | fops | file operations.
  [in] | drvid | id.
  [in] | info | driver handle.

Return values

  0 | on success.
  -1 | on fail and errno is set.

int TEES_UDF_InitDriver | ( | char * | name,
|  | struct fops * | fops,
|  | unsigned int | drvid,
|  | struct usr_drv_info ** | info
| ) |  |

`#include <udf.h>`

This function is used to initialize and register UDF driver.

Parameters

  [in] | name | name.
  [in] | fops | file operations.
  [in] | drvid | id.
  [in] | info | driver handle.

Return values

  0 | on success.
  -1 | on fail and errno is set.

int TEES_UDF_RegisterIoctlDesc | ( | struct usr_drv_info * | info,
|  | unsigned int | cmd,
|  | const struct ioctl_desc * | desc
| ) |  |

`#include <udf.h>`

Register an ioctl() cmd for UDF driver.

Parameters

  [in] | info | A pointer to struct usr_drv_info that contains information describing the driver.
  [in] | cmd | An ioctl() command being added.
  [in] | desc | An ioctl() arguments descriptor, see below for details.

Return values

  0 | on success, -1 otherwise. errno variable is set appropriately.

Example:

struct example { uint32_t a; char *b; uint32_t items_cnt; uint32_t items[]; };

struct example data = { .a = 0xa5a5a5a5, .b = "0123456789", .items_cnt = 3, .items = {0, 1, 2}, };

struct ioctl_desc example_desc = { .cnt = 5, .tpl = { {.type = DESC_ATOM_VAL, .len = sizeof(uint32_t) }, {.type = DESC_ATOM_REF, .len = 10 }, {.type = DESC_ATOM_ARR_CNT_0, .len = sizeof(uint32_t) }, {.type = DESC_ATOM_ARR_ITEM_0, .len = 1 }, {.type = DESC_ATOM_VAL, .len = sizeof(uint32_t) }, }, };

ret = TEES_UDF_RegisterIoctlDesc(my_driver_info, EXAMPLE_IOCTL_ID, &example_desc);
if (ret) {
printf("udf register ioctl() desc failed, ret = %d\n", ret);
}