Lines Matching +full:i +full:- +full:drive

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 1996-2000 Russell King.
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()
171 * with pointer to next 'drive'. 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()
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.
246 * Alloc : hda = whole drive
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()
330 int i; in valid_ics_sector() local
332 for (i = 0, sum = 0x50617274; i < 508; i++) in valid_ics_sector()
333 sum += data[i]; in valid_ics_sector()
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.
345 * Alloc : hda = whole drive
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()
394 size -= 1; in adfspart_check_ICS()
403 strlcat(state->pp_buf, "\n", PAGE_SIZE); in adfspart_check_ICS()
421 int i; in valid_ptec_sector() local
430 for (i = 0; i < 511; i++) in valid_ptec_sector()
431 checksum += data[i]; 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.
441 * Alloc : hda = whole drive
442 * hda1 = ADFS partition 0 on first drive.
443 * hda2 = ADFS partition 1 on first drive.
452 int i; in adfspart_check_POWERTEC() local
456 return -1; in adfspart_check_POWERTEC()
463 strlcat(state->pp_buf, " [POWERTEC]", PAGE_SIZE); in adfspart_check_POWERTEC()
465 for (i = 0, p = (const struct ptec_part *)data; i < 12; i++, p++) { 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()
493 'N', 'e', 'i', 'l', ' ',
494 'C', 'r', 'i', 't', 'c', 'h', 'e', 'l', 'l', ' ', ' '
514 int i, slot = 1; in adfspart_check_EESOX() local
518 return -1; in adfspart_check_EESOX()
523 for (i = 0; i < 256; i++) in adfspart_check_EESOX()
524 buffer[i] = data[i] ^ eesox_name[i & 15]; in adfspart_check_EESOX()
528 for (i = 0, p = (struct eesox_part *)buffer; i < 8; i++, p++) { 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()
535 if (i) in adfspart_check_EESOX()
536 put_partition(state, slot++, start, next - start); in adfspart_check_EESOX()
540 if (i != 0) { 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()
548 return i ? 1 : 0; in adfspart_check_EESOX()