hmcdrv_ftp.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * SE/HMC Drive FTP Services
  3. *
  4. * Copyright IBM Corp. 2013
  5. * Author(s): Ralf Hoppe (rhoppe@de.ibm.com)
  6. */
  7. #ifndef __HMCDRV_FTP_H__
  8. #define __HMCDRV_FTP_H__
  9. #include <linux/types.h> /* size_t, loff_t */
  10. /*
  11. * HMC drive FTP Service max. length of path (w/ EOS)
  12. */
  13. #define HMCDRV_FTP_FIDENT_MAX 192
  14. /**
  15. * enum hmcdrv_ftp_cmdid - HMC drive FTP commands
  16. * @HMCDRV_FTP_NOOP: do nothing (only for probing)
  17. * @HMCDRV_FTP_GET: read a file
  18. * @HMCDRV_FTP_PUT: (over-) write a file
  19. * @HMCDRV_FTP_APPEND: append to a file
  20. * @HMCDRV_FTP_DIR: list directory long (ls -l)
  21. * @HMCDRV_FTP_NLIST: list files, no directories (name list)
  22. * @HMCDRV_FTP_DELETE: delete a file
  23. * @HMCDRV_FTP_CANCEL: cancel operation (SCLP/LPAR only)
  24. */
  25. enum hmcdrv_ftp_cmdid {
  26. HMCDRV_FTP_NOOP = 0,
  27. HMCDRV_FTP_GET = 1,
  28. HMCDRV_FTP_PUT = 2,
  29. HMCDRV_FTP_APPEND = 3,
  30. HMCDRV_FTP_DIR = 4,
  31. HMCDRV_FTP_NLIST = 5,
  32. HMCDRV_FTP_DELETE = 6,
  33. HMCDRV_FTP_CANCEL = 7
  34. };
  35. /**
  36. * struct hmcdrv_ftp_cmdspec - FTP command specification
  37. * @id: FTP command ID
  38. * @ofs: offset in file
  39. * @fname: filename (ASCII), null-terminated
  40. * @buf: kernel-space transfer data buffer, 4k aligned
  41. * @len: (max) number of bytes to transfer from/to @buf
  42. */
  43. struct hmcdrv_ftp_cmdspec {
  44. enum hmcdrv_ftp_cmdid id;
  45. loff_t ofs;
  46. const char *fname;
  47. void __kernel *buf;
  48. size_t len;
  49. };
  50. int hmcdrv_ftp_startup(void);
  51. void hmcdrv_ftp_shutdown(void);
  52. int hmcdrv_ftp_probe(void);
  53. ssize_t hmcdrv_ftp_do(const struct hmcdrv_ftp_cmdspec *ftp);
  54. ssize_t hmcdrv_ftp_cmd(char __kernel *cmd, loff_t offset,
  55. char __user *buf, size_t len);
  56. #endif /* __HMCDRV_FTP_H__ */