From: Artem Bityutskiy <dedekind1@gmail.com>
To: linux-mtd@lists.infradead.org
Cc: Mika Westerberg <ext-mika.1.westerberg@nokia.com>,
Jon Ringle <jon@ringle.org>
Subject: [PATCH 2/4] UBI: sync ubi-user.h with the lates kernel verion
Date: Thu, 8 Apr 2010 12:04:10 +0300 [thread overview]
Message-ID: <1270717452-8993-2-git-send-email-dedekind1@gmail.com> (raw)
In-Reply-To: <1270717452-8993-1-git-send-email-dedekind1@gmail.com>
From: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
include/mtd/ubi-user.h | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h
index 296efae..4b139a6 100644
--- a/include/mtd/ubi-user.h
+++ b/include/mtd/ubi-user.h
@@ -25,11 +25,12 @@
* UBI device creation (the same as MTD device attachment)
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
- * MTD devices may be attached using %UBI_IOCATT ioctl command of the UBI
- * control device. The caller has to properly fill and pass
- * &struct ubi_attach_req object - UBI will attach the MTD device specified in
- * the request and return the newly created UBI device number as the ioctl
- * return value.
+ * MTD and block devices may be attached using %UBI_IOCATT ioctl command of the
+ * UBI control device. The caller has to properly fill and pass
+ * &struct ubi_attach_req object. If the @bdev_major and @bdev_minor fields
+ * contain zeroes, UBI will attaches MTD device number @mtd_num. Otherwise it
+ * attaches block device with major/minor numbers @bdev_major and @bdev_minor.
+ * The ioctl returns the newly created UBI device number.
*
* UBI device deletion (the same as MTD device detachment)
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -235,14 +236,25 @@ enum {
* @ubi_num: UBI device number to create
* @mtd_num: MTD device number to attach
* @vid_hdr_offset: VID header offset (use defaults if %0)
+ * @bdev_major: major number of the block device to attach
+ * @bdev_minor: minor number of the block device to attach
* @padding: reserved for future, not used, has to be zeroed
*
- * This data structure is used to specify MTD device UBI has to attach and the
+ * This data structure is used to specify the device UBI has to attach and the
* parameters it has to use. The number which should be assigned to the new UBI
* device is passed in @ubi_num. UBI may automatically assign the number if
* @UBI_DEV_NUM_AUTO is passed. In this case, the device number is returned in
* @ubi_num.
*
+ * UBI can attach block and MTD devices. To attach a block device, @bdev_major
+ * and @bdev_minor have to contain block device major an minor numbers. And
+ * @mtd_num and @vid_hdr_offset have to contain zeroes. Note, the major number
+ * cannot be zero. To attach an MTD device, @bdev_major and @bdev_minor have to
+ * contain zeroes, while @mtd_num has to contain the MTD device number to
+ * attach.
+ *
+ * The rest of the documentation is specific to the MTD device case.
+ *
* Most applications should pass %0 in @vid_hdr_offset to make UBI use default
* offset of the VID header within physical eraseblocks. The default offset is
* the next min. I/O unit after the EC header. For example, it will be offset
@@ -263,7 +275,9 @@ struct ubi_attach_req {
int32_t ubi_num;
int32_t mtd_num;
int32_t vid_hdr_offset;
- int8_t padding[12];
+ int32_t bdev_major;
+ int32_t bdev_minor;
+ int8_t padding[4];
};
/**
--
1.6.6.1
next prev parent reply other threads:[~2010-04-08 9:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-08 9:04 [PATCH 1/4] ubinfo: document the new -N option Artem Bityutskiy
2010-04-08 9:04 ` Artem Bityutskiy [this message]
2010-04-08 16:05 ` [PATCH 2/4] UBI: sync ubi-user.h with the lates kernel verion Corentin Chary
2010-04-08 16:36 ` Artem Bityutskiy
2010-04-08 9:04 ` [PATCH 3/4] libubi: add support to attach/detach by MTD device path Artem Bityutskiy
2010-04-08 9:04 ` [PATCH 4/4] ubiattach/ubidetach: add support to attach/detach by path Artem Bityutskiy
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=1270717452-8993-2-git-send-email-dedekind1@gmail.com \
--to=dedekind1@gmail.com \
--cc=ext-mika.1.westerberg@nokia.com \
--cc=jon@ringle.org \
--cc=linux-mtd@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.