diff options
author | scottl <scottl@FreeBSD.org> | 2013-09-24 16:50:53 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2013-09-24 16:50:53 +0000 |
commit | 108b7070e7a17abc52f44f333ba095f8f0eafc3a (patch) | |
tree | ccab290b4cfbac27db6123e5df329c2ca4e9a641 /sys/cam/cam_compat.h | |
parent | 6633bf70ed24c304037f64ca2f28e6ea8d2a0b47 (diff) | |
download | FreeBSD-src-108b7070e7a17abc52f44f333ba095f8f0eafc3a.zip FreeBSD-src-108b7070e7a17abc52f44f333ba095f8f0eafc3a.tar.gz |
Update the CAM API for FreeBSD 10:
- Remove the timeout_ch field. It's been deprecated since FreeBSD 7.0;
MPSAFE drivers should be managing their own timeout storage. The
remaining non-MPSAFE drivers have been modified to also manage their own
storage, and should be considered for updating to MPSAFE (or removal)
during the FreeBSD 10.x lifecycle.
- Add fields related to soft timeouts and quality of service, to be used
in upcoming work.
- Add room for more flags in the CCB header and path_inq structures.
- Begin support for extended 64-bit LUNs.
- Bump the CAM version number to 0x18, but add compat shims. Tested with
camcontrol and smartctl.
Reviewed by: nathanw, ken, kib
Approved by: re
Obtained from: Netflix
Diffstat (limited to 'sys/cam/cam_compat.h')
-rw-r--r-- | sys/cam/cam_compat.h | 68 |
1 files changed, 67 insertions, 1 deletions
diff --git a/sys/cam/cam_compat.h b/sys/cam/cam_compat.h index 53ead7a..b873ec3 100644 --- a/sys/cam/cam_compat.h +++ b/sys/cam/cam_compat.h @@ -31,7 +31,7 @@ #ifndef _CAM_CAM_COMPAT_H #define _CAM_CAM_COMPAT_H -int cam_compat_ioctl(struct cdev *dev, u_long *cmd, caddr_t *addr, int *flag, struct thread *td); +int cam_compat_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td, d_ioctl_t *cbfnp); /* Version 0x16 compatibility */ #define CAM_VERSION_0x16 0x16 @@ -44,5 +44,71 @@ int cam_compat_ioctl(struct cdev *dev, u_long *cmd, caddr_t *addr, int *flag, st #define CAM_SG_LIST_PHYS_0x16 0x00040000 #define CAM_DATA_PHYS_0x16 0x00200000 +/* Version 0x17 compatibility */ +#define CAM_VERSION_0x17 0x17 + +struct ccb_hdr_0x17 { + cam_pinfo pinfo; /* Info for priority scheduling */ + 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; + void (*cbfcnp)(struct cam_periph *, union ccb *); + xpt_opcode func_code; /* XPT function code */ + u_int32_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 */ + ccb_ppriv_area periph_priv; + ccb_spriv_area sim_priv; + u_int32_t timeout; /* Hard timeout value in seconds */ + struct callout_handle 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 */ + /* 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 */ + 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 */ + cam_proto protocol; + u_int protocol_version; + cam_xport transport; + u_int transport_version; + union { + struct ccb_pathinq_settings_spi spi; + struct ccb_pathinq_settings_fc fc; + struct ccb_pathinq_settings_sas sas; + 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 */ +}; + +#define CAM_0X17_LEN (sizeof(union ccb) - sizeof(struct ccb_hdr) + sizeof(struct ccb_hdr_0x17)) +#define CAM_0X17_DATA_LEN (sizeof(union ccb) - sizeof(struct ccb_hdr_0x17)) + +#define CAMIOCOMMAND_0x17 _IOC(IOC_INOUT, CAM_VERSION_0x17, 2, CAM_0X17_LEN) +#define CAMGETPASSTHRU_0x17 _IOC(IOC_INOUT, CAM_VERSION_0x17, 3, CAM_0X17_LEN) + #endif |