65 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2/*3 * SE/HMC Drive FTP Services4 *5 * Copyright IBM Corp. 20136 * Author(s): Ralf Hoppe (rhoppe@de.ibm.com)7 */8 9#ifndef __HMCDRV_FTP_H__10#define __HMCDRV_FTP_H__11 12#include <linux/types.h> /* size_t, loff_t */13 14/*15 * HMC drive FTP Service max. length of path (w/ EOS)16 */17#define HMCDRV_FTP_FIDENT_MAX 19218 19/**20 * enum hmcdrv_ftp_cmdid - HMC drive FTP commands21 * @HMCDRV_FTP_NOOP: do nothing (only for probing)22 * @HMCDRV_FTP_GET: read a file23 * @HMCDRV_FTP_PUT: (over-) write a file24 * @HMCDRV_FTP_APPEND: append to a file25 * @HMCDRV_FTP_DIR: list directory long (ls -l)26 * @HMCDRV_FTP_NLIST: list files, no directories (name list)27 * @HMCDRV_FTP_DELETE: delete a file28 * @HMCDRV_FTP_CANCEL: cancel operation (SCLP/LPAR only)29 */30enum hmcdrv_ftp_cmdid {31 HMCDRV_FTP_NOOP = 0,32 HMCDRV_FTP_GET = 1,33 HMCDRV_FTP_PUT = 2,34 HMCDRV_FTP_APPEND = 3,35 HMCDRV_FTP_DIR = 4,36 HMCDRV_FTP_NLIST = 5,37 HMCDRV_FTP_DELETE = 6,38 HMCDRV_FTP_CANCEL = 739};40 41/**42 * struct hmcdrv_ftp_cmdspec - FTP command specification43 * @id: FTP command ID44 * @ofs: offset in file45 * @fname: filename (ASCII), null-terminated46 * @buf: kernel-space transfer data buffer, 4k aligned47 * @len: (max) number of bytes to transfer from/to @buf48 */49struct hmcdrv_ftp_cmdspec {50 enum hmcdrv_ftp_cmdid id;51 loff_t ofs;52 const char *fname;53 void __kernel *buf;54 size_t len;55};56 57int hmcdrv_ftp_startup(void);58void hmcdrv_ftp_shutdown(void);59int hmcdrv_ftp_probe(void);60ssize_t hmcdrv_ftp_do(const struct hmcdrv_ftp_cmdspec *ftp);61ssize_t hmcdrv_ftp_cmd(char __kernel *cmd, loff_t offset,62 char __user *buf, size_t len);63 64#endif /* __HMCDRV_FTP_H__ */65