/* * Because the event buffer is located in a page which is owned * by the SCLP core, all data of interest must be copied. The * error indication is in 'sclp_ftp_ldflg'
*/
sclp_ftp_ldflg = diag->mdd.ftp.ldflg;
sclp_ftp_fsize = diag->mdd.ftp.fsize;
sclp_ftp_length = diag->mdd.ftp.length;
complete(&sclp_ftp_rx_complete);
}
/** * sclp_ftp_et7() - start a Diagnostic Test FTP Service SCLP request * @ftp: pointer to FTP descriptor * * Return: 0 on success, else a (negative) error code
*/ staticint sclp_ftp_et7(conststruct hmcdrv_ftp_cmdspec *ftp)
{ struct completion completion; struct sclp_diag_sccb *sccb; struct sclp_req *req;
ssize_t len; int rc;
rc = sclp_add_request(req); if (rc) goto out_free;
/* Wait for end of ftp sclp command. */
wait_for_completion(&completion);
#ifdef DEBUG
pr_debug("status of SCLP (ET7) request is 0x%04x (0x%02x)\n",
sccb->hdr.response_code, sccb->evbuf.hdr.flags); #endif
/* * Check if sclp accepted the request. The data transfer runs * asynchronously and the completion is indicated with an * sclp ET7 event.
*/ if (req->status != SCLP_REQ_DONE ||
(sccb->evbuf.hdr.flags & 0x80) == 0 || /* processed-buffer */
(sccb->hdr.response_code & 0xffU) != 0x20U) {
rc = -EIO;
}
/** * sclp_ftp_cmd() - executes a HMC related SCLP Diagnose (ET7) FTP command * @ftp: pointer to FTP command specification * @fsize: return of file size (or NULL if undesirable) * * Attention: Notice that this function is not reentrant - so the caller * must ensure locking. * * Return: number of bytes read/written or a (negative) error code
*/
ssize_t sclp_ftp_cmd(conststruct hmcdrv_ftp_cmdspec *ftp, size_t *fsize)
{
ssize_t len; #ifdef DEBUG unsignedlong start_jiffies;
pr_debug("starting SCLP (ET7), cmd %d for '%s' at %lld with %zd bytes\n",
ftp->id, ftp->fname, (longlong) ftp->ofs, ftp->len);
start_jiffies = jiffies; #endif
init_completion(&sclp_ftp_rx_complete);
/* Start ftp sclp command. */
len = sclp_ftp_et7(ftp); if (len) goto out_unlock;
/* * There is no way to cancel the sclp ET7 request, the code * needs to wait unconditionally until the transfer is complete.
*/
wait_for_completion(&sclp_ftp_rx_complete);
#ifdef DEBUG
pr_debug("completed SCLP (ET7) request after %lu ms (all)\n",
(jiffies - start_jiffies) * 1000 / HZ);
pr_debug("return code of SCLP (ET7) FTP Service is 0x%02x, with %lld/%lld bytes\n",
sclp_ftp_ldflg, sclp_ftp_length, sclp_ftp_fsize); #endif
switch (sclp_ftp_ldflg) { case SCLP_DIAG_FTP_OK:
len = sclp_ftp_length; if (fsize)
*fsize = sclp_ftp_fsize; break; case SCLP_DIAG_FTP_LDNPERM:
len = -EPERM; break; case SCLP_DIAG_FTP_LDRUNS:
len = -EBUSY; break; case SCLP_DIAG_FTP_LDFAIL:
len = -ENOENT; break; default:
len = -EIO; break;
}
/** * sclp_ftp_startup() - startup of FTP services, when running on LPAR
*/ int sclp_ftp_startup(void)
{ #ifdef DEBUG unsignedlong info; #endif int rc;
rc = sclp_register(&sclp_ftp_event); if (rc) return rc;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.