Lines Matching refs:dev
18 static int yaffs_tags_marshall_write(struct yaffs_dev *dev,
26 dev->param.no_tags_ecc ? sizeof(pt.t) : sizeof(pt);
28 dev->param.no_tags_ecc ? (void *)&pt.t : (void *)&pt;
40 else if (dev->param.inband_tags) {
44 dev->
48 yaffs_pack_tags2(&pt, tags, !dev->param.no_tags_ecc);
51 retval = dev->drv.drv_write_chunk_fn(dev, nand_chunk,
52 data, dev->param.total_bytes_per_chunk,
53 (dev->param.inband_tags) ? NULL : packed_tags_ptr,
54 (dev->param.inband_tags) ? 0 : packed_tags_size);
59 static int yaffs_tags_marshall_read(struct yaffs_dev *dev,
71 dev->param.no_tags_ecc ? sizeof(pt.t) : sizeof(pt);
73 dev->param.no_tags_ecc ? (void *)&pt.t : (void *)&pt;
79 if (dev->param.inband_tags) {
82 data = yaffs_get_temp_buffer(dev);
86 if (dev->param.inband_tags || (data && !tags))
87 retval = dev->drv.drv_read_chunk_fn(dev, nand_chunk,
88 data, dev->param.total_bytes_per_chunk,
92 retval = dev->drv.drv_read_chunk_fn(dev, nand_chunk,
93 data, dev->param.total_bytes_per_chunk,
100 if (dev->param.inband_tags) {
105 &data[dev->data_bytes_per_chunk];
110 yaffs_unpack_tags2(tags, &pt, !dev->param.no_tags_ecc);
114 yaffs_release_temp_buffer(dev, data);
118 dev->n_ecc_unfixed++;
124 dev->n_ecc_fixed++;
133 static int yaffs_tags_marshall_query_block(struct yaffs_dev *dev, int block_no,
142 retval = dev->drv.drv_check_bad_fn(dev, block_no);
152 yaffs_tags_marshall_read(dev,
153 block_no * dev->param.chunks_per_block,
175 static int yaffs_tags_marshall_mark_bad(struct yaffs_dev *dev, int block_no)
177 return dev->drv.drv_mark_bad_fn(dev, block_no);
182 void yaffs_tags_marshall_install(struct yaffs_dev *dev)
184 if (!dev->param.is_yaffs2)
187 if (!dev->tagger.write_chunk_tags_fn)
188 dev->tagger.write_chunk_tags_fn = yaffs_tags_marshall_write;
190 if (!dev->tagger.read_chunk_tags_fn)
191 dev->tagger.read_chunk_tags_fn = yaffs_tags_marshall_read;
193 if (!dev->tagger.query_block_fn)
194 dev->tagger.query_block_fn = yaffs_tags_marshall_query_block;
196 if (!dev->tagger.mark_bad_fn)
197 dev->tagger.mark_bad_fn = yaffs_tags_marshall_mark_bad;