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