Functions for Getting Arguments in Signature functions


Functions

int os_dev_is_flag_read (void)
int os_dev_is_flag_write (void)
int os_dev_is_flag_nonblock (void)
int os_dev_get_major (void)
int os_dev_get_minor (void)
unsigned os_dev_get_ioctl_op (void)
os_dev_ioctl_arg_t os_dev_get_ioctl_arg (void)
unsigned os_dev_get_count (void)
void * os_dev_get_user_buffer (void)
unsigned os_dev_get_file_flags (void)
void os_dev_set_user_private (void *struct_p)
void * os_dev_get_user_private (void)
int os_dev_get_irq (void)

Function Documentation

unsigned os_dev_get_count ( void   ) 

Determine the requested byte count. This should be the size of buffer at os_dev_get_user_buffer(). Usable in OS_DEV_READ() and OS_DEV_WRITE() routines.

Returns:
A count of bytes

unsigned os_dev_get_file_flags ( void   ) 

Get the POSIX flags field for the associated open file. Usable in OS_DEV_READ(), OS_DEV_WRITE(), and OS_DEV_IOCTL() routines.

Returns:
The flags associated with the file.

os_dev_ioctl_arg_t os_dev_get_ioctl_arg ( void   ) 

Retrieve the associated argument for the desired operation. Usable in OS_DEV_IOCTL().

Returns:
A value which can be cast to a struct pointer or used as int/long.

Referenced by OS_DEV_IOCTL().

unsigned os_dev_get_ioctl_op ( void   ) 

Determine which operation the user wants performed. Usable in OS_DEV_IOCTL().

Returns:
Value of the operation.

Referenced by OS_DEV_IOCTL().

int os_dev_get_irq ( void   ) 

Get the IRQ associated with this call to the OS_DEV_ISR() function.

Returns:
The IRQ (integer) interrupt number.

int os_dev_get_major ( void   ) 

Determine which major device is being accessed. Usable in OS_DEV_OPEN() and OS_DEV_CLOSE().

int os_dev_get_minor ( void   ) 

Determine which minor device is being accessed. Usable in OS_DEV_OPEN() and OS_DEV_CLOSE().

void* os_dev_get_user_buffer ( void   ) 

Get the pointer to the user's data buffer. Usable in OS_DEV_READ(), OS_DEV_WRITE(), and OS_DEV_MMAP() routines.

Returns:
Pointer to user buffer (in user space). See os_copy_to_user() and os_copy_from_user().

void* os_dev_get_user_private ( void   ) 

Get the driver's private structure associated with this file.

May be used during OS_DEV_OPEN(), OS_DEV_READ(), OS_DEV_WRITE(), OS_DEV_IOCTL(), OS_DEV_MMAP(), and OS_DEV_CLOSE(). See also os_dev_set_user_private().

Returns:
The driver data structure to associate with this user.

Referenced by OS_DEV_CLOSE(), OS_DEV_IOCTL(), and OS_DEV_MMAP().

int os_dev_is_flag_nonblock ( void   ) 

Check whether user is requesting non-blocking I/O. Usable in OS_DEV_OPEN(), OS_DEV_CLOSE(), OS_DEV_IOCTL(), OS_DEV_READ() and OS_DEV_WRITE() routines.

int os_dev_is_flag_read ( void   ) 

Check whether user is requesting read (permission) on the file/device. Usable in OS_DEV_OPEN(), OS_DEV_CLOSE(), OS_DEV_IOCTL(), OS_DEV_READ() and OS_DEV_WRITE() routines.

int os_dev_is_flag_write ( void   ) 

Check whether user is requesting write (permission) on the file/device. Usable in OS_DEV_OPEN(), OS_DEV_CLOSE(), OS_DEV_IOCTL(), OS_DEV_READ() and OS_DEV_WRITE() routines.

void os_dev_set_user_private ( void *  struct_p  ) 

Set the driver's private structure associated with this file/open.

Generally used during OS_DEV_OPEN(). May also be used during OS_DEV_READ(), OS_DEV_WRITE(), OS_DEV_IOCTL(), OS_DEV_MMAP(), and OS_DEV_CLOSE(). See also os_dev_get_user_private().

Parameters:
struct_p The driver data structure to associate with this user.

Referenced by OS_DEV_CLOSE(), OS_DEV_IOCTL(), OS_DEV_MMAP(), and OS_DEV_OPEN().

footer
©  Freescale Semiconductor, Inc., 2007.  All rights reserved.
Freescale Confidential Proprietary
NDA Required
doxygen