Commit baa98798 authored by Veerasenareddy Burru's avatar Veerasenareddy Burru Committed by David S. Miller

octeon_ep: support asynchronous notifications

Add asynchronous notification support to the control mailbox.
Signed-off-by: default avatarVeerasenareddy Burru <vburru@marvell.com>
Signed-off-by: default avatarAbhijit Ayarekar <aayarekar@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f25e5967
...@@ -271,6 +271,33 @@ static void process_mbox_resp(struct octep_device *oct, ...@@ -271,6 +271,33 @@ static void process_mbox_resp(struct octep_device *oct,
} }
} }
static int process_mbox_notify(struct octep_device *oct,
struct octep_ctrl_mbox_msg *msg)
{
struct net_device *netdev = oct->netdev;
struct octep_ctrl_net_f2h_req *req;
req = (struct octep_ctrl_net_f2h_req *)msg->sg_list[0].msg;
switch (req->hdr.s.cmd) {
case OCTEP_CTRL_NET_F2H_CMD_LINK_STATUS:
if (netif_running(netdev)) {
if (req->link.state) {
dev_info(&oct->pdev->dev, "netif_carrier_on\n");
netif_carrier_on(netdev);
} else {
dev_info(&oct->pdev->dev, "netif_carrier_off\n");
netif_carrier_off(netdev);
}
}
break;
default:
pr_info("Unknown mbox req : %u\n", req->hdr.s.cmd);
break;
}
return 0;
}
void octep_ctrl_net_recv_fw_messages(struct octep_device *oct) void octep_ctrl_net_recv_fw_messages(struct octep_device *oct)
{ {
static u16 msg_sz = sizeof(union octep_ctrl_net_max_data); static u16 msg_sz = sizeof(union octep_ctrl_net_max_data);
...@@ -291,6 +318,8 @@ void octep_ctrl_net_recv_fw_messages(struct octep_device *oct) ...@@ -291,6 +318,8 @@ void octep_ctrl_net_recv_fw_messages(struct octep_device *oct)
if (msg.hdr.s.flags & OCTEP_CTRL_MBOX_MSG_HDR_FLAG_RESP) if (msg.hdr.s.flags & OCTEP_CTRL_MBOX_MSG_HDR_FLAG_RESP)
process_mbox_resp(oct, &msg); process_mbox_resp(oct, &msg);
else if (msg.hdr.s.flags & OCTEP_CTRL_MBOX_MSG_HDR_FLAG_NOTIFY)
process_mbox_notify(oct, &msg);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment