Skip to content

Commit baa9879

Browse files
vburrudavem330
authored andcommitted
octeon_ep: support asynchronous notifications
Add asynchronous notification support to the control mailbox. Signed-off-by: Veerasenareddy Burru <[email protected]> Signed-off-by: Abhijit Ayarekar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f25e596 commit baa9879

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

drivers/net/ethernet/marvell/octeon_ep/octep_ctrl_net.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,33 @@ static void process_mbox_resp(struct octep_device *oct,
271271
}
272272
}
273273

274+
static int process_mbox_notify(struct octep_device *oct,
275+
struct octep_ctrl_mbox_msg *msg)
276+
{
277+
struct net_device *netdev = oct->netdev;
278+
struct octep_ctrl_net_f2h_req *req;
279+
280+
req = (struct octep_ctrl_net_f2h_req *)msg->sg_list[0].msg;
281+
switch (req->hdr.s.cmd) {
282+
case OCTEP_CTRL_NET_F2H_CMD_LINK_STATUS:
283+
if (netif_running(netdev)) {
284+
if (req->link.state) {
285+
dev_info(&oct->pdev->dev, "netif_carrier_on\n");
286+
netif_carrier_on(netdev);
287+
} else {
288+
dev_info(&oct->pdev->dev, "netif_carrier_off\n");
289+
netif_carrier_off(netdev);
290+
}
291+
}
292+
break;
293+
default:
294+
pr_info("Unknown mbox req : %u\n", req->hdr.s.cmd);
295+
break;
296+
}
297+
298+
return 0;
299+
}
300+
274301
void octep_ctrl_net_recv_fw_messages(struct octep_device *oct)
275302
{
276303
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)
291318

292319
if (msg.hdr.s.flags & OCTEP_CTRL_MBOX_MSG_HDR_FLAG_RESP)
293320
process_mbox_resp(oct, &msg);
321+
else if (msg.hdr.s.flags & OCTEP_CTRL_MBOX_MSG_HDR_FLAG_NOTIFY)
322+
process_mbox_notify(oct, &msg);
294323
}
295324
}
296325

0 commit comments

Comments
 (0)