fcoe.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright(c) 2009 Intel Corporation. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms and conditions of the GNU General Public License,
  6. * version 2, as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope it will be useful, but WITHOUT
  9. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. * more details.
  12. *
  13. * You should have received a copy of the GNU General Public License along with
  14. * this program; if not, write to the Free Software Foundation, Inc.,
  15. * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  16. *
  17. * Maintained at www.Open-FCoE.org
  18. */
  19. #ifndef _FCOE_H_
  20. #define _FCOE_H_
  21. #include <linux/skbuff.h>
  22. #include <linux/kthread.h>
  23. #define FCOE_MAX_QUEUE_DEPTH 256
  24. #define FCOE_LOW_QUEUE_DEPTH 32
  25. /* destination address mode */
  26. #define FCOE_GW_ADDR_MODE 0x00
  27. #define FCOE_FCOUI_ADDR_MODE 0x01
  28. #define FCOE_WORD_TO_BYTE 4
  29. #define FCOE_VERSION "0.1"
  30. #define FCOE_NAME "fcoe"
  31. #define FCOE_VENDOR "Open-FCoE.org"
  32. #define FCOE_MAX_LUN 255
  33. #define FCOE_MAX_FCP_TARGET 256
  34. #define FCOE_MAX_OUTSTANDING_COMMANDS 1024
  35. #define FCOE_MIN_XID 0x0001 /* the min xid supported by fcoe_sw */
  36. #define FCOE_MAX_XID 0x07ef /* the max xid supported by fcoe_sw */
  37. /*
  38. * this percpu struct for fcoe
  39. */
  40. struct fcoe_percpu_s {
  41. struct task_struct *thread;
  42. struct sk_buff_head fcoe_rx_list;
  43. struct page *crc_eof_page;
  44. int crc_eof_offset;
  45. };
  46. /*
  47. * the fcoe sw transport private data
  48. */
  49. struct fcoe_softc {
  50. struct list_head list;
  51. struct fc_lport *lp;
  52. struct net_device *real_dev;
  53. struct net_device *phys_dev; /* device with ethtool_ops */
  54. struct packet_type fcoe_packet_type;
  55. struct sk_buff_head fcoe_pending_queue;
  56. u8 fcoe_pending_queue_active;
  57. u8 dest_addr[ETH_ALEN];
  58. u8 ctl_src_addr[ETH_ALEN];
  59. u8 data_src_addr[ETH_ALEN];
  60. /*
  61. * fcoe protocol address learning related stuff
  62. */
  63. u16 flogi_oxid;
  64. u8 flogi_progress;
  65. u8 address_mode;
  66. };
  67. static inline struct net_device *fcoe_netdev(
  68. const struct fc_lport *lp)
  69. {
  70. return ((struct fcoe_softc *)lport_priv(lp))->real_dev;
  71. }
  72. #endif /* _FCOE_H_ */