lkml.org 
[lkml]   [2014]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next] hyperv: Add handler for RNDIS_STATUS_NETWORK_CHANGE event
On Thu, Jun 19, 2014 at 06:34:36PM -0700, Haiyang Zhang wrote:
> @@ -589,7 +590,19 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
> net_device = hv_get_drvdata(device_obj);
> rdev = net_device->extension;
>
> - rdev->link_state = status != 1;
> + switch (indicate->status) {
> + case RNDIS_STATUS_MEDIA_CONNECT:
> + rdev->link_state = false;

link_state false means that we want to connect?

> + break;
> + case RNDIS_STATUS_MEDIA_DISCONNECT:
> + rdev->link_state = true;

link_state true means that we are disconnecting.

> + break;
> + case RNDIS_STATUS_NETWORK_CHANGE:
> + rdev->link_change = true;
> + break;
> + default:
> + return;
> + }
>
> net = net_device->ndev;
>
> @@ -597,7 +610,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,

> @@ -782,10 +797,17 @@ static void netvsc_link_change(struct work_struct *w)
> } else {
> netif_carrier_on(net);
> notify = true;
> + if (rdev->link_change) {
> + rdev->link_change = false;
> + refresh = true;
> + }

How do we know that we received a RNDIS_STATUS_MEDIA_CONNECT before we
received the RNDIS_STATUS_NETWORK_CHANGE? In other words, why does
RNDIS_STATUS_NETWORK_CHANGE imply that the link_state is false?

> }
>
> rtnl_unlock();
>
> + if (refresh)
> + call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC);

You may as well use UMH_NO_WAIT since there is no error handling if
/etc/init.d/network is not found.

regards,
dan carpenter


\
 
 \ /
  Last update: 2014-06-20 11:21    [W:0.121 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site