From 7af2f2c8016ef05f0d1ff46095d38b6ec247fe5b Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 24 Jul 2023 21:17:41 -0600 Subject: [PATCH] cam: Migrate to modern uintXX_t from u_intXX_t As per https://lists.freebsd.org/archives/freebsd-scsi/2023-July/000257.html move to the modern uintXX_t. MFC After: 3 days Sponsored by: Netflix --- sys/cam/cam.c | 8 +- sys/cam/cam.h | 24 ++-- sys/cam/cam_ccb.h | 272 ++++++++++++++++++------------------- sys/cam/cam_compat.c | 4 +- sys/cam/cam_compat.h | 54 ++++---- sys/cam/cam_debug.h | 4 +- sys/cam/cam_periph.c | 78 +++++------ sys/cam/cam_periph.h | 22 +-- sys/cam/cam_queue.c | 10 +- sys/cam/cam_queue.h | 12 +- sys/cam/cam_sim.c | 8 +- sys/cam/cam_sim.h | 20 +-- sys/cam/cam_xpt.c | 46 +++---- sys/cam/cam_xpt.h | 14 +- sys/cam/cam_xpt_internal.h | 26 ++-- sys/cam/cam_xpt_periph.h | 2 +- sys/cam/cam_xpt_sim.h | 4 +- 17 files changed, 304 insertions(+), 304 deletions(-) diff --git a/sys/cam/cam.c b/sys/cam/cam.c index 7d9d8602d00..22c0faad7f0 100644 --- a/sys/cam/cam.c +++ b/sys/cam/cam.c @@ -123,14 +123,14 @@ SYSCTL_INT(_kern_cam, OID_AUTO, sort_io_queues, CTLFLAG_RWTUN, #endif void -cam_strvis(u_int8_t *dst, const u_int8_t *src, int srclen, int dstlen) +cam_strvis(uint8_t *dst, const uint8_t *src, int srclen, int dstlen) { cam_strvis_flag(dst, src, srclen, dstlen, CAM_STRVIS_FLAG_NONASCII_ESC); } void -cam_strvis_flag(u_int8_t *dst, const u_int8_t *src, int srclen, int dstlen, +cam_strvis_flag(uint8_t *dst, const uint8_t *src, int srclen, int dstlen, uint32_t flags) { struct sbuf sb; @@ -141,7 +141,7 @@ cam_strvis_flag(u_int8_t *dst, const u_int8_t *src, int srclen, int dstlen, } void -cam_strvis_sbuf(struct sbuf *sb, const u_int8_t *src, int srclen, +cam_strvis_sbuf(struct sbuf *sb, const uint8_t *src, int srclen, uint32_t flags) { @@ -203,7 +203,7 @@ cam_strvis_sbuf(struct sbuf *sb, const u_int8_t *src, int srclen, * Each '*' generates recursion, so keep the number of * in check. */ int -cam_strmatch(const u_int8_t *str, const u_int8_t *pattern, int str_len) +cam_strmatch(const uint8_t *str, const uint8_t *pattern, int str_len) { while (*pattern != '\0' && str_len > 0) { diff --git a/sys/cam/cam.h b/sys/cam/cam.h index eacf3a248ce..1b89afef529 100644 --- a/sys/cam/cam.h +++ b/sys/cam/cam.h @@ -44,7 +44,7 @@ typedef u_int path_id_t; typedef u_int target_id_t; -typedef u_int64_t lun_id_t; +typedef uint64_t lun_id_t; #define CAM_XPT_PATH_ID ((path_id_t)~0) #define CAM_BUS_WILDCARD ((path_id_t)~0) @@ -52,10 +52,10 @@ typedef u_int64_t lun_id_t; #define CAM_LUN_WILDCARD (~(u_int)0) #define CAM_EXTLUN_BYTE_SWIZZLE(lun) ( \ - ((((u_int64_t)lun) & 0xffff000000000000L) >> 48) | \ - ((((u_int64_t)lun) & 0x0000ffff00000000L) >> 16) | \ - ((((u_int64_t)lun) & 0x00000000ffff0000L) << 16) | \ - ((((u_int64_t)lun) & 0x000000000000ffffL) << 48)) + ((((uint64_t)lun) & 0xffff000000000000L) >> 48) | \ + ((((uint64_t)lun) & 0x0000ffff00000000L) >> 16) | \ + ((((uint64_t)lun) & 0x00000000ffff0000L) << 16) | \ + ((((uint64_t)lun) & 0x000000000000ffffL) << 48)) /* * Maximum length for a CAM CDB. @@ -86,15 +86,15 @@ typedef enum { * the queue giving round robin per priority level scheduling. */ typedef struct { - u_int32_t priority; + uint32_t priority; #define CAM_PRIORITY_HOST ((CAM_RL_HOST << 8) + 0x80) #define CAM_PRIORITY_BUS ((CAM_RL_BUS << 8) + 0x80) #define CAM_PRIORITY_XPT ((CAM_RL_XPT << 8) + 0x80) #define CAM_PRIORITY_DEV ((CAM_RL_DEV << 8) + 0x80) #define CAM_PRIORITY_OOB (CAM_RL_DEV << 8) #define CAM_PRIORITY_NORMAL ((CAM_RL_NORMAL << 8) + 0x80) -#define CAM_PRIORITY_NONE (u_int32_t)-1 - u_int32_t generation; +#define CAM_PRIORITY_NONE (uint32_t)-1 + uint32_t generation; int index; #define CAM_UNQUEUED_INDEX -1 #define CAM_ACTIVE_INDEX -2 @@ -385,13 +385,13 @@ typedef int (cam_quirkmatch_t)(caddr_t, caddr_t); caddr_t cam_quirkmatch(caddr_t target, caddr_t quirk_table, int num_entries, int entry_size, cam_quirkmatch_t *comp_func); -void cam_strvis(u_int8_t *dst, const u_int8_t *src, int srclen, int dstlen); -void cam_strvis_flag(u_int8_t *dst, const u_int8_t *src, int srclen, +void cam_strvis(uint8_t *dst, const uint8_t *src, int srclen, int dstlen); +void cam_strvis_flag(uint8_t *dst, const uint8_t *src, int srclen, int dstlen, uint32_t flags); -void cam_strvis_sbuf(struct sbuf *sb, const u_int8_t *src, int srclen, +void cam_strvis_sbuf(struct sbuf *sb, const uint8_t *src, int srclen, uint32_t flags); -int cam_strmatch(const u_int8_t *str, const u_int8_t *pattern, int str_len); +int cam_strmatch(const uint8_t *str, const uint8_t *pattern, int str_len); const struct cam_status_entry* cam_fetch_status_entry(cam_status status); #ifdef _KERNEL diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h index ba200ce15a0..5a68643d714 100644 --- a/sys/cam/cam_ccb.h +++ b/sys/cam/cam_ccb.h @@ -326,17 +326,17 @@ typedef union { typedef union { void *ptr; u_long field; - u_int8_t bytes[sizeof(uintptr_t)]; + uint8_t bytes[sizeof(uintptr_t)]; } ccb_priv_entry; typedef union { ccb_priv_entry entries[CCB_PERIPH_PRIV_SIZE]; - u_int8_t bytes[CCB_PERIPH_PRIV_SIZE * sizeof(ccb_priv_entry)]; + uint8_t bytes[CCB_PERIPH_PRIV_SIZE * sizeof(ccb_priv_entry)]; } ccb_ppriv_area; typedef union { ccb_priv_entry entries[CCB_SIM_PRIV_SIZE]; - u_int8_t bytes[CCB_SIM_PRIV_SIZE * sizeof(ccb_priv_entry)]; + uint8_t bytes[CCB_SIM_PRIV_SIZE * sizeof(ccb_priv_entry)]; } ccb_spriv_area; typedef struct { @@ -351,26 +351,26 @@ struct ccb_hdr { camq_entry sim_links; /* For chaining in the SIM layer */ camq_entry periph_links; /* For chaining in the type driver */ #if BYTE_ORDER == LITTLE_ENDIAN - u_int16_t retry_count; - u_int16_t alloc_flags; /* ccb_alloc_flags */ + uint16_t retry_count; + uint16_t alloc_flags; /* ccb_alloc_flags */ #else - u_int16_t alloc_flags; /* ccb_alloc_flags */ - u_int16_t retry_count; + uint16_t alloc_flags; /* ccb_alloc_flags */ + uint16_t retry_count; #endif void (*cbfcnp)(struct cam_periph *, union ccb *); /* Callback on completion function */ xpt_opcode func_code; /* XPT function code */ - u_int32_t status; /* Status returned by CAM subsystem */ + uint32_t status; /* Status returned by CAM subsystem */ struct cam_path *path; /* Compiled path for this ccb */ path_id_t path_id; /* Path ID for the request */ target_id_t target_id; /* Target device ID */ lun_id_t target_lun; /* Target LUN number */ - u_int32_t flags; /* ccb_flags */ - u_int32_t xflags; /* Extended flags */ + uint32_t flags; /* ccb_flags */ + uint32_t xflags; /* Extended flags */ ccb_ppriv_area periph_priv; ccb_spriv_area sim_priv; ccb_qos_area qos; - u_int32_t timeout; /* Hard timeout value in mseconds */ + uint32_t timeout; /* Hard timeout value in mseconds */ struct timeval softtimeout; /* Soft timeout value in sec + usec */ }; @@ -380,9 +380,9 @@ struct ccb_getdev { cam_proto protocol; struct scsi_inquiry_data inq_data; struct ata_params ident_data; - u_int8_t serial_num[252]; - u_int8_t inq_flags; - u_int8_t serial_num_len; + uint8_t serial_num[252]; + uint8_t inq_flags; + uint8_t serial_num_len; void *padding[2]; }; @@ -415,9 +415,9 @@ typedef enum { struct ccb_getdevlist { struct ccb_hdr ccb_h; char periph_name[DEV_IDLEN]; - u_int32_t unit_number; + uint32_t unit_number; unsigned int generation; - u_int32_t index; + uint32_t index; ccb_getdevlist_status_e status; }; @@ -432,7 +432,7 @@ typedef enum { struct periph_match_pattern { char periph_name[DEV_IDLEN]; - u_int32_t unit_number; + uint32_t unit_number; path_id_t path_id; target_id_t target_id; lun_id_t target_lun; @@ -475,8 +475,8 @@ typedef enum { struct bus_match_pattern { path_id_t path_id; char dev_name[DEV_IDLEN]; - u_int32_t unit_number; - u_int32_t bus_id; + uint32_t unit_number; + uint32_t bus_id; bus_pattern_flags flags; }; @@ -499,7 +499,7 @@ struct dev_match_pattern { struct periph_match_result { char periph_name[DEV_IDLEN]; - u_int32_t unit_number; + uint32_t unit_number; path_id_t path_id; target_id_t target_id; lun_id_t target_lun; @@ -523,8 +523,8 @@ struct device_match_result { struct bus_match_result { path_id_t path_id; char dev_name[DEV_IDLEN]; - u_int32_t unit_number; - u_int32_t bus_id; + uint32_t unit_number; + uint32_t bus_id; }; union match_result { @@ -579,11 +579,11 @@ struct ccb_dev_position { struct ccb_dev_match { struct ccb_hdr ccb_h; ccb_dev_match_status status; - u_int32_t num_patterns; - u_int32_t pattern_buf_len; + uint32_t num_patterns; + uint32_t pattern_buf_len; struct dev_match_pattern *patterns; - u_int32_t num_matches; - u_int32_t match_buf_len; + uint32_t num_matches; + uint32_t match_buf_len; struct dev_match_result *matches; struct ccb_dev_position pos; }; @@ -628,18 +628,18 @@ typedef enum { /* Path Inquiry CCB */ struct ccb_pathinq_settings_spi { - u_int8_t ppr_options; + uint8_t ppr_options; }; struct ccb_pathinq_settings_fc { - u_int64_t wwnn; /* world wide node name */ - u_int64_t wwpn; /* world wide port name */ - u_int32_t port; /* 24 bit port id, if known */ - u_int32_t bitrate; /* Mbps */ + uint64_t wwnn; /* world wide node name */ + uint64_t wwpn; /* world wide port name */ + uint32_t port; /* 24 bit port id, if known */ + uint32_t bitrate; /* Mbps */ }; struct ccb_pathinq_settings_sas { - u_int32_t bitrate; /* Mbps */ + uint32_t bitrate; /* Mbps */ }; #define NVME_DEV_NAME_LEN 52 @@ -659,24 +659,24 @@ _Static_assert(sizeof(struct ccb_pathinq_settings_nvme) == 64, struct ccb_pathinq { struct ccb_hdr ccb_h; - u_int8_t version_num; /* Version number for the SIM/HBA */ - u_int8_t hba_inquiry; /* Mimic of INQ byte 7 for the HBA */ - u_int16_t target_sprt; /* Flags for target mode support */ - u_int32_t hba_misc; /* Misc HBA features */ - u_int16_t hba_eng_cnt; /* HBA engine count */ + uint8_t version_num; /* Version number for the SIM/HBA */ + uint8_t hba_inquiry; /* Mimic of INQ byte 7 for the HBA */ + uint16_t target_sprt; /* Flags for target mode support */ + uint32_t hba_misc; /* Misc HBA features */ + uint16_t hba_eng_cnt; /* HBA engine count */ /* Vendor Unique capabilities */ - u_int8_t vuhba_flags[VUHBALEN]; - u_int32_t max_target; /* Maximum supported Target */ - u_int32_t max_lun; /* Maximum supported Lun */ - u_int32_t async_flags; /* Installed Async handlers */ + uint8_t vuhba_flags[VUHBALEN]; + uint32_t max_target; /* Maximum supported Target */ + uint32_t max_lun; /* Maximum supported Lun */ + uint32_t async_flags; /* Installed Async handlers */ path_id_t hpath_id; /* Highest Path ID in the subsystem */ target_id_t initiator_id; /* ID of the HBA on the SCSI bus */ char sim_vid[SIM_IDLEN]; /* Vendor ID of the SIM */ char hba_vid[HBA_IDLEN]; /* Vendor ID of the HBA */ char dev_name[DEV_IDLEN];/* Device name for SIM */ - u_int32_t unit_number; /* Unit number for SIM */ - u_int32_t bus_id; /* Bus ID for SIM */ - u_int32_t base_transfer_speed;/* Base bus speed in KB/sec */ + uint32_t unit_number; /* Unit number for SIM */ + uint32_t bus_id; /* Bus ID for SIM */ + uint32_t base_transfer_speed;/* Base bus speed in KB/sec */ cam_proto protocol; u_int protocol_version; cam_xport transport; @@ -689,10 +689,10 @@ struct ccb_pathinq { char ccb_pathinq_settings_opaque[PATHINQ_SETTINGS_SIZE]; } xport_specific; u_int maxio; /* Max supported I/O size, in bytes. */ - u_int16_t hba_vendor; /* HBA vendor ID */ - u_int16_t hba_device; /* HBA device ID */ - u_int16_t hba_subvendor; /* HBA subvendor ID */ - u_int16_t hba_subdevice; /* HBA subdevice ID */ + uint16_t hba_vendor; /* HBA vendor ID */ + uint16_t hba_device; /* HBA device ID */ + uint16_t hba_subvendor; /* HBA subvendor ID */ + uint16_t hba_subdevice; /* HBA subdevice ID */ }; /* Path Statistics CCB */ @@ -728,7 +728,7 @@ struct ccb_smpio { }; typedef union { - u_int8_t *sense_ptr; /* + uint8_t *sense_ptr; /* * Pointer to storage * for sense information */ @@ -737,9 +737,9 @@ typedef union { } sense_t; typedef union { - u_int8_t *cdb_ptr; /* Pointer to the CDB bytes to send */ + uint8_t *cdb_ptr; /* Pointer to the CDB bytes to send */ /* Area for the CDB send */ - u_int8_t cdb_bytes[IOCDBLEN]; + uint8_t cdb_bytes[IOCDBLEN]; } cdb_t; /* @@ -749,21 +749,21 @@ typedef union { struct ccb_scsiio { struct ccb_hdr ccb_h; union ccb *next_ccb; /* Ptr for next CCB for action */ - u_int8_t *req_map; /* Ptr to mapping info */ - u_int8_t *data_ptr; /* Ptr to the data buf/SG list */ - u_int32_t dxfer_len; /* Data transfer length */ + uint8_t *req_map; /* Ptr to mapping info */ + uint8_t *data_ptr; /* Ptr to the data buf/SG list */ + uint32_t dxfer_len; /* Data transfer length */ /* Autosense storage */ struct scsi_sense_data sense_data; - u_int8_t sense_len; /* Number of bytes to autosense */ - u_int8_t cdb_len; /* Number of bytes for the CDB */ - u_int16_t sglist_cnt; /* Number of SG list entries */ - u_int8_t scsi_status; /* Returned SCSI status */ - u_int8_t sense_resid; /* Autosense resid length: 2's comp */ - u_int32_t resid; /* Transfer residual length: 2's comp */ + uint8_t sense_len; /* Number of bytes to autosense */ + uint8_t cdb_len; /* Number of bytes for the CDB */ + uint16_t sglist_cnt; /* Number of SG list entries */ + uint8_t scsi_status; /* Returned SCSI status */ + uint8_t sense_resid; /* Autosense resid length: 2's comp */ + uint32_t resid; /* Transfer residual length: 2's comp */ cdb_t cdb_io; /* Union for CDB bytes/pointer */ - u_int8_t *msg_ptr; /* Pointer to the message buffer */ - u_int16_t msg_len; /* Number of bytes for the Message */ - u_int8_t tag_action; /* What to do for tag queueing */ + uint8_t *msg_ptr; /* Pointer to the message buffer */ + uint16_t msg_len; /* Number of bytes for the Message */ + uint8_t tag_action; /* What to do for tag queueing */ /* * The tag action should be either the define below (to send a * non-tagged transaction) or one of the defined scsi tag messages @@ -793,10 +793,10 @@ struct ccb_ataio { union ccb *next_ccb; /* Ptr for next CCB for action */ struct ata_cmd cmd; /* ATA command register set */ struct ata_res res; /* ATA result register set */ - u_int8_t *data_ptr; /* Ptr to the data buf/SG list */ - u_int32_t dxfer_len; /* Data transfer length */ - u_int32_t resid; /* Transfer residual length: 2's comp */ - u_int8_t ata_flags; /* Flags for the rest of the buffer */ + uint8_t *data_ptr; /* Ptr to the data buf/SG list */ + uint32_t dxfer_len; /* Data transfer length */ + uint32_t resid; /* Transfer residual length: 2's comp */ + uint8_t ata_flags; /* Flags for the rest of the buffer */ #define ATA_FLAG_AUX 0x1 #define ATA_FLAG_ICC 0x2 uint8_t icc; /* Isochronous Command Completion */ @@ -817,9 +817,9 @@ struct ccb_mmcio { struct ccb_accept_tio { struct ccb_hdr ccb_h; cdb_t cdb_io; /* Union for CDB bytes/pointer */ - u_int8_t cdb_len; /* Number of bytes for the CDB */ - u_int8_t tag_action; /* What to do for tag queueing */ - u_int8_t sense_len; /* Number of bytes of Sense Data */ + uint8_t cdb_len; /* Number of bytes for the CDB */ + uint8_t tag_action; /* What to do for tag queueing */ + uint8_t sense_len; /* Number of bytes of Sense Data */ uint8_t priority; /* Command priority for SIMPLE tag */ u_int tag_id; /* tag id from initator (target mode) */ u_int init_id; /* initiator id of who selected */ @@ -836,14 +836,14 @@ atio_cdb_ptr(struct ccb_accept_tio *ccb) /* Release SIM Queue */ struct ccb_relsim { struct ccb_hdr ccb_h; - u_int32_t release_flags; + uint32_t release_flags; #define RELSIM_ADJUST_OPENINGS 0x01 #define RELSIM_RELEASE_AFTER_TIMEOUT 0x02 #define RELSIM_RELEASE_AFTER_CMDCMPLT 0x04 #define RELSIM_RELEASE_AFTER_QEMPTY 0x08 - u_int32_t openings; - u_int32_t release_timeout; /* Abstract argument. */ - u_int32_t qfrozen_cnt; + uint32_t openings; + uint32_t release_timeout; /* Abstract argument. */ + uint32_t qfrozen_cnt; }; /* @@ -880,7 +880,7 @@ typedef enum { AC_BUS_RESET = 0x001 /* A SCSI bus reset occurred */ } ac_code; -typedef void ac_callback_t (void *softc, u_int32_t code, +typedef void ac_callback_t (void *softc, uint32_t code, struct cam_path *path, void *args); /* @@ -889,24 +889,24 @@ typedef void ac_callback_t (void *softc, u_int32_t code, * Generic arguments passed bac which are then interpreted between a per-system * contract number. */ -#define AC_CONTRACT_DATA_MAX (128 - sizeof (u_int64_t)) +#define AC_CONTRACT_DATA_MAX (128 - sizeof (uint64_t)) struct ac_contract { - u_int64_t contract_number; - u_int8_t contract_data[AC_CONTRACT_DATA_MAX]; + uint64_t contract_number; + uint8_t contract_data[AC_CONTRACT_DATA_MAX]; }; #define AC_CONTRACT_DEV_CHG 1 struct ac_device_changed { - u_int64_t wwpn; - u_int32_t port; + uint64_t wwpn; + uint32_t port; target_id_t target; - u_int8_t arrived; + uint8_t arrived; }; /* Set Asynchronous Callback CCB */ struct ccb_setasync { struct ccb_hdr ccb_h; - u_int32_t event_enable; /* Async Event enables */ + uint32_t event_enable; /* Async Event enables */ ac_callback_t *callback; void *callback_arg; }; @@ -914,7 +914,7 @@ struct ccb_setasync { /* Set Device Type CCB */ struct ccb_setdev { struct ccb_hdr ccb_h; - u_int8_t dev_type; /* Value for dev type field in EDT */ + uint8_t dev_type; /* Value for dev type field in EDT */ }; /* SCSI Control Functions */ @@ -984,16 +984,16 @@ struct ccb_trans_settings_fc { #define CTS_FC_VALID_WWPN 0x4000 #define CTS_FC_VALID_PORT 0x2000 #define CTS_FC_VALID_SPEED 0x1000 - u_int64_t wwnn; /* world wide node name */ - u_int64_t wwpn; /* world wide port name */ - u_int32_t port; /* 24 bit port id, if known */ - u_int32_t bitrate; /* Mbps */ + uint64_t wwnn; /* world wide node name */ + uint64_t wwpn; /* world wide port name */ + uint32_t port; /* 24 bit port id, if known */ + uint32_t bitrate; /* Mbps */ }; struct ccb_trans_settings_sas { u_int valid; /* Which fields to honor */ #define CTS_SAS_VALID_SPEED 0x1000 - u_int32_t bitrate; /* Mbps */ + uint32_t bitrate; /* Mbps */ }; struct ccb_trans_settings_pata { @@ -1133,11 +1133,11 @@ struct ccb_trans_settings { */ struct ccb_calc_geometry { struct ccb_hdr ccb_h; - u_int32_t block_size; - u_int64_t volume_size; - u_int32_t cylinders; - u_int8_t heads; - u_int8_t secs_per_track; + uint32_t block_size; + uint64_t volume_size; + uint32_t cylinders; + uint8_t heads; + uint8_t secs_per_track; }; /* @@ -1160,14 +1160,14 @@ struct ccb_sim_knob_settings_spi { struct ccb_sim_knob_settings_fc { u_int valid; - u_int64_t wwnn; /* world wide node name */ - u_int64_t wwpn; /* world wide port name */ + uint64_t wwnn; /* world wide node name */ + uint64_t wwpn; /* world wide port name */ u_int role; }; struct ccb_sim_knob_settings_sas { u_int valid; - u_int64_t wwnn; /* world wide node name */ + uint64_t wwnn; /* world wide node name */ u_int role; }; #define KNOB_SETTINGS_SIZE 128 @@ -1203,24 +1203,24 @@ struct ccb_debug { struct ccb_en_lun { struct ccb_hdr ccb_h; - u_int16_t grp6_len; /* Group 6 VU CDB length */ - u_int16_t grp7_len; /* Group 7 VU CDB length */ - u_int8_t enable; + uint16_t grp6_len; /* Group 6 VU CDB length */ + uint16_t grp7_len; /* Group 7 VU CDB length */ + uint8_t enable; }; /* old, barely used immediate notify, binary compatibility */ struct ccb_immed_notify { struct ccb_hdr ccb_h; struct scsi_sense_data sense_data; - u_int8_t sense_len; /* Number of bytes in sense buffer */ - u_int8_t initiator_id; /* Id of initiator that selected */ - u_int8_t message_args[7]; /* Message Arguments */ + uint8_t sense_len; /* Number of bytes in sense buffer */ + uint8_t initiator_id; /* Id of initiator that selected */ + uint8_t message_args[7]; /* Message Arguments */ }; struct ccb_notify_ack { struct ccb_hdr ccb_h; - u_int16_t seq_id; /* Sequence identifier */ - u_int8_t event; /* Event flags */ + uint16_t seq_id; /* Sequence identifier */ + uint8_t event; /* Event flags */ }; struct ccb_immediate_notify { @@ -1267,26 +1267,26 @@ typedef enum { struct ccb_eng_inq { struct ccb_hdr ccb_h; - u_int16_t eng_num; /* The engine number for this inquiry */ + uint16_t eng_num; /* The engine number for this inquiry */ ei_type eng_type; /* Returned engine type */ ei_algo eng_algo; /* Returned engine algorithm type */ - u_int32_t eng_memeory; /* Returned engine memory size */ + uint32_t eng_memeory; /* Returned engine memory size */ }; struct ccb_eng_exec { /* This structure must match SCSIIO size */ struct ccb_hdr ccb_h; - u_int8_t *pdrv_ptr; /* Ptr used by the peripheral driver */ - u_int8_t *req_map; /* Ptr for mapping info on the req. */ - u_int8_t *data_ptr; /* Pointer to the data buf/SG list */ - u_int32_t dxfer_len; /* Data transfer length */ - u_int8_t *engdata_ptr; /* Pointer to the engine buffer data */ - u_int16_t sglist_cnt; /* Num of scatter gather list entries */ - u_int32_t dmax_len; /* Destination data maximum length */ - u_int32_t dest_len; /* Destination data length */ + uint8_t *pdrv_ptr; /* Ptr used by the peripheral driver */ + uint8_t *req_map; /* Ptr for mapping info on the req. */ + uint8_t *data_ptr; /* Pointer to the data buf/SG list */ + uint32_t dxfer_len; /* Data transfer length */ + uint8_t *engdata_ptr; /* Pointer to the engine buffer data */ + uint16_t sglist_cnt; /* Num of scatter gather list entries */ + uint32_t dmax_len; /* Destination data maximum length */ + uint32_t dest_len; /* Destination data length */ int32_t src_resid; /* Source residual length: 2's comp */ - u_int32_t timeout; /* Timeout value */ - u_int16_t eng_num; /* Engine number for this request */ - u_int16_t vu_flags; /* Vendor Unique flags */ + uint32_t timeout; /* Timeout value */ + uint16_t eng_num; /* Engine number for this request */ + uint16_t vu_flags; /* Vendor Unique flags */ }; /* @@ -1386,12 +1386,12 @@ union ccb { __BEGIN_DECLS static __inline void -cam_fill_csio(struct ccb_scsiio *csio, u_int32_t retries, +cam_fill_csio(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int32_t flags, u_int8_t tag_action, - u_int8_t *data_ptr, u_int32_t dxfer_len, - u_int8_t sense_len, u_int8_t cdb_len, - u_int32_t timeout) + uint32_t flags, uint8_t tag_action, + uint8_t *data_ptr, uint32_t dxfer_len, + uint8_t sense_len, uint8_t cdb_len, + uint32_t timeout) { csio->ccb_h.func_code = XPT_SCSI_IO; csio->ccb_h.flags = flags; @@ -1411,11 +1411,11 @@ cam_fill_csio(struct ccb_scsiio *csio, u_int32_t retries, } static __inline void -cam_fill_ctio(struct ccb_scsiio *csio, u_int32_t retries, +cam_fill_ctio(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int32_t flags, u_int tag_action, u_int tag_id, - u_int init_id, u_int scsi_status, u_int8_t *data_ptr, - u_int32_t dxfer_len, u_int32_t timeout) + uint32_t flags, u_int tag_action, u_int tag_id, + u_int init_id, u_int scsi_status, uint8_t *data_ptr, + uint32_t dxfer_len, uint32_t timeout) { csio->ccb_h.func_code = XPT_CONT_TARGET_IO; csio->ccb_h.flags = flags; @@ -1433,11 +1433,11 @@ cam_fill_ctio(struct ccb_scsiio *csio, u_int32_t retries, } static __inline void -cam_fill_ataio(struct ccb_ataio *ataio, u_int32_t retries, +cam_fill_ataio(struct ccb_ataio *ataio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int32_t flags, u_int tag_action __unused, - u_int8_t *data_ptr, u_int32_t dxfer_len, - u_int32_t timeout) + uint32_t flags, u_int tag_action __unused, + uint8_t *data_ptr, uint32_t dxfer_len, + uint32_t timeout) { ataio->ccb_h.func_code = XPT_ATA_IO; ataio->ccb_h.flags = flags; @@ -1525,10 +1525,10 @@ cam_ccb_success(union ccb *ccb) void cam_calc_geometry(struct ccb_calc_geometry *ccg, int extended); static __inline void -cam_fill_nvmeio(struct ccb_nvmeio *nvmeio, u_int32_t retries, +cam_fill_nvmeio(struct ccb_nvmeio *nvmeio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int32_t flags, u_int8_t *data_ptr, u_int32_t dxfer_len, - u_int32_t timeout) + uint32_t flags, uint8_t *data_ptr, uint32_t dxfer_len, + uint32_t timeout) { nvmeio->ccb_h.func_code = XPT_NVME_IO; nvmeio->ccb_h.flags = flags; @@ -1540,10 +1540,10 @@ cam_fill_nvmeio(struct ccb_nvmeio *nvmeio, u_int32_t retries, } static __inline void -cam_fill_nvmeadmin(struct ccb_nvmeio *nvmeio, u_int32_t retries, +cam_fill_nvmeadmin(struct ccb_nvmeio *nvmeio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), - u_int32_t flags, u_int8_t *data_ptr, u_int32_t dxfer_len, - u_int32_t timeout) + uint32_t flags, uint8_t *data_ptr, uint32_t dxfer_len, + uint32_t timeout) { nvmeio->ccb_h.func_code = XPT_NVME_ADMIN; nvmeio->ccb_h.flags = flags; diff --git a/sys/cam/cam_compat.c b/sys/cam/cam_compat.c index b061a3de24b..512df480372 100644 --- a/sys/cam/cam_compat.c +++ b/sys/cam/cam_compat.c @@ -216,8 +216,8 @@ cam_compat_handle_0x17(struct cdev *dev, u_long cmd, caddr_t addr, int flag, cpi17 = (struct ccb_pathinq_0x17 *)hdr17; cpi17->version_num = cpi->version_num; cpi17->hba_inquiry = cpi->hba_inquiry; - cpi17->target_sprt = (u_int8_t)cpi->target_sprt; - cpi17->hba_misc = (u_int8_t)cpi->hba_misc; + cpi17->target_sprt = (uint8_t)cpi->target_sprt; + cpi17->hba_misc = (uint8_t)cpi->hba_misc; cpi17->hba_eng_cnt = cpi->hba_eng_cnt; bcopy(&cpi->vuhba_flags[0], &cpi17->vuhba_flags[0], VUHBALEN); cpi17->max_target = cpi->max_target; diff --git a/sys/cam/cam_compat.h b/sys/cam/cam_compat.h index 821ef18eaae..2f62298acd2 100644 --- a/sys/cam/cam_compat.h +++ b/sys/cam/cam_compat.h @@ -59,41 +59,41 @@ struct ccb_hdr_0x17 { camq_entry xpt_links; /* For chaining in the XPT layer */ camq_entry sim_links; /* For chaining in the SIM layer */ camq_entry periph_links; /* For chaining in the type driver */ - u_int32_t retry_count; + uint32_t retry_count; void (*cbfcnp)(struct cam_periph *, union ccb *); xpt_opcode func_code; /* XPT function code */ - u_int32_t status; /* Status returned by CAM subsystem */ + uint32_t status; /* Status returned by CAM subsystem */ struct cam_path *path; /* Compiled path for this ccb */ path_id_t path_id; /* Path ID for the request */ target_id_t target_id; /* Target device ID */ u_int target_lun; /* Target LUN number */ - u_int32_t flags; /* ccb_flags */ + uint32_t flags; /* ccb_flags */ ccb_ppriv_area periph_priv; ccb_spriv_area sim_priv; - u_int32_t timeout; /* Hard timeout value in seconds */ + uint32_t timeout; /* Hard timeout value in seconds */ struct callout *timeout_ch; }; struct ccb_pathinq_0x17 { struct ccb_hdr_0x17 ccb_h; - u_int8_t version_num; /* Version number for the SIM/HBA */ - u_int8_t hba_inquiry; /* Mimic of INQ byte 7 for the HBA */ - u_int8_t target_sprt; /* Flags for target mode support */ - u_int8_t hba_misc; /* Misc HBA features */ - u_int16_t hba_eng_cnt; /* HBA engine count */ + uint8_t version_num; /* Version number for the SIM/HBA */ + uint8_t hba_inquiry; /* Mimic of INQ byte 7 for the HBA */ + uint8_t target_sprt; /* Flags for target mode support */ + uint8_t hba_misc; /* Misc HBA features */ + uint16_t hba_eng_cnt; /* HBA engine count */ /* Vendor Unique capabilities */ - u_int8_t vuhba_flags[VUHBALEN]; - u_int32_t max_target; /* Maximum supported Target */ - u_int32_t max_lun; /* Maximum supported Lun */ - u_int32_t async_flags; /* Installed Async handlers */ + uint8_t vuhba_flags[VUHBALEN]; + uint32_t max_target; /* Maximum supported Target */ + uint32_t max_lun; /* Maximum supported Lun */ + uint32_t async_flags; /* Installed Async handlers */ path_id_t hpath_id; /* Highest Path ID in the subsystem */ target_id_t initiator_id; /* ID of the HBA on the SCSI bus */ char sim_vid[SIM_IDLEN]; /* Vendor ID of the SIM */ char hba_vid[HBA_IDLEN]; /* Vendor ID of the HBA */ char dev_name[DEV_IDLEN];/* Device name for SIM */ - u_int32_t unit_number; /* Unit number for SIM */ - u_int32_t bus_id; /* Bus ID for SIM */ - u_int32_t base_transfer_speed;/* Base bus speed in KB/sec */ + uint32_t unit_number; /* Unit number for SIM */ + uint32_t bus_id; /* Bus ID for SIM */ + uint32_t base_transfer_speed;/* Base bus speed in KB/sec */ cam_proto protocol; u_int protocol_version; cam_xport transport; @@ -105,10 +105,10 @@ struct ccb_pathinq_0x17 { char ccb_pathinq_settings_opaque[PATHINQ_SETTINGS_SIZE]; } xport_specific; u_int maxio; /* Max supported I/O size, in bytes. */ - u_int16_t hba_vendor; /* HBA vendor ID */ - u_int16_t hba_device; /* HBA device ID */ - u_int16_t hba_subvendor; /* HBA subvendor ID */ - u_int16_t hba_subdevice; /* HBA subdevice ID */ + uint16_t hba_vendor; /* HBA vendor ID */ + uint16_t hba_device; /* HBA device ID */ + uint16_t hba_subvendor; /* HBA subvendor ID */ + uint16_t hba_subdevice; /* HBA subdevice ID */ }; struct ccb_trans_settings_0x17 { @@ -147,21 +147,21 @@ struct ccb_hdr_0x18 { camq_entry xpt_links; /* For chaining in the XPT layer */ camq_entry sim_links; /* For chaining in the SIM layer */ camq_entry periph_links; /* For chaining in the type driver */ - u_int32_t retry_count; + uint32_t retry_count; void (*cbfcnp)(struct cam_periph *, union ccb *); xpt_opcode func_code; /* XPT function code */ - u_int32_t status; /* Status returned by CAM subsystem */ + uint32_t status; /* Status returned by CAM subsystem */ struct cam_path *path; /* Compiled path for this ccb */ path_id_t path_id; /* Path ID for the request */ target_id_t target_id; /* Target device ID */ u_int target_lun; /* Target LUN number */ - u_int64_t ext_lun; /* 64-bit LUN, more or less */ - u_int32_t flags; /* ccb_flags */ - u_int32_t xflags; /* extended ccb_flags */ + uint64_t ext_lun; /* 64-bit LUN, more or less */ + uint32_t flags; /* ccb_flags */ + uint32_t xflags; /* extended ccb_flags */ ccb_ppriv_area periph_priv; ccb_spriv_area sim_priv; ccb_qos_area qos; - u_int32_t timeout; /* Hard timeout value in seconds */ + uint32_t timeout; /* Hard timeout value in seconds */ struct timeval softtimeout; /* Soft timeout value in sec + usec */ }; @@ -196,7 +196,7 @@ struct dev_match_result_0x18 { union { struct { char periph_name[DEV_IDLEN]; - u_int32_t unit_number; + uint32_t unit_number; path_id_t path_id; target_id_t target_id; u_int target_lun; diff --git a/sys/cam/cam_debug.h b/sys/cam/cam_debug.h index 39db02d8b8c..d5117a13b5a 100644 --- a/sys/cam/cam_debug.h +++ b/sys/cam/cam_debug.h @@ -79,9 +79,9 @@ typedef enum { /* Path we want to debug */ extern struct cam_path *cam_dpath; /* Current debug levels set */ -extern u_int32_t cam_dflags; +extern uint32_t cam_dflags; /* Printf delay value (to prevent scrolling) */ -extern u_int32_t cam_debug_delay; +extern uint32_t cam_debug_delay; /* Debugging macros. */ #define CAM_DEBUGGED(path, flag) \ diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 0de73cffdc1..1ae99440221 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -78,20 +78,20 @@ static void camperiphfree(struct cam_periph *periph); static int camperiphscsistatuserror(union ccb *ccb, union ccb **orig_ccb, cam_flags camflags, - u_int32_t sense_flags, + uint32_t sense_flags, int *openings, - u_int32_t *relsim_flags, - u_int32_t *timeout, - u_int32_t *action, + uint32_t *relsim_flags, + uint32_t *timeout, + uint32_t *action, const char **action_string); static int camperiphscsisenseerror(union ccb *ccb, union ccb **orig_ccb, cam_flags camflags, - u_int32_t sense_flags, + uint32_t sense_flags, int *openings, - u_int32_t *relsim_flags, - u_int32_t *timeout, - u_int32_t *action, + uint32_t *relsim_flags, + uint32_t *timeout, + uint32_t *action, const char **action_string); static void cam_periph_devctl_notify(union ccb *ccb); @@ -809,9 +809,9 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo, u_int maxmap) { int numbufs, i; - u_int8_t **data_ptrs[CAM_PERIPH_MAXMAPS]; - u_int32_t lengths[CAM_PERIPH_MAXMAPS]; - u_int32_t dirs[CAM_PERIPH_MAXMAPS]; + uint8_t **data_ptrs[CAM_PERIPH_MAXMAPS]; + uint32_t lengths[CAM_PERIPH_MAXMAPS]; + uint32_t dirs[CAM_PERIPH_MAXMAPS]; bzero(mapinfo, sizeof(*mapinfo)); if (maxmap == 0) @@ -826,15 +826,15 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo, return(EINVAL); } if (ccb->cdm.pattern_buf_len > 0) { - data_ptrs[0] = (u_int8_t **)&ccb->cdm.patterns; + data_ptrs[0] = (uint8_t **)&ccb->cdm.patterns; lengths[0] = ccb->cdm.pattern_buf_len; dirs[0] = CAM_DIR_OUT; - data_ptrs[1] = (u_int8_t **)&ccb->cdm.matches; + data_ptrs[1] = (uint8_t **)&ccb->cdm.matches; lengths[1] = ccb->cdm.match_buf_len; dirs[1] = CAM_DIR_IN; numbufs = 2; } else { - data_ptrs[0] = (u_int8_t **)&ccb->cdm.matches; + data_ptrs[0] = (uint8_t **)&ccb->cdm.matches; lengths[0] = ccb->cdm.match_buf_len; dirs[0] = CAM_DIR_IN; numbufs = 1; @@ -1020,9 +1020,9 @@ void cam_periph_unmapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) { int numbufs, i; - u_int8_t **data_ptrs[CAM_PERIPH_MAXMAPS]; - u_int32_t lengths[CAM_PERIPH_MAXMAPS]; - u_int32_t dirs[CAM_PERIPH_MAXMAPS]; + uint8_t **data_ptrs[CAM_PERIPH_MAXMAPS]; + uint32_t lengths[CAM_PERIPH_MAXMAPS]; + uint32_t dirs[CAM_PERIPH_MAXMAPS]; if (mapinfo->num_bufs_used <= 0) { /* nothing to free and the process wasn't held. */ @@ -1032,15 +1032,15 @@ cam_periph_unmapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) switch (ccb->ccb_h.func_code) { case XPT_DEV_MATCH: if (ccb->cdm.pattern_buf_len > 0) { - data_ptrs[0] = (u_int8_t **)&ccb->cdm.patterns; + data_ptrs[0] = (uint8_t **)&ccb->cdm.patterns; lengths[0] = ccb->cdm.pattern_buf_len; dirs[0] = CAM_DIR_OUT; - data_ptrs[1] = (u_int8_t **)&ccb->cdm.matches; + data_ptrs[1] = (uint8_t **)&ccb->cdm.matches; lengths[1] = ccb->cdm.match_buf_len; dirs[1] = CAM_DIR_IN; numbufs = 2; } else { - data_ptrs[0] = (u_int8_t **)&ccb->cdm.matches; + data_ptrs[0] = (uint8_t **)&ccb->cdm.matches; lengths[0] = ccb->cdm.match_buf_len; dirs[0] = CAM_DIR_IN; numbufs = 1; @@ -1060,10 +1060,10 @@ cam_periph_unmapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) numbufs = 1; break; case XPT_MMC_IO: - data_ptrs[0] = (u_int8_t **)&ccb->mmcio.cmd.data; + data_ptrs[0] = (uint8_t **)&ccb->mmcio.cmd.data; lengths[0] = sizeof(struct mmc_data *); dirs[0] = ccb->ccb_h.flags & CAM_DIR_MASK; - data_ptrs[1] = (u_int8_t **)&ccb->mmcio.cmd.data->data; + data_ptrs[1] = (uint8_t **)&ccb->mmcio.cmd.data->data; lengths[1] = ccb->mmcio.cmd.data->len; dirs[1] = ccb->ccb_h.flags & CAM_DIR_MASK; numbufs = 2; @@ -1124,7 +1124,7 @@ int cam_periph_ioctl(struct cam_periph *periph, u_long cmd, caddr_t addr, int (*error_routine)(union ccb *ccb, cam_flags camflags, - u_int32_t sense_flags)) + uint32_t sense_flags)) { union ccb *ccb; int error; @@ -1223,8 +1223,8 @@ int cam_periph_runccb(union ccb *ccb, int (*error_routine)(union ccb *ccb, cam_flags camflags, - u_int32_t sense_flags), - cam_flags camflags, u_int32_t sense_flags, + uint32_t sense_flags), + cam_flags camflags, uint32_t sense_flags, struct devstat *ds) { struct bintime *starttime; @@ -1359,9 +1359,9 @@ cam_freeze_devq(struct cam_path *path) xpt_action((union ccb *)&ccb_h); } -u_int32_t -cam_release_devq(struct cam_path *path, u_int32_t relsim_flags, - u_int32_t openings, u_int32_t arg, +uint32_t +cam_release_devq(struct cam_path *path, uint32_t relsim_flags, + uint32_t openings, uint32_t arg, int getcount_only) { struct ccb_relsim crs; @@ -1387,7 +1387,7 @@ camperiphdone(struct cam_periph *periph, union ccb *done_ccb) cam_status status; struct scsi_start_stop_unit *scsi_cmd; int error = 0, error_code, sense_key, asc, ascq; - u_int16_t done_flags; + uint16_t done_flags; scsi_cmd = (struct scsi_start_stop_unit *) &done_ccb->csio.cdb_io.cdb_bytes; @@ -1485,7 +1485,7 @@ out: * and leave the rest to this function. */ void -cam_periph_async(struct cam_periph *periph, u_int32_t code, +cam_periph_async(struct cam_periph *periph, uint32_t code, struct cam_path *path, void *arg) { switch (code) { @@ -1540,9 +1540,9 @@ cam_periph_freeze_after_event(struct cam_periph *periph, static int camperiphscsistatuserror(union ccb *ccb, union ccb **orig_ccb, - cam_flags camflags, u_int32_t sense_flags, - int *openings, u_int32_t *relsim_flags, - u_int32_t *timeout, u_int32_t *action, const char **action_string) + cam_flags camflags, uint32_t sense_flags, + int *openings, uint32_t *relsim_flags, + uint32_t *timeout, uint32_t *action, const char **action_string) { struct cam_periph *periph; int error; @@ -1655,14 +1655,14 @@ camperiphscsistatuserror(union ccb *ccb, union ccb **orig_ccb, static int camperiphscsisenseerror(union ccb *ccb, union ccb **orig, - cam_flags camflags, u_int32_t sense_flags, - int *openings, u_int32_t *relsim_flags, - u_int32_t *timeout, u_int32_t *action, const char **action_string) + cam_flags camflags, uint32_t sense_flags, + int *openings, uint32_t *relsim_flags, + uint32_t *timeout, uint32_t *action, const char **action_string) { struct cam_periph *periph; union ccb *orig_ccb = ccb; int error, recoveryccb; - u_int16_t flags; + uint16_t flags; #if defined(BUF_TRACKING) || defined(FULL_BUF_TRACKING) if (ccb->ccb_h.func_code == XPT_SCSI_IO && ccb->csio.bio != NULL) @@ -1879,7 +1879,7 @@ sense_error_done: */ int cam_periph_error(union ccb *ccb, cam_flags camflags, - u_int32_t sense_flags) + uint32_t sense_flags) { struct cam_path *newpath; union ccb *orig_ccb, *scan_ccb; @@ -1887,7 +1887,7 @@ cam_periph_error(union ccb *ccb, cam_flags camflags, const char *action_string; cam_status status; int frozen, error, openings, devctl_err; - u_int32_t action, relsim_flags, timeout; + uint32_t action, relsim_flags, timeout; action = SSQ_PRINT_SENSE; periph = xpt_path_periph(ccb->ccb_h.path); diff --git a/sys/cam/cam_periph.h b/sys/cam/cam_periph.h index 27800114e21..6a1def5f3c4 100644 --- a/sys/cam/cam_periph.h +++ b/sys/cam/cam_periph.h @@ -124,9 +124,9 @@ struct cam_periph { struct cam_path *path; /* Compiled path to device */ void *softc; struct cam_sim *sim; - u_int32_t unit_number; + uint32_t unit_number; cam_periph_type type; - u_int32_t flags; + uint32_t flags; #define CAM_PERIPH_RUNNING 0x01 #define CAM_PERIPH_LOCKED 0x02 #define CAM_PERIPH_LOCK_WANTED 0x04 @@ -142,7 +142,7 @@ struct cam_periph { uint32_t immediate_priority; int periph_allocating; int periph_allocated; - u_int32_t refcount; + uint32_t refcount; SLIST_HEAD(, ccb_hdr) ccb_list; /* For "immediate" requests */ SLIST_ENTRY(cam_periph) periph_links; TAILQ_ENTRY(cam_periph) unit_links; @@ -185,23 +185,23 @@ int cam_periph_mapmem(union ccb *ccb, void cam_periph_unmapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo); union ccb *cam_periph_getccb(struct cam_periph *periph, - u_int32_t priority); + uint32_t priority); int cam_periph_runccb(union ccb *ccb, int (*error_routine)(union ccb *ccb, cam_flags camflags, - u_int32_t sense_flags), - cam_flags camflags, u_int32_t sense_flags, + uint32_t sense_flags), + cam_flags camflags, uint32_t sense_flags, struct devstat *ds); int cam_periph_ioctl(struct cam_periph *periph, u_long cmd, caddr_t addr, int (*error_routine)(union ccb *ccb, cam_flags camflags, - u_int32_t sense_flags)); + uint32_t sense_flags)); void cam_freeze_devq(struct cam_path *path); -u_int32_t cam_release_devq(struct cam_path *path, u_int32_t relsim_flags, - u_int32_t opening_reduction, u_int32_t arg, +uint32_t cam_release_devq(struct cam_path *path, uint32_t relsim_flags, + uint32_t opening_reduction, uint32_t arg, int getcount_only); -void cam_periph_async(struct cam_periph *periph, u_int32_t code, +void cam_periph_async(struct cam_periph *periph, uint32_t code, struct cam_path *path, void *arg); void cam_periph_bus_settle(struct cam_periph *periph, u_int bus_settle_ms); @@ -209,7 +209,7 @@ void cam_periph_freeze_after_event(struct cam_periph *periph, struct timeval* event_time, u_int duration_ms); int cam_periph_error(union ccb *ccb, cam_flags camflags, - u_int32_t sense_flags); + uint32_t sense_flags); int cam_periph_invalidate_sysctl(SYSCTL_HANDLER_ARGS); static __inline struct mtx * diff --git a/sys/cam/cam_queue.c b/sys/cam/cam_queue.c index fbf2df77377..66f8e01bbf8 100644 --- a/sys/cam/cam_queue.c +++ b/sys/cam/cam_queue.c @@ -84,7 +84,7 @@ camq_fini(struct camq *queue) } } -u_int32_t +uint32_t camq_resize(struct camq *queue, int new_size) { cam_pinfo **new_array; @@ -166,7 +166,7 @@ camq_remove(struct camq *queue, int index) * element index and restore the Heap(0, num_elements) property. */ void -camq_change_priority(struct camq *queue, int index, u_int32_t new_priority) +camq_change_priority(struct camq *queue, int index, uint32_t new_priority) { if (new_priority > queue->queue_array[index]->priority) { queue->queue_array[index]->priority = new_priority; @@ -217,10 +217,10 @@ cam_devq_free(struct cam_devq *devq) free(devq, M_CAMDEVQ); } -u_int32_t +uint32_t cam_devq_resize(struct cam_devq *camq, int devices) { - u_int32_t retval; + uint32_t retval; retval = camq_resize(&camq->send_queue, devices); return (retval); @@ -253,7 +253,7 @@ cam_ccbq_free(struct cam_ccbq *ccbq) } } -u_int32_t +uint32_t cam_ccbq_resize(struct cam_ccbq *ccbq, int new_size) { int delta; diff --git a/sys/cam/cam_queue.h b/sys/cam/cam_queue.h index d109183350e..f59eaea7555 100644 --- a/sys/cam/cam_queue.h +++ b/sys/cam/cam_queue.h @@ -51,8 +51,8 @@ struct camq { cam_pinfo **queue_array; int array_size; int entries; - u_int32_t generation; - u_int32_t qfrozen_cnt; + uint32_t generation; + uint32_t qfrozen_cnt; }; TAILQ_HEAD(ccb_hdr_tailq, ccb_hdr); @@ -85,14 +85,14 @@ int cam_devq_init(struct cam_devq *devq, int devices, void cam_devq_free(struct cam_devq *devq); -u_int32_t cam_devq_resize(struct cam_devq *camq, int openings); +uint32_t cam_devq_resize(struct cam_devq *camq, int openings); /* * Allocate a cam_ccb_queue structure and initialize it. */ struct cam_ccbq *cam_ccbq_alloc(int openings); -u_int32_t cam_ccbq_resize(struct cam_ccbq *ccbq, int devices); +uint32_t cam_ccbq_resize(struct cam_ccbq *ccbq, int devices); int cam_ccbq_init(struct cam_ccbq *ccbq, int openings); @@ -103,7 +103,7 @@ void cam_ccbq_fini(struct cam_ccbq *ccbq); /* * Resize a cam queue */ -u_int32_t camq_resize(struct camq *queue, int new_size); +uint32_t camq_resize(struct camq *queue, int new_size); /* * Initialize a camq structure. Return 0 on success, 1 on failure. @@ -140,7 +140,7 @@ cam_pinfo *camq_remove(struct camq *queue, int index); * maintaining queue order. */ void camq_change_priority(struct camq *queue, int index, - u_int32_t new_priority); + uint32_t new_priority); static __inline int cam_ccbq_pending_ccb_count(struct cam_ccbq *ccbq) diff --git a/sys/cam/cam_sim.c b/sys/cam/cam_sim.c index a46bb611e01..e993a998fb2 100644 --- a/sys/cam/cam_sim.c +++ b/sys/cam/cam_sim.c @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define CAM_PATH_ANY (u_int32_t)-1 +#define CAM_PATH_ANY (uint32_t)-1 static MALLOC_DEFINE(M_CAMSIM, "CAM SIM", "CAM SIM buffers"); @@ -52,7 +52,7 @@ static struct mtx cam_sim_free_mtx; MTX_SYSINIT(cam_sim_free_init, &cam_sim_free_mtx, "CAM SIM free lock", MTX_DEF); struct cam_devq * -cam_simq_alloc(u_int32_t max_sim_transactions) +cam_simq_alloc(uint32_t max_sim_transactions) { return (cam_devq_alloc(/*size*/0, max_sim_transactions)); } @@ -101,7 +101,7 @@ cam_simq_free(struct cam_devq *devq) */ struct cam_sim * cam_sim_alloc(sim_action_func sim_action, sim_poll_func sim_poll, - const char *sim_name, void *softc, u_int32_t unit, + const char *sim_name, void *softc, uint32_t unit, struct mtx *mtx, int max_dev_transactions, int max_tagged_dev_transactions, struct cam_devq *queue) { @@ -209,7 +209,7 @@ cam_sim_hold(struct cam_sim *sim) } void -cam_sim_set_path(struct cam_sim *sim, u_int32_t path_id) +cam_sim_set_path(struct cam_sim *sim, uint32_t path_id) { sim->path_id = path_id; } diff --git a/sys/cam/cam_sim.h b/sys/cam/cam_sim.h index c1fed2eb2db..babe07bc2f2 100644 --- a/sys/cam/cam_sim.h +++ b/sys/cam/cam_sim.h @@ -50,14 +50,14 @@ struct cam_devq; typedef void (*sim_action_func)(struct cam_sim *sim, union ccb *ccb); typedef void (*sim_poll_func)(struct cam_sim *sim); -struct cam_devq * cam_simq_alloc(u_int32_t max_sim_transactions); +struct cam_devq * cam_simq_alloc(uint32_t max_sim_transactions); void cam_simq_free(struct cam_devq *devq); struct cam_sim * cam_sim_alloc(sim_action_func sim_action, sim_poll_func sim_poll, const char *sim_name, void *softc, - u_int32_t unit, + uint32_t unit, struct mtx *mtx, int max_dev_transactions, int max_tagged_dev_transactions, @@ -76,7 +76,7 @@ void cam_sim_hold(struct cam_sim *sim); void cam_sim_release(struct cam_sim *sim); /* Optional sim attributes may be set with these. */ -void cam_sim_set_path(struct cam_sim *sim, u_int32_t path_id); +void cam_sim_set_path(struct cam_sim *sim, uint32_t path_id); /* Generically useful offsets into the sim private area */ #define spriv_ptr0 sim_priv.entries[0].ptr @@ -95,17 +95,17 @@ struct cam_sim { void *softc; struct mtx *mtx; TAILQ_ENTRY(cam_sim) links; - u_int32_t path_id;/* The Boot device may set this to 0? */ - u_int32_t unit_number; - u_int32_t bus_id; + uint32_t path_id;/* The Boot device may set this to 0? */ + uint32_t unit_number; + uint32_t bus_id; int max_tagged_dev_openings; int max_dev_openings; - u_int32_t flags; + uint32_t flags; struct cam_devq *devq; /* Device Queue to use for this SIM */ int refcount; /* References to the SIM. */ }; -static __inline u_int32_t +static __inline uint32_t cam_sim_path(const struct cam_sim *sim) { return (sim->path_id); @@ -123,13 +123,13 @@ cam_sim_softc(const struct cam_sim *sim) return (sim->softc); } -static __inline u_int32_t +static __inline uint32_t cam_sim_unit(const struct cam_sim *sim) { return (sim->unit_number); } -static __inline u_int32_t +static __inline uint32_t cam_sim_bus(const struct cam_sim *sim) { return (sim->bus_id); diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 9eb42a8f914..b85da5f30a3 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -214,10 +214,10 @@ static struct cdevsw xpt_cdevsw = { /* Storage for debugging datastructures */ struct cam_path *cam_dpath; -u_int32_t __read_mostly cam_dflags = CAM_DEBUG_FLAGS; +uint32_t __read_mostly cam_dflags = CAM_DEBUG_FLAGS; SYSCTL_UINT(_kern_cam, OID_AUTO, dflags, CTLFLAG_RWTUN, &cam_dflags, 0, "Enabled debug flags"); -u_int32_t cam_debug_delay = CAM_DEBUG_DELAY; +uint32_t cam_debug_delay = CAM_DEBUG_DELAY; SYSCTL_UINT(_kern_cam, OID_AUTO, debug_delay, CTLFLAG_RWTUN, &cam_debug_delay, 0, "Delay in us after each debug message"); @@ -236,7 +236,7 @@ DECLARE_MODULE(cam, cam_moduledata, SI_SUB_CONFIGURE, SI_ORDER_SECOND); MODULE_VERSION(cam, 1); static void xpt_async_bcast(struct async_list *async_head, - u_int32_t async_code, + uint32_t async_code, struct cam_path *path, void *async_arg); static path_id_t xptnextfreepathid(void); @@ -265,7 +265,7 @@ static struct cam_ed* static void xpt_config(void *arg); static void xpt_hold_boot_locked(void); static int xpt_schedule_dev(struct camq *queue, cam_pinfo *dev_pinfo, - u_int32_t new_priority); + uint32_t new_priority); static xpt_devicefunc_t xptpassannouncefunc; static void xptaction(struct cam_sim *sim, union ccb *work_ccb); static void xptpoll(struct cam_sim *sim); @@ -311,7 +311,7 @@ static xpt_targetfunc_t xptdeftargetfunc; static xpt_devicefunc_t xptdefdevicefunc; static xpt_periphfunc_t xptdefperiphfunc; static void xpt_finishconfig_task(void *context, int pending); -static void xpt_dev_async_default(u_int32_t async_code, +static void xpt_dev_async_default(uint32_t async_code, struct cam_eb *bus, struct cam_et *target, struct cam_ed *device, @@ -2953,7 +2953,7 @@ call_sim: struct ccb_setasync *csa; struct async_node *cur_entry; struct async_list *async_head; - u_int32_t added; + uint32_t added; csa = &start_ccb->csa; added = csa->event_enable; @@ -3179,7 +3179,7 @@ xpt_sim_poll(struct cam_sim *sim) uint32_t xpt_poll_setup(union ccb *start_ccb) { - u_int32_t timeout; + uint32_t timeout; struct cam_sim *sim; struct cam_devq *devq; struct cam_ed *dev; @@ -3240,7 +3240,7 @@ xpt_pollwait(union ccb *start_ccb, uint32_t timeout) * target device has space for more transactions. */ void -xpt_schedule(struct cam_periph *periph, u_int32_t new_priority) +xpt_schedule(struct cam_periph *periph, uint32_t new_priority) { CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("xpt_schedule\n")); @@ -3261,10 +3261,10 @@ xpt_schedule(struct cam_periph *periph, u_int32_t new_priority) */ static int xpt_schedule_dev(struct camq *queue, cam_pinfo *pinfo, - u_int32_t new_priority) + uint32_t new_priority) { int retval; - u_int32_t old_priority; + uint32_t old_priority; CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_schedule_dev\n")); @@ -3494,7 +3494,7 @@ xpt_merge_ccb(union ccb *dst_ccb, union ccb *src_ccb) void xpt_setup_ccb_flags(struct ccb_hdr *ccb_h, struct cam_path *path, - u_int32_t priority, u_int32_t flags) + uint32_t priority, uint32_t flags) { CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_setup_ccb\n")); @@ -3517,7 +3517,7 @@ xpt_setup_ccb_flags(struct ccb_hdr *ccb_h, struct cam_path *path, } void -xpt_setup_ccb(struct ccb_hdr *ccb_h, struct cam_path *path, u_int32_t priority) +xpt_setup_ccb(struct ccb_hdr *ccb_h, struct cam_path *path, uint32_t priority) { xpt_setup_ccb_flags(ccb_h, path, priority, /*flags*/ 0); } @@ -4165,7 +4165,7 @@ xptpathid(const char *sim_name, int sim_unit, int sim_bus) } static const char * -xpt_async_string(u_int32_t async_code) +xpt_async_string(uint32_t async_code) { switch (async_code) { @@ -4188,7 +4188,7 @@ xpt_async_string(u_int32_t async_code) } static int -xpt_async_size(u_int32_t async_code) +xpt_async_size(uint32_t async_code) { switch (async_code) { @@ -4216,7 +4216,7 @@ xpt_async_process_dev(struct cam_ed *device, void *arg) union ccb *ccb = arg; struct cam_path *path = ccb->ccb_h.path; void *async_arg = ccb->casync.async_arg_ptr; - u_int32_t async_code = ccb->casync.async_code; + uint32_t async_code = ccb->casync.async_code; bool relock; if (path->device != device @@ -4285,7 +4285,7 @@ xpt_async_process(struct cam_periph *periph, union ccb *ccb) struct cam_eb *bus; struct cam_path *path; void *async_arg; - u_int32_t async_code; + uint32_t async_code; path = ccb->ccb_h.path; async_code = ccb->casync.async_code; @@ -4323,7 +4323,7 @@ xpt_async_process(struct cam_periph *periph, union ccb *ccb) static void xpt_async_bcast(struct async_list *async_head, - u_int32_t async_code, + uint32_t async_code, struct cam_path *path, void *async_arg) { struct async_node *cur_entry; @@ -4354,7 +4354,7 @@ xpt_async_bcast(struct async_list *async_head, } void -xpt_async(u_int32_t async_code, struct cam_path *path, void *async_arg) +xpt_async(uint32_t async_code, struct cam_path *path, void *async_arg) { union ccb *ccb; int size; @@ -4408,7 +4408,7 @@ xpt_async(u_int32_t async_code, struct cam_path *path, void *async_arg) } static void -xpt_dev_async_default(u_int32_t async_code, struct cam_eb *bus, +xpt_dev_async_default(uint32_t async_code, struct cam_eb *bus, struct cam_et *target, struct cam_ed *device, void *async_arg) { @@ -4441,7 +4441,7 @@ xpt_freeze_devq_device(struct cam_ed *dev, u_int count) return (freeze); } -u_int32_t +uint32_t xpt_freeze_devq(struct cam_path *path, u_int count) { struct cam_ed *dev = path->device; @@ -4456,7 +4456,7 @@ xpt_freeze_devq(struct cam_path *path, u_int count) return (freeze); } -u_int32_t +uint32_t xpt_freeze_simq(struct cam_sim *sim, u_int count) { struct cam_devq *devq; @@ -4699,7 +4699,7 @@ xpt_get_ccb(struct cam_periph *periph) } union ccb * -cam_periph_getccb(struct cam_periph *periph, u_int32_t priority) +cam_periph_getccb(struct cam_periph *periph, uint32_t priority) { struct ccb_hdr *ccb_h; @@ -4961,7 +4961,7 @@ xpt_release_device(struct cam_ed *device) taskqueue_enqueue(xsoftc.xpt_taskq, &device->device_destroy_task); } -u_int32_t +uint32_t xpt_dev_ccbq_resize(struct cam_path *path, int newopenings) { int result; diff --git a/sys/cam/cam_xpt.h b/sys/cam/cam_xpt.h index 17214845934..e6304498afe 100644 --- a/sys/cam/cam_xpt.h +++ b/sys/cam/cam_xpt.h @@ -63,9 +63,9 @@ struct cam_path; */ struct async_node { SLIST_ENTRY(async_node) links; - u_int32_t event_enable; /* Async Event enables */ - u_int32_t event_lock; /* Take SIM lock for handlers. */ - void (*callback)(void *arg, u_int32_t code, + uint32_t event_enable; /* Async Event enables */ + uint32_t event_lock; /* Take SIM lock for handlers. */ + void (*callback)(void *arg, uint32_t code, struct cam_path *path, void *args); void *callback_arg; }; @@ -80,11 +80,11 @@ union ccb *xpt_alloc_ccb_nowait(void); void xpt_free_ccb(union ccb *free_ccb); void xpt_setup_ccb_flags(struct ccb_hdr *ccb_h, struct cam_path *path, - u_int32_t priority, - u_int32_t flags); + uint32_t priority, + uint32_t flags); void xpt_setup_ccb(struct ccb_hdr *ccb_h, struct cam_path *path, - u_int32_t priority); + uint32_t priority); void xpt_merge_ccb(union ccb *dst_ccb, union ccb *src_ccb); cam_status xpt_create_path(struct cam_path **new_path_ptr, @@ -117,7 +117,7 @@ device_t xpt_path_sim_device(const struct cam_path *path); void xpt_print_path(struct cam_path *path); void xpt_print_device(struct cam_ed *device); void xpt_print(struct cam_path *path, const char *fmt, ...); -void xpt_async(u_int32_t async_code, struct cam_path *path, +void xpt_async(uint32_t async_code, struct cam_path *path, void *async_arg); void xpt_rescan(union ccb *ccb); void xpt_hold_boot(void); diff --git a/sys/cam/cam_xpt_internal.h b/sys/cam/cam_xpt_internal.h index 4c8dc4cf5b4..f30ef2aa81b 100644 --- a/sys/cam/cam_xpt_internal.h +++ b/sys/cam/cam_xpt_internal.h @@ -43,7 +43,7 @@ typedef struct cam_ed * (*xpt_alloc_device_func)(struct cam_eb *bus, lun_id_t lun_id); typedef void (*xpt_release_device_func)(struct cam_ed *device); typedef void (*xpt_action_func)(union ccb *start_ccb); -typedef void (*xpt_dev_async_func)(u_int32_t async_code, +typedef void (*xpt_dev_async_func)(uint32_t async_code, struct cam_eb *bus, struct cam_et *target, struct cam_ed *device, @@ -127,16 +127,16 @@ struct cam_ed { uint8_t *rcap_buf; struct ata_params ident_data; struct mmc_params mmc_ident_data; - u_int8_t inq_flags; /* + uint8_t inq_flags; /* * Current settings for inquiry flags. * This allows us to override settings * like disconnection and tagged * queuing for a device. */ - u_int8_t queue_flags; /* Queue flags from the control page */ - u_int8_t serial_num_len; - u_int8_t *serial_num; - u_int32_t flags; + uint8_t queue_flags; /* Queue flags from the control page */ + uint8_t serial_num_len; + uint8_t *serial_num; + uint32_t flags; #define CAM_DEV_UNCONFIGURED 0x01 #define CAM_DEV_REL_TIMEOUT_PENDING 0x02 #define CAM_DEV_REL_ON_COMPLETE 0x04 @@ -146,10 +146,10 @@ struct cam_ed { #define CAM_DEV_IN_DV 0x80 #define CAM_DEV_DV_HIT_BOTTOM 0x100 #define CAM_DEV_IDENTIFY_DATA_VALID 0x200 - u_int32_t tag_delay_count; + uint32_t tag_delay_count; #define CAM_TAG_DELAY_COUNT 5 - u_int32_t tag_saved_openings; - u_int32_t refcount; + uint32_t tag_saved_openings; + uint32_t refcount; struct callout callout; STAILQ_ENTRY(cam_ed) highpowerq_entry; struct mtx device_mtx; @@ -169,7 +169,7 @@ struct cam_et { TAILQ_ENTRY(cam_et) links; struct cam_eb *bus; target_id_t target_id; - u_int32_t refcount; + uint32_t refcount; u_int generation; struct timeval last_reset; u_int rpl_size; @@ -188,9 +188,9 @@ struct cam_eb { path_id_t path_id; struct cam_sim *sim; struct timeval last_reset; - u_int32_t flags; + uint32_t flags; #define CAM_EB_RUNQ_SCHEDULED 0x01 - u_int32_t refcount; + uint32_t refcount; u_int generation; device_t parent_dev; struct xpt_xport *xport; @@ -209,7 +209,7 @@ struct cam_ed * xpt_alloc_device(struct cam_eb *bus, lun_id_t lun_id); void xpt_acquire_device(struct cam_ed *device); void xpt_release_device(struct cam_ed *device); -u_int32_t xpt_dev_ccbq_resize(struct cam_path *path, int newopenings); +uint32_t xpt_dev_ccbq_resize(struct cam_path *path, int newopenings); void xpt_start_tags(struct cam_path *path); void xpt_stop_tags(struct cam_path *path); diff --git a/sys/cam/cam_xpt_periph.h b/sys/cam/cam_xpt_periph.h index 79efa0fc5fa..19ae0687de0 100644 --- a/sys/cam/cam_xpt_periph.h +++ b/sys/cam/cam_xpt_periph.h @@ -41,7 +41,7 @@ /* Functions accessed by the peripheral drivers */ #ifdef _KERNEL void xpt_release_ccb(union ccb *released_ccb); -void xpt_schedule(struct cam_periph *perph, u_int32_t new_priority); +void xpt_schedule(struct cam_periph *perph, uint32_t new_priority); int32_t xpt_add_periph(struct cam_periph *periph); void xpt_remove_periph(struct cam_periph *periph); void xpt_announce_periph(struct cam_periph *periph, diff --git a/sys/cam/cam_xpt_sim.h b/sys/cam/cam_xpt_sim.h index 1c9840c40dd..0a4c265fec7 100644 --- a/sys/cam/cam_xpt_sim.h +++ b/sys/cam/cam_xpt_sim.h @@ -42,9 +42,9 @@ int xpt_bus_register(struct cam_sim *sim, device_t parent, uint32_t bus); int xpt_bus_deregister(path_id_t path_id); -u_int32_t xpt_freeze_simq(struct cam_sim *sim, u_int count); +uint32_t xpt_freeze_simq(struct cam_sim *sim, u_int count); void xpt_release_simq(struct cam_sim *sim, int run_queue); -u_int32_t xpt_freeze_devq(struct cam_path *path, u_int count); +uint32_t xpt_freeze_devq(struct cam_path *path, u_int count); void xpt_release_devq(struct cam_path *path, u_int count, int run_queue); void xpt_done(union ccb *done_ccb);