Skip to content

Commit

Permalink
net/bnxt: add link state operations
Browse files Browse the repository at this point in the history
Adds dev_ops to set link Up or Down as appropriate.
Uses the bnxt_set_hwrm_link_config() API added previously.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Reviewed-by: David Christensen <david.christensen@broadcom.com>
  • Loading branch information
ajitkhaparde authored and bruce-richardson committed Jun 20, 2016
1 parent 778b759 commit 5c20608
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions drivers/net/bnxt/bnxt_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,24 @@ static int bnxt_dev_start_op(struct rte_eth_dev *eth_dev)
return rc;
}

static int bnxt_dev_set_link_up_op(struct rte_eth_dev *eth_dev)
{
struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;

eth_dev->data->dev_link.link_status = 1;
bnxt_set_hwrm_link_config(bp, true);
return 0;
}

static int bnxt_dev_set_link_down_op(struct rte_eth_dev *eth_dev)
{
struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;

eth_dev->data->dev_link.link_status = 0;
bnxt_set_hwrm_link_config(bp, false);
return 0;
}

static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
{
struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
Expand Down Expand Up @@ -574,6 +592,8 @@ static struct eth_dev_ops bnxt_dev_ops = {
.dev_configure = bnxt_dev_configure_op,
.dev_start = bnxt_dev_start_op,
.dev_stop = bnxt_dev_stop_op,
.dev_set_link_up = bnxt_dev_set_link_up_op,
.dev_set_link_down = bnxt_dev_set_link_down_op,
.stats_get = bnxt_stats_get_op,
.stats_reset = bnxt_stats_reset_op,
.rx_queue_setup = bnxt_rx_queue_setup_op,
Expand Down

0 comments on commit 5c20608

Please sign in to comment.