lkml.org 
[lkml]   [2005]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch 5/5] Add MMC password protection (lock/unlock) support V2
    The MMC_LOCK_UNLOCK command requires the block length to be exactly the
    password length + 2 bytes, but hardware-specific drivers force a "power of 2"
    block size.

    This patch sends the exact block size (password + 2 bytes) to the host. OMAP
    specific.

    Signed-off-by: Anderson Briglia <anderson.briglia@indt.org.br>
    Signed-off-by: Anderson Lizardo <anderson.lizardo@indt.org.br>
    Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br>

    Index: linux-2.6.15-rc4-omap1/drivers/mmc/omap.c
    ===================================================================
    --- linux-2.6.15-rc4-omap1.orig/drivers/mmc/omap.c 2005-12-28 14:30:06.000000000 -0400
    +++ linux-2.6.15-rc4-omap1/drivers/mmc/omap.c 2005-12-28 14:31:42.000000000 -0400
    @@ -889,8 +889,12 @@ mmc_omap_prepare_data(struct mmc_omap_ho
    return;
    }

    -
    - block_size = 1 << data->blksz_bits;
    + /* password protection: we need to send the exact block size to the
    + * card (password + 2), not a power of two */
    + if (req->cmd->opcode == MMC_LOCK_UNLOCK)
    + block_size = data->sg[0].length;
    + else
    + block_size = 1 << data->blksz_bits;

    OMAP_MMC_WRITE(host->base, NBLK, data->blocks - 1);
    OMAP_MMC_WRITE(host->base, BLEN, block_size - 1);
    --
    Anderson Lizardo
    Embedded Linux Lab - 10LE
    Nokia Institute of Technology - INdT
    Manaus - Brazil
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-12-28 19:57    [W:0.036 / U:0.384 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site