tag | line | file | source code |
mseg | 757 | drivers/char/ftape/ecc.c | int ecc_set_segment_parity(struct memory_segment *mseg) |
mseg | 762 | drivers/char/ftape/ecc.c | parity_bytes = &mseg->data[(mseg->blocks - 3) * SECTOR_SIZE]; |
mseg | 764 | drivers/char/ftape/ecc.c | set_parity((unsigned long *) &mseg->data[i], mseg->blocks - 3, |
mseg | 768 | drivers/char/ftape/ecc.c | if (!sanity_check((unsigned long *) &mseg->data[i], mseg->blocks)) { |
mseg | 781 | drivers/char/ftape/ecc.c | int ecc_correct_data(struct memory_segment *mseg) |
mseg | 792 | drivers/char/ftape/ecc.c | mseg->corrected = 0; |
mseg | 796 | drivers/char/ftape/ecc.c | if (!compute_syndromes((unsigned long *) &mseg->data[col], |
mseg | 797 | drivers/char/ftape/ecc.c | mseg->blocks, ss)) { |
mseg | 808 | drivers/char/ftape/ecc.c | if (mseg->read_bad) { |
mseg | 809 | drivers/char/ftape/ecc.c | for (i = 0; i < mseg->blocks; i++) { |
mseg | 810 | drivers/char/ftape/ecc.c | if (BAD_CHECK(mseg->read_bad, i)) { |
mseg | 850 | drivers/char/ftape/ecc.c | result = correct_block(&mseg->data[col + sizeof(long) - 1 - i], |
mseg | 851 | drivers/char/ftape/ecc.c | mseg->blocks, |
mseg | 853 | drivers/char/ftape/ecc.c | &mseg->corrected); |
mseg | 855 | drivers/char/ftape/ecc.c | result = correct_block(&mseg->data[col + i], mseg->blocks, |
mseg | 857 | drivers/char/ftape/ecc.c | &mseg->corrected); |
mseg | 871 | drivers/char/ftape/ecc.c | if (!sanity_check((unsigned long *) &mseg->data[col], mseg->blocks)) { |
mseg | 879 | drivers/char/ftape/ecc.c | if (!compute_syndromes((unsigned long *) &mseg->data[col], |
mseg | 880 | drivers/char/ftape/ecc.c | mseg->blocks, ss)) { |
mseg | 113 | drivers/char/ftape/ftape-read.c | struct memory_segment mseg; |
mseg | 117 | drivers/char/ftape/ftape-read.c | mseg.read_bad = convert_sector_map(&buffer[tail]); |
mseg | 118 | drivers/char/ftape/ftape-read.c | mseg.marked_bad = 0; /* not used... */ |
mseg | 119 | drivers/char/ftape/ftape-read.c | mseg.blocks = buffer[tail].bytes / SECTOR_SIZE; |
mseg | 120 | drivers/char/ftape/ftape-read.c | mseg.data = buffer[tail].address; |
mseg | 123 | drivers/char/ftape/ftape-read.c | if (mseg.blocks <= 3) { |
mseg | 128 | drivers/char/ftape/ftape-read.c | read_bad = mseg.read_bad; |
mseg | 130 | drivers/char/ftape/ftape-read.c | result = ecc_correct_data(&mseg); |
mseg | 131 | drivers/char/ftape/ftape-read.c | if (read_bad != 0 || mseg.corrected != 0) { |
mseg | 133 | drivers/char/ftape/ftape-read.c | TRACElx(4, "corrected map:", mseg.corrected); |
mseg | 134 | drivers/char/ftape/ftape-read.c | history.corrected += count_ones(mseg.corrected); |
mseg | 140 | drivers/char/ftape/ftape-read.c | memcpy(destination, mseg.data, (mseg.blocks - 3) * SECTOR_SIZE); |
mseg | 141 | drivers/char/ftape/ftape-read.c | if ((read_bad ^ mseg.corrected) & mseg.corrected) { |
mseg | 146 | drivers/char/ftape/ftape-read.c | return (mseg.blocks - 3) * SECTOR_SIZE; |
mseg | 78 | drivers/char/ftape/ftape-write.c | struct memory_segment mseg; |
mseg | 86 | drivers/char/ftape/ftape-write.c | mseg.blocks = 0; /* skip entire segment */ |
mseg | 89 | drivers/char/ftape/ftape-write.c | mseg.blocks = SECTORS_PER_SEGMENT - bads; |
mseg | 90 | drivers/char/ftape/ftape-write.c | mseg.data = destination; |
mseg | 91 | drivers/char/ftape/ftape-write.c | memcpy(mseg.data, source, (mseg.blocks - 3) * SECTOR_SIZE); |
mseg | 92 | drivers/char/ftape/ftape-write.c | result = ecc_set_segment_parity(&mseg); |
mseg | 96 | drivers/char/ftape/ftape-write.c | result = (mseg.blocks - 3) * SECTOR_SIZE; |