request.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #include <linux/list.h>
  2. #include <linux/types.h>
  3. #include <linux/uio.h>
  4. #include <linux/wait.h>
  5. struct smb_request {
  6. struct list_head rq_queue; /* recvq or xmitq for the server */
  7. atomic_t rq_count;
  8. wait_queue_head_t rq_wait;
  9. int rq_flags;
  10. int rq_mid; /* multiplex ID, set by request.c */
  11. struct smb_sb_info *rq_server;
  12. /* header + word count + parameter words + byte count */
  13. unsigned char rq_header[SMB_HEADER_LEN + 20*2 + 2];
  14. int rq_bufsize;
  15. unsigned char *rq_buffer;
  16. /* FIXME: this is not good enough for merging IO requests. */
  17. unsigned char *rq_page;
  18. int rq_rsize;
  19. int rq_resp_wct;
  20. int rq_resp_bcc;
  21. int rq_rlen;
  22. int rq_bytes_recvd;
  23. int rq_slen;
  24. int rq_bytes_sent;
  25. int rq_iovlen;
  26. struct kvec rq_iov[4];
  27. int (*rq_setup_read) (struct smb_request *);
  28. void (*rq_callback) (struct smb_request *);
  29. /* ------ trans2 stuff ------ */
  30. u16 rq_trans2_command; /* 0 if not a trans2 request */
  31. unsigned int rq_ldata;
  32. unsigned char *rq_data;
  33. unsigned int rq_lparm;
  34. unsigned char *rq_parm;
  35. int rq_fragment;
  36. u32 rq_total_data;
  37. u32 rq_total_parm;
  38. int rq_trans2bufsize;
  39. unsigned char *rq_trans2buffer;
  40. /* ------ response ------ */
  41. unsigned short rq_rcls;
  42. unsigned short rq_err;
  43. int rq_errno;
  44. };
  45. #define SMB_REQ_STATIC 0x0001 /* rq_buffer is static */
  46. #define SMB_REQ_NORETRY 0x0002 /* request is invalid after retry */
  47. #define SMB_REQ_TRANSMITTED 0x4000 /* all data has been sent */
  48. #define SMB_REQ_RECEIVED 0x8000 /* reply received, smbiod is done */
  49. #define xSMB_REQ_NOREPLY 0x0004 /* we don't want the reply (if any) */
  50. #define xSMB_REQ_NORECEIVER 0x0008 /* caller doesn't wait for response */