From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Anderson Briglia <anderson.briglia@indt.org.br>
Cc: linux-kernel@vger.kernel.org,
"Linux-omap-open-source@linux.omap.com"
<linux-omap-open-source@linux.omap.com>,
linux@arm.linux.org.uk, ext David Brownell <david-b@pacbell.net>,
Tony Lindgren <tony@atomide.com>,
drzeus-list@drzeus.cx,
"Aguiar Carlos (EXT-INdT/Manaus)" <carlos.aguiar@indt.org.br>,
"Lizardo Anderson (EXT-INdT/Manaus)"
<anderson.lizardo@indt.org.br>
Subject: Re: [patch 2/5] Add MMC password protection (lock/unlock) support V3
Date: Mon, 9 Jan 2006 22:32:55 +0000 [thread overview]
Message-ID: <20060109223255.GG19131@flint.arm.linux.org.uk> (raw)
In-Reply-To: <43C2E087.1090608@indt.org.br>
On Mon, Jan 09, 2006 at 06:15:35PM -0400, Anderson Briglia wrote:
> + cmd.opcode = MMC_LOCK_UNLOCK;
> + cmd.arg = 0;
> + cmd.flags = MMC_RSP_R1B;
> +
> + memset(&data, 0, sizeof(struct mmc_data));
> +
> + data.timeout_ns = card->csd.tacc_ns * 10;
> + data.timeout_clks = card->csd.tacc_clks * 10;
> + data.blksz_bits = blksz_bits(data_size);
> + data.blocks = 1;
> + data.flags = MMC_DATA_WRITE;
> + data.sg = &sg;
> + data.sg_len = 1;
> +
> + memset(&mrq, 0, sizeof(struct mmc_request));
> +
> + mrq.cmd = &cmd;
> + mrq.data = &data;
> +
> + sg_init_one(&sg, data_buf, data_size);
> + err = mmc_wait_for_req(card->host, &mrq);
> + if (err != MMC_ERR_NONE) {
> + mmc_card_set_dead(card);
> + goto error;
> + }
If the command error is MMC_ERR_INVALID, this means the host doesn't
support this operation, so we shouldn't set the card "dead".
> + memset(&cmd, 0, sizeof(struct mmc_command));
The ugly formatting monster makes an appearance. Tabs please.
> Index: linux-2.6.15-rc4/include/linux/mmc/host.h
> ===================================================================
> --- linux-2.6.15-rc4.orig/include/linux/mmc/host.h 2006-01-08 07:35:39.069715192 -0400
> +++ linux-2.6.15-rc4/include/linux/mmc/host.h 2006-01-08 07:49:40.763758248 -0400
> @@ -83,6 +83,7 @@
> u32 ocr_avail;
>
> unsigned long caps; /* Host capabilities */
> + int pwd_support; /* MMC password support */
>
> #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */
>
And this means we don't need the "pwd_support" thing here. Even
if we did, it should be a host capability, not an "int".
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
prev parent reply other threads:[~2006-01-09 22:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-09 22:15 [patch 2/5] Add MMC password protection (lock/unlock) support V3 Anderson Briglia
2006-01-09 22:32 ` 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=20060109223255.GG19131@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=anderson.briglia@indt.org.br \
--cc=anderson.lizardo@indt.org.br \
--cc=carlos.aguiar@indt.org.br \
--cc=david-b@pacbell.net \
--cc=drzeus-list@drzeus.cx \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap-open-source@linux.omap.com \
--cc=linux@arm.linux.org.uk \
--cc=tony@atomide.com \
/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