summaryrefslogtreecommitdiffstats
path: root/sys/dev/cxgb/cxgb_ioctl.h
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2008-09-02 07:47:14 +0000
committerkmacy <kmacy@FreeBSD.org>2008-09-02 07:47:14 +0000
commit580027241503d52b1bad46521e6e7b8066e4b23b (patch)
tree90d1d82dfd8872b6e7405ef87884696dc860e725 /sys/dev/cxgb/cxgb_ioctl.h
parentb9e54556741d38f7243ad02034c16262652f2f51 (diff)
downloadFreeBSD-src-580027241503d52b1bad46521e6e7b8066e4b23b.zip
FreeBSD-src-580027241503d52b1bad46521e6e7b8066e4b23b.tar.gz
Import ioctl updates for latest rev of cxgbtool
Obtained from: Chelsio Inc. MFC after: 3 days
Diffstat (limited to 'sys/dev/cxgb/cxgb_ioctl.h')
-rw-r--r--sys/dev/cxgb/cxgb_ioctl.h181
1 files changed, 64 insertions, 117 deletions
diff --git a/sys/dev/cxgb/cxgb_ioctl.h b/sys/dev/cxgb/cxgb_ioctl.h
index 64a4ce9..7cbb746 100644
--- a/sys/dev/cxgb/cxgb_ioctl.h
+++ b/sys/dev/cxgb/cxgb_ioctl.h
@@ -37,38 +37,34 @@ $FreeBSD$
enum {
CH_SETREG = 0x40,
CH_GETREG,
- CH_SETTPI,
- CH_GETTPI,
- CH_DEVUP,
CH_GETMTUTAB,
CH_SETMTUTAB,
- CH_GETMTU,
CH_SET_PM,
CH_GET_PM,
- CH_GET_TCAM,
- CH_SET_TCAM,
- CH_GET_TCB,
CH_READ_TCAM_WORD,
CH_GET_MEM,
CH_GET_SGE_CONTEXT,
CH_GET_SGE_DESC,
CH_LOAD_FW,
- CH_GET_PROTO,
- CH_SET_PROTO,
CH_SET_TRACE_FILTER,
- CH_SET_QSET_PARAMS,
CH_GET_QSET_PARAMS,
- CH_SET_QSET_NUM,
CH_GET_QSET_NUM,
CH_SET_PKTSCHED,
CH_IFCONF_GETREGS,
- CH_GETMIIREGS,
- CH_SETMIIREGS,
- CH_SET_FILTER,
+ CH_GET_MIIREG,
+ CH_SET_MIIREG,
+ CH_GET_EEPROM,
CH_SET_HW_SCHED,
- CH_DEL_FILTER,
+ CH_LOAD_BOOT,
+ CH_CLEAR_STATS,
};
+/* statistics categories */
+enum {
+ STATS_PORT = 1 << 1,
+ STATS_QUEUE = 1 << 2,
+};
+
struct ch_reg {
uint32_t addr;
uint32_t val;
@@ -84,7 +80,6 @@ struct ch_cntxt {
enum { CNTXT_TYPE_EGRESS, CNTXT_TYPE_FL, CNTXT_TYPE_RSP, CNTXT_TYPE_CQ };
struct ch_desc {
- uint32_t cmd;
uint32_t queue_num;
uint32_t idx;
uint32_t size;
@@ -92,7 +87,6 @@ struct ch_desc {
};
struct ch_mem_range {
- uint32_t cmd;
uint32_t mem_id;
uint32_t addr;
uint32_t len;
@@ -100,21 +94,22 @@ struct ch_mem_range {
uint8_t *buf;
};
+enum { MEM_CM, MEM_PMRX, MEM_PMTX }; /* ch_mem_range.mem_id values */
+
struct ch_qset_params {
- uint32_t qset_idx;
- int32_t txq_size[3];
- int32_t rspq_size;
- int32_t fl_size[2];
- int32_t intr_lat;
- int32_t polling;
- int32_t lro;
- int32_t cong_thres;
- int32_t vector;
- int32_t qnum;
+ uint32_t qset_idx;
+ int32_t txq_size[3];
+ int32_t rspq_size;
+ int32_t fl_size[2];
+ int32_t intr_lat;
+ int32_t polling;
+ int32_t lro;
+ int32_t cong_thres;
+ int32_t vector;
+ int32_t qnum;
};
struct ch_pktsched_params {
- uint32_t cmd;
uint8_t sched;
uint8_t idx;
uint8_t min;
@@ -123,56 +118,20 @@ struct ch_pktsched_params {
};
struct ch_hw_sched {
- uint32_t cmd;
uint8_t sched;
int8_t mode;
int8_t channel;
int32_t kbps; /* rate in Kbps */
int32_t class_ipg; /* tenths of nanoseconds */
- uint32_t flow_ipg; /* usec */
-};
-
-struct ch_filter_tuple {
- uint32_t sip;
- uint32_t dip;
- uint16_t sport;
- uint16_t dport;
- uint16_t vlan:12;
- uint16_t vlan_prio:3;
-};
-
-struct ch_filter {
- uint32_t cmd;
- uint32_t filter_id;
- struct ch_filter_tuple val;
- struct ch_filter_tuple mask;
- uint16_t mac_addr_idx;
- uint8_t mac_hit:1;
- uint8_t proto:2;
-
- uint8_t want_filter_id:1; /* report filter TID instead of RSS hash */
- uint8_t pass:1; /* whether to pass or drop packets */
- uint8_t rss:1; /* use RSS or specified qset */
- uint8_t qset;
+ int32_t flow_ipg; /* usec */
};
-#ifndef TCB_SIZE
-# define TCB_SIZE 128
-#endif
-
-/* TCB size in 32-bit words */
-#define TCB_WORDS (TCB_SIZE / 4)
-
-enum { MEM_CM, MEM_PMRX, MEM_PMTX }; /* ch_mem_range.mem_id values */
-
struct ch_mtus {
- uint32_t cmd;
uint32_t nmtus;
uint16_t mtus[NMTUS];
};
struct ch_pm {
- uint32_t cmd;
uint32_t tx_pg_sz;
uint32_t tx_num_pg;
uint32_t rx_pg_sz;
@@ -180,28 +139,12 @@ struct ch_pm {
uint32_t pm_total;
};
-struct ch_tcam {
- uint32_t cmd;
- uint32_t tcam_size;
- uint32_t nservers;
- uint32_t nroutes;
- uint32_t nfilters;
-};
-
-struct ch_tcb {
- uint32_t cmd;
- uint32_t tcb_index;
- uint32_t tcb_data[TCB_WORDS];
-};
-
struct ch_tcam_word {
- uint32_t cmd;
uint32_t addr;
uint32_t buf[3];
};
struct ch_trace {
- uint32_t cmd;
uint32_t sip;
uint32_t sip_mask;
uint32_t dip;
@@ -210,57 +153,61 @@ struct ch_trace {
uint16_t sport_mask;
uint16_t dport;
uint16_t dport_mask;
- uint32_t vlan:12,
- vlan_mask:12,
- intf:4,
- intf_mask:4;
+ uint32_t vlan:12;
+ uint32_t vlan_mask:12;
+ uint32_t intf:4;
+ uint32_t intf_mask:4;
uint8_t proto;
uint8_t proto_mask;
- uint8_t invert_match:1,
- config_tx:1,
- config_rx:1,
- trace_tx:1,
- trace_rx:1;
+ uint8_t invert_match:1;
+ uint8_t config_tx:1;
+ uint8_t config_rx:1;
+ uint8_t trace_tx:1;
+ uint8_t trace_rx:1;
};
#define REGDUMP_SIZE (4 * 1024)
-struct ifconf_regs {
+struct ch_ifconf_regs {
uint32_t version;
uint32_t len; /* bytes */
uint8_t *data;
};
-struct mii_data {
+struct ch_mii_data {
uint32_t phy_id;
uint32_t reg_num;
uint32_t val_in;
uint32_t val_out;
};
-#define CHELSIO_SETREG _IOW('f', CH_SETREG, struct ch_reg)
-#define CHELSIO_GETREG _IOWR('f', CH_GETREG, struct ch_reg)
-#define CHELSIO_READ_TCAM_WORD _IOR('f', CH_READ_TCAM_WORD, struct ch_tcam)
-#define CHELSIO_GET_MEM _IOWR('f', CH_GET_MEM, struct ch_mem_range)
-#define CHELSIO_GET_SGE_CONTEXT _IOWR('f', CH_GET_SGE_CONTEXT, struct ch_cntxt)
-#define CHELSIO_GET_SGE_DESC _IOWR('f', CH_GET_SGE_DESC, struct ch_desc)
-#define CHELSIO_GET_QSET_PARAMS _IOWR('f', CH_GET_QSET_PARAMS, struct ch_qset_params)
-#define CHELSIO_SET_QSET_PARAMS _IOW('f', CH_SET_QSET_PARAMS, struct ch_qset_params)
-#define CHELSIO_GET_QSET_NUM _IOWR('f', CH_GET_QSET_NUM, struct ch_reg)
-#define CHELSIO_SET_QSET_NUM _IOW('f', CH_SET_QSET_NUM, struct ch_reg)
-#define CHELSIO_GETMTUTAB _IOR('f', CH_GET_QSET_NUM, struct ch_mtus)
-#define CHELSIO_SETMTUTAB _IOW('f', CH_SET_QSET_NUM, struct ch_mtus)
-
-
-#define CHELSIO_SET_TRACE_FILTER _IOW('f', CH_SET_TRACE_FILTER, struct ch_trace)
-#define CHELSIO_SET_PKTSCHED _IOW('f', CH_SET_PKTSCHED, struct ch_pktsched_params)
-#define CHELSIO_IFCONF_GETREGS _IOWR('f', CH_IFCONF_GETREGS, struct ifconf_regs)
-#define SIOCGMIIREG _IOWR('f', CH_GETMIIREGS, struct mii_data)
-#define SIOCSMIIREG _IOWR('f', CH_SETMIIREGS, struct mii_data)
-#define CHELSIO_SET_HW_SCHED _IOWR('f', CH_SET_HW_SCHED, struct ch_hw_sched)
-#define CHELSIO_SET_FILTER _IOW('f', CH_SET_FILTER, struct ch_filter)
-#define CHELSIO_DEL_FILTER _IOW('f', CH_DEL_FILTER, struct ch_filter)
-#define CHELSIO_DEVUP _IO('f', CH_DEVUP)
-
-#define CHELSIO_GET_TCB _IOWR('f', CH_GET_TCB, struct ch_tcb)
+struct ch_eeprom {
+ uint32_t magic;
+ uint32_t offset;
+ uint32_t len;
+ uint8_t *data;
+};
+
+#define CHELSIO_SETREG _IOW('f', CH_SETREG, struct ch_reg)
+#define CHELSIO_GETREG _IOWR('f', CH_GETREG, struct ch_reg)
+#define CHELSIO_GETMTUTAB _IOR('f', CH_GETMTUTAB, struct ch_mtus)
+#define CHELSIO_SETMTUTAB _IOW('f', CH_SETMTUTAB, struct ch_mtus)
+#define CHELSIO_SET_PM _IOW('f', CH_SET_PM, struct ch_pm)
+#define CHELSIO_GET_PM _IOR('f', CH_GET_PM, struct ch_pm)
+#define CHELSIO_READ_TCAM_WORD _IOWR('f', CH_READ_TCAM_WORD, struct ch_tcam_word)
+#define CHELSIO_GET_MEM _IOWR('f', CH_GET_MEM, struct ch_mem_range)
+#define CHELSIO_GET_SGE_CONTEXT _IOWR('f', CH_GET_SGE_CONTEXT, struct ch_cntxt)
+#define CHELSIO_GET_SGE_DESC _IOWR('f', CH_GET_SGE_DESC, struct ch_desc)
+#define CHELSIO_LOAD_FW _IOWR('f', CH_LOAD_FW, struct ch_mem_range)
+#define CHELSIO_SET_TRACE_FILTER _IOW('f', CH_SET_TRACE_FILTER, struct ch_trace)
+#define CHELSIO_GET_QSET_PARAMS _IOWR('f', CH_GET_QSET_PARAMS, struct ch_qset_params)
+#define CHELSIO_GET_QSET_NUM _IOR('f', CH_GET_QSET_NUM, struct ch_reg)
+#define CHELSIO_SET_PKTSCHED _IOW('f', CH_SET_PKTSCHED, struct ch_pktsched_params)
+#define CHELSIO_SET_HW_SCHED _IOW('f', CH_SET_HW_SCHED, struct ch_hw_sched)
+#define CHELSIO_LOAD_BOOT _IOW('f', CH_LOAD_BOOT, struct ch_mem_range)
+#define CHELSIO_CLEAR_STATS _IO('f', CH_CLEAR_STATS)
+#define CHELSIO_IFCONF_GETREGS _IOWR('f', CH_IFCONF_GETREGS, struct ch_ifconf_regs)
+#define CHELSIO_GET_MIIREG _IOWR('f', CH_GET_MIIREG, struct ch_mii_data)
+#define CHELSIO_SET_MIIREG _IOW('f', CH_SET_MIIREG, struct ch_mii_data)
+#define CHELSIO_GET_EEPROM _IOWR('f', CH_GET_EEPROM, struct ch_eeprom)
#endif
OpenPOWER on IntegriCloud