<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mtd-utils.git/include/libmtd.h, branch v2.3.1</title>
<subtitle>A mirror of http://git.infradead.org/mtd-utils.git</subtitle>
<id>https://git.infraroot.at/mtd-utils.git/atom?h=v2.3.1</id>
<link rel='self' href='https://git.infraroot.at/mtd-utils.git/atom?h=v2.3.1'/>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/'/>
<updated>2023-05-30T09:12:12+00:00</updated>
<entry>
<title>libmtd: Add function to get MTD info by device name</title>
<updated>2023-05-30T09:12:12+00:00</updated>
<author>
<name>Brandon Maier</name>
<email>brandon.maier@collins.com</email>
</author>
<published>2022-12-12T18:01:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=a527b22f0a30d66d4674624d16f4bb0ffe2e94d0'/>
<id>urn:sha1:a527b22f0a30d66d4674624d16f4bb0ffe2e94d0</id>
<content type='text'>
This is a convenience function for end users. In some situations it's
easier to reference MTD device's by their name then by MTD number, as
the name may be more reliable if device partitioning is dynamic or for
porting between systems.

Signed-off-by: Brandon Maier &lt;brandon.maier@collins.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>mtd-utils: flash_erase: Add flash erase chip</title>
<updated>2021-05-05T06:29:50+00:00</updated>
<author>
<name>Larisa Ileana Grigore</name>
<email>larisa.grigore@nxp.com</email>
</author>
<published>2021-04-23T15:07:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=2ca0bbf296d6f7ce51b8255347c7fd08afa33651'/>
<id>urn:sha1:2ca0bbf296d6f7ce51b8255347c7fd08afa33651</id>
<content type='text'>
Some flash types support full erase chip command which can reduce the
flash erase time. Try first to erase the entire flash and fall back
to the old method if the operation fails.

Signed-off-by: Larisa Ileana Grigore &lt;larisa.grigore@nxp.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>libmtd: Add support to access OOB available size</title>
<updated>2018-04-10T13:38:56+00:00</updated>
<author>
<name>Xiaolei Li</name>
<email>xiaolei.li@mediatek.com</email>
</author>
<published>2018-04-10T07:36:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=a10353584f93334b5687c598a15260c0fc5b8d3e'/>
<id>urn:sha1:a10353584f93334b5687c598a15260c0fc5b8d3e</id>
<content type='text'>
This patch exposes OOB available size to user. Then user can use
OOB free area according to OOB available size.

Steps to get OOB available size:
First, access /sys/class/mtd/mtdX/oobavail. If not exist, then
try to get ecc layout by ioctl "ECCGETLAYOUT". If none of them
work, set OOB available size to 0.

Signed-off-by: Xiaolei Li &lt;xiaolei.li@mediatek.com&gt;
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Fix libmtd behaviour if MTD is not present on the system</title>
<updated>2017-03-15T11:10:34+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2017-03-15T10:26:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=a2eeedb0a7af1d8ebe8593cb9a9bb994d2854e63'/>
<id>urn:sha1:a2eeedb0a7af1d8ebe8593cb9a9bb994d2854e63</id>
<content type='text'>
The documentation of libmtd_open says, if it returns NULL and errno is
zero, MTD is not present. However, the current version always returns
a libmtd_t object. The function internally checks, if it can access the
MTD sysfs files and, if not, sets a flag to use the procfs fallback.

This patch adds an additional check to libmtd_open, to test if the
MTD procfs file can be read and fails with errno cleared if it does
not exist.

Furhtermore, mtd_get_info is documented to fail with errno set to ENODEV
if MTD is not present. First of all, this was broken in the original
version. It was implemented to specification for the sysfs code path,
but if MTD is not present, that won't be executed, because of the flag
set by libmtd_open. This makes the check not only redundant, but masks
an actual error (the sysfs paths suddenly not being readable anymore).
The legacy path that was used if the sysfs files are not avaible fails
with ENOENT if it cannot read the procfs file. With the above changes
in addition, we don't have a libmtd_t object if neither sysfs nor
procfs is readable, so this error status no longer makes sense.

This patch removes the documentation on the ENODEV errno, and
makes sure that mtd_get_info always returns with apropriate errno
on failure.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>mtd-utils: Add multi-block erase function</title>
<updated>2016-11-17T10:36:55+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2016-04-25T22:13:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=5d524111adc549ec80e577dd3d9045a4c589fa7b'/>
<id>urn:sha1:5d524111adc549ec80e577dd3d9045a4c589fa7b</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>Remove unused and broken mtd_write_img function from libmtd</title>
<updated>2016-11-17T10:36:55+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2016-08-25T11:41:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=f45bc6e3c99b62d04d50f210ed8d4f8d02b15357'/>
<id>urn:sha1:f45bc6e3c99b62d04d50f210ed8d4f8d02b15357</id>
<content type='text'>
The function _tries_ to support short reads but doesn't adjust the
pointer into the buffer. If a short read happens, we scrambles the
flash contents. Interrupted reads aren't handled. Short or
interrupted writes aren't handled at all. Either a write succeeds
writing the entire buffer or the function gives up.

During an attempt at fixing it, it was discovered, that no mtd-utils
program uses this function. Furthermore, its highly specific nature
makes it more of a "feature looking for use case".

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
Signed-off-by: Richard Weinberger &lt;richard@nod.at&gt;
</content>
</entry>
<entry>
<title>libmtd: add `mtd_dev_present()' library function</title>
<updated>2012-02-02T11:23:39+00:00</updated>
<author>
<name>Brian Norris</name>
<email>computersforpeace@gmail.com</email>
</author>
<published>2012-01-27T18:30:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=de3f8789d9e54b2e0e45197a693ad87ebf3bab60'/>
<id>urn:sha1:de3f8789d9e54b2e0e45197a693ad87ebf3bab60</id>
<content type='text'>
Will be used for `mtdinfo --all'

Artem: add a temporary stub for pre-2.6.30 kernels.

Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>libmtd: modify `mtd_write' to cover OOB writes</title>
<updated>2011-09-11T13:11:41+00:00</updated>
<author>
<name>Brian Norris</name>
<email>computersforpeace@gmail.com</email>
</author>
<published>2011-08-31T20:00:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=cd42aea270e84884e6bbac845414568f0febbedf'/>
<id>urn:sha1:cd42aea270e84884e6bbac845414568f0febbedf</id>
<content type='text'>
To support the MEMWRITE ioctl, we will need a different sort of libmtd
interface for writing to flash. We will expand mtd_write to include more
functionality; for now, we just change the function definition and
description as we begin to add the actual functionality.

Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Signed-off-by: Artem Bityutskiy &lt;artem.bityutskiy@intel.com&gt;
</content>
</entry>
<entry>
<title>libmtd: improve mtd_islocked interface</title>
<updated>2011-06-08T12:30:14+00:00</updated>
<author>
<name>Artem Bityutskiy</name>
<email>Artem.Bityutskiy@nokia.com</email>
</author>
<published>2011-06-08T12:30:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=92a06994b7c3f146cbdb770b30780e32f021118f'/>
<id>urn:sha1:92a06994b7c3f146cbdb770b30780e32f021118f</id>
<content type='text'>
This patch first of all, re-names 'mtd_islocked()' into 'mtd_is_locked()' since
this seems to be the name Mike wanted, and it looks a bit nicer.

This patch also makes 'mtd_is_locked()' print an error message if it fails. I'm
not sure if it is good idea for a library to do so, but all functions do this,
so it certainly _not_ a good idea to be inconsistent.

However, for the special case, when the the "is locked" ioctl is not supported
or is not valid for this device, we do not print an error message and return
ENOTSUPP error code.

Thus, the user can distinguish between real errors and non-fatal "not
supported" cases.

Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
<entry>
<title>libmtd: add helper funcs for getting regioninfo and locked info</title>
<updated>2011-06-08T11:58:14+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@gentoo.org</email>
</author>
<published>2011-06-07T15:28:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/mtd-utils.git/commit/?id=d1bc539a3a77bd38f1776d5026277d66b1661c8a'/>
<id>urn:sha1:d1bc539a3a77bd38f1776d5026277d66b1661c8a</id>
<content type='text'>
This extends the libmtd with the helper functions:
	mtd_regioninfo: interface to MEMGETREGIONINFO
	mtd_islocked: interface to MEMISLOCKED

Users of these functions will follow shortly ...

Artem: do not print error message in mtd_islocked()

Signed-off-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Signed-off-by: Artem Bityutskiy &lt;Artem.Bityutskiy@nokia.com&gt;
</content>
</entry>
</feed>
