- ("nandmtd2_WriteChunkWithTagsToNAND chunk %d data %p tags %p"
- TENDSTR), chunkInNAND, data, tags));
+ ("nandmtd2_write_chunk_tags chunk %d data %p tags %p"
+ TENDSTR), nand_chunk, data, tags));
+
+
+ addr = ((loff_t) nand_chunk) * dev->param.total_bytes_per_chunk;
+
+ /* For yaffs2 writing there must be both data and tags.
+ * If we're using inband tags, then the tags are stuffed into
+ * the end of the data buffer.
+ */
+ if (!data || !tags)
+ BUG();
+ else if (dev->param.inband_tags) {
+ yaffs_packed_tags2_tags_only *pt2tp;
+ pt2tp = (yaffs_packed_tags2_tags_only *)(data + dev->data_bytes_per_chunk);
+ yaffs_pack_tags2_tags_only(pt2tp, tags);
+ } else
+ yaffs_pack_tags2(&pt, tags, !dev->param.no_tags_ecc);