DCMD_SDMMC_DEVICE_INFO

Get information about the device

Synopsis:

#include <hw/dcmd_sim_sdmmc.h>

#define DCMD_SDMMC_DEVICE_INFO   __DIOF(_DCMD_CAM, _SIM_SDMMC + 0, struct _sdmmc_device_info)

Arguments to devctl():

Argument Value
filedes A file descriptor that you obtained by opening the device
dcmd DCMD_SDMMC_DEVICE_INFO
dev_data_ptr A pointer to a SDMMC_DEVICE_INFO structure (see below)
n_bytes sizeof(SDMMC_DEVICE_INFO)
dev_info_ptr NULL

Description:

This command gets information about the device.

Input:

None.

Output:

A filled-in SDMMC_DEVICE_INFO structure:

typedef struct _sdmmc_device_info {
        uint32_t                        dtype;
        uint32_t                        flags;
        uint32_t                        mid;
        uint32_t                        oid;
        uint8_t                         pnm[8];
        uint32_t                        prv;
        uint32_t                        psn;
        uint32_t                        month;
        uint32_t                        year;
        uint8_t                         vu[8];
        uint32_t                        rca;
        uint32_t                        spec_vers;
        uint32_t                        spec_rev;
        uint32_t                        security;
        uint64_t                        caps;
        uint32_t                        dtr;
        uint32_t                        timing;
        uint32_t                        bus_width;
        uint32_t                        sectors;
        uint32_t                        sector_size;
        uint32_t                        super_page_size;
        uint32_t                        native_sector_size;
        uint32_t                        wp_size;
        uint32_t                        erase_size;
        uint32_t                        optimal_trim_size;
        uint32_t                        optimal_read_size;
        uint32_t                        optimal_write_size;
        uint32_t                        speed_class;
        uint32_t                        start_sector;
        uint32_t                        rsvd[34];
} SDMMC_DEVICE_INFO;

The members include:

dtype
The device type; either DEV_TYPE_MMC or DEV_TYPE_SD.
flags
The bits include:
  • DEV_FLAG_CARD_LOCKED — the card is locked
  • DEV_FLAG_WP — the card is write-protected
mid
The manufacturer ID:
  • MID_MMC_SANDISK — 0x02
  • MID_MMC_SANDISK_2 — 0x45
  • MID_MMC_TOSHIBA — 0x11
  • MID_MMC_MICRON — 0x13
  • MID_MMC_SAMSUNG — 0x15
  • MID_MMC_HYNIX — 0x90
  • MID_MMC_NUMONYX — 0xFE
oid
The OEM ID.
pnm[8]
The product name.
prv
The product revision number.
psn
The product serial number.
month
The month of manufacture.
year
The year of manufacture.
vu[8]
Vendor-unique information (e.g., the SanDisk firmware revision).
rca
The relative card address.
spec_vers
spec_rev
security
caps
The device's capabilities; a bitwise OR of the following:
  • DEV_CAP_HC — high capacity
  • DEV_CAP_HS — high speed
  • DEV_CAP_HS200 — high speed 200
  • DEV_CAP_DDR50 — DDR
  • DEV_CAP_UHS — UHS
  • DEV_CAP_TRIM — TRIM is supported
  • DEV_CAP_SECURE — Secure Purge is supported
  • DEV_CAP_SANITIZE — Sanitize is supported
  • DEV_CAP_BKOPS — Background operations are supported
  • DEV_CAP_CMD23 — CMD23 is supported
  • DEV_CAP_SLEEP — Sleep/awake supported
  • DEV_CAP_ASSD — ASSD
  • DEV_CAP_HPI_CMD12
  • DEV_CAP_HPI_CMD13
  • DEV_CAP_DISCARD — Discard supported
dtr
The current data transfer rate.
timing
The current timing; one of:
  • TIMING_HS200
  • TIMING_SDR104
  • TIMING_SDR50
  • TIMING_SDR25
  • TIMING_SDR12
  • TIMING_DDR50
  • TIMING_HS
  • TIMING_LS
bus_width
The current bus width.
sectors
sector_size
super_page_size
native_sector_size
wp_size
erase_size
optimal_trim_size
optimal_read_size
optimal_write_size
speed_class
The speed class; one of:
  • SPEED_CLASS_0 — legacy/non-compliant
  • SPEED_CLASS_2 — approximately 2 MB/sec
  • SPEED_CLASS_4 — approximately 4 MB/sec
  • SPEED_CLASS_6 — approximately 6 MB/sec
  • SPEED_CLASS_10 — approximately 10 MB/sec
start_sector
The physical start sector.

See also:

devctl() in the QNX Neutrino C Library Reference