Fujitsu DTV/STB solution driver (FAPex driver) Documentation [V01L00R00]


abst_libtsd.c File Reference

abstraction library source file (TSD driver). More...

Functions

FAPEXOPENRET_T FAPEX_TSD_Open (FAPEXOPENARG1_T id, FAPEXOPENARG2_T flags, FAPEXOPENARG3_T argptr)
 open method. This function is called with the systemcall "open".
FAPEXRELRET_T FAPEX_TSD_Close (FAPEXRELARG1_T id)
 release method. This function is called with the systemcall "close".
FAPEXREADRET_T FAPEX_TSD_Read (FAPEXREADARG1_T id, FAPEXREADARG2_T buf, FAPEXREADARG3_T count)
 read method. This function is called with the systemcall "read".
This function is waited for until the stream data is prepared.
FAPEXWRTRET_T FAPEX_TSD_Write (FAPEXWRTARG1_T id, FAPEXWRTARG2_T buf, FAPEXWRTARG3_T count)
 write method. This function is called with the systemcall "write".
This function is waited for until the empty area is available in buffer.
This function is supported only when the tsSelect value of FAPEX_TSD_OpenParamStrT / FAPEX_TSD_InputParamStrT structure is FAPEX_TSD_INPUT_LINEAR_AUTO_MODE at FAPEX_TSD_Open() or FAPEX_IOCCOM_TSD_SET_INPUT command with FAPEX_TSD_Ioctl().

FAPEXIOCRET_T FAPEX_TSD_Ioctl (FAPEXIOCARG1_T id, FAPEXIOCARG2_T cmd, FAPEXIOCARG3_T pArg)
 ioctl method. This function is called with the systemcall "ioctl".
FAPEXMMPRET_T FAPEX_TSD_Mmap (FAPEXMMPARG1_T start, FAPEXMMPARG2_T length, FAPEXMMPARG3_T prot, FAPEXMMPARG4_T flags, FAPEXMMPARG5_T id, FAPEXMMPARG6_T offset)
 mmap method. This function is called with the systemcall "mmap".

FAPEXMUNMPRET_T FAPEX_TSD_Munmap (FAPEXMMPARG1_T start, FAPEXMMPARG2_T length)
 munmap method. This function is called with the systemcall "munmap".

Detailed Description

abstraction library source file (TSD driver).

These function is executed in user space.

Attention:
This program is provided as is. You can redistribute it and/or modify it. Fujitsu Semiconductor Limited accepts no responsibility or liability for any errors or omissions.

Copyright (C) 2008-2010 Fujitsu Semiconductor Limited, All Rights Reserved.


Function Documentation

FAPEXOPENRET_T FAPEX_TSD_Open ( FAPEXOPENARG1_T  id,
FAPEXOPENARG2_T  flags,
FAPEXOPENARG3_T  argptr 
)

open method. This function is called with the systemcall "open".

Parameters:
idThe identifier for TSD block descriptor (common descriptor).
flagsThis parameter indicate a open mode (read only/write only/read-write).
This implementation supports only read-write mode.
argptrargument pointer (FAPEX_TSD_OpenParamStrT)
If descriptor for this 'id' has already been opened, this 'argptr' will be invalid.
Return values:
>=0process OK, new file descriptor is returned.
<0process fails, its value is set to errno.
FAPEXRELRET_T FAPEX_TSD_Close ( FAPEXRELARG1_T  id )

release method. This function is called with the systemcall "close".

Parameters:
idThe identifier for TSD block descriptor (common descriptor).
Return values:
0process OK
<0process fails, its value is set to errno.
FAPEXREADRET_T FAPEX_TSD_Read ( FAPEXREADARG1_T  id,
FAPEXREADARG2_T  buf,
FAPEXREADARG3_T  count 
)

read method. This function is called with the systemcall "read".
This function is waited for until the stream data is prepared.

Parameters:
idThe identifier for TSD channel descriptor (sub descriptor).
bufThe pointer to the destination buffer which is in the user space.
countThe data size.
Return values:
>=0process OK, its value is the number of bytes actually read.
<0process fails, its value is set to errno.
FAPEXWRTRET_T FAPEX_TSD_Write ( FAPEXWRTARG1_T  id,
FAPEXWRTARG2_T  buf,
FAPEXWRTARG3_T  count 
)

write method. This function is called with the systemcall "write".
This function is waited for until the empty area is available in buffer.
This function is supported only when the tsSelect value of FAPEX_TSD_OpenParamStrT / FAPEX_TSD_InputParamStrT structure is FAPEX_TSD_INPUT_LINEAR_AUTO_MODE at FAPEX_TSD_Open() or FAPEX_IOCCOM_TSD_SET_INPUT command with FAPEX_TSD_Ioctl().

Parameters:
idThe identifier for TSD block descriptor (common descriptor).
bufThe pointer to the source buffer which is in the user space.
countThe data size.
Return values:
>=0process OK, its value is the number of bytes actually write.
<0process fails, its value is set to errno.
Note:
There are limitation for using this function as follows.
  • The first data in 'buf' area should be the sync word of TS packet.
  • The size of TS packet should be "188" byte.
  • TS packet data should be registered with big endian format.
FAPEXIOCRET_T FAPEX_TSD_Ioctl ( FAPEXIOCARG1_T  id,
FAPEXIOCARG2_T  cmd,
FAPEXIOCARG3_T  pArg 
)

ioctl method. This function is called with the systemcall "ioctl".

Parameters:
idThe identifier for this descriptor.
cmdThe ioctl command.
pArgThe pointer to the argument of the ioctl command.
Return values:
0process OK
<0process fails, its value is set to errno.

ioctl command(cmd) type:

  • FAPEX_IOCCOM_START
    start TSD channel. (pArg is ignored)
    When id is common descriptor for TSD block, all TSD channels on the ready state in this block will start.
    When id is sub descriptor for a TSD channel on the ready state, only this TSD channel will start.

  • FAPEX_IOCCOM_STOP
    stop TSD channel. (pArg is ignored)
    When id is common descriptor for TSD block, all TSD channels on the running state in this block will stop.
    When id is sub descriptor for a TSD channel on the running state, only this TSD channel will start.

  • FAPEX_IOCCOM_RESET
    reset TSD block STC regulation. (pArg is ignored)
    The id should be common descriptor for TSD block.

  • FAPEX_IOCCOM_TSD_GET_STATUS
    get TSD block/channel status.
    Set pointer of FAPEX_TSD_StatusStrT data field to pArg.
    The status value will be set to this field.
    When id is common descriptor, it is possible to get TSD block status.
    When id is sub descriptor, it is possible to get channel status.

  • FAPEX_IOCCOM_TSD_GET_STC_VALUE
    get STC value (unit of 90kHz).
    Set pointer of uint64_t data to pArg.
    If the appointed TSD block doesn't use STC, the returned value will be 0xFFFFFFFFFFFFFFFF.

FAPEXMMPRET_T FAPEX_TSD_Mmap ( FAPEXMMPARG1_T  start,
FAPEXMMPARG2_T  length,
FAPEXMMPARG3_T  prot,
FAPEXMMPARG4_T  flags,
FAPEXMMPARG5_T  id,
FAPEXMMPARG6_T  offset 
)

mmap method. This function is called with the systemcall "mmap".

tsd_PacketInMapInfoStrT.png
  • Demuxed Buffer Mapping
    When 'id' is TSD channel descriptor (sub descriptor),
    this function supports accessing of the mapped area forTS-Demuxed payload data.
    The readable area is only bufferSize bytes from mapped address.
    This bufferSize is parameter of FAPEX_TSD_PidParamStrT or the FAPEX_TSD_SctFltParamStrT structure.
    If the access of area excluding this is executed, the operation will not be guaranteed.
    After reading of this payload data, the FAPEX_IOCCOM_TSD_SET_BUFFER_READSIZE command with FAPEX_TSD_Ioctl() should be executed.
tsd_ReadInfoStrT.png
Parameters:
startThe memory mapping start pointer.
lengthThe memory mapping size.
protThe desired memory protection.
flagsThe mapping option.
idThe identifier for TSD block descriptor (common descriptor) or TSD channel descriptor (sub descriptor).
offsetThe memory mapping offset value.
Return values:
>0process OK, its value is the mapping address.
<0process fails, its value is set to errno.
FAPEXMUNMPRET_T FAPEX_TSD_Munmap ( FAPEXMMPARG1_T  start,
FAPEXMMPARG2_T  length 
)

munmap method. This function is called with the systemcall "munmap".

Parameters:
startThe memory mapping start pointer.
lengthThe memory mapping size.
Return values:
0process OK
<0process fails, its value is set to errno.


Copyright © 2006-2010 by Fujitsu Semiconductor Europe GmbH
Copyright © 2008-2010 by Fujitsu Semiconductor Limited

Disclaimer:
Please note that the use of this has been based on the terms and conditions of "DK Consent Letter (For Linux)" agreement between you and Fujitsu Semiconductor Limited.
The contents of this document may be revised without prior notice. Contact our sales department for confirmation. The information in this document are presented as is, no license is granted by implication or otherwise.
More...

FUJITSU sales representatives