Deleted Added
full compact
usb_compat_linux.c (191825) usb_compat_linux.c (192499)
1/* $FreeBSD: head/sys/dev/usb/usb_compat_linux.c 191825 2009-05-05 15:39:29Z thompsa $ */
1/* $FreeBSD: head/sys/dev/usb/usb_compat_linux.c 192499 2009-05-21 00:04:17Z thompsa $ */
2/*-
3 * Copyright (c) 2007 Luigi Rizzo - Universita` di Pisa. All rights reserved.
4 * Copyright (c) 2007 Hans Petter Selasky. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright

--- 179 unchanged lines hidden (view full) ---

189 *------------------------------------------------------------------------*/
190static int
191usb_linux_probe(device_t dev)
192{
193 struct usb2_attach_arg *uaa = device_get_ivars(dev);
194 struct usb_driver *udrv;
195 int err = ENXIO;
196
2/*-
3 * Copyright (c) 2007 Luigi Rizzo - Universita` di Pisa. All rights reserved.
4 * Copyright (c) 2007 Hans Petter Selasky. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright

--- 179 unchanged lines hidden (view full) ---

189 *------------------------------------------------------------------------*/
190static int
191usb_linux_probe(device_t dev)
192{
193 struct usb2_attach_arg *uaa = device_get_ivars(dev);
194 struct usb_driver *udrv;
195 int err = ENXIO;
196
197 if (uaa->usb2_mode != USB_MODE_HOST) {
197 if (uaa->usb_mode != USB_MODE_HOST) {
198 return (ENXIO);
199 }
200 mtx_lock(&Giant);
201 LIST_FOREACH(udrv, &usb_linux_driver_list, linux_driver_list) {
202 if (usb_linux_lookup_id(udrv->id_table, uaa)) {
203 err = 0;
204 break;
205 }

--- 429 unchanged lines hidden (view full) ---

635 &actlen, timeout);
636 if (err) {
637 err = -EPIPE;
638 } else {
639 err = actlen;
640 }
641 return (err);
642 }
198 return (ENXIO);
199 }
200 mtx_lock(&Giant);
201 LIST_FOREACH(udrv, &usb_linux_driver_list, linux_driver_list) {
202 if (usb_linux_lookup_id(udrv->id_table, uaa)) {
203 err = 0;
204 break;
205 }

--- 429 unchanged lines hidden (view full) ---

635 &actlen, timeout);
636 if (err) {
637 err = -EPIPE;
638 } else {
639 err = actlen;
640 }
641 return (err);
642 }
643 if (dev->bsd_udev->flags.usb2_mode != USB_MODE_HOST) {
643 if (dev->bsd_udev->flags.usb_mode != USB_MODE_HOST) {
644 /* not supported */
645 return (-EINVAL);
646 }
647 err = usb_setup_endpoint(dev, uhe, 1 /* dummy */ );
648
649 /*
650 * NOTE: we need to allocate real memory here so that we don't
651 * transfer data to/from the stack!

--- 982 unchanged lines hidden ---
644 /* not supported */
645 return (-EINVAL);
646 }
647 err = usb_setup_endpoint(dev, uhe, 1 /* dummy */ );
648
649 /*
650 * NOTE: we need to allocate real memory here so that we don't
651 * transfer data to/from the stack!

--- 982 unchanged lines hidden ---