Ejemplo n.º 1
0
static void init_3592_inquiry(struct lu_phy_attr *lu)
{
	int pg;
	uint8_t worm;
	uint8_t local_TapeAlert[8] =
			{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };

	worm = ((struct priv_lu_ssc *)lu->lu_private)->pm->drive_supports_WORM;
	lu->inquiry[2] =
		((struct priv_lu_ssc *)lu->lu_private)->pm->drive_ANSI_VERSION;

	/* Sequential Access device capabilities - Ref: 8.4.2 */
	pg = PCODE_OFFSET(0xb0);
	lu->lu_vpd[pg] = alloc_vpd(VPD_B0_SZ);
	if (!lu->lu_vpd[pg]) {
		MHVTL_ERR("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_vpd_b0(lu, &worm);

	/* Manufacture-assigned serial number - Ref: 8.4.3 */
	pg = PCODE_OFFSET(0xb1);
	lu->lu_vpd[pg] = alloc_vpd(VPD_B1_SZ);
	if (!lu->lu_vpd[pg]) {
		MHVTL_ERR("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_vpd_b1(lu, lu->lu_serial_no);

	/* TapeAlert supported flags - Ref: 8.4.4 */
	pg = PCODE_OFFSET(0xb2);
	lu->lu_vpd[pg] = alloc_vpd(VPD_B2_SZ);
	if (!lu->lu_vpd[pg]) {
		MHVTL_ERR("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_vpd_b2(lu, &local_TapeAlert);

	/* VPD page 0xC0 */
	pg = PCODE_OFFSET(0xc0);
	lu->lu_vpd[pg] = alloc_vpd(VPD_C0_SZ);
	if (!lu->lu_vpd[pg]) {
		MHVTL_ERR("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_vpd_c0(lu, "10-03-2008 19:38:00");

	/* VPD page 0xC1 */
	pg = PCODE_OFFSET(0xc1);
	lu->lu_vpd[pg] = alloc_vpd(strlen("Security"));
	if (!lu->lu_vpd[pg]) {
		MHVTL_ERR("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_vpd_c1(lu, "Security");
}
Ejemplo n.º 2
0
static void init_ult_inquiry(struct lu_phy_attr *lu)
{
	int pg;
	uint8_t worm = 1;	/* Supports WORM */
	uint8_t local_TapeAlert[8] =
			{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };

	pg = PCODE_OFFSET(0x86);
	lu->lu_vpd[pg] = alloc_vpd(VPD_86_SZ);
	if (!lu->lu_vpd[pg]) {
		MHVTL_LOG("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}

	/* Sequential Access device capabilities - Ref: 8.4.2 */
	pg = PCODE_OFFSET(0xb0);
	lu->lu_vpd[pg] = alloc_vpd(VPD_B0_SZ);
	if (!lu->lu_vpd[pg]) {
		MHVTL_LOG("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_vpd_b0(lu, &worm);

	/* Manufacture-assigned serial number - Ref: 8.4.3 */
	pg = PCODE_OFFSET(0xb1);
	lu->lu_vpd[pg] = alloc_vpd(VPD_B1_SZ);
	if (!lu->lu_vpd[pg]) {
		MHVTL_LOG("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_vpd_b1(lu, lu->lu_serial_no);

	/* TapeAlert supported flags - Ref: 8.4.4 */
	pg = PCODE_OFFSET(0xb2);
	lu->lu_vpd[pg] = alloc_vpd(VPD_B2_SZ);
	if (!lu->lu_vpd[pg]) {
		MHVTL_LOG("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_vpd_b2(lu, &local_TapeAlert);

	/* VPD page 0xC0 - Firmware revision page */
	pg = PCODE_OFFSET(0xc0);
	lu->lu_vpd[pg] = alloc_vpd(0x60);
	if (!lu->lu_vpd[pg]) {
		MHVTL_LOG("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_hp_vpd_cx(lu, pg, "Firmware", MHVTL_VERSION,
						"2012/04/18 19:38", "6");

	/* VPD page 0xC1 - Hardware */
	pg = PCODE_OFFSET(0xc1);
	lu->lu_vpd[pg] = alloc_vpd(0x60);
	if (!lu->lu_vpd[pg]) {
		MHVTL_LOG("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_hp_vpd_cx(lu, pg, "Hardware", MHVTL_VERSION,
						"2012/04/18 06:53", "5");

	/* VPD page 0xC2 - PCA */
	pg = PCODE_OFFSET(0xc2);
	lu->lu_vpd[pg] = alloc_vpd(0x60);
	if (!lu->lu_vpd[pg]) {
		MHVTL_LOG("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_hp_vpd_cx(lu, pg, "PCA", MHVTL_VERSION,
						"1996/11/29 10:00", "4");

	/* VPD page 0xC3 - Mechanism */
	pg = PCODE_OFFSET(0xc3);
	lu->lu_vpd[pg] = alloc_vpd(0x60);
	if (!lu->lu_vpd[pg]) {
		MHVTL_LOG("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_hp_vpd_cx(lu, pg, "Mechanism", MHVTL_VERSION,
						"1992/08/11 10:00", "3");

	/* VPD page 0xC4 - Head Assembly */
	pg = PCODE_OFFSET(0xc4);
	lu->lu_vpd[pg] = alloc_vpd(0x60);
	if (!lu->lu_vpd[pg]) {
		MHVTL_LOG("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_hp_vpd_cx(lu, pg, "Head Assy", MHVTL_VERSION,
						"1966/07/28 10:00", "2");

	/* VPD page 0xC5 - ACI */
	pg = PCODE_OFFSET(0xc5);
	lu->lu_vpd[pg] = alloc_vpd(0x60);
	if (!lu->lu_vpd[pg]) {
		MHVTL_LOG("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_hp_vpd_cx(lu, pg, "ACI", MHVTL_VERSION,
						"1960/03/10 10:00", "1");
}
Ejemplo n.º 3
0
/* SuperDLT range */
static void init_sdlt_inquiry(struct lu_phy_attr *lu)
{
	int pg;
	uint8_t worm;
	uint8_t ta[8] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
	char b[32];
	int x, y, z;

	worm = ((struct priv_lu_ssc *)lu->lu_private)->pm->drive_supports_WORM;
	lu->inquiry[2] =
		((struct priv_lu_ssc *)lu->lu_private)->pm->drive_ANSI_VERSION;


	lu->inquiry[36] = get_product_family(lu);

	sprintf(b, "%s", MHVTL_VERSION);
	sscanf(b, "%d.%d.%d", &x, &y, &z);
	if (x) {
		lu->inquiry[37] = x;
		lu->inquiry[38] = y;
	} else {
		lu->inquiry[37] = y;
		lu->inquiry[38] = z;
	}

	/* Sequential Access device capabilities - Ref: 8.4.2 */
	pg = PCODE_OFFSET(0xb0);
	lu->lu_vpd[pg] = alloc_vpd(VPD_B0_SZ);
	if (!lu->lu_vpd[pg]) {
		MHVTL_LOG("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_vpd_b0(lu, &worm);

	/* Manufacture-assigned serial number - Ref: 8.4.3 */
	pg = PCODE_OFFSET(0xb1);
	lu->lu_vpd[pg] = alloc_vpd(VPD_B1_SZ);
	if (!lu->lu_vpd[pg]) {
		MHVTL_LOG("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_vpd_b1(lu, lu->lu_serial_no);

	/* TapeAlert supported flags - Ref: 8.4.4 */
	pg = PCODE_OFFSET(0xb2);
	lu->lu_vpd[pg] = alloc_vpd(VPD_B2_SZ);
	if (!lu->lu_vpd[pg]) {
		MHVTL_LOG("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_vpd_b2(lu, &ta);

	/* VPD page 0xC0 */
	pg = PCODE_OFFSET(0xc0);
	lu->lu_vpd[pg] = alloc_vpd(44);
	if (!lu->lu_vpd[pg]) {
		MHVTL_LOG("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_vpd_dlt_c0(lu);

	/* VPD page 0xC1 */
	pg = PCODE_OFFSET(0xc1);
	lu->lu_vpd[pg] = alloc_vpd(44);
	if (!lu->lu_vpd[pg]) {
		MHVTL_LOG("Failed to malloc(): Line %d", __LINE__);
		exit(-ENOMEM);
	}
	update_vpd_dlt_c1(lu, lu->lu_serial_no);
}