Execute a vendor-unique command
#include <hw/dcmd_sim_mmcsd.h> #define DCMD_MMCSD_VUC_CMD __DIOTF(_DCMD_CAM, _SIM_MMCSD + 6, struct _mmcsd_vuc_cmd)
| Argument | Value |
|---|---|
| filedes | A file descriptor that you obtained by opening the device |
| dcmd | DCMD_MMCSD_VUC_CMD |
| dev_data_ptr | An array of MMCSD_VUC_CMD structures |
| n_bytes | The size of the array |
| dev_info_ptr | NULL |
This command executes a vendor-unique command. The MMCSD_VUC_CMD structure is defined as follows:
typedef struct _mmcsd_vuc_cmd {
int result;
uint16_t opcode;
uint16_t rsvd2;
uint32_t flags;
uint32_t arg;
uint32_t resp[4];
uint32_t blk_sz;
paddr_t data_ptr;
uint32_t buf_off;
uint32_t data_len;
uint32_t timeout;
uint32_t postdelay_us;
uint32_t rsvd[2];
} MMCSD_VUC_CMD;
The members include:
MMCSD_VUC_DATA_MSK is a mask for the bits that indicate whether or not data is present and its direction. MMCSD_VUC_RESP_MSK is a mask for the response type.
/* * for performance, * we assume that the RESP bits are the same as internal driver defines. * If any of the internal defines change (which I doubt), we will need to * add parsing code to do the translation. #define MMC_RSP_PRESENT (1 << 0) #define MMC_RSP_136 (1 << 1) // 136 bit response #define MMC_RSP_CRC (1 << 2) // expect valid crc #define MMC_RSP_BUSY (1 << 3) // card may send busy #define MMC_RSP_OPCODE (1 << 4) // response contains opcode */
devctl() in the QNX Neutrino C Library Reference