cxgb_ctl_defs.h revision 237263
1117404Skan/*
2169706Skan * Copyright (C) 2003-2006 Chelsio Communications.  All rights reserved.
390075Sobrien *
490075Sobrien * This program is distributed in the hope that it will be useful, but WITHOUT
5132746Skan * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
690075Sobrien * FITNESS FOR A PARTICULAR PURPOSE.  See the LICENSE file included in this
7132746Skan * release for licensing terms and conditions.
890075Sobrien *
990075Sobrien * $FreeBSD: head/sys/dev/cxgb/common/cxgb_ctl_defs.h 237263 2012-06-19 07:34:13Z np $
1090075Sobrien */
1190075Sobrien
12132746Skan#ifndef _CXGB3_OFFLOAD_CTL_DEFS_H
1390075Sobrien#define _CXGB3_OFFLOAD_CTL_DEFS_H
1490075Sobrien
1590075Sobrienenum {
1690075Sobrien	GET_MAX_OUTSTANDING_WR,
1790075Sobrien	GET_TX_MAX_CHUNK,
18132746Skan	GET_TID_RANGE,
19169706Skan	GET_STID_RANGE,
20169706Skan	GET_RTBL_RANGE,
2190075Sobrien	GET_L2T_CAPACITY,
22103261Sobrien	GET_MTUS,
2390075Sobrien	GET_WR_LEN,
24132746Skan	GET_IFF_FROM_MAC,
25132746Skan	GET_DDP_PARAMS,
26132746Skan	GET_PORTS,
27132746Skan
28107599Sobrien	ULP_ISCSI_GET_PARAMS,
29174482Smarius	ULP_ISCSI_SET_PARAMS,
30174482Smarius
31103261Sobrien	RDMA_GET_PARAMS,
32123546Sobrien	RDMA_CQ_OP,
33123546Sobrien	RDMA_CQ_SETUP,
34123546Sobrien	RDMA_CQ_DISABLE,
35123546Sobrien	RDMA_CTRL_QP_SETUP,
36123546Sobrien	RDMA_GET_MEM,
37174482Smarius
38174482Smarius	FAILOVER           = 30,
39174482Smarius	FAILOVER_DONE      = 31,
40174482Smarius	FAILOVER_CLEAR     = 32,
41174482Smarius
42123546Sobrien	GET_CPUIDX_OF_QSET = 40,
43123546Sobrien
44123546Sobrien	GET_RX_PAGE_INFO   = 50,
4596263Sobrien};
4696263Sobrien
47169706Skan/*
48236329Smarius * Structure used to describe a TID range.  Valid TIDs are [base, base+num).
4990075Sobrien */
5090075Sobrienstruct tid_range {
5190075Sobrien	unsigned int base;   /* first TID */
5290075Sobrien	unsigned int num;    /* number of TIDs in range */
5390075Sobrien};
54132746Skan
55236329Smarius/*
56236329Smarius * Structure used to request the size and contents of the MTU table.
57236329Smarius */
5890075Sobrienstruct mtutab {
5990075Sobrien	unsigned int size;          /* # of entries in the MTU table */
6090075Sobrien	const unsigned short *mtus; /* the MTU table values */
6190075Sobrien};
6290075Sobrien
6390075Sobrien/*
6490075Sobrien * Structure used to request the ifnet that owns a given MAC address.
6590075Sobrien */
6690075Sobrienstruct iff_mac {
6790075Sobrien	struct ifnet *dev;
6890075Sobrien	const unsigned char *mac_addr;
6990075Sobrien	u16 vlan_tag;
7090075Sobrien};
7190075Sobrien
7290075Sobrienstruct pci_dev;
73117404Skan
74117404Skan/*
7590075Sobrien * Structure used to request the TCP DDP parameters.
7690075Sobrien */
7790075Sobrienstruct ddp_params {
7890075Sobrien	unsigned int llimit;     /* TDDP region start address */
7990075Sobrien	unsigned int ulimit;     /* TDDP region end address */
8090075Sobrien	unsigned int tag_mask;   /* TDDP tag mask */
8190075Sobrien	struct pci_dev *pdev;
8290075Sobrien};
8390075Sobrien
8490075Sobrienstruct adap_ports {
8590075Sobrien	unsigned int nports;     /* number of ports on this adapter */
8690075Sobrien	struct ifnet *lldevs[MAX_NPORTS];
8790075Sobrien};
8890075Sobrien
8990075Sobrien/*
9090075Sobrien * Structure used to return information to the iscsi layer.
9190075Sobrien */
9290075Sobrienstruct ulp_iscsi_info {
9390075Sobrien	unsigned int	offset;
9490075Sobrien	unsigned int	llimit;
9590075Sobrien	unsigned int	ulimit;
9690075Sobrien	unsigned int	tagmask;
9790075Sobrien	unsigned int	pgsz3;
9890075Sobrien	unsigned int	pgsz2;
9996263Sobrien	unsigned int	pgsz1;
10096263Sobrien	unsigned int	pgsz0;
10190075Sobrien	unsigned int	max_rxsz;
10290075Sobrien	unsigned int	max_txsz;
10390075Sobrien	struct pci_dev	*pdev;
10490075Sobrien};
10596263Sobrien
10690075Sobrien/*
107132746Skan * Offload TX/RX page information.
108106442Sobrien */
109106442Sobrienstruct ofld_page_info {
110106442Sobrien	unsigned int page_size;  /* Page size, should be a power of 2 */
111106442Sobrien	unsigned int num;        /* Number of pages */
112106442Sobrien};
113106442Sobrien
114106442Sobrien/*
115106442Sobrien * Structure used to return information to the RDMA layer.
116106442Sobrien */
117106442Sobrienstruct rdma_info {
118106442Sobrien	unsigned int tpt_base;   /* TPT base address */
119106442Sobrien	unsigned int tpt_top;	 /* TPT last entry address */
120106442Sobrien	unsigned int pbl_base;   /* PBL base address */
121106442Sobrien	unsigned int pbl_top;	 /* PBL last entry address */
122106442Sobrien	unsigned int rqt_base;   /* RQT base address */
123106442Sobrien	unsigned int rqt_top;	 /* RQT last entry address */
124106442Sobrien	unsigned int udbell_len; /* user doorbell region length */
125106442Sobrien	unsigned long udbell_physbase;  /* user doorbell physical start addr */
126106442Sobrien	void *kdb_addr;  /* kernel doorbell register address */
127106442Sobrien	struct device *pdev;    /* associated PCI device */
128106442Sobrien};
129106442Sobrien
130106442Sobrien/*
13190075Sobrien * Structure used to request an operation on an RDMA completion queue.
132106442Sobrien */
13390075Sobrienstruct rdma_cq_op {
13490075Sobrien	unsigned int id;
13596263Sobrien	unsigned int op;
13696263Sobrien	unsigned int credits;
13790075Sobrien};
13890075Sobrien
13990075Sobrien/*
14090075Sobrien * Structure used to setup RDMA completion queues.
14190075Sobrien */
14290075Sobrienstruct rdma_cq_setup {
14390075Sobrien	unsigned int id;
14490075Sobrien	unsigned long long base_addr;
14590075Sobrien	unsigned int size;
146132746Skan	unsigned int credits;
14790075Sobrien	unsigned int credit_thres;
14890075Sobrien	unsigned int ovfl_mode;
14990075Sobrien};
15090075Sobrien
15190075Sobrien/*
15290075Sobrien * Structure used to setup the RDMA control egress context.
15390075Sobrien */
15490075Sobrienstruct rdma_ctrlqp_setup {
15590075Sobrien	unsigned long long base_addr;
15690075Sobrien	unsigned int size;
15790075Sobrien};
15890075Sobrien#endif /* _CXGB3_OFFLOAD_CTL_DEFS_H */
15990075Sobrien