Lines Matching +full:partition +full:-

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 1996-2000 Russell King.
16 * Partition types. (Oh for reusability)
36 if (dr->disc_size == 0 && dr->disc_size_high == 0) in adfs_partition()
39 nr_sects = (le32_to_cpu(dr->disc_size_high) << 23) | in adfs_partition()
40 (le32_to_cpu(dr->disc_size) >> 9); in adfs_partition()
43 strlcat(state->pp_buf, " [", PAGE_SIZE); in adfs_partition()
44 strlcat(state->pp_buf, name, PAGE_SIZE); in adfs_partition()
45 strlcat(state->pp_buf, "]", PAGE_SIZE); in adfs_partition()
79 return -1; in riscix_partition()
81 strlcat(state->pp_buf, " [RISCiX]", PAGE_SIZE); in riscix_partition()
84 if (rr->magic == RISCIX_MAGIC) { in riscix_partition()
88 strlcat(state->pp_buf, " <", PAGE_SIZE); in riscix_partition()
92 if (rr->part[part].one && in riscix_partition()
93 memcmp(rr->part[part].name, "All\0", 4)) { in riscix_partition()
95 le32_to_cpu(rr->part[part].start), in riscix_partition()
96 le32_to_cpu(rr->part[part].length)); in riscix_partition()
97 strlcat(state->pp_buf, "(", PAGE_SIZE); in riscix_partition()
98 strlcat(state->pp_buf, rr->part[part].name, PAGE_SIZE); in riscix_partition()
99 strlcat(state->pp_buf, ")", PAGE_SIZE); in riscix_partition()
103 strlcat(state->pp_buf, " >\n", PAGE_SIZE); in riscix_partition()
133 strlcat(state->pp_buf, " [Linux]", PAGE_SIZE); in linux_partition()
139 return -1; in linux_partition()
141 strlcat(state->pp_buf, " <", PAGE_SIZE); in linux_partition()
142 while (linuxp->magic == cpu_to_le32(LINUX_NATIVE_MAGIC) || in linux_partition()
143 linuxp->magic == cpu_to_le32(LINUX_SWAP_MAGIC)) { in linux_partition()
144 if (slot == state->limit) in linux_partition()
147 le32_to_cpu(linuxp->start_sect), in linux_partition()
148 le32_to_cpu(linuxp->nr_sects)); in linux_partition()
151 strlcat(state->pp_buf, " >", PAGE_SIZE); in linux_partition()
170 * Try Cumana style partitions - sector 6 contains ADFS boot block in adfspart_check_CUMANA()
173 * There are unknowns in this code - is the 'cylinder number' of the in adfspart_check_CUMANA()
174 * next partition relative to the start of this one - I'm assuming in adfspart_check_CUMANA()
188 return -1; in adfspart_check_CUMANA()
190 if (slot == state->limit) in adfspart_check_CUMANA()
200 (dr->heads + (dr->lowsector & 0x40 ? 1 : 0)) * in adfspart_check_CUMANA()
201 dr->secspertrack; in adfspart_check_CUMANA()
208 start_blk += nr_sects >> (BLOCK_SIZE_BITS - 9); in adfspart_check_CUMANA()
209 nr_sects = 0; /* hmm - should be partition size */ in adfspart_check_CUMANA()
212 case 0: /* No partition / ADFS? */ in adfspart_check_CUMANA()
217 /* RISCiX - we don't know how to find the next one. */ in adfspart_check_CUMANA()
229 if (slot == -1) in adfspart_check_CUMANA()
230 return -1; in adfspart_check_CUMANA()
241 * Params : hd - pointer to gendisk structure to store partition info.
242 * dev - device number to access.
244 * Returns: -1 on error, 0 for no ADFS boot sector, 1 for ok.
247 * hda1 = ADFS partition on first drive.
248 * hda2 = non-ADFS partition.
261 return -1; in adfspart_check_ADFS()
269 heads = dr->heads + ((dr->lowsector >> 6) & 1); in adfspart_check_ADFS()
270 sectscyl = dr->secspertrack * heads; in adfspart_check_ADFS()
276 * Work out start of non-adfs partition. in adfspart_check_ADFS()
278 nr_sects = get_capacity(state->disk) - start_sect; in adfspart_check_ADFS()
296 strlcat(state->pp_buf, "\n", PAGE_SIZE); in adfspart_check_ADFS()
325 * Check for a valid ICS partition using the checksum.
335 sum -= le32_to_cpu(*(__le32 *)(&data[508])); in valid_ics_sector()
342 * Params : hd - pointer to gendisk structure to store partition info.
343 * dev - device number to access.
344 * Returns: -1 on error, 0 for no ICS table, 1 for partitions ok.
346 * hda1 = ADFS partition 0 on first drive.
347 * hda2 = ADFS partition 1 on first drive.
358 * Try ICS style partitions - sector 0 contains partition info. in adfspart_check_ICS()
362 return -1; in adfspart_check_ICS()
369 strlcat(state->pp_buf, " [ICS]", PAGE_SIZE); in adfspart_check_ICS()
371 for (slot = 1, p = (const struct ics_part *)data; p->size; p++) { in adfspart_check_ICS()
372 u32 start = le32_to_cpu(p->start); in adfspart_check_ICS()
373 s32 size = le32_to_cpu(p->size); /* yes, it's signed. */ in adfspart_check_ICS()
375 if (slot == state->limit) in adfspart_check_ICS()
380 * this partition - in effect it says that this does not in adfspart_check_ICS()
384 size = -size; in adfspart_check_ICS()
387 * Our own extension - We use the first sector in adfspart_check_ICS()
388 * of the partition to identify what type this in adfspart_check_ICS()
389 * partition is. We must not make this visible in adfspart_check_ICS()
394 size -= 1; in adfspart_check_ICS()
403 strlcat(state->pp_buf, "\n", PAGE_SIZE); in adfspart_check_ICS()
424 * If it looks like a PC/BIOS partition, then it in valid_ptec_sector()
438 * Params : hd - pointer to gendisk structure to store partition info.
439 * dev - device number to access.
440 * Returns: -1 on error, 0 for no ICS table, 1 for partitions ok.
442 * hda1 = ADFS partition 0 on first drive.
443 * hda2 = ADFS partition 1 on first drive.
456 return -1; in adfspart_check_POWERTEC()
463 strlcat(state->pp_buf, " [POWERTEC]", PAGE_SIZE); in adfspart_check_POWERTEC()
466 u32 start = le32_to_cpu(p->start); in adfspart_check_POWERTEC()
467 u32 size = le32_to_cpu(p->size); in adfspart_check_POWERTEC()
474 strlcat(state->pp_buf, "\n", PAGE_SIZE); in adfspart_check_POWERTEC()
498 * EESOX SCSI partition format.
500 * This is a goddamned awful partition format. We don't seem to store
501 * the size of the partition in this table, only the start addresses.
518 return -1; in adfspart_check_EESOX()
521 * "Decrypt" the partition table. God knows why... in adfspart_check_EESOX()
531 if (memcmp(p->magic, "Eesox", 6)) in adfspart_check_EESOX()
534 next = le32_to_cpu(p->start); in adfspart_check_EESOX()
536 put_partition(state, slot++, start, next - start); in adfspart_check_EESOX()
543 size = get_capacity(state->disk); in adfspart_check_EESOX()
544 put_partition(state, slot++, start, size - start); in adfspart_check_EESOX()
545 strlcat(state->pp_buf, "\n", PAGE_SIZE); in adfspart_check_EESOX()