Skip to content
Browse files

Add two extra fields into MAM for multi-partition support

Signed-off-by: Mark Harvey <markh794@gmail.com>
  • Loading branch information...
1 parent 1b20ee1 commit d03d43c78731a018a126a821702e1a4791ac920e @markh794 committed Apr 3, 2013
Showing with 9 additions and 1 deletion.
  1. +6 −0 usr/vtllib.c
  2. +3 −1 usr/vtllib.h
View
6 usr/vtllib.c
@@ -1133,6 +1133,8 @@ unsigned int set_media_params(struct MAM *mamp, char *density)
put_unaligned_be32(127, &mamp->MediumWidth);
put_unaligned_be32(1024, &mamp->MediumLength);
memcpy(&mamp->media_info.description, "mhvtl", 5);
+ mamp->max_partitions = 1;
+ mamp->num_partitions = 1;
if (!(strncmp(density, "LTO1", 4))) {
mamp->MediumDensityCode = medium_density_code_lto1;
@@ -1188,6 +1190,8 @@ unsigned int set_media_params(struct MAM *mamp, char *density)
memcpy(&mamp->media_info.density_name, "U-516 ", 6);
memcpy(&mamp->AssigningOrganization_1, "LTO-CVE", 7);
put_unaligned_be32(15142, &mamp->media_info.bits_per_mm);
+ mamp->max_partitions = 2;
+ mamp->num_partitions = 2;
} else if (!(strncmp(density, "LTO6", 4))) { /* FIXME */
mamp->MediumDensityCode = medium_density_code_lto6;
mamp->MediaType = Media_LTO6;
@@ -1197,6 +1201,8 @@ unsigned int set_media_params(struct MAM *mamp, char *density)
memcpy(&mamp->media_info.density_name, "U-616 ", 6);
memcpy(&mamp->AssigningOrganization_1, "LTO-CVE", 7);
put_unaligned_be32(18441, &mamp->media_info.bits_per_mm);
+ mamp->max_partitions = 2;
+ mamp->num_partitions = 2;
} else if (!(strncmp(density, "AIT1", 4))) {
/* Vaules for AIT taken from "Product Manual SDX-900V v1.0" */
mamp->MediumDensityCode = medium_density_code_ait1;
View
4 usr/vtllib.h
@@ -187,9 +187,11 @@ struct MAM {
char density_name[8];
char description[32];
} media_info;
+ uint8_t max_partitions;
+ uint8_t num_partitions;
/* Pad to keep MAM to 1024 bytes */
- uint8_t pad[1024 - 876];
+ uint8_t pad[1024 - 878];
} __attribute__((packed));
#define MAM_FLAGS_ENCRYPTION_FORMAT 0x0001

0 comments on commit d03d43c

Please sign in to comment.
Something went wrong with that request. Please try again.