• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/usb/core/

Lines Matching refs:intf

134 static const struct usb_device_id *usb_match_dynamic_id(struct usb_interface *intf,
141 if (usb_match_one_id(intf, &dynid->id)) {
190 struct usb_interface *intf;
200 intf = to_usb_interface(dev);
201 udev = interface_to_usbdev(intf);
203 id = usb_match_id(intf, driver->id_table);
205 id = usb_match_dynamic_id(intf, driver);
217 mark_active(intf);
218 intf->condition = USB_INTERFACE_BINDING;
223 intf->pm_usage_cnt = !(driver->supports_autosuspend);
225 error = driver->probe(intf, id);
227 mark_quiesced(intf);
228 intf->needs_remote_wakeup = 0;
229 intf->condition = USB_INTERFACE_UNBOUND;
231 intf->condition = USB_INTERFACE_BOUND;
243 struct usb_interface *intf = to_usb_interface(dev);
247 intf->condition = USB_INTERFACE_UNBINDING;
250 udev = interface_to_usbdev(intf);
254 usb_disable_interface(interface_to_usbdev(intf), intf);
256 driver->disconnect(intf);
259 usb_set_interface(interface_to_usbdev(intf),
260 intf->altsetting[0].desc.bInterfaceNumber,
262 usb_set_intfdata(intf, NULL);
264 intf->condition = USB_INTERFACE_UNBOUND;
265 mark_quiesced(intf);
266 intf->needs_remote_wakeup = 0;
408 struct usb_host_interface *intf;
415 intf = interface->cur_altsetting;
432 (id->bInterfaceClass != intf->desc.bInterfaceClass))
436 (id->bInterfaceSubClass != intf->desc.bInterfaceSubClass))
440 (id->bInterfaceProtocol != intf->desc.bInterfaceProtocol))
553 struct usb_interface *intf;
561 intf = to_usb_interface(dev);
564 id = usb_match_id(intf, usb_drv->id_table);
568 id = usb_match_dynamic_id(intf, usb_drv);
593 struct usb_interface *intf = to_usb_interface(dev);
594 usb_dev = interface_to_usbdev(intf);
850 /* Caller has locked intf's usb_device's pm mutex */
851 static int usb_suspend_interface(struct usb_interface *intf, pm_message_t msg)
857 if (interface_to_usbdev(intf)->state == USB_STATE_NOTATTACHED ||
858 !is_active(intf))
861 if (intf->condition == USB_INTERFACE_UNBOUND) /* This can't happen */
863 driver = to_usb_driver(intf->dev.driver);
866 status = driver->suspend(intf, msg);
868 mark_quiesced(intf);
869 else if (!interface_to_usbdev(intf)->auto_pm)
870 dev_err(&intf->dev, "%s error %d\n",
874 dev_warn(&intf->dev, "no suspend for driver %s?\n",
876 mark_quiesced(intf);
880 // dev_dbg(&intf->dev, "%s: status %d\n", __FUNCTION__, status);
882 intf->dev.power.power_state.event = msg.event;
886 /* Caller has locked intf's usb_device's pm_mutex */
887 static int usb_resume_interface(struct usb_interface *intf)
892 if (interface_to_usbdev(intf)->state == USB_STATE_NOTATTACHED ||
893 is_active(intf))
897 if (intf->condition == USB_INTERFACE_UNBINDING)
901 if (intf->condition == USB_INTERFACE_UNBOUND) {
905 driver = to_usb_driver(intf->dev.driver);
908 status = driver->resume(intf);
910 dev_err(&intf->dev, "%s error %d\n",
913 mark_active(intf);
915 dev_warn(&intf->dev, "no resume for driver %s?\n",
917 mark_active(intf);
921 // dev_dbg(&intf->dev, "%s: status %d\n", __FUNCTION__, status);
923 intf->dev.power.power_state.event = PM_EVENT_ON;
933 struct usb_interface *intf;
949 intf = udev->actconfig->interface[i];
950 if (!is_active(intf))
952 if (intf->pm_usage_cnt > 0)
954 if (intf->needs_remote_wakeup &&
1032 struct usb_interface *intf;
1050 intf = udev->actconfig->interface[i];
1051 status = usb_suspend_interface(intf, msg);
1062 intf = udev->actconfig->interface[i];
1063 usb_resume_interface(intf);
1114 struct usb_interface *intf;
1169 intf = udev->actconfig->interface[i];
1170 usb_resume_interface(intf);
1298 static int usb_autopm_do_interface(struct usb_interface *intf,
1301 struct usb_device *udev = interface_to_usbdev(intf);
1305 if (intf->condition == USB_INTERFACE_UNBOUND)
1309 intf->pm_usage_cnt += inc_usage_cnt;
1310 if (inc_usage_cnt >= 0 && intf->pm_usage_cnt > 0) {
1314 intf->pm_usage_cnt -= inc_usage_cnt;
1317 } else if (inc_usage_cnt <= 0 && intf->pm_usage_cnt <= 0) {
1329 * @intf: the usb_interface whose counter should be decremented
1332 * finished using @intf and wants to allow it to autosuspend. A typical
1336 * The routine decrements @intf's usage counter. When the counter reaches
1337 * 0, a delayed autosuspend request for @intf's device is queued. When
1338 * the delay expires, if @intf->pm_usage_cnt is still <= 0 along with all
1339 * the other usage counters for the sibling interfaces and @intf's
1342 * Note that @intf->pm_usage_cnt is owned by the interface driver. The
1348 * If the driver has set @intf->needs_remote_wakeup then autosuspend will
1352 * while @intf is resumed and its usage counter is equal to 0. They are
1358 void usb_autopm_put_interface(struct usb_interface *intf)
1362 status = usb_autopm_do_interface(intf, -1);
1363 // dev_dbg(&intf->dev, "%s: status %d cnt %d\n",
1364 // __FUNCTION__, status, intf->pm_usage_cnt);
1370 * @intf: the usb_interface whose counter should be incremented
1373 * use @intf and needs to guarantee that it is not suspended. In addition,
1374 * the routine prevents @intf from being autosuspended subsequently. (Note
1377 * or @intf is unbound. A typical example would be a character-device
1381 * The routine increments @intf's usage counter. (However if the
1383 * counter is greater than 0, autosuspend will not be allowed for @intf
1384 * or its usb_device. When the driver is finished using @intf it should
1389 * Note that @intf->pm_usage_cnt is owned by the interface driver. The
1396 * while @intf is suspended. They are not protected by the usb_device's
1402 int usb_autopm_get_interface(struct usb_interface *intf)
1406 status = usb_autopm_do_interface(intf, 1);
1407 // dev_dbg(&intf->dev, "%s: status %d cnt %d\n",
1408 // __FUNCTION__, status, intf->pm_usage_cnt);
1415 * @intf: the usb_interface whose state should be set
1417 * This routine sets the autosuspend state of @intf's device according
1418 * to @intf's usage counter, which the caller must have set previously.
1424 int usb_autopm_set_interface(struct usb_interface *intf)
1428 status = usb_autopm_do_interface(intf, 0);
1429 // dev_dbg(&intf->dev, "%s: status %d cnt %d\n",
1430 // __FUNCTION__, status, intf->pm_usage_cnt);