• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/usb/gadget/

Lines Matching refs:acm

285 	struct f_acm	*acm = ep->driver_data;
286 struct usb_composite_dev *cdev = acm->port.func.config->cdev;
289 DBG(cdev, "acm ttyGS%d completion, err %d\n",
290 acm->port_num, req->status);
295 if (req->actual != sizeof(acm->port_line_coding)) {
296 DBG(cdev, "acm ttyGS%d short resp, len %d\n",
297 acm->port_num, req->actual);
309 acm->port_line_coding = *value;
315 struct f_acm *acm = func_to_acm(f);
337 || w_index != acm->ctrl_id)
341 cdev->gadget->ep0->driver_data = acm;
348 if (w_index != acm->ctrl_id)
353 memcpy(req->buf, &acm->port_line_coding, value);
359 if (w_index != acm->ctrl_id)
364 acm->port_handshake_bits = w_value;
376 DBG(cdev, "acm ttyGS%d req%02x.%02x v%04x i%04x l%d\n",
377 acm->port_num, ctrl->bRequestType, ctrl->bRequest,
383 ERROR(cdev, "acm response on ttyGS%d, err %d\n",
384 acm->port_num, value);
393 struct f_acm *acm = func_to_acm(f);
398 if (intf == acm->ctrl_id) {
399 if (acm->notify->driver_data) {
400 VDBG(cdev, "reset acm control interface %d\n", intf);
401 usb_ep_disable(acm->notify);
403 VDBG(cdev, "init acm ctrl interface %d\n", intf);
404 acm->notify_desc = ep_choose(cdev->gadget,
405 acm->hs.notify,
406 acm->fs.notify);
408 usb_ep_enable(acm->notify, acm->notify_desc);
409 acm->notify->driver_data = acm;
411 } else if (intf == acm->data_id) {
412 if (acm->port.in->driver_data) {
413 DBG(cdev, "reset acm ttyGS%d\n", acm->port_num);
414 gserial_disconnect(&acm->port);
416 DBG(cdev, "activate acm ttyGS%d\n", acm->port_num);
417 acm->port.in_desc = ep_choose(cdev->gadget,
418 acm->hs.in, acm->fs.in);
419 acm->port.out_desc = ep_choose(cdev->gadget,
420 acm->hs.out, acm->fs.out);
422 gserial_connect(&acm->port, acm->port_num);
432 struct f_acm *acm = func_to_acm(f);
435 DBG(cdev, "acm ttyGS%d deactivated\n", acm->port_num);
436 gserial_disconnect(&acm->port);
437 usb_ep_disable(acm->notify);
438 acm->notify->driver_data = NULL;
445 * @acm: wraps host to be notified
450 * Context: irqs blocked, acm->lock held, acm_notify_req non-null
457 static int acm_cdc_notify(struct f_acm *acm, u8 type, u16 value,
460 struct usb_ep *ep = acm->notify;
467 req = acm->notify_req;
468 acm->notify_req = NULL;
469 acm->pending = false;
479 notify->wIndex = cpu_to_le16(acm->ctrl_id);
484 spin_unlock(&acm->lock);
486 spin_lock(&acm->lock);
489 ERROR(acm->port.func.config->cdev,
490 "acm ttyGS%d can't notify serial state, %d\n",
491 acm->port_num, status);
492 acm->notify_req = req;
498 static int acm_notify_serial_state(struct f_acm *acm)
500 struct usb_composite_dev *cdev = acm->port.func.config->cdev;
503 spin_lock(&acm->lock);
504 if (acm->notify_req) {
505 DBG(cdev, "acm ttyGS%d serial state %04x\n",
506 acm->port_num, acm->serial_state);
507 status = acm_cdc_notify(acm, USB_CDC_NOTIFY_SERIAL_STATE,
508 0, &acm->serial_state, sizeof(acm->serial_state));
510 acm->pending = true;
513 spin_unlock(&acm->lock);
519 struct f_acm *acm = req->context;
525 spin_lock(&acm->lock);
527 doit = acm->pending;
528 acm->notify_req = req;
529 spin_unlock(&acm->lock);
532 acm_notify_serial_state(acm);
539 struct f_acm *acm = port_to_acm(port);
541 acm->serial_state |= ACM_CTRL_DSR | ACM_CTRL_DCD;
542 acm_notify_serial_state(acm);
547 struct f_acm *acm = port_to_acm(port);
549 acm->serial_state &= ~(ACM_CTRL_DSR | ACM_CTRL_DCD);
550 acm_notify_serial_state(acm);
555 struct f_acm *acm = port_to_acm(port);
558 state = acm->serial_state;
563 acm->serial_state = state;
564 return acm_notify_serial_state(acm);
574 struct f_acm *acm = func_to_acm(f);
582 acm->ctrl_id = status;
591 acm->data_id = status;
603 acm->port.in = ep;
609 acm->port.out = ep;
615 acm->notify = ep;
619 acm->notify_req = gs_alloc_req(ep,
622 if (!acm->notify_req)
625 acm->notify_req->complete = acm_cdc_notify_complete;
626 acm->notify_req->context = acm;
633 acm->fs.in = usb_find_endpoint(acm_fs_function,
635 acm->fs.out = usb_find_endpoint(acm_fs_function,
637 acm->fs.notify = usb_find_endpoint(acm_fs_function,
655 acm->hs.in = usb_find_endpoint(acm_hs_function,
657 acm->hs.out = usb_find_endpoint(acm_hs_function,
659 acm->hs.notify = usb_find_endpoint(acm_hs_function,
663 DBG(cdev, "acm ttyGS%d: %s speed IN/%s OUT/%s NOTIFY/%s\n",
664 acm->port_num,
666 acm->port.in->name, acm->port.out->name,
667 acm->notify->name);
671 if (acm->notify_req)
672 gs_free_req(acm->notify, acm->notify_req);
675 if (acm->notify)
676 acm->notify->driver_data = NULL;
677 if (acm->port.out)
678 acm->port.out->driver_data = NULL;
679 if (acm->port.in)
680 acm->port.in->driver_data = NULL;
690 struct f_acm *acm = func_to_acm(f);
695 gs_free_req(acm->notify, acm->notify_req);
696 kfree(acm);
720 struct f_acm *acm;
755 acm = kzalloc(sizeof *acm, GFP_KERNEL);
756 if (!acm)
759 spin_lock_init(&acm->lock);
761 acm->port_num = port_num;
763 acm->port.connect = acm_connect;
764 acm->port.disconnect = acm_disconnect;
765 acm->port.send_break = acm_send_break;
767 acm->port.func.name = "acm";
768 acm->port.func.strings = acm_strings;
770 acm->port.func.bind = acm_bind;
771 acm->port.func.unbind = acm_unbind;
772 acm->port.func.set_alt = acm_set_alt;
773 acm->port.func.setup = acm_setup;
774 acm->port.func.disable = acm_disable;
776 status = usb_add_function(c, &acm->port.func);
778 kfree(acm);