man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: July 2014
 
 

ldi_get_blksize(9F)

Name

ldi_get_size, ldi_get_blksize, ldi_get_pblksize - Retrieve device size properties

Synopsis

#include <sys/sunldi.h>

int ldi_get_size(ldi_handle_t lh, uint64_t *sizep);
int ldi_get_blksize(ldi_handle_t lh, uint34_t *blksizep);
int ldi_get_pblksize(ldi_handle_t lh, uint32_t *pblksizep);

Parameters

lh

Layered handle.

sizep

Pointer to the caller's unsigned 64-bit integer buffer.

blksizep

Pointer to the caller's unsigned 32-bit integer buffer

pblksizep

Pointer to the caller's unsigned 32-bit integer buffer

Description

The ldi_get_size() function uses the layered driver handle to calculate and return a device's size. The device size is returned within the caller supplied buffer (*sizep).

The ldi_get_blksize() function uses the layered driver handle to return a device's logical block size. Its value is returned within the caller supplied buffer (*blksizep).

The ldi_get_pblksize() function uses the layered driver handle to return a device's physical block size. Its value is returned within the caller supplied buffer (*pblksizep).

A valid layered driver handle must be obtained via the ldi_open_by_name(9F) interface prior to calling ldi_get_size(), ldi_get_blksize(), and ldi_get_pblksize().

Return Values

The ldi_get_size() function returns the following values:

DDI_SUCCESS

The device size property has been returned within the caller supplied buffer.

DDI_FAILURE

The device size property could not be found or determined.

Context

These functions may be called from user or kernel context.

See Also

ldi_open_by_name(9F)

Writing Device Drivers