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 | |
13 | #ifndef __CXGB3I_H__ |
14 | #define __CXGB3I_H__ |
15 | |
16 | #define CXGB3I_SCSI_HOST_QDEPTH 1024 |
17 | #define CXGB3I_MAX_LUN 512 |
18 | #define ISCSI_PDU_NONPAYLOAD_MAX \ |
19 | (sizeof(struct iscsi_hdr) + ISCSI_MAX_AHS_SIZE + 2*ISCSI_DIGEST_SIZE) |
20 | |
21 | /*for TX: a skb must have a headroom of at least TX_HEADER_LEN bytes */ |
22 | #define \ |
23 | (sizeof(struct tx_data_wr) + sizeof(struct sge_opaque_hdr)) |
24 | |
25 | extern cxgb3_cpl_handler_func cxgb3i_cpl_handlers[NUM_CPL_CMDS]; |
26 | |
27 | static inline unsigned int cxgb3i_get_private_ipv4addr(struct net_device *ndev) |
28 | { |
29 | return ((struct port_info *)(netdev_priv(dev: ndev)))->iscsi_ipv4addr; |
30 | } |
31 | |
32 | static inline void cxgb3i_set_private_ipv4addr(struct net_device *ndev, |
33 | unsigned int addr) |
34 | { |
35 | struct port_info *pi = (struct port_info *)netdev_priv(dev: ndev); |
36 | |
37 | pi->iscsic.flags = addr ? 1 : 0; |
38 | pi->iscsi_ipv4addr = addr; |
39 | if (addr) |
40 | memcpy(pi->iscsic.mac_addr, ndev->dev_addr, ETH_ALEN); |
41 | } |
42 | |
43 | struct { |
44 | union opcode_tid ; |
45 | u16 ; |
46 | u16 ; |
47 | u32 ; |
48 | u16 ; |
49 | u8 ; |
50 | u8 ; |
51 | }; |
52 | |
53 | struct { |
54 | union opcode_tid ; |
55 | u16 ; |
56 | u16 ; |
57 | u32 ; |
58 | u32 ; |
59 | u32 ; |
60 | u32 ; |
61 | }; |
62 | #endif |
63 | |