DCMD_SDMMC_WRITE_PROTECT

Clear or set write protection

Synopsis:

#include <hw/dcmd_sim_sdmmc.h>

#define DCMD_SDMMC_WRITE_PROTECT   __DIOTF(_DCMD_CAM, _SIM_SDMMC + 3, struct _sdmmc_write_protect)

Arguments to devctl():

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

Description:

This command sets or clears write protection. The SDMMC_WRITE_PROTECT structure is defined as follows:

typedef struct _sdmmc_write_protect {
        uint32_t                action;
        uint32_t                mode;
        uint64_t                lba;
        uint64_t                nlba;
        uint64_t                prot;
        uint32_t                rsvd[4];
} SDMMC_WRITE_PROTECT;

The members include:

action
The action to take; one of:
  • SDMMC_WP_ACTION_CLR — remove write protection
  • SDMMC_WP_ACTION_SET — set write protection
  • SDMMC_WP_ACTION_PROT — 32 write protection bits (representing 32 write protect groups)
  • SDMMC_WP_ACTION_PROT_TYPE — 64 write protection bits (representing 32 write protect groups) where:
    • 0x0 WPG not protected
    • 0x1 WPG temporary WP
    • 0x2 WPG power-on WP
    • 0x3 WPG permanent WP
mode
The mode:
  • SDMMC_WP_MODE_PWR_WP_EN — apply power-on period protection
lba
Logical block address
nlba
The number of logical blocks to protect.
prot
Filled in on return with the resulting protection.

Input:

Set the members as appropriate.

Output:

A filled-in structure.

See also:

devctl() in the QNX Neutrino C Library Reference