Skip to content
This repository
Browse code

Add two extra fields into MAM for multi-partition support

Signed-off-by: Mark Harvey <markh794@gmail.com>
  • Loading branch information...
commit d03d43c78731a018a126a821702e1a4791ac920e 1 parent 1b20ee1
Mark Harvey authored

Showing 2 changed files with 9 additions and 1 deletion. Show diff stats Hide diff stats

  1. +6 0 usr/vtllib.c
  2. +3 1 usr/vtllib.h
6 usr/vtllib.c
@@ -1133,6 +1133,8 @@ unsigned int set_media_params(struct MAM *mamp, char *density)
1133 1133 put_unaligned_be32(127, &mamp->MediumWidth);
1134 1134 put_unaligned_be32(1024, &mamp->MediumLength);
1135 1135 memcpy(&mamp->media_info.description, "mhvtl", 5);
  1136 + mamp->max_partitions = 1;
  1137 + mamp->num_partitions = 1;
1136 1138
1137 1139 if (!(strncmp(density, "LTO1", 4))) {
1138 1140 mamp->MediumDensityCode = medium_density_code_lto1;
@@ -1188,6 +1190,8 @@ unsigned int set_media_params(struct MAM *mamp, char *density)
1188 1190 memcpy(&mamp->media_info.density_name, "U-516 ", 6);
1189 1191 memcpy(&mamp->AssigningOrganization_1, "LTO-CVE", 7);
1190 1192 put_unaligned_be32(15142, &mamp->media_info.bits_per_mm);
  1193 + mamp->max_partitions = 2;
  1194 + mamp->num_partitions = 2;
1191 1195 } else if (!(strncmp(density, "LTO6", 4))) { /* FIXME */
1192 1196 mamp->MediumDensityCode = medium_density_code_lto6;
1193 1197 mamp->MediaType = Media_LTO6;
@@ -1197,6 +1201,8 @@ unsigned int set_media_params(struct MAM *mamp, char *density)
1197 1201 memcpy(&mamp->media_info.density_name, "U-616 ", 6);
1198 1202 memcpy(&mamp->AssigningOrganization_1, "LTO-CVE", 7);
1199 1203 put_unaligned_be32(18441, &mamp->media_info.bits_per_mm);
  1204 + mamp->max_partitions = 2;
  1205 + mamp->num_partitions = 2;
1200 1206 } else if (!(strncmp(density, "AIT1", 4))) {
1201 1207 /* Vaules for AIT taken from "Product Manual SDX-900V v1.0" */
1202 1208 mamp->MediumDensityCode = medium_density_code_ait1;
4 usr/vtllib.h
@@ -187,9 +187,11 @@ struct MAM {
187 187 char density_name[8];
188 188 char description[32];
189 189 } media_info;
  190 + uint8_t max_partitions;
  191 + uint8_t num_partitions;
190 192
191 193 /* Pad to keep MAM to 1024 bytes */
192   - uint8_t pad[1024 - 876];
  194 + uint8_t pad[1024 - 878];
193 195 } __attribute__((packed));
194 196
195 197 #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.