Re: [PATCH 4/7] usbnet: remove EVENT_DEV_OPEN flag

4 messages, 3 authors, 2012-06-13 · open the first message on its own page

Re: [PATCH 4/7] usbnet: remove EVENT_DEV_OPEN flag

From: Oliver Neukum <hidden>
Date: 2012-06-12 18:14:28

Am Dienstag, 12. Juni 2012, 03:19:42 schrieb Ming Lei:
EVENT_DEV_OPEN is introduced to mark if the interface is opened or
not, but we already have IFF_UP to handle it, so just
remove the flag and use IFF_UP.
When is IFF_UP cleared? The flag is tested in usbnet_resume(),
so it must be cleared before usbnet_stop() is called.

	Regards
		Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: [PATCH 4/7] usbnet: remove EVENT_DEV_OPEN flag

From: Ming Lei <tom.leiming@gmail.com>
Date: 2012-06-13 02:12:28

On Wed, Jun 13, 2012 at 2:14 AM, Oliver Neukum [off-list ref] wrote:
Am Dienstag, 12. Juni 2012, 03:19:42 schrieb Ming Lei:
quoted
EVENT_DEV_OPEN is introduced to mark if the interface is opened or
not, but we already have IFF_UP to handle it, so just
remove the flag and use IFF_UP.
When is IFF_UP cleared? The flag is tested in usbnet_resume(),
The flag is cleared just after usbnet_stop completes.
so it must be cleared before usbnet_stop() is called.
Yes, I see, otherwise system or runtime resume may happen
at the same time with usbnet_stop.

Thanking you for point it out.

Thanks,
-- 
Ming Lei

Re: [PATCH 4/7] usbnet: remove EVENT_DEV_OPEN flag

From: Ming Lei <tom.leiming@gmail.com>
Date: 2012-06-13 04:47:19

On Wed, Jun 13, 2012 at 10:12 AM, Ming Lei [off-list ref] wrote:
On Wed, Jun 13, 2012 at 2:14 AM, Oliver Neukum [off-list ref] wrote:
quoted
Am Dienstag, 12. Juni 2012, 03:19:42 schrieb Ming Lei:
quoted
EVENT_DEV_OPEN is introduced to mark if the interface is opened or
not, but we already have IFF_UP to handle it, so just
remove the flag and use IFF_UP.
When is IFF_UP cleared? The flag is tested in usbnet_resume(),
The flag is cleared just after usbnet_stop completes.
Looks we can use the below to replace EVENT_DEV_OPEN:

     (netif_running((dev)->net) && ((dev)->net->flags & IFF_UP))


Thanks,
-- 
Ming Lei

Re: [PATCH 4/7] usbnet: remove EVENT_DEV_OPEN flag

From: Oliver Neukum <oliver@neukum.org>
Date: 2012-06-13 07:44:05

Am Mittwoch, 13. Juni 2012, 06:47:18 schrieb Ming Lei:
On Wed, Jun 13, 2012 at 10:12 AM, Ming Lei [off-list ref] wrote:
quoted
On Wed, Jun 13, 2012 at 2:14 AM, Oliver Neukum [off-list ref] wrote:
quoted
Am Dienstag, 12. Juni 2012, 03:19:42 schrieb Ming Lei:
quoted
EVENT_DEV_OPEN is introduced to mark if the interface is opened or
not, but we already have IFF_UP to handle it, so just
remove the flag and use IFF_UP.
When is IFF_UP cleared? The flag is tested in usbnet_resume(),
The flag is cleared just after usbnet_stop completes.
Looks we can use the below to replace EVENT_DEV_OPEN:

     (netif_running((dev)->net) && ((dev)->net->flags & IFF_UP))
That goes down a bit into the interna of the network code.
If we do this, please encapsulated and with a big fat comment.

	Regards
		Oliver
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help