Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/siis/siis.h
Show First 20 Lines • Show All 257 Lines • ▼ Show 20 Lines | |||||
#define SIIS_P_SNTF 0x1F10 | #define SIIS_P_SNTF 0x1F10 | ||||
#define SIIS_MAX_PORTS 4 | #define SIIS_MAX_PORTS 4 | ||||
#define SIIS_MAX_SLOTS 31 | #define SIIS_MAX_SLOTS 31 | ||||
#define SIIS_OFFSET 0x100 | #define SIIS_OFFSET 0x100 | ||||
#define SIIS_STEP 0x80 | #define SIIS_STEP 0x80 | ||||
/* Just to be sure, if building as module. */ | |||||
#if MAXPHYS < 512 * 1024 | |||||
#undef MAXPHYS | |||||
#define MAXPHYS 512 * 1024 | |||||
#endif | |||||
/* Pessimistic prognosis on number of required S/G entries */ | /* Pessimistic prognosis on number of required S/G entries */ | ||||
#define SIIS_SG_ENTRIES (roundup(btoc(MAXPHYS), 4) + 1) | #define SIIS_SG_ENTRIES (roundup(btoc(maxphys), 4) + 1) | ||||
/* Command tables. Up to 32 commands, Each, 128byte aligned. */ | /* Port Request Block + S/G entries. 128byte aligned. */ | ||||
#define SIIS_CT_OFFSET 0 | #define SIIS_PRB_SIZE (32 + 16 + SIIS_SG_ENTRIES * 16) | ||||
#define SIIS_CT_SIZE (32 + 16 + SIIS_SG_ENTRIES * 16) | |||||
/* Total main work area. */ | /* Total main work area. */ | ||||
#define SIIS_WORK_SIZE (SIIS_CT_OFFSET + SIIS_CT_SIZE * SIIS_MAX_SLOTS) | #define SIIS_WORK_SIZE (SIIS_PRB_SIZE * SIIS_MAX_SLOTS) | ||||
struct siis_dma_prd { | struct siis_dma_prd { | ||||
u_int64_t dba; | u_int64_t dba; | ||||
u_int32_t dbc; | u_int32_t dbc; | ||||
u_int32_t control; | u_int32_t control; | ||||
#define SIIS_PRD_TRM 0x80000000 | #define SIIS_PRD_TRM 0x80000000 | ||||
#define SIIS_PRD_LNK 0x40000000 | #define SIIS_PRD_LNK 0x40000000 | ||||
#define SIIS_PRD_DRD 0x20000000 | #define SIIS_PRD_DRD 0x20000000 | ||||
#define SIIS_PRD_XCF 0x10000000 | #define SIIS_PRD_XCF 0x10000000 | ||||
} __packed; | } __packed; | ||||
struct siis_cmd_ata { | struct siis_cmd_ata { | ||||
struct siis_dma_prd prd[1 + SIIS_SG_ENTRIES]; | struct siis_dma_prd prd[2]; | ||||
} __packed; | } __packed; | ||||
struct siis_cmd_atapi { | struct siis_cmd_atapi { | ||||
u_int8_t ccb[16]; | u_int8_t ccb[16]; | ||||
struct siis_dma_prd prd[SIIS_SG_ENTRIES]; | struct siis_dma_prd prd[1]; | ||||
} __packed; | } __packed; | ||||
struct siis_cmd { | struct siis_cmd { | ||||
u_int16_t control; | u_int16_t control; | ||||
#define SIIS_PRB_PROTOCOL_OVERRIDE 0x0001 | #define SIIS_PRB_PROTOCOL_OVERRIDE 0x0001 | ||||
#define SIIS_PRB_RETRANSMIT 0x0002 | #define SIIS_PRB_RETRANSMIT 0x0002 | ||||
#define SIIS_PRB_EXTERNAL_COMMAND 0x0004 | #define SIIS_PRB_EXTERNAL_COMMAND 0x0004 | ||||
#define SIIS_PRB_RECEIVE 0x0008 | #define SIIS_PRB_RECEIVE 0x0008 | ||||
Show All 40 Lines | enum siis_slot_states { | ||||
SIIS_SLOT_RUNNING, | SIIS_SLOT_RUNNING, | ||||
SIIS_SLOT_WAITING | SIIS_SLOT_WAITING | ||||
}; | }; | ||||
struct siis_slot { | struct siis_slot { | ||||
device_t dev; /* Device handle */ | device_t dev; /* Device handle */ | ||||
u_int8_t slot; /* Number of this slot */ | u_int8_t slot; /* Number of this slot */ | ||||
enum siis_slot_states state; /* Slot state */ | enum siis_slot_states state; /* Slot state */ | ||||
u_int prb_offset; /* PRB offset */ | |||||
union ccb *ccb; /* CCB occupying slot */ | union ccb *ccb; /* CCB occupying slot */ | ||||
struct ata_dmaslot dma; /* DMA data of this slot */ | struct ata_dmaslot dma; /* DMA data of this slot */ | ||||
struct callout timeout; /* Execution timeout */ | struct callout timeout; /* Execution timeout */ | ||||
}; | }; | ||||
struct siis_device { | struct siis_device { | ||||
int revision; | int revision; | ||||
int mode; | int mode; | ||||
▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines |