[go: nahoru, domu]

14d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray/*
2a02d44a02bd2b3f3848f30e335adc3c076b3f905Divy Le Ray * Copyright (c) 2003-2008 Chelsio, Inc. All rights reserved.
34d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray *
41d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray * This software is available to you under a choice of one of two
51d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray * licenses.  You may choose to be licensed under the terms of the GNU
61d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray * General Public License (GPL) Version 2, available from the file
71d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray * COPYING in the main directory of this source tree, or the
81d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray * OpenIB.org BSD license below:
94d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray *
101d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray *     Redistribution and use in source and binary forms, with or
111d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray *     without modification, are permitted provided that the following
121d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray *     conditions are met:
131d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray *
141d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray *      - Redistributions of source code must retain the above
151d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray *        copyright notice, this list of conditions and the following
161d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray *        disclaimer.
171d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray *
181d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray *      - Redistributions in binary form must reproduce the above
191d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray *        copyright notice, this list of conditions and the following
201d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray *        disclaimer in the documentation and/or other materials
211d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray *        provided with the distribution.
221d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray *
231d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
241d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
251d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
261d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
271d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
281d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
291d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
301d68e93d65d63814388d1a0b3de028de6dc27ae0Divy Le Ray * SOFTWARE.
314d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray */
324d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray#ifndef __CHIOCTL_H__
334d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray#define __CHIOCTL_H__
344d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
354d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray/*
364d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray * Ioctl commands specific to this driver.
374d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray */
384d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Rayenum {
391825494a7ec6c0fed0a7dfb1646e84402979743eDivy Le Ray	CHELSIO_GETMTUTAB 		= 1029,
401825494a7ec6c0fed0a7dfb1646e84402979743eDivy Le Ray	CHELSIO_SETMTUTAB 		= 1030,
411825494a7ec6c0fed0a7dfb1646e84402979743eDivy Le Ray	CHELSIO_SET_PM 			= 1032,
421825494a7ec6c0fed0a7dfb1646e84402979743eDivy Le Ray	CHELSIO_GET_PM			= 1033,
431825494a7ec6c0fed0a7dfb1646e84402979743eDivy Le Ray	CHELSIO_GET_MEM			= 1038,
441825494a7ec6c0fed0a7dfb1646e84402979743eDivy Le Ray	CHELSIO_LOAD_FW			= 1041,
451825494a7ec6c0fed0a7dfb1646e84402979743eDivy Le Ray	CHELSIO_SET_TRACE_FILTER	= 1044,
461825494a7ec6c0fed0a7dfb1646e84402979743eDivy Le Ray	CHELSIO_SET_QSET_PARAMS		= 1045,
471825494a7ec6c0fed0a7dfb1646e84402979743eDivy Le Ray	CHELSIO_GET_QSET_PARAMS		= 1046,
481825494a7ec6c0fed0a7dfb1646e84402979743eDivy Le Ray	CHELSIO_SET_QSET_NUM		= 1047,
491825494a7ec6c0fed0a7dfb1646e84402979743eDivy Le Ray	CHELSIO_GET_QSET_NUM		= 1048,
504d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray};
514d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
524d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Raystruct ch_reg {
534d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t cmd;
544d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t addr;
554d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t val;
564d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray};
574d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
584d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Raystruct ch_cntxt {
594d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t cmd;
604d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t cntxt_type;
614d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t cntxt_id;
624d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t data[4];
634d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray};
644d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
654d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray/* context types */
664d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Rayenum { CNTXT_TYPE_EGRESS, CNTXT_TYPE_FL, CNTXT_TYPE_RSP, CNTXT_TYPE_CQ };
674d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
684d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Raystruct ch_desc {
694d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t cmd;
704d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t queue_num;
714d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t idx;
724d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t size;
734d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint8_t data[128];
744d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray};
754d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
764d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Raystruct ch_mem_range {
774d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t cmd;
784d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t mem_id;
794d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t addr;
804d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t len;
814d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t version;
824d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint8_t buf[0];
834d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray};
844d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
854d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Raystruct ch_qset_params {
864d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t cmd;
874d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t qset_idx;
884d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	int32_t txq_size[3];
894d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	int32_t rspq_size;
904d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	int32_t fl_size[2];
914d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	int32_t intr_lat;
924d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	int32_t polling;
93b47385bd4f67481a7dbfcf1b4b82e9a67ecb846cDivy Le Ray	int32_t lro;
944d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	int32_t cong_thres;
958c26376112fb4b8dfea42069b602c03d53366052Divy Le Ray	int32_t  vector;
968c26376112fb4b8dfea42069b602c03d53366052Divy Le Ray	int32_t  qnum;
974d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray};
984d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
994d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Raystruct ch_pktsched_params {
1004d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t cmd;
1014d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint8_t sched;
1024d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint8_t idx;
1034d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint8_t min;
1044d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint8_t max;
1054d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint8_t binding;
1064d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray};
1074d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
1084d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray#ifndef TCB_SIZE
1094d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray# define TCB_SIZE   128
1104d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray#endif
1114d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
1124d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray/* TCB size in 32-bit words */
1134d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray#define TCB_WORDS (TCB_SIZE / 4)
1144d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
1154d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Rayenum { MEM_CM, MEM_PMRX, MEM_PMTX };	/* ch_mem_range.mem_id values */
1164d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
1174d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Raystruct ch_mtus {
1184d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t cmd;
1194d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t nmtus;
1204d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint16_t mtus[NMTUS];
1214d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray};
1224d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
1234d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Raystruct ch_pm {
1244d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t cmd;
1254d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t tx_pg_sz;
1264d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t tx_num_pg;
1274d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t rx_pg_sz;
1284d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t rx_num_pg;
1294d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t pm_total;
1304d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray};
1314d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
1324d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Raystruct ch_tcam {
1334d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t cmd;
1344d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t tcam_size;
1354d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t nservers;
1364d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t nroutes;
1374d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t nfilters;
1384d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray};
1394d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
1404d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Raystruct ch_tcb {
1414d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t cmd;
1424d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t tcb_index;
1434d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t tcb_data[TCB_WORDS];
1444d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray};
1454d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
1464d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Raystruct ch_tcam_word {
1474d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t cmd;
1484d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t addr;
1494d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t buf[3];
1504d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray};
1514d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
1524d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Raystruct ch_trace {
1534d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t cmd;
1544d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t sip;
1554d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t sip_mask;
1564d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t dip;
1574d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t dip_mask;
1584d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint16_t sport;
1594d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint16_t sport_mask;
1604d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint16_t dport;
1614d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint16_t dport_mask;
1624d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t vlan:12;
1634d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t vlan_mask:12;
1644d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t intf:4;
1654d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint32_t intf_mask:4;
1664d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint8_t proto;
1674d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint8_t proto_mask;
1684d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint8_t invert_match:1;
1694d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint8_t config_tx:1;
1704d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint8_t config_rx:1;
1714d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint8_t trace_tx:1;
1724d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray	uint8_t trace_rx:1;
1734d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray};
1744d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
1754d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray#define SIOCCHIOCTL SIOCDEVPRIVATE
1764d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray
1774d22de3e6cc4a09c369b504cd8bcde3385a974cdDivy Le Ray#endif
178