cxgb3i.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * cxgb3i.h: Chelsio S3xx iSCSI driver.
  3. *
  4. * Copyright (c) 2008-2015 Chelsio Communications, Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation.
  9. *
  10. * Written by: Karen Xie (kxie@chelsio.com)
  11. */
  12. #ifndef __CXGB3I_H__
  13. #define __CXGB3I_H__
  14. #define CXGB3I_SCSI_HOST_QDEPTH 1024
  15. #define CXGB3I_MAX_LUN 512
  16. #define ISCSI_PDU_NONPAYLOAD_MAX \
  17. (sizeof(struct iscsi_hdr) + ISCSI_MAX_AHS_SIZE + 2*ISCSI_DIGEST_SIZE)
  18. /*for TX: a skb must have a headroom of at least TX_HEADER_LEN bytes */
  19. #define CXGB3I_TX_HEADER_LEN \
  20. (sizeof(struct tx_data_wr) + sizeof(struct sge_opaque_hdr))
  21. extern cxgb3_cpl_handler_func cxgb3i_cpl_handlers[NUM_CPL_CMDS];
  22. static inline unsigned int cxgb3i_get_private_ipv4addr(struct net_device *ndev)
  23. {
  24. return ((struct port_info *)(netdev_priv(ndev)))->iscsi_ipv4addr;
  25. }
  26. static inline void cxgb3i_set_private_ipv4addr(struct net_device *ndev,
  27. unsigned int addr)
  28. {
  29. struct port_info *pi = (struct port_info *)netdev_priv(ndev);
  30. pi->iscsic.flags = addr ? 1 : 0;
  31. pi->iscsi_ipv4addr = addr;
  32. if (addr)
  33. memcpy(pi->iscsic.mac_addr, ndev->dev_addr, ETH_ALEN);
  34. }
  35. struct cpl_iscsi_hdr_norss {
  36. union opcode_tid ot;
  37. u16 pdu_len_ddp;
  38. u16 len;
  39. u32 seq;
  40. u16 urg;
  41. u8 rsvd;
  42. u8 status;
  43. };
  44. struct cpl_rx_data_ddp_norss {
  45. union opcode_tid ot;
  46. u16 urg;
  47. u16 len;
  48. u32 seq;
  49. u32 nxt_seq;
  50. u32 ulp_crc;
  51. u32 ddp_status;
  52. };
  53. #endif