summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_dev.c
Commit message (Collapse)AuthorAgeFilesLines
* Resolve a LOR after r246616. Protect control requests using the USB devicehselasky2013-02-131-5/+6
| | | | | | | | | enumeration lock. Make sure all callers of usbd_enum_lock() check the return value. Remove the control transfer specific lock. Bump the FreeBSD version number, hence external USB modules may need to be recompiled due to a USB device structure change. MFC after: 1 week
* Modify the FreeBSD USB kernel code so that it can be compiled directlyhselasky2013-01-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | into the FreeBSD boot loader, typically for non-USB aware BIOSes, EFI systems or embedded platforms. This is also useful for out of the system compilation of the FreeBSD USB stack for various purposes. The USB kernel files can now optionally include a global header file which should include all needed definitions required to compile the FreeBSD USB stack. When the global USB header file is included, no other USB header files will be included by default. Add new file containing the USB stack configuration for the FreeBSD loader build. Replace some __FBSDID()'s by /* $FreeBSD$ */ comments. Now all USB files follow the same style. Use cases: - console in loader via USB - loading kernel via USB Discussed with: Hiroki Sato, hrs @ EuroBSDCon
* Add missing CTLFLAG_TUN flag to tunable sysctls in USB stack.hselasky2012-10-261-2/+1
| | | | | | | | Rearrange the tunables and belonging sysctl declarations, so that they are next to eachother. Submitted by: n_hibma @ MFC after: 1 week
* Fix compiler warnings, mostly signed issues,hselasky2012-04-021-3/+3
| | | | | | when USB modules are compiled with WARNS=9. MFC after: 1 weeks
* Remove direct access to si_name.ed2012-02-101-1/+1
| | | | | | | | Code should just use the devtoname() function to obtain the name of a character device. Also add const keywords to pieces of code that need it to build properly. MFC after: 2 weeks
* Style change.hselasky2011-11-121-4/+4
| | | | | | | | | | | | - Make it easier to port the USB code to other platforms by only using one set of memory functions for clearing and copying memory. None of the memory copies are overlapping. This means using bcopy() is not required. - Fix a compile warning when USB_HAVE_BUSDMA=0 - Add missing semicolon in avr32dci. - Update some comments. MFC after: 1 week
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-11-071-1/+1
| | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static.
* In order to maximize the re-usability of kernel code in user space thiskmacy2011-09-161-2/+2
| | | | | | | | | | | | | patch modifies makesyscalls.sh to prefix all of the non-compatibility calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel entry points and all places in the code that use them. It also fixes an additional name space collision between the kernel function psignal and the libc function of the same name by renaming the kernel psignal kern_psignal(). By introducing this change now we will ease future MFCs that change syscalls. Reviewed by: rwatson Approved by: re (bz)
* Fix for recursive locking in usb_close() after change 224777.hselasky2011-08-201-6/+18
| | | | | | Approved by: re (kib) MFC after: 3 days Reported by: kwm @
* Use synchronous device destruction instead of asynchronous, so that a newhselasky2011-08-111-28/+7
| | | | | | | | | device having the same name like a previous one is not created before the old one is gone. This fixes some panics due to asserts in the devfs code which were added recently. Approved by: re (kib) MFC after: 1 week
* Remove unneeded includes of <sys/linker_set.h>. Other headers that usejhb2011-01-111-1/+0
| | | | | | it internally contain nested includes. Reviewed by: bde
* Serialise USB re-enumeration with the USB explore thread.hselasky2010-10-041-13/+36
| | | | | | | This patch can solve problems when multiple USB devices are re-enumerated at the same time on the same bus. Approved by: thompsa (mentor)
* Correct IOCTL return code.hselasky2010-10-041-1/+5
| | | | Approved by: thompsa (mentor)
* fix a few cases where a string is passed via format argument instead ofavg2010-06-111-1/+1
| | | | | | | | | | via %s Most of the cases looked harmless, but this is done for the sake of correctness. In one case it even allowed to drop an intermediate buffer. Found by: clang MFC after: 2 week
* Staticise usb_ref_device and usb_unref_device.thompsa2010-05-121-2/+2
| | | | Submitted by: Hans Petter Selasky
* Use a more obvious prefix for the USB control (endpoint 0) transfers ratherthompsa2010-04-221-1/+1
| | | | than default_*.
* Properly name the sxlocks, mutexes and condvars.thompsa2010-04-221-4/+4
|
* Remove overuse of exclamation marks in kernel printfs, there mere fact athompsa2009-11-261-2/+2
| | | | | | message has been printed is enough to get someones attention. Also remove the line number for DPRINTF/DPRINTFN, it already prints the funtion name and a unique message.
* Provide tunables for some of the usb sysctls that affect boot behaviour.thompsa2009-11-221-0/+2
| | | | Submitted by: Andriy Gapon
* - Patch to allow USB controller to resume operation afteralfred2009-08-241-11/+8
| | | | | | | | | | | | | | | | | | | | | | | being polled. - Remove the need for Giant from the USB HUB driver. - Leave device unconfigured instead of disabling the USB port when Huawei Autoinstall disk detection triggers. This should fix problems that the Huawei device is not detected after Autoinstall eject is issued. - Reported by: Nikolay Antsiferov - Fix memory use after free race for USB character devices. - Reported by: Lucius Windschuh - Factor out the enumeration lock into three functions to make the coming newbus lock conversion more easy. - usbd_enum_lock - usbd_enum_unlock - usbd_enum_is_locked Submitted by: hps
* Temporarily revert the new-bus locking for 8.0 release. It will bejhb2009-08-201-6/+0
| | | | | | reintroduced after HEAD is reopened for commits by re@. Approved by: re (kib), attilio
* Make the newbus subsystem Giant free by adding the new newbus sxlock.attilio2009-08-021-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The newbus lock is responsible for protecting newbus internIal structures, device states and devclass flags. It is necessary to hold it when all such datas are accessed. For the other operations, softc locking should ensure enough protection to avoid races. Newbus lock is automatically held when virtual operations on the device and bus are invoked when loading the driver or when the suspend/resume take place. For other 'spourious' operations trying to access/modify the newbus topology, newbus lock needs to be automatically acquired and dropped. For the moment Giant is also acquired in some key point (modules subsystem) in order to avoid problems before the 8.0 release as module handlers could make assumptions about it. This Giant locking should go just after the release happens. Please keep in mind that the public interface can be expanded in order to provide more support, if there are really necessities at some point and also some bugs could arise as long as the patch needs a bit of further testing. Bump __FreeBSD_version in order to reflect the newbus lock introduction. Reviewed by: ed, hps, jhb, imp, mav, scottl No answer by: ariff, thompsa, yongari Tested by: pho, G. Trematerra <giovanni dot trematerra at gmail dot com>, Brandon Gooch <jamesbrandongooch at gmail dot com> Sponsored by: Yahoo! Incorporated Approved by: re (ksmith)
* USB core:alfred2009-07-301-16/+67
| | | | | | | | | | | | | | | - add support for defragging of written device data. - improve handling of alternate settings in device side mode. - correct return value from usbd_get_no_alts() function. - reported by: HPS - P4 ID: 166156, 166168 - report USB device release information to devd and pnpinfo. - reported by: MIHIRA Sanpei Yoshiro - P4 ID: 166221 Submitted by: hps Approved by: re
* - Make struct usb_xfer opaque so that drivers can not access the internalsthompsa2009-06-231-4/+33
| | | | - Reduce the number of headers needed for a usb driver, the common case is just usb.h and usbdi.h
* s/usb2_/usb_|usbd_/ on all function names for the USB stack.thompsa2009-06-151-233/+233
|
* Remove usb2_cv_* and just use the kernel condvar implementation, it was neededthompsa2009-06-151-13/+13
| | | | | earlier since condition variables didnt work with Giant but this was fixed 10 months ago.
* Make variables static where appropriate.thompsa2009-06-131-1/+1
| | | | Found by: cscout
* Rename usb pipes to endpoints as it better represents what they are, and structthompsa2009-06-071-34/+34
| | | | usb_pipe may be used for a different purpose later on.
* Place the fifo and ref counting variables on the stack to prevent races.thompsa2009-06-021-99/+90
| | | | Submitted by: Hans Petter Selasky
* Fix multithread issue where the is_uref variable was not set and clearedthompsa2009-06-021-8/+23
| | | | | | properly in the CDEV private data. Submitted by: Hans Petter Selasky
* Revert the size_t part of the last commit for the moment, this blows up thethompsa2009-05-301-9/+9
| | | | USB_ADD_BYTES macro.
* s/usb2_/usb_/ on all typedefs for the USB stack.thompsa2009-05-291-21/+21
|
* s/usb2_/usb_/ on all C structs for the USB stack.thompsa2009-05-281-93/+93
|
* Rename the usb sysctl tree from hw.usb2.* back to hw.usb.*.thompsa2009-05-211-2/+2
| | | | Submitted by: Hans Petter Selasky
* - rename usb2_mode to usb_mode [1]thompsa2009-05-211-2/+2
| | | | | | - change variable types to use the enum Submitted by: Hans Petter Selasky [1]
* Check the correct variable for IO_NDELAY.thompsa2009-05-131-2/+2
| | | | Submitted by: Hans Petter Selasky
* MFp4 //depot/projects/usb@159864thompsa2009-04-051-44/+32
| | | | | | Fix possible deadlock with UGEN at detach. Submitted by: Hans Petter Selasky
* MFp4 //depot/projects/usb@159806thompsa2009-04-051-4/+4
| | | | | | | Properly name usb2_uref_location() so that it is not confused with usb2_unref_location() . Submitted by: Hans Petter Selasky
* Set the endpoint on the preallocated fifo so it doesnt get matched as anthompsa2009-03-221-0/+2
| | | | | | endpoint fifo. Reported by: Pieter de Goeje
* Improve debugging output around ioctls.thompsa2009-03-221-3/+6
|
* Fix compile with USB_HAVE_BUSDMA/USB_HAVE_UGEN/USB_HAVE_STRINGS.thompsa2009-03-201-0/+3
| | | | Submitted by: Hans Petter Selasky
* MFp4 //depot/projects/usb @159431,159437,159438thompsa2009-03-201-13/+13
| | | | | | | - start using the new USB typedefs in the USB core - Remove usage of USB_ADD_BYTES() Submitted by: Hans Petter Selasky
* MFp4 //depot/projects/usb @159430thompsa2009-03-201-1/+0
| | | | | | | | | | - Move tunable defines into usb_core.h and dependancy towards usb_defs.h - Leave hardcoded defines in "usb_defs.h". - Allow overriding all tunable defines. - Add more customisable typedefs. - Correct maximum device number. Submitted by: Hans Petter Selasky
* MFp4 //depot/projects/usb 159225,159241,159292thompsa2009-03-171-52/+62
| | | | | | | | | | | Fix regression issue in the USB file system interface. - Use cdev_privdata pointer as indicator of correct file handle. - Remove redundant FIFO opened flags. Don't send ZLP at close for ulpt and uscanner devices as this causes some models to stop working. This reverts back to the USB1 behaviour. Submitted by: Hans Petter Selasky
* Fix usb2_poll not to return an error number as the function return value is athompsa2009-03-051-9/+5
| | | | | | bitmask of events. Pointed out by: HPS
* A couple of style nits in the last committhompsa2009-02-281-6/+3
| | | | | - unwrap short lines - move variable initialisation out of the declaration.
* - Remove the usb interface number from the device nodes as it is not needed.thompsa2009-02-281-44/+14
| | | | | | | - Do not recreate the device nodes in set_alt_interface as the endpoints do not change. Submitted by: Hans Petter Selasky
* Change the last references to PRIV_ROOT. /dev/usb used to be world writable sothompsa2009-02-271-1/+1
| | | | | | | further root checks were needed, this isnt the case anymore but just change it to PRIV_DRIVER until it can be investigated later. Spotted by: rwatson
* Change USB over to make_dev() for all device nodes, previously it hooked intothompsa2009-02-271-983/+384
| | | | | | | | | | | | | | | the devfs clone handler to open the (invisible) devices on the fly. The /dev entries are layed out as follows, /dev/usbctl = master device /dev/usb/0.1.0.5 = usb device, (<bus>.<dev>.<iface>.<endpoint>) /dev/ugen0.1 -> usb/0.1.0.0 = ugen link to ctrl endpoint This also removes the custom permissions model from USB. Bump __FreeBSD_version to 800066. Submitted by: rink (earlier version)
* Fix compiler warning.thompsa2009-02-241-0/+1
|
OpenPOWER on IntegriCloud