Flash Translation Layer  1.0
Functions | Variables
device.c File Reference

implementation of the device More...

#include "include/device.h"
#include "include/log.h"
#include "include/ramdisk.h"
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <pthread.h>
Include dependency graph for device.c:

Functions

struct device_requestdevice_alloc_request (uint64_t flags)
 dynamic allocate the device request More...
 
void device_free_request (struct device_request *request)
 free pre-allocated device_request resource More...
 
int device_module_init (const uint64_t modnum, struct device **__dev, uint64_t flags)
 initialize the device module More...
 
int device_module_exit (struct device *dev)
 deallocate the device module More...
 

Variables

static int(* submodule_init [])(struct device *, uint64_t)
 initialize the submodule More...
 

Detailed Description

implementation of the device

Author
Gijun Oh
Version
0.2
Date
2021-10-01

Function Documentation

◆ device_alloc_request()

struct device_request* device_alloc_request ( uint64_t  flags)

dynamic allocate the device request

Parameters
flagsflags for allocate the device request
Returns
device_request pointer when it is allocated or NULL when it is not allocated

◆ device_free_request()

void device_free_request ( struct device_request request)

free pre-allocated device_request resource

Parameters
requestpointer of the device request

◆ device_module_exit()

int device_module_exit ( struct device dev)

deallocate the device module

Parameters
devpointer of the device module's structure
Returns
0 for success, negative value for fail

◆ device_module_init()

int device_module_init ( const uint64_t  modnum,
struct device **  __dev,
uint64_t  flags 
)

initialize the device module

Parameters
modnummodule's number
__devdevice structure pointer (will be allocated)
flagsinitializing flag
Returns
0 for success, negative value for fail
Here is the call graph for this function:

Variable Documentation

◆ submodule_init

int(* submodule_init[])(struct device *, uint64_t)
static
Initial value:
= {
NULL,
NULL,
}
int ramdisk_device_init(struct device *dev, uint64_t flags)
initialize the device and ramdisk module
Definition: ramdisk.c:307

initialize the submodule

Parameters
devicepointer of the device structure
uint64_tcontain the flag information