Modify aai to support pass-1 device initialization
The Soft Channel device support requests pass-1 initialization. It no longer needs to initialize the INP link or allocate the array buffer itself, these are taken care of elsewhere. The record code uses PACT to remember that the device must be initialized again in pass 1.
This commit is contained in:
@@ -47,19 +47,15 @@ static long init_record(dbCommon *pcommon)
|
||||
aaiRecord *prec = (aaiRecord *)pcommon;
|
||||
DBLINK *plink = &prec->inp;
|
||||
|
||||
/* This is pass 0, link hasn't been initialized yet */
|
||||
dbInitLink(plink, DBF_INLINK);
|
||||
/* Ask record to call us in pass 1 instead */
|
||||
if (prec->pact != 2) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
if (dbLinkIsConstant(plink)) {
|
||||
long nRequest = prec->nelm;
|
||||
long status;
|
||||
|
||||
/* Allocate a buffer, record support hasn't done that yet */
|
||||
if (!prec->bptr) {
|
||||
prec->bptr = callocMustSucceed(nRequest, dbValueSize(prec->ftvl),
|
||||
"devAaiSoft: buffer calloc failed");
|
||||
}
|
||||
|
||||
status = dbLoadLinkArray(plink, prec->ftvl, prec->bptr, &nRequest);
|
||||
if (!status) {
|
||||
prec->nord = nRequest;
|
||||
|
||||
Reference in New Issue
Block a user