aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mlx4
diff options
context:
space:
mode:
authorJack Morgenstein <jackm@dev.mellanox.co.il>2011-12-12 23:10:41 -0500
committerDavid S. Miller <davem@davemloft.net>2011-12-13 13:56:05 -0500
commit65dab25deb8da7dba4b6dd0145a9143be7f8369f (patch)
treea494864c9c97eef341f30529d71feceb08dcdb64 /include/linux/mlx4
parent623ed84b1f9553bc962c2aca92f488aa6f27ecd1 (diff)
mlx4: Extanding port_mask functionality
Port mask now has additional state. Port can be set as "none". In this case neither the mlx4_en or mlx4_ib drivers take ownership of the port. In multifunction mode there is an option to set the vfs as single ported devices. (in single function mode, both physical ports belong to same function) Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il> Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mlx4')
-rw-r--r--include/linux/mlx4/device.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index b9466af2348f..3333018d2913 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -302,7 +302,7 @@ struct mlx4_caps {
302 int log_num_prios; 302 int log_num_prios;
303 enum mlx4_port_type port_type[MLX4_MAX_PORTS + 1]; 303 enum mlx4_port_type port_type[MLX4_MAX_PORTS + 1];
304 u8 supported_type[MLX4_MAX_PORTS + 1]; 304 u8 supported_type[MLX4_MAX_PORTS + 1];
305 u32 port_mask; 305 u32 port_mask[MLX4_MAX_PORTS + 1];
306 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1]; 306 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1];
307 u32 max_counters; 307 u32 max_counters;
308 u8 ext_port_cap[MLX4_MAX_PORTS + 1]; 308 u8 ext_port_cap[MLX4_MAX_PORTS + 1];
@@ -507,13 +507,12 @@ struct mlx4_init_port_param {
507 507
508#define mlx4_foreach_port(port, dev, type) \ 508#define mlx4_foreach_port(port, dev, type) \
509 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ 509 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
510 if (((type) == MLX4_PORT_TYPE_IB ? (dev)->caps.port_mask : \ 510 if ((type) == (dev)->caps.port_mask[(port)])
511 ~(dev)->caps.port_mask) & 1 << ((port) - 1))
512 511
513#define mlx4_foreach_ib_transport_port(port, dev) \ 512#define mlx4_foreach_ib_transport_port(port, dev) \
514 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \ 513 for ((port) = 1; (port) <= (dev)->caps.num_ports; (port)++) \
515 if (((dev)->caps.port_mask & 1 << ((port) - 1)) || \ 514 if (((dev)->caps.port_mask[port] == MLX4_PORT_TYPE_IB) || \
516 ((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE)) 515 ((dev)->caps.flags & MLX4_DEV_CAP_FLAG_IBOE))
517 516
518static inline int mlx4_is_master(struct mlx4_dev *dev) 517static inline int mlx4_is_master(struct mlx4_dev *dev)
519{ 518{