Subversion Repositories freemyipod

Rev

Rev 920 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 920 Rev 966
Line 25... Line 25...
25
#define __STORAGE_ATA_TARGET_H__
25
#define __STORAGE_ATA_TARGET_H__
26
 
26
 
27
#include "../global.h"
27
#include "../global.h"
28
 
28
 
29
 
29
 
-
 
30
struct __attribute__((packed)) ata_raw_cmd_t
-
 
31
{
-
 
32
    uint8_t lba48;
-
 
33
    uint8_t transfer;
-
 
34
    uint8_t send;
-
 
35
    uint8_t dma;
-
 
36
    uint32_t delay;
-
 
37
    void* buffer;
-
 
38
    uint32_t size;
-
 
39
    uint32_t blksize;
-
 
40
    uint16_t feature;
-
 
41
    uint16_t count;
-
 
42
    uint16_t lba_low;
-
 
43
    uint16_t lba_mid;
-
 
44
    uint16_t lba_high;
-
 
45
    uint8_t device;
-
 
46
    uint8_t command;
-
 
47
    uint8_t result_valid;
-
 
48
    uint8_t reserved[3];
-
 
49
};
-
 
50
 
30
struct ata_target_driverinfo
51
struct ata_target_driverinfo
31
{
52
{
32
    void (*srst_after_error)(bool enable);
53
    void (*srst_after_error)(bool enable);
33
    void (*set_retries)(int retries);
54
    void (*set_retries)(int retries);
34
    int (*bbt_translate)(uint64_t sector, uint32_t count, uint64_t* phys, uint32_t* physcount);
55
    int (*bbt_translate)(uint64_t sector, uint32_t count, uint64_t* phys, uint32_t* physcount);
35
    int (*bbt_reload)();
56
    int (*bbt_reload)();
36
    void (*bbt_disable)();
57
    void (*bbt_disable)();
-
 
58
    int (*soft_reset)();
-
 
59
    int (*hard_reset)();
-
 
60
    int (*read_taskfile)(struct ata_raw_cmd_t* cmd);
-
 
61
    int (*raw_cmd)(struct ata_raw_cmd_t* cmd);
37
};
62
};
38
 
63
 
39
 
64
 
40
extern uint16_t ata_identify_data[0x100];
65
extern uint16_t ata_identify_data[0x100];
41
extern uint64_t ata_total_sectors;
66
extern uint64_t ata_total_sectors;
42
extern struct mutex ata_mutex;
67
extern struct mutex ata_mutex;
43
 
68
 
44
void ata_set_retries(int retries);
69
extern void ata_set_retries(int retries);
45
void ata_srst_after_error(bool enable);
70
extern void ata_srst_after_error(bool enable);
-
 
71
extern int ata_soft_reset();
-
 
72
extern int ata_hard_reset();
-
 
73
extern int ata_read_taskfile(struct ata_raw_cmd_t* cmd);
-
 
74
extern int ata_raw_cmd(struct ata_raw_cmd_t* cmd);
46
 
75
 
47
#ifdef ATA_HAVE_BBT
76
#ifdef ATA_HAVE_BBT
48
extern uint16_t (*ata_bbt)[0x20];
77
extern uint16_t (*ata_bbt)[0x20];
49
extern uint64_t ata_virtual_sectors;
78
extern uint64_t ata_virtual_sectors;
50
 
79