aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);