aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mlx4/cmd.h2
-rw-r--r--include/linux/mlx4/device.h35
-rw-r--r--include/linux/mlx4/driver.h9
-rw-r--r--include/linux/mlx4/qp.h9
4 files changed, 51 insertions, 4 deletions
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index 0f82293a82ed..ddbe81261d5d 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -57,6 +57,7 @@ enum {
57 MLX4_CMD_QUERY_PORT = 0x43, 57 MLX4_CMD_QUERY_PORT = 0x43,
58 MLX4_CMD_SENSE_PORT = 0x4d, 58 MLX4_CMD_SENSE_PORT = 0x4d,
59 MLX4_CMD_SET_PORT = 0xc, 59 MLX4_CMD_SET_PORT = 0xc,
60 MLX4_CMD_SET_NODE = 0x5a,
60 MLX4_CMD_ACCESS_DDR = 0x2e, 61 MLX4_CMD_ACCESS_DDR = 0x2e,
61 MLX4_CMD_MAP_ICM = 0xffa, 62 MLX4_CMD_MAP_ICM = 0xffa,
62 MLX4_CMD_UNMAP_ICM = 0xff9, 63 MLX4_CMD_UNMAP_ICM = 0xff9,
@@ -140,6 +141,7 @@ enum {
140 MLX4_SET_PORT_MAC_TABLE = 0x2, 141 MLX4_SET_PORT_MAC_TABLE = 0x2,
141 MLX4_SET_PORT_VLAN_TABLE = 0x3, 142 MLX4_SET_PORT_VLAN_TABLE = 0x3,
142 MLX4_SET_PORT_PRIO_MAP = 0x4, 143 MLX4_SET_PORT_PRIO_MAP = 0x4,
144 MLX4_SET_PORT_GID_TABLE = 0x5,
143}; 145};
144 146
145struct mlx4_dev; 147struct mlx4_dev;
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 7a7f9c1e679a..897ec71a0ca5 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -67,7 +67,8 @@ enum {
67 MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, 67 MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18,
68 MLX4_DEV_CAP_FLAG_RAW_MCAST = 1 << 19, 68 MLX4_DEV_CAP_FLAG_RAW_MCAST = 1 << 19,
69 MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1 << 20, 69 MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1 << 20,
70 MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21 70 MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21,
71 MLX4_DEV_CAP_FLAG_IBOE = 1 << 30
71}; 72};
72 73
73enum { 74enum {
@@ -171,6 +172,10 @@ enum {
171 MLX4_NUM_FEXCH = 64 * 1024, 172 MLX4_NUM_FEXCH = 64 * 1024,
172}; 173};
173 174
175enum {
176 MLX4_MAX_FAST_REG_PAGES = 511,
177};
178
174static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) 179static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor)
175{ 180{
176 return (major << 32) | (minor << 16) | subminor; 181 return (major << 32) | (minor << 16) | subminor;
@@ -373,6 +378,27 @@ struct mlx4_av {
373 u8 dgid[16]; 378 u8 dgid[16];
374}; 379};
375 380
381struct mlx4_eth_av {
382 __be32 port_pd;
383 u8 reserved1;
384 u8 smac_idx;
385 u16 reserved2;
386 u8 reserved3;
387 u8 gid_index;
388 u8 stat_rate;
389 u8 hop_limit;
390 __be32 sl_tclass_flowlabel;
391 u8 dgid[16];
392 u32 reserved4[2];
393 __be16 vlan;
394 u8 mac[6];
395};
396
397union mlx4_ext_av {
398 struct mlx4_av ib;
399 struct mlx4_eth_av eth;
400};
401
376struct mlx4_dev { 402struct mlx4_dev {
377 struct pci_dev *pdev; 403 struct pci_dev *pdev;
378 unsigned long flags; 404 unsigned long flags;
@@ -401,6 +427,12 @@ struct mlx4_init_port_param {
401 if (((type) == MLX4_PORT_TYPE_IB ? (dev)->caps.port_mask : \ 427 if (((type) == MLX4_PORT_TYPE_IB ? (dev)->caps.port_mask : \
402 ~(dev)->caps.port_mask) & 1 << ((port) - 1)) 428 ~(dev)->caps.port_mask) & 1 << ((port) - 1))
403 429
430#define mlx4_foreach_ib_transport_port(port, dev) \
431 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
432 if (((dev)->caps.port_mask & 1 << ((port) - 1)) || \
433 ((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE))
434
435
404int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct, 436int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct,
405 struct mlx4_buf *buf); 437 struct mlx4_buf *buf);
406void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf); 438void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf);
@@ -468,6 +500,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]);
468int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index); 500int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index);
469void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index); 501void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index);
470 502
503int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx);
471int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); 504int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index);
472void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index); 505void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, int index);
473 506
diff --git a/include/linux/mlx4/driver.h b/include/linux/mlx4/driver.h
index 53c5fdb6eac4..f407cd4bfb34 100644
--- a/include/linux/mlx4/driver.h
+++ b/include/linux/mlx4/driver.h
@@ -44,15 +44,24 @@ enum mlx4_dev_event {
44 MLX4_DEV_EVENT_PORT_REINIT, 44 MLX4_DEV_EVENT_PORT_REINIT,
45}; 45};
46 46
47enum mlx4_protocol {
48 MLX4_PROTOCOL_IB,
49 MLX4_PROTOCOL_EN,
50};
51
47struct mlx4_interface { 52struct mlx4_interface {
48 void * (*add) (struct mlx4_dev *dev); 53 void * (*add) (struct mlx4_dev *dev);
49 void (*remove)(struct mlx4_dev *dev, void *context); 54 void (*remove)(struct mlx4_dev *dev, void *context);
50 void (*event) (struct mlx4_dev *dev, void *context, 55 void (*event) (struct mlx4_dev *dev, void *context,
51 enum mlx4_dev_event event, int port); 56 enum mlx4_dev_event event, int port);
57 void * (*get_dev)(struct mlx4_dev *dev, void *context, u8 port);
52 struct list_head list; 58 struct list_head list;
59 enum mlx4_protocol protocol;
53}; 60};
54 61
55int mlx4_register_interface(struct mlx4_interface *intf); 62int mlx4_register_interface(struct mlx4_interface *intf);
56void mlx4_unregister_interface(struct mlx4_interface *intf); 63void mlx4_unregister_interface(struct mlx4_interface *intf);
57 64
65void *mlx4_get_protocol_dev(struct mlx4_dev *dev, enum mlx4_protocol proto, int port);
66
58#endif /* MLX4_DRIVER_H */ 67#endif /* MLX4_DRIVER_H */
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 7abe64326f72..0eeb2a1a867c 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -109,10 +109,11 @@ struct mlx4_qp_path {
109 __be32 tclass_flowlabel; 109 __be32 tclass_flowlabel;
110 u8 rgid[16]; 110 u8 rgid[16];
111 u8 sched_queue; 111 u8 sched_queue;
112 u8 snooper_flags; 112 u8 vlan_index;
113 u8 reserved3[2]; 113 u8 reserved3[2];
114 u8 counter_index; 114 u8 counter_index;
115 u8 reserved4[7]; 115 u8 reserved4;
116 u8 dmac[6];
116}; 117};
117 118
118struct mlx4_qp_context { 119struct mlx4_qp_context {
@@ -166,6 +167,7 @@ enum {
166 MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5, 167 MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5,
167 MLX4_WQE_CTRL_INS_VLAN = 1 << 6, 168 MLX4_WQE_CTRL_INS_VLAN = 1 << 6,
168 MLX4_WQE_CTRL_STRONG_ORDER = 1 << 7, 169 MLX4_WQE_CTRL_STRONG_ORDER = 1 << 7,
170 MLX4_WQE_CTRL_FORCE_LOOPBACK = 1 << 0,
169}; 171};
170 172
171struct mlx4_wqe_ctrl_seg { 173struct mlx4_wqe_ctrl_seg {
@@ -219,7 +221,8 @@ struct mlx4_wqe_datagram_seg {
219 __be32 av[8]; 221 __be32 av[8];
220 __be32 dqpn; 222 __be32 dqpn;
221 __be32 qkey; 223 __be32 qkey;
222 __be32 reservd[2]; 224 __be16 vlan;
225 u8 mac[6];
223}; 226};
224 227
225struct mlx4_wqe_lso_seg { 228struct mlx4_wqe_lso_seg {