Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/s390guy/hercules-390
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Shorter committed Jan 12, 2013
2 parents 29696ba + 8d1b7ab commit b18ed12
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 19 deletions.
39 changes: 29 additions & 10 deletions ckddasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3213,15 +3213,33 @@ BYTE trk_ovfl; /* == 1 if track ovfl write */
iobuf[95] = myssid & 0xff;
break;
case 0x03: /* Read attention message for this path-group for
the addressed device Return a "no message"
the addressed device Return a "No Message"
message */
iobuf[0] = 0x00; // Message length
iobuf[1] = 0x09; // ...
iobuf[2] = 0x00; // Format: "No message"
iobuf[3] = 0x00; // Message code: n/a
memcpy (iobuf+4, iobuf+8, 4); // Copy message identifier from bytes 8-11
iobuf[8] = 0x00; // Flags
dev->ckdssdlen = 9; // Indicate length of subsystem data prepared
/*------------------------------------------------------*/
/* PROGRAMMING NOTE: 2013/01/09 Fish */
/* According to GA32-0274 IBM 3990,9390 Storage Control */
/* Reference the Read Attention Message response should */
/* be 11 bytes for a 3990-6 with Message Format byte 2 */
/* being 0x02 (3990-6/ESS message) with byte 9 and 10 */
/* containing additional response information such as a */
/* bit map indicating which physical subsystem SPs are */
/* caching. Since Hercules does not yet support caching */
/* and thus cannot return a valid SP caching bit map we */
/* return a 9 byte response instead with byte 2 = 0x00 */
/* (No Message) because an 11 byte response with zeros */
/* in bytes 9 and 10 (no caching SPs bit map flags set) */
/* causes problems with certain operating systems. Thus */
/* a 9-byte response with byte 2 = 0x00 is the safest */
/* approach to make most operating systems happy. */
/*------------------------------------------------------*/
iobuf[0] = 0x00; /* Message... */
iobuf[1] = 0x09; /* ...Length */
iobuf[2] = 0x00; /* Format: "No message" */
iobuf[3] = 0x00; /* Message code: n/a */
memcpy (iobuf+4, iobuf+8, 4); /* Copy same message Id
from bytes 8-11 */
iobuf[8] = 0x00; /* Flags = 00 */
dev->ckdssdlen = 9; /* Len of prepared data */
break;
case 0x0E: /* Unit address configuration */
/* Prepare unit address configuration record */
Expand Down Expand Up @@ -4778,8 +4796,9 @@ BYTE trk_ovfl; /* == 1 if track ovfl write */
/* LOCATE RECORD EXTENDED */
/*---------------------------------------------------------------*/

/* LRE only valid for 3990-6 */
if (dev->ckdcu->devt != 0x3990 || dev->ckdcu->model != 0xe9)
/* LRE only valid for 3990-3 or 3990-6 (or greater) */
if (dev->ckdcu->devt != 0x3990 ||
!(MODEL3( dev->ckdcu ) || MODEL6( dev->ckdcu )))
{
/* Set command reject sense byte, and unit check status */
ckd_build_sense (dev, SENSE_CR, 0, 0, FORMAT_0, MESSAGE_1);
Expand Down
50 changes: 42 additions & 8 deletions dasdtab.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,20 @@ static CKDCU ckdcutab[] = {
{"3830", 0x3830,0x02,0x00,0x00,0x00,0x00000000,0,0,0,0,0,0,0,0,24},
{"3880", 0x3880,0x05,0x09,0x00,0x00,0x80000000,0,0,0,0,0,0,0,0,24},
{"3990", 0x3990,0xc2,0x10,0x00,0x00,0xd0000000,0x40fa0100,0,0,0,0,0,0,0,32},
{"3990-3", 0x3990,0xec,0x06,0x00,0x00,0xd0000010,0x40fa0100,0x41270004,0x423e0040,0,0,0,0,0,32},
{"3990-6", 0x3990,0xe9,0x15,0x48,0x15,0x50000010,0x40fa0100,0x41270004,0x423e0060,0,0,0,0,0,32},
/*
PROGRAMMING NOTE: the 00001000 features bit (RAMAC Data striping
and compaction on parallel channels) is apparently needed in order
to allow SMS to create VSAM Extended Format Datasets (as well as
RDC bytes 51-53 needing to be set properly too). We set them even
though we do not directly support RAID since the user may provide
such support themselves by placing their Hercules dasd file on a
RAID array and it's important to be able to create VSAM Extended
Format datasets since doing so is common in the real world so we
need to "support" allowing them to do so.
*/
{"3990-3", 0x3990,0xec,0x06,0x00,0x00,0xd0001010,0x40fa0100,0x41270004,0x423e0040,0,0,0,0,0,32},
{"3990-6", 0x3990,0xe9,0x15,0x48,0x15,0x50001010,0x40fa0100,0x41270004,0x423e0060,0,0,0,0,0,32},

{"9343", 0x9343,0xe0,0x11,0x00,0x00,0x80000000,0,0,0,0,0,0,0,0,32}
/*"2105", 0x2105,0xe8,0x15,0x48,0x15,0x50000037,0x40fa0100,0x41270004,0x423e01a0,0x433e0008,0,0,0,0,32}, */
} ;
Expand Down Expand Up @@ -432,14 +444,36 @@ int altcyls; /* Number alternate cyls */
devchar[47] = 0x01; // Track set
devchar[48] = (BYTE)(ckd->f6); // F6
store_hw(devchar+49, ckd->rpscalc); // RPS factor
//--REMOVE-REMOVE-REMOVE-REMOVE-REMOVE-REMOVE-REMOVE-REMOVE-REMOVE-REMOVE-REMOVE-REMOVE-REMOVE
// devchar[51] = MODEL6(cu) ? 0x0f : 0x00; // reserved byte 51 !!! REMOVE !!!
// Setting of byte 51 is in ERROR when Hercules does not support the feature !!! REMOVE !!!
// for which a threshold is being set. !!! REMOVE !!!
//--REMOVE-REMOVE-REMOVE-REMOVE-REMOVE-REMOVE-REMOVE-REMOVE-REMOVE-REMOVE-REMOVE-REMOVE-REMOVE
devchar[51] = 0x00; // reserved byte 51
/*---------------------------------------------------------------*/
/* 2013/01/09 Fish */
/* RDC bytes 51-53 are reserved for model-3, model-6 and higher */
/* control units and define a feature buffer lower/upper limit. */
/* The lower limit might not need to be precisely 0x0f, but it */
/* cannot be zero or else VSAM Extended Format Datasets cannot */
/* be created by SMS. The precise value is unknown but was 0x0f */
/* in previous versions of Hercules so we use that value. Bytes */
/* 52-53 were previously always zero but defining them to be a */
/* value larger than byte 51 seems to make logical sense since */
/* we know it's an upper limit. I was told 0x7f was reasonable. */
/*---------------------------------------------------------------*/
if (MODEL3(cu) || MODEL6(cu)) // Model-3/-6/greater?
{
devchar[51] = 0x0f; // reserved (feature buffer lower limit)

if (MODEL3(cu)) // 3990-3
{
devchar[52] = 0x00; // reserved (always zero)
devchar[53] = 0x3f; // reserved (feature buffer upper limit)
}
else // 3990-6 or greater
{
devchar[52] = 0x00; // reserved (high byte feature buffer upper limit)
devchar[53] = 0x7f; // reserved (low byte feature buffer upper limit)
}
}
devchar[54] = cu->funcfeat; // device/CU functions/features
devchar[56] = cu->typecode; // Real CU type code

/*---------------------------------------------------------------*/
/* 2007/05/04 @kl */
/* The following line to set devchar[57] to 0xff was restored */
Expand Down
3 changes: 2 additions & 1 deletion dasdtab.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
#define SSID(_dev) ((_dev)->devnum & ~(DEVICES_PER_SUBSYS-1))
#define IFID(_dev) ((SSID((_dev)) >> DEVICES_PER_SUBSYS_SHIFT) & 0x7)

/* Test for 3990-6 control unit with extended function */
/* Test for 3990-3 or 3990-6 control unit */
#define MODEL3(_cu) ((_cu)->devt == 0x3990 && (_cu)->model == 0xec)
#define MODEL6(_cu) ((_cu)->devt == 0x3990 && (_cu)->model == 0xe9)

/*-------------------------------------------------------------------*/
Expand Down

0 comments on commit b18ed12

Please sign in to comment.