Skip to content

Commit 2a13b53

Browse files
authored
fix: HP LTO 6 remaining capacity (#634)
1 parent 30fad32 commit 2a13b53

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/tape_drivers/freebsd/cam/cam_tc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1781,7 +1781,8 @@ int camtape_remaining_capacity(void *device, struct tc_remaining_cap *cap)
17811781
int rc;
17821782

17831783
ltfs_profiler_add_entry(softc->profiler, NULL, TAPEBEND_REQ_ENTER(REQ_TC_REMAINCAP));
1784-
if (IS_LTO(softc->drive_type) && (DRIVE_GEN(softc->drive_type) == 0x05)) {
1784+
if ((IS_LTO(softc->drive_type) && (DRIVE_GEN(softc->drive_type) == 0x05)) ||
1785+
(softc->vendor == VENDOR_HP && IS_LTO(softc->drive_type) && (DRIVE_GEN(softc->drive_type) == 0x06))) {
17851786
/* Issue LogPage 0x31 */
17861787
rc = camtape_logsense(device, LOG_TAPECAPACITY, (uint8_t)0, logdata, LOGSENSEPAGE);
17871788
if (rc < 0) {

src/tape_drivers/linux/lin_tape/lin_tape_ibmtape.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,8 @@ int lin_tape_ibmtape_remaining_capacity(void *device, struct tc_remaining_cap *c
22682268
struct lin_tape_ibmtape *priv = (struct lin_tape_ibmtape *) device;
22692269

22702270
ltfs_profiler_add_entry(priv->profiler, NULL, TAPEBEND_REQ_ENTER(REQ_TC_REMAINCAP));
2271-
if (IS_LTO(priv->drive_type) && (DRIVE_GEN(priv->drive_type) == 0x05)) {
2271+
if ((IS_LTO(priv->drive_type) && (DRIVE_GEN(priv->drive_type) == 0x05)) ||
2272+
(priv->vendor == VENDOR_HP && IS_LTO(priv->drive_type) && (DRIVE_GEN(priv->drive_type) == 0x06))) {
22722273
/* Issue LogPage 0x31 */
22732274
rc = lin_tape_ibmtape_logsense(device, LOG_TAPECAPACITY, (uint8_t)0, logdata, LOGSENSEPAGE);
22742275
if (rc) {

src/tape_drivers/linux/sg/sg_tape.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3031,7 +3031,8 @@ int sg_remaining_capacity(void *device, struct tc_remaining_cap *cap)
30313031

30323032
memset(buffer, 0, LOGSENSEPAGE);
30333033

3034-
if (IS_LTO(priv->drive_type) && (DRIVE_GEN(priv->drive_type) == 0x05)) {
3034+
if ((IS_LTO(priv->drive_type) && (DRIVE_GEN(priv->drive_type) == 0x05)) ||
3035+
(priv->vendor == VENDOR_HP && IS_LTO(priv->drive_type) && (DRIVE_GEN(priv->drive_type) == 0x06))) {
30353036
/* Use LogPage 0x31 */
30363037
ret = sg_logsense(device, (uint8_t)LOG_TAPECAPACITY, (uint8_t)0, (void *)buffer, LOGSENSEPAGE);
30373038
if(ret < 0)

src/tape_drivers/netbsd/scsipi-ibmtape/scsipi_ibmtape.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2575,7 +2575,8 @@ int scsipi_ibmtape_remaining_capacity(void *device, struct tc_remaining_cap *cap
25752575

25762576
memset(buffer, 0, LOGSENSEPAGE);
25772577

2578-
if (IS_LTO(priv->drive_type) && (DRIVE_GEN(priv->drive_type) == 0x05)) {
2578+
if ((IS_LTO(priv->drive_type) && (DRIVE_GEN(priv->drive_type) == 0x05)) ||
2579+
(priv->vendor == VENDOR_HP && IS_LTO(priv->drive_type) && (DRIVE_GEN(priv->drive_type) == 0x06))) {
25792580
/* Use LogPage 0x31 */
25802581
ret = scsipi_ibmtape_logsense(device, (uint8_t)LOG_TAPECAPACITY, (uint8_t)0, (void *)buffer, LOGSENSEPAGE);
25812582
if(ret < 0)

src/tape_drivers/osx/iokit/iokit_tape.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2299,7 +2299,8 @@ int iokit_remaining_capacity(void *device, struct tc_remaining_cap *cap)
22992299

23002300
memset(&buffer, 0, LOGSENSEPAGE);
23012301

2302-
if (IS_LTO(priv->drive_type) && (DRIVE_GEN(priv->drive_type) == 0x05)) {
2302+
if ((IS_LTO(priv->drive_type) && (DRIVE_GEN(priv->drive_type) == 0x05)) ||
2303+
(priv->vendor == VENDOR_HP && IS_LTO(priv->drive_type) && (DRIVE_GEN(priv->drive_type) == 0x06))) {
23032304
/* Use LogPage 0x31 */
23042305
ret = iokit_logsense(device, (uint8_t)LOG_TAPECAPACITY, (uint8_t)0, (void *)buffer, LOGSENSEPAGE);
23052306
if(ret < 0)

0 commit comments

Comments
 (0)