aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4/port.c
diff options
context:
space:
mode:
authorYevgeny Petrilin <yevgenyp@mellanox.co.il>2009-03-11 18:47:18 -0400
committerRoland Dreier <rolandd@cisco.com>2009-03-11 18:47:18 -0400
commit793730bfb6711d6d14629e63845c25a3c14d205e (patch)
tree4b530c3bb7ac3dbebe855c6862d9e936ce940938 /drivers/net/mlx4/port.c
parent085343b47592b33276abf58a71c52ea29f0a338b (diff)
mlx4_core: Don't perform SET_PORT command for Ethernet ports
The same operation is performed when the Ethernet driver initializes the port. Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/net/mlx4/port.c')
-rw-r--r--drivers/net/mlx4/port.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/net/mlx4/port.c b/drivers/net/mlx4/port.c
index 0a057e5dc63b..7cce3342ef8c 100644
--- a/drivers/net/mlx4/port.c
+++ b/drivers/net/mlx4/port.c
@@ -298,20 +298,17 @@ int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port)
298{ 298{
299 struct mlx4_cmd_mailbox *mailbox; 299 struct mlx4_cmd_mailbox *mailbox;
300 int err; 300 int err;
301 u8 is_eth = dev->caps.port_type[port] == MLX4_PORT_TYPE_ETH;
302 301
303 mailbox = mlx4_alloc_cmd_mailbox(dev); 302 mailbox = mlx4_alloc_cmd_mailbox(dev);
304 if (IS_ERR(mailbox)) 303 if (IS_ERR(mailbox))
305 return PTR_ERR(mailbox); 304 return PTR_ERR(mailbox);
306 305
307 memset(mailbox->buf, 0, 256); 306 memset(mailbox->buf, 0, 256);
308 if (is_eth) { 307 if (dev->caps.port_type[port] == MLX4_PORT_TYPE_ETH)
309 ((u8 *) mailbox->buf)[3] = 6; 308 return 0;
310 ((__be16 *) mailbox->buf)[4] = cpu_to_be16(1 << 15); 309
311 ((__be16 *) mailbox->buf)[6] = cpu_to_be16(1 << 15); 310 ((__be32 *) mailbox->buf)[1] = dev->caps.ib_port_def_cap[port];
312 } else 311 err = mlx4_cmd(dev, mailbox->dma, port, 0, MLX4_CMD_SET_PORT,
313 ((__be32 *) mailbox->buf)[1] = dev->caps.ib_port_def_cap[port];
314 err = mlx4_cmd(dev, mailbox->dma, port, is_eth, MLX4_CMD_SET_PORT,
315 MLX4_CMD_TIME_CLASS_B); 312 MLX4_CMD_TIME_CLASS_B);
316 313
317 mlx4_free_cmd_mailbox(dev, mailbox); 314 mlx4_free_cmd_mailbox(dev, mailbox);