Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/cam_ccb.h
| Show First 20 Lines • Show All 292 Lines • ▼ Show 20 Lines | typedef enum { | ||||
| XPORT_ATA, /* AT Attachment */ | XPORT_ATA, /* AT Attachment */ | ||||
| XPORT_SAS, /* Serial Attached SCSI */ | XPORT_SAS, /* Serial Attached SCSI */ | ||||
| XPORT_SATA, /* Serial AT Attachment */ | XPORT_SATA, /* Serial AT Attachment */ | ||||
| XPORT_ISCSI, /* iSCSI */ | XPORT_ISCSI, /* iSCSI */ | ||||
| XPORT_SRP, /* SCSI RDMA Protocol */ | XPORT_SRP, /* SCSI RDMA Protocol */ | ||||
| XPORT_NVME, /* NVMe over PCIe */ | XPORT_NVME, /* NVMe over PCIe */ | ||||
| XPORT_MMCSD, /* MMC, SD, SDIO card */ | XPORT_MMCSD, /* MMC, SD, SDIO card */ | ||||
| XPORT_NVMF, /* NVMe over Fabrics */ | XPORT_NVMF, /* NVMe over Fabrics */ | ||||
| XPORT_UFSHCI, /* Universal Flash Storage Host Interface */ | |||||
| } cam_xport; | } cam_xport; | ||||
| #define XPORT_IS_NVME(t) ((t) == XPORT_NVME || (t) == XPORT_NVMF) | #define XPORT_IS_NVME(t) ((t) == XPORT_NVME || (t) == XPORT_NVMF) | ||||
| #define XPORT_IS_ATA(t) ((t) == XPORT_ATA || (t) == XPORT_SATA) | #define XPORT_IS_ATA(t) ((t) == XPORT_ATA || (t) == XPORT_SATA) | ||||
| #define XPORT_IS_SCSI(t) ((t) != XPORT_UNKNOWN && \ | #define XPORT_IS_SCSI(t) ((t) != XPORT_UNKNOWN && \ | ||||
| (t) != XPORT_UNSPECIFIED && \ | (t) != XPORT_UNSPECIFIED && \ | ||||
| !XPORT_IS_ATA(t) && !XPORT_IS_NVME(t)) | !XPORT_IS_ATA(t) && !XPORT_IS_NVME(t)) | ||||
| #define XPORT_DEVSTAT_TYPE(t) (XPORT_IS_ATA(t) ? DEVSTAT_TYPE_IF_IDE : \ | #define XPORT_DEVSTAT_TYPE(t) (XPORT_IS_ATA(t) ? DEVSTAT_TYPE_IF_IDE : \ | ||||
| ▲ Show 20 Lines • Show All 751 Lines • ▼ Show 20 Lines | |||||
| struct ccb_trans_settings_nvmf | struct ccb_trans_settings_nvmf | ||||
| { | { | ||||
| u_int valid; /* Which fields to honor */ | u_int valid; /* Which fields to honor */ | ||||
| #define CTS_NVMF_VALID_TRTYPE 0x01 | #define CTS_NVMF_VALID_TRTYPE 0x01 | ||||
| uint8_t trtype; | uint8_t trtype; | ||||
| }; | }; | ||||
| struct ccb_trans_settings_ufshci | |||||
| { | |||||
| u_int valid; /* Which fields to honor */ | |||||
| #define CTS_UFSHCI_VALID_MODE 0x01 | |||||
imp: So this needs a comment about what this bit covers. And are all the following items guaranteed… | |||||
Done Inline ActionsI modified it as shown below. /* * Ensure the validity of the information for the Unipro link * (GEAR, SPEED, LANE) */ #define CTS_UFSHCI_VALID_LINK 0x01 jaeyoon: I modified it as shown below.
Items that follow CTS_UFSHCI_VALID_LINK are valid as a unit. | |||||
| uint8_t hs_gear; /* High Speed Gear (G1, G2, G3...) */ | |||||
| uint8_t tx_lanes; | |||||
| uint8_t rx_lanes; | |||||
| uint32_t speed; | |||||
Done Inline Actionsthis is a bad layout. It will cause endian problems and 32 vs 64 bit problems. I suggest to move speed to be first after valid. imp: this is a bad layout. It will cause endian problems and 32 vs 64 bit problems. I suggest to… | |||||
| uint8_t max_hs_gear; /* Maximum HS Gear */ | |||||
| uint8_t max_tx_lanes; | |||||
| uint8_t max_rx_lanes; | |||||
| }; | |||||
| #include <cam/mmc/mmc_bus.h> | #include <cam/mmc/mmc_bus.h> | ||||
| struct ccb_trans_settings_mmc { | struct ccb_trans_settings_mmc { | ||||
| struct mmc_ios ios; | struct mmc_ios ios; | ||||
| #define MMC_CLK (1 << 1) | #define MMC_CLK (1 << 1) | ||||
| #define MMC_VDD (1 << 2) | #define MMC_VDD (1 << 2) | ||||
| #define MMC_CS (1 << 3) | #define MMC_CS (1 << 3) | ||||
| #define MMC_BW (1 << 4) | #define MMC_BW (1 << 4) | ||||
| #define MMC_PM (1 << 5) | #define MMC_PM (1 << 5) | ||||
| ▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | union { | ||||
| u_int valid; /* Which fields to honor */ | u_int valid; /* Which fields to honor */ | ||||
| struct ccb_trans_settings_spi spi; | struct ccb_trans_settings_spi spi; | ||||
| struct ccb_trans_settings_fc fc; | struct ccb_trans_settings_fc fc; | ||||
| struct ccb_trans_settings_sas sas; | struct ccb_trans_settings_sas sas; | ||||
| struct ccb_trans_settings_pata ata; | struct ccb_trans_settings_pata ata; | ||||
| struct ccb_trans_settings_sata sata; | struct ccb_trans_settings_sata sata; | ||||
| struct ccb_trans_settings_nvme nvme; | struct ccb_trans_settings_nvme nvme; | ||||
| struct ccb_trans_settings_nvmf nvmf; | struct ccb_trans_settings_nvmf nvmf; | ||||
| struct ccb_trans_settings_ufshci ufshci; | |||||
| } xport_specific; | } xport_specific; | ||||
| }; | }; | ||||
| /* | /* | ||||
| * Calculate the geometry parameters for a device | * Calculate the geometry parameters for a device | ||||
| * give the block size and volume size in blocks. | * give the block size and volume size in blocks. | ||||
| */ | */ | ||||
| struct ccb_calc_geometry { | struct ccb_calc_geometry { | ||||
| ▲ Show 20 Lines • Show All 424 Lines • Show Last 20 Lines | |||||
So this needs a comment about what this bit covers. And are all the following items guaranteed to be valid as a unit (apart from when you are filling them in)?