Re: [PATCH 05/10] usb: gadget: rndis: Fix re-binding f_rndis

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Benoit Goby <benoit@xxxxxxxxxxx>
> Date: Thu, Dec 22, 2011 at 6:51 AM
> Subject: [PATCH 05/10] usb: gadget: rndis: Fix re-binding f_rndis
> To: Felipe Balbi <balbi@xxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxx>,
> linux-usb@xxxxxxxxxxxxxxx
> Cc: Benoit Goby <benoit@xxxxxxxxxxx>, Mike Lockwood <lockwood@xxxxxxxxxxx>
>
>
> f_rndis checks if rndis_string_defs[0].id is null to setup rndis
> and allocate string ids when it is bound to the first configuration:
>
>        /* maybe allocate device-global string IDs */
>        if (rndis_string_defs[0].id == 0) {
>
>                /* ... and setup RNDIS itself */
>                status = rndis_init();
>                if (status < 0)
>                        return status;
>
> rndis_string_defs[0].id must be reset to 0 on unbind for rndis to be
> correctly initialized on the next composite_bind.
>

This code change is resulting in new RNDIS sting id for each composite_bind.
i.e. When the configuration is changing the RNDIS is getting new
string id each time RNDIS is added to configuration.

What will happen with previously allocated string id for RNDIS?

One problem is seen in case of Android:
when we do Tethering enable/disable from Android Menu, RNDIS drivers
are asked multiple times.

What is the purpose of setting  "rndis_string_defs[0].id = 0;"?

No other class is doing that then why RNDIS only?

> Signed-off-by: Benoit Goby <benoit@xxxxxxxxxxx>
> ---
>  drivers/usb/gadget/f_rndis.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c
> index 704d1d9..707ec37 100644
> --- a/drivers/usb/gadget/f_rndis.c
> +++ b/drivers/usb/gadget/f_rndis.c
> @@ -819,6 +819,7 @@ rndis_unbind(struct usb_configuration *c, struct
> usb_function *f)
>
>        rndis_deregister(rndis->config);
>        rndis_exit();
> +       rndis_string_defs[0].id = 0;
>
>        if (gadget_is_superspeed(c->cdev->gadget))
>                usb_free_descriptors(f->ss_descriptors);
> --
> 1.7.3.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux