Lines Matching +full:transfer +full:- +full:function
1 // SPDX-License-Identifier: GPL-2.0
26 * struct hmcdrv_ftp_ops - HMC drive FTP operations
27 * @startup: startup function
28 * @shutdown: shutdown function
29 * @transfer: FTP transfer function
34 ssize_t (*transfer)(const struct hmcdrv_ftp_cmdspec *ftp, member
46 * hmcdrv_ftp_cmd_getid() - determine FTP command ID from a command string
47 * @cmd: FTP command string (NOT zero-terminated)
96 if (!pdesc->str || strncmp(pdesc->str, cmd, len)) in hmcdrv_ftp_cmd_getid()
100 pdesc->str, pdesc->cmd); in hmcdrv_ftp_cmd_getid()
102 return pdesc->cmd; in hmcdrv_ftp_cmd_getid()
106 * hmcdrv_ftp_parse() - HMC drive FTP command parser
117 ftp->id = HMCDRV_FTP_NOOP; in hmcdrv_ftp_parse()
118 ftp->fname = NULL; in hmcdrv_ftp_parse()
134 ftp->id = hmcdrv_ftp_cmd_getid(start, cmd - start); in hmcdrv_ftp_parse()
139 ftp->fname = start; in hmcdrv_ftp_parse()
149 if (!ftp->fname || (ftp->id == HMCDRV_FTP_NOOP)) in hmcdrv_ftp_parse()
150 return -EINVAL; in hmcdrv_ftp_parse()
156 * hmcdrv_ftp_do() - perform a HMC drive FTP, with data from kernel-space
168 pr_debug("starting transfer, cmd %d for '%s' at %lld with %zd bytes\n", in hmcdrv_ftp_do()
169 ftp->id, ftp->fname, (long long) ftp->ofs, ftp->len); in hmcdrv_ftp_do()
170 len = hmcdrv_cache_cmd(ftp, hmcdrv_ftp_funcs->transfer); in hmcdrv_ftp_do()
172 len = -ENXIO; in hmcdrv_ftp_do()
181 * hmcdrv_ftp_probe() - probe for the HMC drive FTP service
199 return -ENOMEM; in hmcdrv_ftp_probe()
210 case -ENOENT: /* no such file/media or currently busy, */ in hmcdrv_ftp_probe()
211 case -EBUSY: /* but service seems to be available */ in hmcdrv_ftp_probe()
214 default: /* leave 'rc' as it is for [0, -EPERM, -E...] */ in hmcdrv_ftp_probe()
226 * hmcdrv_ftp_cmd() - Perform a HMC drive FTP, with data from user-space
230 * @buf: user-space buffer for read/written directory/file
233 * This function must not be called before hmcdrv_ftp_startup() was called.
252 return -ENOMEM; in hmcdrv_ftp_cmd()
262 retlen = -EFAULT; in hmcdrv_ftp_cmd()
270 retlen = -EFAULT; in hmcdrv_ftp_cmd()
278 retlen = -EOPNOTSUPP; in hmcdrv_ftp_cmd()
287 * hmcdrv_ftp_startup() - startup of HMC drive FTP functionality for a
297 .transfer = diag_ftp_cmd in hmcdrv_ftp_startup()
303 .transfer = sclp_ftp_cmd in hmcdrv_ftp_startup()
308 mutex_lock(&hmcdrv_ftp_mutex); /* block transfers while start-up */ in hmcdrv_ftp_startup()
316 rc = -EOPNOTSUPP; in hmcdrv_ftp_startup()
319 rc = hmcdrv_ftp_funcs->startup(); in hmcdrv_ftp_startup()
331 * hmcdrv_ftp_shutdown() - shutdown of HMC drive FTP functionality for a
337 --hmcdrv_ftp_refcnt; in hmcdrv_ftp_shutdown()
340 hmcdrv_ftp_funcs->shutdown(); in hmcdrv_ftp_shutdown()