mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] filetype: add Somfy BPK2 type
@ 2013-09-17 16:09 Jean-Christophe PLAGNIOL-VILLARD
  2013-09-17 16:09 ` [PATCH 2/2] fs: add Somfy BPK2 support Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 3+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-09-17 16:09 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 common/filetype.c  | 3 +++
 include/filetype.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/common/filetype.c b/common/filetype.c
index f986ea4..e07b65a 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -51,6 +51,7 @@ static const struct filetype_str filetype_str[] = {
 	[filetype_png] = { "PNG image", "png" },
 	[filetype_ext] = { "ext filesystem", "ext" },
 	[filetype_gpt] = { "GUID Partition Table", "gpt" },
+	[filetype_somfy_bpk2] = { "Somfy BPK2", "somfy-bpk2" },
 };
 
 const char *file_type_to_string(enum filetype f)
@@ -219,6 +220,8 @@ enum filetype file_detect_type(const void *_buf, size_t bufsize)
 		return filetype_png;
 	if (is_barebox_mips_head(_buf))
 		return filetype_mips_barebox;
+	if (buf[0] == be32_to_cpu(0x534F4659))
+		return filetype_somfy_bpk2;
 
 	if (bufsize < 64)
 		return filetype_unknown;
diff --git a/include/filetype.h b/include/filetype.h
index 3e9cea3..b97d860 100644
--- a/include/filetype.h
+++ b/include/filetype.h
@@ -28,6 +28,7 @@ enum filetype {
 	filetype_png,
 	filetype_ext,
 	filetype_gpt,
+	filetype_somfy_bpk2,
 	filetype_max,
 };
 
-- 
1.8.4.rc1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-18  7:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-17 16:09 [PATCH 1/2] filetype: add Somfy BPK2 type Jean-Christophe PLAGNIOL-VILLARD
2013-09-17 16:09 ` [PATCH 2/2] fs: add Somfy BPK2 support Jean-Christophe PLAGNIOL-VILLARD
2013-09-18  7:08   ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox