linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Anderson Briglia <briglia.anderson@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [patch 1/5] [RFC] Add MMC password protection (lock/unlock) support
Date: Thu, 15 Dec 2005 13:28:47 +0000	[thread overview]
Message-ID: <20051215132847.GA6211@flint.arm.linux.org.uk> (raw)
In-Reply-To: <e55525570512140530u3601e325ha63b1db10209dbcc@mail.gmail.com>

On Wed, Dec 14, 2005 at 09:30:49AM -0400, Anderson Briglia wrote:
> @@ -69,12 +70,16 @@ struct mmc_card {
>  #define mmc_card_bad(c)		((c)->state & MMC_STATE_BAD)
>  #define mmc_card_sd(c)		((c)->state & MMC_STATE_SDCARD)
>  #define mmc_card_readonly(c)	((c)->state & MMC_STATE_READONLY)
> +#define mmc_card_locked(c)	((c)->state & MMC_STATE_LOCKED)
> +
> +#define mmc_card_lockable(c)	((c)->csd.cmdclass & CCC_LOCK_CARD)

Looking at some of the MMC specs, this is not sufficient to tell whether
the card supports the lock/unlock commands - eg, the Sandisk cards have
a CCC value of 0x1ff but do not appear to support CMD42.

It would appear that there are different definitions for command
classes 6 to 8:

command group:		A				B
6			write write-protection		write protection
7			read write-protection		lock card
8			erase write-protection		app. specific

What the interpretation of whether A or B applies is unclear.
Type A cards have CSD structure 1 and MMC protocol version code 1.
Type B cards have CSD structure 2 and MMC protocol version code 3.

It would appear that the "CSD structure" field describes the version
of the CSD structure itself, and in part determines the validity
of the MMC protocol version field (maybe defining the mapping of
version codes to MMC spec versions).  Sandisk implies that CSD
structure 1 has version codes 0=v1.0-v1.2, 1=v1.4.

CSD structure 2 we have less idea about the interpretation of the
MMC protocol version codes, except that 3 may mean MMC spec v3.1.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

      parent reply	other threads:[~2005-12-15 13:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-14 13:30 [patch 1/5] [RFC] Add MMC password protection (lock/unlock) support Anderson Briglia
2005-12-14 14:29 ` Russell King
2005-12-15 13:28 ` Russell King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051215132847.GA6211@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=briglia.anderson@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).