qeth_eddp.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * linux/drivers/s390/net/qeth_eddp.h
  3. *
  4. * Header file for qeth enhanced device driver packing.
  5. *
  6. * Copyright 2004 IBM Corporation
  7. *
  8. * Author(s): Thomas Spatzier <tspat@de.ibm.com>
  9. *
  10. */
  11. #ifndef __QETH_EDDP_H__
  12. #define __QETH_EDDP_H__
  13. struct qeth_eddp_element {
  14. u32 flags;
  15. u32 length;
  16. void *addr;
  17. };
  18. struct qeth_eddp_context {
  19. atomic_t refcnt;
  20. enum qeth_large_send_types type;
  21. int num_pages; /* # of allocated pages */
  22. u8 **pages; /* pointers to pages */
  23. int offset; /* offset in ctx during creation */
  24. int num_elements; /* # of required 'SBALEs' */
  25. struct qeth_eddp_element *elements; /* array of 'SBALEs' */
  26. int elements_per_skb; /* # of 'SBALEs' per skb **/
  27. };
  28. struct qeth_eddp_context_reference {
  29. struct list_head list;
  30. struct qeth_eddp_context *ctx;
  31. };
  32. extern struct qeth_eddp_context *
  33. qeth_eddp_create_context(struct qeth_card *,struct sk_buff *,
  34. struct qeth_hdr *, unsigned char);
  35. extern void
  36. qeth_eddp_put_context(struct qeth_eddp_context *);
  37. extern int
  38. qeth_eddp_fill_buffer(struct qeth_qdio_out_q *,struct qeth_eddp_context *,int);
  39. extern void
  40. qeth_eddp_buf_release_contexts(struct qeth_qdio_out_buffer *);
  41. extern int
  42. qeth_eddp_check_buffers_for_context(struct qeth_qdio_out_q *,
  43. struct qeth_eddp_context *);
  44. /*
  45. * Data used for fragmenting a IP packet.
  46. */
  47. struct qeth_eddp_data {
  48. struct qeth_hdr qh;
  49. struct ethhdr mac;
  50. __be16 vlan[2];
  51. union {
  52. struct {
  53. struct iphdr h;
  54. u8 options[40];
  55. } ip4;
  56. struct {
  57. struct ipv6hdr h;
  58. } ip6;
  59. } nh;
  60. u8 nhl;
  61. void *nh_in_ctx; /* address of nh within the ctx */
  62. union {
  63. struct {
  64. struct tcphdr h;
  65. u8 options[40];
  66. } tcp;
  67. } th;
  68. u8 thl;
  69. void *th_in_ctx; /* address of th within the ctx */
  70. struct sk_buff *skb;
  71. int skb_offset;
  72. int frag;
  73. int frag_offset;
  74. } __attribute__ ((packed));
  75. #endif /* __QETH_EDDP_H__ */