FreeBSD kernel CAM code
ata_all.h File Reference
#include <sys/ata.h>
Include dependency graph for ata_all.h:
This graph shows which files directly or indirectly include this file:

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)
 

Macro Definition Documentation

◆ CAM_ATAIO_48BIT [1/2]

#define CAM_ATAIO_48BIT   0x01 /* Command has 48-bit format */

Definition at line 72 of file ata_all.h.

◆ CAM_ATAIO_48BIT [2/2]

#define CAM_ATAIO_48BIT   0x01 /* Command has 48-bit format */

Definition at line 72 of file ata_all.h.

◆ CAM_ATAIO_CONTROL

#define CAM_ATAIO_CONTROL   0x04 /* Control, not a command */

Definition at line 48 of file ata_all.h.

◆ CAM_ATAIO_DMA

#define CAM_ATAIO_DMA   0x10 /* DMA command */

Definition at line 50 of file ata_all.h.

◆ CAM_ATAIO_FPDMA

#define CAM_ATAIO_FPDMA   0x02 /* FPDMA command */

Definition at line 47 of file ata_all.h.

◆ CAM_ATAIO_NEEDRESULT

#define CAM_ATAIO_NEEDRESULT   0x08 /* Request requires result. */

Definition at line 49 of file ata_all.h.

◆ SID_AEN

#define SID_AEN   0x04 /* Abuse inq_flags bit to track enabled AEN. */

Definition at line 41 of file ata_all.h.

◆ SID_DMA

#define SID_DMA   0x10 /* Abuse inq_flags bit to track enabled DMA. */

Definition at line 42 of file ata_all.h.

◆ SID_DMA48

#define SID_DMA48   0x01 /* Abuse inq_flags bit to track enabled DMA48. */

Definition at line 40 of file ata_all.h.

Function Documentation

◆ ata_28bit_cmd()

void ata_28bit_cmd ( struct ccb_ataio ataio,
uint8_t  cmd,
uint8_t  features,
uint32_t  lba,
uint8_t  sector_count 
)

◆ ata_48bit_cmd()

◆ ata_bpack()

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().

Here is the caller graph for this function:

◆ ata_bswap()

void ata_bswap ( int8_t *  buf,
int  len 
)

Definition at line 762 of file ata_all.c.

Referenced by aprobedone(), and ata_param_fixup().

Here is the caller graph for this function:

◆ ata_btrim()

void ata_btrim ( int8_t *  buf,
int  len 
)

Definition at line 771 of file ata_all.c.

Referenced by ata_param_fixup().

Here is the caller graph for this function:

◆ ata_cmd_sbuf()

◆ ata_cmd_string()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ata_command_sbuf()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ata_identify_match()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ata_logical_sector_offset()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ata_logical_sector_size()

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().

Here is the caller graph for this function:

◆ ata_max_mode()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ata_max_pmode()

int ata_max_pmode ( struct ata_params *  ap)

Definition at line 806 of file ata_all.c.

Referenced by aprobedone(), and ata_max_mode().

Here is the caller graph for this function:

◆ ata_max_umode()

int ata_max_umode ( struct ata_params *  ap)

Definition at line 842 of file ata_all.c.

Referenced by ata_max_mode().

Here is the caller graph for this function:

◆ ata_max_wmode()

int ata_max_wmode ( struct ata_params *  ap)

Definition at line 830 of file ata_all.c.

Referenced by ata_max_mode().

Here is the caller graph for this function:

◆ ata_mode2speed()

u_int ata_mode2speed ( int  mode)

Definition at line 934 of file ata_all.c.

Referenced by _ata_announce_periph().

Here is the caller graph for this function:

◆ ata_mode2string()

char * ata_mode2string ( int  mode)

Definition at line 877 of file ata_all.c.

Referenced by ata_announce_periph(), and ata_announce_periph_sbuf().

Here is the caller graph for this function:

◆ ata_ncq_cmd()

void ata_ncq_cmd ( struct ccb_ataio ataio,
uint8_t  cmd,
uint64_t  lba,
uint16_t  sector_count 
)

◆ ata_op_string()

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().

Here is the caller graph for this function:

◆ ata_param_fixup()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ata_physical_sector_size()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ata_pm_read_cmd()

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().

Here is the caller graph for this function:

◆ ata_pm_write_cmd()

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().

Here is the caller graph for this function:

◆ ata_print_ident()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ata_print_ident_sbuf()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ata_print_ident_short()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ata_print_ident_short_sbuf()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ata_read_log()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ata_res_sbuf()

int ata_res_sbuf ( struct ata_res res,
struct sbuf *  sb 
)

◆ ata_res_string()

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().

Here is the call graph for this function:

◆ ata_reset_cmd()

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().

Here is the caller graph for this function:

◆ ata_revision2speed()

u_int ata_revision2speed ( int  revision)

Definition at line 972 of file ata_all.c.

Referenced by _ata_announce_periph().

Here is the caller graph for this function:

◆ ata_speed2revision()

int ata_speed2revision ( u_int  speed)

Definition at line 986 of file ata_all.c.

◆ ata_static_identify_match()

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.

Here is the call graph for this function:

◆ ata_status_sbuf()

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().

Here is the caller graph for this function:

◆ ata_string2mode()

int ata_string2mode ( char *  str)

Definition at line 906 of file ata_all.c.

◆ ata_version()

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().

Here is the caller graph for this function:

◆ ata_zac_mgmt_in()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ata_zac_mgmt_out()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ semb_print_ident()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ semb_print_ident_sbuf()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ semb_print_ident_short()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ semb_print_ident_short_sbuf()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ semb_read_buffer()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ semb_receive_diagnostic_results()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ semb_send_diagnostic()

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().

Here is the call graph for this function:

◆ semb_write_buffer()

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().

Here is the call graph for this function:
Here is the caller graph for this function: