Re: g_serial and cdc_acm communications

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

 



(please use reply to all and keep the previous mail)

On Tue, Jul 24, 2012 at 02:29:57PM +0000, Dipen Patel wrote:
> Hi Felipe,
> 
> I think I know why my application is not receiving SIGHUP. 
> 
> When HOST sends SET_CONFIGURATION the set_config() in composite.c calls
> acm_set_alt(). Now acm_set_alt() calls gserial_connect() and it will 
> create new port. But it never called gserial_disconnect() to close 
> previously called gserial_connect(), so SIGHUP is not generated. 
> 
> But why acm_set_alt() does not do gserial_disconnect() before calling
> gserial_connect()?

In case of configuration change, composite.c will call f->disable()
which is implemented on acm as:

464 static void acm_disable(struct usb_function *f)
465 {
466         struct f_acm    *acm = func_to_acm(f);
467         struct usb_composite_dev *cdev = f->config->cdev;
468 
469         DBG(cdev, "acm ttyGS%d deactivated\n", acm->port_num);
470         gserial_disconnect(&acm->port);
471         usb_ep_disable(acm->notify);
472         acm->notify->driver_data = NULL;
473 }

there you have yor gserial_disconnect(). I suggest you enable debugging
and see where things are going fishy.

-- 
balbi

Attachment: signature.asc
Description: Digital signature


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

  Powered by Linux