FreeBSD kernel CAM code
|
#include <sys/ata.h>
Go to the source code of this file.
Data Structures | |
struct | ata_cmd |
struct | ata_res |
struct | sep_identify_data |
Macros | |
#define | SID_DMA48 0x01 /* Abuse inq_flags bit to track enabled DMA48. */ |
#define | SID_AEN 0x04 /* Abuse inq_flags bit to track enabled AEN. */ |
#define | SID_DMA 0x10 /* Abuse inq_flags bit to track enabled DMA. */ |
#define | CAM_ATAIO_48BIT 0x01 /* Command has 48-bit format */ |
#define | CAM_ATAIO_FPDMA 0x02 /* FPDMA command */ |
#define | CAM_ATAIO_CONTROL 0x04 /* Control, not a command */ |
#define | CAM_ATAIO_NEEDRESULT 0x08 /* Request requires result. */ |
#define | CAM_ATAIO_DMA 0x10 /* DMA command */ |
#define | CAM_ATAIO_48BIT 0x01 /* Command has 48-bit format */ |
Functions | |
int | ata_version (int ver) |
char * | ata_op_string (struct ata_cmd *cmd) |
char * | ata_cmd_string (struct ata_cmd *cmd, char *cmd_string, size_t len) |
void | ata_cmd_sbuf (struct ata_cmd *cmd, struct sbuf *sb) |
char * | ata_res_string (struct ata_res *res, char *res_string, size_t len) |
int | ata_command_sbuf (struct ccb_ataio *ataio, struct sbuf *sb) |
int | ata_status_sbuf (struct ccb_ataio *ataio, struct sbuf *sb) |
int | ata_res_sbuf (struct ata_res *res, struct sbuf *sb) |
void | ata_print_ident (struct ata_params *ident_data) |
void | ata_print_ident_sbuf (struct ata_params *ident_data, struct sbuf *sb) |
void | ata_print_ident_short (struct ata_params *ident_data) |
void | ata_print_ident_short_sbuf (struct ata_params *ident_data, struct sbuf *sb) |
uint32_t | ata_logical_sector_size (struct ata_params *ident_data) |
uint64_t | ata_physical_sector_size (struct ata_params *ident_data) |
uint64_t | ata_logical_sector_offset (struct ata_params *ident_data) |
void | ata_28bit_cmd (struct ccb_ataio *ataio, uint8_t cmd, uint8_t features, uint32_t lba, uint8_t sector_count) |
void | ata_48bit_cmd (struct ccb_ataio *ataio, uint8_t cmd, uint16_t features, uint64_t lba, uint16_t sector_count) |
void | ata_ncq_cmd (struct ccb_ataio *ataio, uint8_t cmd, uint64_t lba, uint16_t sector_count) |
void | ata_reset_cmd (struct ccb_ataio *ataio) |
void | ata_pm_read_cmd (struct ccb_ataio *ataio, int reg, int port) |
void | ata_pm_write_cmd (struct ccb_ataio *ataio, int reg, int port, uint32_t val) |
void | ata_read_log (struct ccb_ataio *ataio, uint32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint32_t log_address, uint32_t page_number, uint16_t block_count, uint32_t protocol, uint8_t *data_ptr, uint32_t dxfer_len, uint32_t timeout) |
void | ata_param_fixup (struct ata_params *ident_buf) |
void | ata_bswap (int8_t *buf, int len) |
void | ata_btrim (int8_t *buf, int len) |
void | ata_bpack (int8_t *src, int8_t *dst, int len) |
int | ata_max_pmode (struct ata_params *ap) |
int | ata_max_wmode (struct ata_params *ap) |
int | ata_max_umode (struct ata_params *ap) |
int | ata_max_mode (struct ata_params *ap, int maxmode) |
char * | ata_mode2string (int mode) |
int | ata_string2mode (char *str) |
u_int | ata_mode2speed (int mode) |
u_int | ata_revision2speed (int revision) |
int | ata_speed2revision (u_int speed) |
int | ata_identify_match (caddr_t identbuffer, caddr_t table_entry) |
int | ata_static_identify_match (caddr_t identbuffer, caddr_t table_entry) |
void | semb_print_ident (struct sep_identify_data *ident_data) |
void | semb_print_ident_sbuf (struct sep_identify_data *ident_data, struct sbuf *sb) |
void | semb_print_ident_short (struct sep_identify_data *ident_data) |
void | semb_print_ident_short_sbuf (struct sep_identify_data *ident_data, struct sbuf *sb) |
void | semb_receive_diagnostic_results (struct ccb_ataio *ataio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, int pcv, uint8_t page_code, uint8_t *data_ptr, uint16_t allocation_length, uint32_t timeout) |
void | semb_send_diagnostic (struct ccb_ataio *ataio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint8_t *data_ptr, uint16_t param_list_length, uint32_t timeout) |
void | semb_read_buffer (struct ccb_ataio *ataio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint8_t page_code, uint8_t *data_ptr, uint16_t allocation_length, uint32_t timeout) |
void | semb_write_buffer (struct ccb_ataio *ataio, u_int32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint8_t *data_ptr, uint16_t param_list_length, uint32_t timeout) |
void | ata_zac_mgmt_out (struct ccb_ataio *ataio, uint32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), int use_ncq __unused, uint8_t zm_action, uint64_t zone_id, uint8_t zone_flags, uint16_t sector_count, uint8_t *data_ptr, uint32_t dxfer_len, uint32_t timeout) |
void | ata_zac_mgmt_in (struct ccb_ataio *ataio, uint32_t retries, void(*cbfcnp)(struct cam_periph *, union ccb *), int use_ncq __unused, uint8_t zm_action, uint64_t zone_id, uint8_t zone_flags, uint8_t *data_ptr, uint32_t dxfer_len, uint32_t timeout) |
#define CAM_ATAIO_48BIT 0x01 /* Command has 48-bit format */ |
#define CAM_ATAIO_48BIT 0x01 /* Command has 48-bit format */ |
#define CAM_ATAIO_CONTROL 0x04 /* Control, not a command */ |
#define CAM_ATAIO_NEEDRESULT 0x08 /* Request requires result. */ |
#define SID_AEN 0x04 /* Abuse inq_flags bit to track enabled AEN. */ |
#define SID_DMA 0x10 /* Abuse inq_flags bit to track enabled DMA. */ |
#define SID_DMA48 0x01 /* Abuse inq_flags bit to track enabled DMA48. */ |
void ata_28bit_cmd | ( | struct ccb_ataio * | ataio, |
uint8_t | cmd, | ||
uint8_t | features, | ||
uint32_t | lba, | ||
uint8_t | sector_count | ||
) |
Definition at line 621 of file ata_all.c.
References CAM_ATAIO_DMA, ccb_ataio::cmd, ata_cmd::command, ata_cmd::device, ata_cmd::features, ata_cmd::flags, ata_cmd::lba_high, ata_cmd::lba_low, ata_cmd::lba_mid, and ata_cmd::sector_count.
Referenced by ada_cfaerase(), adaclose(), adadump(), adaflush(), adaspindown(), adastart(), aprobestart(), enc_runcmd(), semb_read_buffer(), semb_receive_diagnostic_results(), semb_send_diagnostic(), and semb_write_buffer().
void ata_48bit_cmd | ( | struct ccb_ataio * | ataio, |
uint8_t | cmd, | ||
uint16_t | features, | ||
uint64_t | lba, | ||
uint16_t | sector_count | ||
) |
Definition at line 646 of file ata_all.c.
References CAM_ATAIO_48BIT, CAM_ATAIO_DMA, ccb_ataio::cmd, ata_cmd::command, ata_cmd::control, ata_cmd::device, ata_cmd::features, ata_cmd::features_exp, ata_cmd::flags, ata_cmd::lba_high, ata_cmd::lba_high_exp, ata_cmd::lba_low, ata_cmd::lba_low_exp, ata_cmd::lba_mid, ata_cmd::lba_mid_exp, ata_cmd::sector_count, and ata_cmd::sector_count_exp.
Referenced by ada_dsmtrim(), adaclose(), adadump(), adaflush(), adastart(), ata_read_log(), ata_zac_mgmt_in(), and ata_zac_mgmt_out().
void ata_bpack | ( | int8_t * | src, |
int8_t * | dst, | ||
int | len | ||
) |
Definition at line 783 of file ata_all.c.
Referenced by ata_param_fixup().
void ata_bswap | ( | int8_t * | buf, |
int | len | ||
) |
Definition at line 762 of file ata_all.c.
Referenced by aprobedone(), and ata_param_fixup().
void ata_btrim | ( | int8_t * | buf, |
int | len | ||
) |
Definition at line 771 of file ata_all.c.
Referenced by ata_param_fixup().
void ata_cmd_sbuf | ( | struct ata_cmd * | cmd, |
struct sbuf * | sb | ||
) |
Definition at line 333 of file ata_all.c.
References ata_cmd::command, ata_cmd::device, ata_cmd::features, ata_cmd::features_exp, ata_cmd::lba_high, ata_cmd::lba_high_exp, ata_cmd::lba_low, ata_cmd::lba_low_exp, ata_cmd::lba_mid, ata_cmd::lba_mid_exp, ata_cmd::sector_count, and ata_cmd::sector_count_exp.
Referenced by ata_cmd_string(), ata_command_sbuf(), and cam_periph_devctl_notify().
char * ata_cmd_string | ( | struct ata_cmd * | cmd, |
char * | cmd_string, | ||
size_t | len | ||
) |
Definition at line 309 of file ata_all.c.
References ata_cmd_sbuf().
Referenced by ata_proto_debug_out().
int ata_command_sbuf | ( | struct ccb_ataio * | ataio, |
struct sbuf * | sb | ||
) |
Definition at line 385 of file ata_all.c.
References ata_cmd_sbuf(), ata_op_string(), and ccb_ataio::cmd.
Referenced by cam_error_string().
int ata_identify_match | ( | caddr_t | identbuffer, |
caddr_t | table_entry | ||
) |
Definition at line 1003 of file ata_all.c.
References cam_strmatch(), scsi_inquiry_pattern::product, and scsi_inquiry_pattern::revision.
Referenced by adaregister(), and ata_find_quirk().
uint64_t ata_logical_sector_offset | ( | struct ata_params * | ident_data | ) |
Definition at line 611 of file ata_all.c.
References ata_logical_sector_size().
Referenced by adasetgeom().
uint32_t ata_logical_sector_size | ( | struct ata_params * | ident_data | ) |
Definition at line 586 of file ata_all.c.
Referenced by adasetgeom(), aprobestart(), ata_logical_sector_offset(), and ata_physical_sector_size().
int ata_max_mode | ( | struct ata_params * | ap, |
int | maxmode | ||
) |
Definition at line 864 of file ata_all.c.
References ata_max_pmode(), ata_max_umode(), and ata_max_wmode().
Referenced by aprobestart().
int ata_max_pmode | ( | struct ata_params * | ap | ) |
Definition at line 806 of file ata_all.c.
Referenced by aprobedone(), and ata_max_mode().
int ata_max_umode | ( | struct ata_params * | ap | ) |
Definition at line 842 of file ata_all.c.
Referenced by ata_max_mode().
int ata_max_wmode | ( | struct ata_params * | ap | ) |
Definition at line 830 of file ata_all.c.
Referenced by ata_max_mode().
u_int ata_mode2speed | ( | int | mode | ) |
Definition at line 934 of file ata_all.c.
Referenced by _ata_announce_periph().
char * ata_mode2string | ( | int | mode | ) |
Definition at line 877 of file ata_all.c.
Referenced by ata_announce_periph(), and ata_announce_periph_sbuf().
void ata_ncq_cmd | ( | struct ccb_ataio * | ataio, |
uint8_t | cmd, | ||
uint64_t | lba, | ||
uint16_t | sector_count | ||
) |
Definition at line 679 of file ata_all.c.
References CAM_ATAIO_48BIT, CAM_ATAIO_FPDMA, ccb_ataio::cmd, ata_cmd::command, ata_cmd::control, ata_cmd::device, ata_cmd::features, ata_cmd::features_exp, ata_cmd::flags, ata_cmd::lba_high, ata_cmd::lba_high_exp, ata_cmd::lba_low, ata_cmd::lba_low_exp, ata_cmd::lba_mid, ata_cmd::lba_mid_exp, ata_cmd::sector_count, and ata_cmd::sector_count_exp.
Referenced by ada_ncq_dsmtrim(), and adastart().
char * ata_op_string | ( | struct ata_cmd * | cmd | ) |
Definition at line 74 of file ata_all.c.
References ata_cmd::command, ata_cmd::control, ata_cmd::features, ata_cmd::lba_low, and ata_cmd::sector_count_exp.
Referenced by ata_command_sbuf(), and ata_proto_debug_out().
void ata_param_fixup | ( | struct ata_params * | ident_buf | ) |
Definition at line 1266 of file ata_all.c.
References ata_bpack(), ata_bswap(), and ata_btrim().
Referenced by aprobedone(), and dadone_probeata().
uint64_t ata_physical_sector_size | ( | struct ata_params * | ident_data | ) |
Definition at line 597 of file ata_all.c.
References ata_logical_sector_size().
Referenced by adasetgeom().
void ata_pm_read_cmd | ( | struct ccb_ataio * | ataio, |
int | reg, | ||
int | port | ||
) |
Definition at line 708 of file ata_all.c.
References CAM_ATAIO_NEEDRESULT, ccb_ataio::cmd, ata_cmd::command, ata_cmd::device, ata_cmd::features, and ata_cmd::flags.
Referenced by aprobestart(), and pmpstart().
void ata_pm_write_cmd | ( | struct ccb_ataio * | ataio, |
int | reg, | ||
int | port, | ||
uint32_t | val | ||
) |
Definition at line 718 of file ata_all.c.
References ccb_ataio::cmd, ata_cmd::command, ata_cmd::device, ata_cmd::features, ata_cmd::flags, ata_cmd::lba_high, ata_cmd::lba_low, ata_cmd::lba_mid, and ata_cmd::sector_count.
Referenced by pmpstart().
void ata_print_ident | ( | struct ata_params * | ident_data | ) |
Definition at line 429 of file ata_all.c.
References ata_print_ident_short(), and ata_version().
Referenced by ata_proto_announce().
void ata_print_ident_sbuf | ( | struct ata_params * | ident_data, |
struct sbuf * | sb | ||
) |
Definition at line 464 of file ata_all.c.
References ata_print_ident_short_sbuf(), and ata_version().
Referenced by ata_proto_announce_sbuf().
void ata_print_ident_short | ( | struct ata_params * | ident_data | ) |
Definition at line 512 of file ata_all.c.
References cam_strvis().
Referenced by ata_print_ident(), and ata_proto_denounce().
void ata_print_ident_short_sbuf | ( | struct ata_params * | ident_data, |
struct sbuf * | sb | ||
) |
Definition at line 524 of file ata_all.c.
References cam_strvis_sbuf().
Referenced by ata_print_ident_sbuf(), and ata_proto_denounce_sbuf().
void ata_read_log | ( | struct ccb_ataio * | ataio, |
uint32_t | retries, | ||
void(*)(struct cam_periph *, union ccb *) | cbfcnp, | ||
uint32_t | log_address, | ||
uint32_t | page_number, | ||
uint16_t | block_count, | ||
uint32_t | protocol, | ||
uint8_t * | data_ptr, | ||
uint32_t | dxfer_len, | ||
uint32_t | timeout | ||
) |
Definition at line 732 of file ata_all.c.
References ata_48bit_cmd(), CAM_ATAIO_DMA, CAM_DIR_IN, and cam_fill_ataio().
Referenced by adastart().
int ata_res_sbuf | ( | struct ata_res * | res, |
struct sbuf * | sb | ||
) |
Definition at line 368 of file ata_all.c.
References ata_res::device, ata_res::error, ata_res::lba_high, ata_res::lba_high_exp, ata_res::lba_low, ata_res::lba_low_exp, ata_res::lba_mid, ata_res::lba_mid_exp, ata_res::sector_count, ata_res::sector_count_exp, and ata_res::status.
Referenced by ata_res_string(), cam_error_string(), and cam_periph_devctl_notify().
char * ata_res_string | ( | struct ata_res * | res, |
char * | res_string, | ||
size_t | len | ||
) |
Definition at line 344 of file ata_all.c.
References ata_res_sbuf().
void ata_reset_cmd | ( | struct ccb_ataio * | ataio | ) |
Definition at line 700 of file ata_all.c.
References CAM_ATAIO_CONTROL, CAM_ATAIO_NEEDRESULT, ccb_ataio::cmd, ata_cmd::control, and ata_cmd::flags.
Referenced by aprobestart().
u_int ata_revision2speed | ( | int | revision | ) |
Definition at line 972 of file ata_all.c.
Referenced by _ata_announce_periph().
int ata_static_identify_match | ( | caddr_t | identbuffer, |
caddr_t | table_entry | ||
) |
Definition at line 1021 of file ata_all.c.
References cam_strmatch(), scsi_static_inquiry_pattern::product, and scsi_static_inquiry_pattern::revision.
int ata_status_sbuf | ( | struct ccb_ataio * | ataio, |
struct sbuf * | sb | ||
) |
Definition at line 399 of file ata_all.c.
References ata_res::error, ccb_ataio::res, and ata_res::status.
Referenced by cam_error_string().
int ata_version | ( | int | ver | ) |
Definition at line 61 of file ata_all.c.
Referenced by ata_device_transport(), ata_print_ident(), and ata_print_ident_sbuf().
void ata_zac_mgmt_in | ( | struct ccb_ataio * | ataio, |
uint32_t | retries, | ||
void(*)(struct cam_periph *, union ccb *) | cbfcnp, | ||
int use_ncq | __unused, | ||
uint8_t | zm_action, | ||
uint64_t | zone_id, | ||
uint8_t | zone_flags, | ||
uint8_t * | data_ptr, | ||
uint32_t | dxfer_len, | ||
uint32_t | timeout | ||
) |
Definition at line 1201 of file ata_all.c.
References ata_48bit_cmd(), ATA_FLAG_AUX, ccb_ataio::ata_flags, ccb_ataio::aux, CAM_ATAIO_DMA, CAM_ATAIO_FPDMA, CAM_DIR_IN, cam_fill_ataio(), ccb_ataio::cmd, and ata_cmd::flags.
Referenced by ada_zone_cmd().
void ata_zac_mgmt_out | ( | struct ccb_ataio * | ataio, |
uint32_t | retries, | ||
void(*)(struct cam_periph *, union ccb *) | cbfcnp, | ||
int use_ncq | __unused, | ||
uint8_t | zm_action, | ||
uint64_t | zone_id, | ||
uint8_t | zone_flags, | ||
uint16_t | sector_count, | ||
uint8_t * | data_ptr, | ||
uint32_t | dxfer_len, | ||
uint32_t | timeout | ||
) |
Definition at line 1121 of file ata_all.c.
References ata_48bit_cmd(), ATA_FLAG_AUX, ccb_ataio::ata_flags, ccb_ataio::aux, CAM_ATAIO_DMA, CAM_ATAIO_FPDMA, CAM_DIR_NONE, CAM_DIR_OUT, cam_fill_ataio(), ccb_ataio::cmd, and ata_cmd::flags.
Referenced by ada_zone_cmd().
void semb_print_ident | ( | struct sep_identify_data * | ident_data | ) |
Definition at line 535 of file ata_all.c.
References cam_strvis(), sep_identify_data::interface_id, sep_identify_data::interface_rev, and semb_print_ident_short().
Referenced by semb_proto_announce().
void semb_print_ident_sbuf | ( | struct sep_identify_data * | ident_data, |
struct sbuf * | sb | ||
) |
Definition at line 546 of file ata_all.c.
References cam_strvis_sbuf(), sep_identify_data::interface_id, sep_identify_data::interface_rev, and semb_print_ident_short_sbuf().
Referenced by semb_proto_announce_sbuf().
void semb_print_ident_short | ( | struct sep_identify_data * | ident_data | ) |
Definition at line 559 of file ata_all.c.
References cam_strvis(), sep_identify_data::firmware_rev, sep_identify_data::product_id, sep_identify_data::product_rev, and sep_identify_data::vendor_id.
Referenced by semb_print_ident(), and semb_proto_denounce().
void semb_print_ident_short_sbuf | ( | struct sep_identify_data * | ident_data, |
struct sbuf * | sb | ||
) |
Definition at line 571 of file ata_all.c.
References cam_strvis_sbuf(), sep_identify_data::firmware_rev, sep_identify_data::product_id, sep_identify_data::product_rev, and sep_identify_data::vendor_id.
Referenced by semb_print_ident_sbuf(), and semb_proto_denounce_sbuf().
void semb_read_buffer | ( | struct ccb_ataio * | ataio, |
u_int32_t | retries, | ||
void(*)(struct cam_periph *, union ccb *) | cbfcnp, | ||
uint8_t | tag_action, | ||
uint8_t | page_code, | ||
uint8_t * | data_ptr, | ||
uint16_t | allocation_length, | ||
uint32_t | timeout | ||
) |
Definition at line 1080 of file ata_all.c.
References ata_28bit_cmd(), CAM_DIR_IN, and cam_fill_ataio().
Referenced by safte_fill_read_buf_io().
void semb_receive_diagnostic_results | ( | struct ccb_ataio * | ataio, |
u_int32_t | retries, | ||
void(*)(struct cam_periph *, union ccb *) | cbfcnp, | ||
uint8_t | tag_action, | ||
int | pcv, | ||
uint8_t | page_code, | ||
uint8_t * | data_ptr, | ||
uint16_t | allocation_length, | ||
uint32_t | timeout | ||
) |
Definition at line 1039 of file ata_all.c.
References ata_28bit_cmd(), CAM_DIR_IN, and cam_fill_ataio().
Referenced by ses_fill_rcv_diag_io().
void semb_send_diagnostic | ( | struct ccb_ataio * | ataio, |
u_int32_t | retries, | ||
void(*)(struct cam_periph *, union ccb *) | cbfcnp, | ||
uint8_t | tag_action, | ||
uint8_t * | data_ptr, | ||
uint16_t | param_list_length, | ||
uint32_t | timeout | ||
) |
Definition at line 1060 of file ata_all.c.
References ata_28bit_cmd(), CAM_DIR_NONE, CAM_DIR_OUT, and cam_fill_ataio().
void semb_write_buffer | ( | struct ccb_ataio * | ataio, |
u_int32_t | retries, | ||
void(*)(struct cam_periph *, union ccb *) | cbfcnp, | ||
uint8_t | tag_action, | ||
uint8_t * | data_ptr, | ||
uint16_t | param_list_length, | ||
uint32_t | timeout | ||
) |
Definition at line 1101 of file ata_all.c.
References ata_28bit_cmd(), CAM_DIR_NONE, CAM_DIR_OUT, and cam_fill_ataio().
Referenced by safte_fill_control_request().