FireBirdLib - Topfield TMS PVR TAP Programming Library
FBLib_hdd.h File Reference
#include <sys/types.h>
#include "tap.h"
#include "libFireBird.h"

Go to the source code of this file.

Data Structures

struct  DirEntry
 
struct  tstat64
 

Macros

#define oTAP_Hdd_ReadSectorDMA   0x00
 
#define oTAP_Hdd_WriteSectorDMA   0x01
 
#define oTAP_Hdd_Move   0x13
 
#define FBHDIO_DRIVE_CMD_HDR_SIZE   (4 * sizeof(unsigned char))
 
#define FBHDIO_DRIVE_TASK_HDR_SIZE   (8 * sizeof(unsigned char))
 
#define WIN_SMART   0xB0
 
#define SMART_READ_VALUES   0xD0
 
#define SMART_READ_THRESHOLDS   0xD1
 
#define SMART_STATUS   0xDA
 
#define SMART_AUTOSAVE   0xD2
 
#define WIN_SETFEATURES   0xEF
 
#define SETFEATURES_EN_AAM   0x42 /* Enable Automatic Acoustic Management */
 
#define SETFEATURES_DIS_AAM   0xC2 /* Disable Automatic Acoustic Management */
 
#define SETFEATURES_EN_APM   0x05 /* Enable advanced power management */
 
#define SETFEATURES_DIS_APM   0x85 /* Disable advanced power management */
 
#define SMART_ENABLE   0xD8
 
#define SMART_DISABLE   0xD9
 
#define HDIO_DRIVE_TASK   0x031e /* execute task and special drive command */
 
#define HDIO_DRIVE_CMD   0x031f /* execute a special drive command */
 
#define endian_swap_word(x)   *x = (*x << 8) | (*x >> 8)
 
#define DIR_MAX_STACK   16
 
#define FATENTRYSIZE   3
 
#define RECYCLEPATH   "/DataFiles/RecycleBin-/"
 

Typedefs

typedef dword(* tTAP_Hdd_ReadSectorDMA) (dword SectorNr, dword NrSectors, void *Buffer)
 
typedef dword(* tTAP_Hdd_WriteSectorDMA) (dword SectorNr, dword NrSectors, void *Buffer)
 
typedef dword(* tTAP_Hdd_Move) (char *from_dir, char *to_dir, char *filename)
 
typedef struct __STDIO_FILE_STRUCT FILE
 

Functions

int lstat64 (__const char *__restrict __file, tstat64 *__restrict __buf) __THROW
 
int stat64 (__const char *__restrict __file, tstat64 *__restrict __buf) __THROW
 
void busyWait (void)
 
void Delay (dword)
 
int GetClusterPointer (int)
 
int SendHDDCommand (dword, const byte *, int)
 
void SwapWords (word *)
 
void SwapDWords (dword *)
 
int ReceiveSector (word *)
 
bool ChangeDirRoot (void)
 
dword CalcAbsSectorFromFAT (TYPE_File *, dword)
 
bool PushDirEntry (dword Cluster, dword Entry, dword DirLen)
 
bool PopDirEntry (dword *Cluster, dword *Entry, dword *DirLen)
 
dword getNextCluster (dword c)
 
FILEfopen64 (__const char *__restrict __filename, __const char *__restrict __modes)
 
int fseeko64 (FILE *__stream, __off64_t __off, int __whence)
 

Variables

volatile word * HDD_pData
 
volatile byte * HDD_pError
 
volatile byte * HDD_pFeature
 
volatile byte * HDD_pSecCount
 
volatile byte * HDD_pLBALow
 
volatile byte * HDD_pLBAMid
 
volatile byte * HDD_pLBAHigh
 
volatile byte * HDD_pDevice
 
volatile byte * HDD_pStatus
 
volatile byte * HDD_pCommand
 
volatile byte * HDD_pAltStatus
 
tTAP_Hdd_ReadSectorDMA TAP_Hdd_ReadSectorDMA
 
tTAP_Hdd_WriteSectorDMA TAP_Hdd_WriteSectorDMA
 
int _appl_version
 
bool LibInitialized
 
void *(* TAP_GetSystemProc )(int)
 

Macro Definition Documentation

◆ DIR_MAX_STACK

#define DIR_MAX_STACK   16

Definition at line 61 of file FBLib_hdd.h.

◆ endian_swap_word

#define endian_swap_word (   x)    *x = (*x << 8) | (*x >> 8)

Definition at line 59 of file FBLib_hdd.h.

◆ FATENTRYSIZE

#define FATENTRYSIZE   3

Definition at line 62 of file FBLib_hdd.h.

◆ FBHDIO_DRIVE_CMD_HDR_SIZE

#define FBHDIO_DRIVE_CMD_HDR_SIZE   (4 * sizeof(unsigned char))

Definition at line 37 of file FBLib_hdd.h.

◆ FBHDIO_DRIVE_TASK_HDR_SIZE

#define FBHDIO_DRIVE_TASK_HDR_SIZE   (8 * sizeof(unsigned char))

Definition at line 38 of file FBLib_hdd.h.

◆ HDIO_DRIVE_CMD

#define HDIO_DRIVE_CMD   0x031f /* execute a special drive command */

Definition at line 52 of file FBLib_hdd.h.

◆ HDIO_DRIVE_TASK

#define HDIO_DRIVE_TASK   0x031e /* execute task and special drive command */

Definition at line 51 of file FBLib_hdd.h.

◆ oTAP_Hdd_Move

#define oTAP_Hdd_Move   0x13

Definition at line 35 of file FBLib_hdd.h.

◆ oTAP_Hdd_ReadSectorDMA

#define oTAP_Hdd_ReadSectorDMA   0x00

Definition at line 33 of file FBLib_hdd.h.

◆ oTAP_Hdd_WriteSectorDMA

#define oTAP_Hdd_WriteSectorDMA   0x01

Definition at line 34 of file FBLib_hdd.h.

◆ RECYCLEPATH

#define RECYCLEPATH   "/DataFiles/RecycleBin-/"

Definition at line 135 of file FBLib_hdd.h.

◆ SETFEATURES_DIS_AAM

#define SETFEATURES_DIS_AAM   0xC2 /* Disable Automatic Acoustic Management */

Definition at line 46 of file FBLib_hdd.h.

◆ SETFEATURES_DIS_APM

#define SETFEATURES_DIS_APM   0x85 /* Disable advanced power management */

Definition at line 48 of file FBLib_hdd.h.

◆ SETFEATURES_EN_AAM

#define SETFEATURES_EN_AAM   0x42 /* Enable Automatic Acoustic Management */

Definition at line 45 of file FBLib_hdd.h.

◆ SETFEATURES_EN_APM

#define SETFEATURES_EN_APM   0x05 /* Enable advanced power management */

Definition at line 47 of file FBLib_hdd.h.

◆ SMART_AUTOSAVE

#define SMART_AUTOSAVE   0xD2

Definition at line 43 of file FBLib_hdd.h.

◆ SMART_DISABLE

#define SMART_DISABLE   0xD9

Definition at line 50 of file FBLib_hdd.h.

◆ SMART_ENABLE

#define SMART_ENABLE   0xD8

Definition at line 49 of file FBLib_hdd.h.

◆ SMART_READ_THRESHOLDS

#define SMART_READ_THRESHOLDS   0xD1

Definition at line 41 of file FBLib_hdd.h.

◆ SMART_READ_VALUES

#define SMART_READ_VALUES   0xD0

Definition at line 40 of file FBLib_hdd.h.

◆ SMART_STATUS

#define SMART_STATUS   0xDA

Definition at line 42 of file FBLib_hdd.h.

◆ WIN_SETFEATURES

#define WIN_SETFEATURES   0xEF

Definition at line 44 of file FBLib_hdd.h.

◆ WIN_SMART

#define WIN_SMART   0xB0

Definition at line 39 of file FBLib_hdd.h.

Typedef Documentation

◆ FILE

typedef struct __STDIO_FILE_STRUCT FILE

Definition at line 137 of file FBLib_hdd.h.

◆ tTAP_Hdd_Move

typedef dword(* tTAP_Hdd_Move) (char *from_dir, char *to_dir, char *filename)

Definition at line 57 of file FBLib_hdd.h.

◆ tTAP_Hdd_ReadSectorDMA

typedef dword(* tTAP_Hdd_ReadSectorDMA) (dword SectorNr, dword NrSectors, void *Buffer)

Definition at line 55 of file FBLib_hdd.h.

◆ tTAP_Hdd_WriteSectorDMA

typedef dword(* tTAP_Hdd_WriteSectorDMA) (dword SectorNr, dword NrSectors, void *Buffer)

Definition at line 56 of file FBLib_hdd.h.

Function Documentation

◆ busyWait()

void busyWait ( void  )

◆ CalcAbsSectorFromFAT()

dword CalcAbsSectorFromFAT ( TYPE_File *  ,
dword   
)

◆ ChangeDirRoot()

bool ChangeDirRoot ( void  )

Definition at line 5 of file ChangeDirRoot.c.

References HDD_ChangeDir(), TRACEENTER, and TRACEEXIT.

◆ Delay()

void Delay ( dword  Loops)

Definition at line 3 of file Delay.c.

◆ fopen64()

FILE * fopen64 ( __const char *__restrict  __filename,
__const char *__restrict  __modes 
)

Referenced by HDD_InfBlockGet(), and HDD_InfBlockSet().

◆ fseeko64()

int fseeko64 ( FILE __stream,
__off64_t  __off,
int  __whence 
)

Referenced by HDD_InfBlockGet(), and HDD_InfBlockSet().

◆ GetClusterPointer()

int GetClusterPointer ( int  )

◆ getNextCluster()

dword getNextCluster ( dword  c)
inline

◆ lstat64()

int lstat64 ( __const char *__restrict  __file,
tstat64 *__restrict  __buf 
)

◆ PopDirEntry()

bool PopDirEntry ( dword *  Cluster,
dword *  Entry,
dword *  DirLen 
)

◆ PushDirEntry()

bool PushDirEntry ( dword  Cluster,
dword  Entry,
dword  DirLen 
)

◆ ReceiveSector()

int ReceiveSector ( word *  )

◆ SendHDDCommand()

◆ stat64()

int stat64 ( __const char *__restrict  __file,
tstat64 *__restrict  __buf 
)

◆ SwapDWords()

void SwapDWords ( dword *  DataBuf)

Definition at line 3 of file SwapDWords.c.

References TRACEENTER, and TRACEEXIT.

◆ SwapWords()

void SwapWords ( word *  DataBuf)

Definition at line 3 of file SwapWords.c.

References TRACEENTER, and TRACEEXIT.

Variable Documentation

◆ _appl_version

int _appl_version
extern

◆ HDD_pAltStatus

volatile byte* HDD_pAltStatus
extern

◆ HDD_pCommand

volatile byte* HDD_pCommand
extern

◆ HDD_pData

volatile word* HDD_pData
extern

◆ HDD_pDevice

volatile byte* HDD_pDevice
extern

◆ HDD_pError

volatile byte* HDD_pError
extern

◆ HDD_pFeature

volatile byte* HDD_pFeature
extern

◆ HDD_pLBAHigh

volatile byte* HDD_pLBAHigh
extern

◆ HDD_pLBALow

volatile byte* HDD_pLBALow
extern

◆ HDD_pLBAMid

volatile byte* HDD_pLBAMid
extern

◆ HDD_pSecCount

volatile byte* HDD_pSecCount
extern

◆ HDD_pStatus

volatile byte* HDD_pStatus
extern

◆ LibInitialized

bool LibInitialized
extern

Definition at line 8 of file InitTAPex.c.

◆ TAP_GetSystemProc

void *(* TAP_GetSystemProc) (int) ( int  )
extern

◆ TAP_Hdd_ReadSectorDMA

tTAP_Hdd_ReadSectorDMA TAP_Hdd_ReadSectorDMA
extern

◆ TAP_Hdd_WriteSectorDMA

tTAP_Hdd_WriteSectorDMA TAP_Hdd_WriteSectorDMA
extern