Lines Matching refs:sdev
146 struct stub_device *sdev = priv->sdev; in tweak_set_configuration_cmd() local
154 err = usb_set_configuration(sdev->udev, config); in tweak_set_configuration_cmd()
156 dev_err(&sdev->udev->dev, "can't set config #%d, error %d\n", in tweak_set_configuration_cmd()
164 struct stub_device *sdev = priv->sdev; in tweak_reset_device_cmd() local
173 if (usb_lock_device_for_reset(sdev->udev, sdev->interface) < 0) { in tweak_reset_device_cmd()
177 usb_reset_device(sdev->udev); in tweak_reset_device_cmd()
178 usb_unlock_device(sdev->udev); in tweak_reset_device_cmd()
220 static int stub_recv_cmd_unlink(struct stub_device *sdev, in stub_recv_cmd_unlink() argument
227 spin_lock_irqsave(&sdev->priv_lock, flags); in stub_recv_cmd_unlink()
229 list_for_each_entry(priv, &sdev->priv_init, list) { in stub_recv_cmd_unlink()
254 spin_unlock_irqrestore(&sdev->priv_lock, flags); in stub_recv_cmd_unlink()
289 stub_enqueue_ret_unlink(sdev, pdu->base.seqnum, 0); in stub_recv_cmd_unlink()
291 spin_unlock_irqrestore(&sdev->priv_lock, flags); in stub_recv_cmd_unlink()
296 static int valid_request(struct stub_device *sdev, struct usbip_header *pdu) in valid_request() argument
298 struct usbip_device *ud = &sdev->ud; in valid_request()
301 if (pdu->base.devid == sdev->devid) { in valid_request()
313 static struct stub_priv *stub_priv_alloc(struct stub_device *sdev, in stub_priv_alloc() argument
317 struct usbip_device *ud = &sdev->ud; in stub_priv_alloc()
320 spin_lock_irqsave(&sdev->priv_lock, flags); in stub_priv_alloc()
324 dev_err(&sdev->interface->dev, "alloc stub_priv\n"); in stub_priv_alloc()
325 spin_unlock_irqrestore(&sdev->priv_lock, flags); in stub_priv_alloc()
331 priv->sdev = sdev; in stub_priv_alloc()
337 list_add_tail(&priv->list, &sdev->priv_init); in stub_priv_alloc()
339 spin_unlock_irqrestore(&sdev->priv_lock, flags); in stub_priv_alloc()
344 static int get_pipe(struct stub_device *sdev, int epnum, int dir) in get_pipe() argument
346 struct usb_device *udev = sdev->udev; in get_pipe()
355 dev_err(&sdev->interface->dev, "no such endpoint?, %d\n", in get_pipe()
390 dev_err(&sdev->interface->dev, "get pipe, epnum %d\n", epnum); in get_pipe()
448 static void stub_recv_cmd_submit(struct stub_device *sdev, in stub_recv_cmd_submit() argument
453 struct usbip_device *ud = &sdev->ud; in stub_recv_cmd_submit()
454 struct usb_device *udev = sdev->udev; in stub_recv_cmd_submit()
455 int pipe = get_pipe(sdev, pdu->base.ep, pdu->base.direction); in stub_recv_cmd_submit()
457 priv = stub_priv_alloc(sdev, pdu); in stub_recv_cmd_submit()
469 dev_err(&sdev->interface->dev, "malloc urb\n"); in stub_recv_cmd_submit()
489 dev_err(&sdev->interface->dev, "allocate setup_packet\n"); in stub_recv_cmd_submit()
520 dev_err(&sdev->interface->dev, "submit_urb error, %d\n", ret); in stub_recv_cmd_submit()
539 struct stub_device *sdev = container_of(ud, struct stub_device, ud); in stub_rx_pdu() local
540 struct device *dev = &sdev->udev->dev; in stub_rx_pdu()
559 if (!valid_request(sdev, &pdu)) { in stub_rx_pdu()
567 stub_recv_cmd_unlink(sdev, &pdu); in stub_rx_pdu()
571 stub_recv_cmd_submit(sdev, &pdu); in stub_rx_pdu()