| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Resolve a special case deadlock: When two or more threads are
simultaneously detaching kernel drivers on the same USB device we can
get stuck in the "usb_wait_pending_ref_locked()" function because the
conditions needed for allowing detach are not met.
While at it ensure that "flag_iserror" is only written when "priv_mtx"
is locked, which is protecting it.
|
|
|
|
|
|
|
|
|
| |
Resolve a deadlock setting the USB configuration index from userspace
on USB HUBs by moving the code into the USB explore threads. The
deadlock happens because child devices of the USB HUB don't have the
expected reference count when called from outside the explore
thread. Only the HUB device itself, which the IOCTL interface locks,
gets the correct reference count.
|
|
|
|
|
|
|
|
|
|
| |
- Separate I/O errors from reception of STALL PID.
- Implement better error recovery for Transaction Translators, TTs,
found in High Speed USB HUBs which translate from High Speed USB into
FULL or LOW speed USB. In some rare cases SPLIT transactions might get
lost, which might leave the TT in an unknown state. Whenever we detect
such an error try to issue either a clear TT buffer request, or if
that is not possible reset the whole TT.
|
|
|
|
|
|
|
|
| |
Fix a deadlock when trying to power off a USB device. The deadlock
happens because the code in question is trying to modify the parent
USB port registers outside the USB explore thread.
Approved by: re (glebius)
|
|
|
|
|
|
|
|
| |
in reduced memory systems.
- Split allocation and freeing of the configuration descriptor into a separate
function, so that the configuration descriptor can be made fixed size
to save memory allocations. This applies for both device and host mode.
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
so that simultaneous access cannot happen. Protect scratch area using
the enumeration lock. Also reduce stack usage in usbd_transfer_setup()
by moving some big stack members to the scratch area. This saves around
200 bytes of stack.
- Fix a whitespace.
MFC after: 1 week
|
|
|
|
| |
MFC after: 2 weeks
|
|
|
|
|
|
|
|
|
|
|
|
| |
which does not support the no synchronize cache SCSI command.
The __FreeBSD_version version macro has been bumped and
external kernel modules needs to be recompiled after
this patch.
Approved by: re (kib)
MFC after: 1 week
PR: usb/160299
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
High-speed USB HUB by resetting the transaction translator (TT)
before trying re-enumeration. Also when clear-stall fails multiple times
try a re-enumeration.
Suggested by: Trevor Blackwell
MFC after: 14 days
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mode in the USB core. The patch mostly consists of updating the USB
HUB code to support USB 3.0 HUBs. This patch also add some more USB
controller methods to support more active-alike USB controllers like
the XHCI which needs to be informed about various device state events.
USB 3.0 HUBs are not tested yet, due to lack of hardware, but are
believed to work.
After this update the initial device descriptor is only read twice
when we know that the bMaxPacketSize is too small for a single packet
transfer of this descriptor.
Approved by: thompsa (mentor)
|
|
|
|
|
|
|
| |
This patch can solve problems when multiple USB devices are
re-enumerated at the same time on the same bus.
Approved by: thompsa (mentor)
|
|
|
|
|
|
|
|
|
|
| |
USB enumeration lock is locked, then the USB stack fails to resume the device
because locking the USB enumeration lock is part of the resume procedure. To
solve this issue a new lock is introduced which only protects the suspend and
resume callbacks, which can be dropped inside the usbd_do_request_flags()
function, to allow suspend and resume during so-called enumeration operations.
Submitted by: Hans Petter Selasky
|
|
|
|
| |
than default_*.
|
| |
|
|
|
|
| |
Submitted by: Hans Petter Selasky
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- clean up USB detach logic. There seems to be some problems detaching multiple
USB HUBs connected in series from the root.
- after this patch the rule is:
1) Always use device_detach() on the USB HUB first.
2) Never just device_delete_child() on the USB HUB, because that function
will traverse to all the device leaves and free them first, and then the USB
stack will free the devices twice which doesn't work very well.
- make sure the did DMA delay gets set after the timeout has elapsed to make
logic more clear. There is no functional difference.
Submitted by: Hans Petter Selasky
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
- Reduce the number of headers needed for a usb driver, the common case is just usb.h and usbdi.h
|
| |
|
| |
|
| |
|
|
|
|
| |
usb_pipe may be used for a different purpose later on.
|
|
|
|
| |
USB_ADD_BYTES macro.
|
| |
|
| |
|
|
|
|
| |
arrays in the usb_device struct. This also eliminates USB_HAVE_STRINGS.
|
| |
|
|
|
|
|
|
| |
- change variable types to use the enum
Submitted by: Hans Petter Selasky [1]
|
|
|
|
|
|
|
|
| |
to be set via two variables (peer_suspended and self_suspended) and can not be
merged into one.
Submitted by: Hans Petter Selasky
Pointy hat: me
|
|
|
|
|
|
|
|
|
| |
helps
to avoid touching the device when it is not going to respond and would otherwise
timeout.
Implement the suspend tracking as a udev state too.
|
|
|
|
|
|
|
|
|
| |
Use direct reference to parent high-speed HUB instead of indirect, due to
pointer clearing race at detach of parent USB HUB.
Reported by: kientzle
Submitted by: Hans Petter Selasky
PR: usb/133545
|
|
|
|
|
|
| |
Remove code for unused and unlikely quirk, "uq_power_claim"
Submitted by: Hans Petter Selasky
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- make usb2_power_mask_t 16-bit
- remove "usb2_config_sub" structure from "usb2_config". To compensate for this
"usb2_config" has a new field called "usb_mode" which select for which mode
the current xfer entry is active. Options are: a) Device mode only b) Host
mode only (default-by-zero) c) Both modes. This change was scripted using
the following sed script: "s/\.mh\././g".
- the standard packet size table in "usb_transfer.c" is now a function, hence
the code for the function uses less memory than the table itself.
Submitted by: Hans Petter Selasky
|
|
|
|
|
|
|
|
| |
- memory usage reduction by only allocating the required USB pipes and USB
interfaces.
- cleanup some USB parsing functions to be more flexible.
Submitted by: Hans Petter Selasky
|
|
|
|
|
|
| |
Remove unused field in "struct usb2_pipe".
Submitted by: Hans Petter Selasky
|
|
|
|
| |
Submitted by: Hans Petter Selasky
|
|
|
|
|
|
|
| |
- start using the new USB typedefs in the USB core
- Remove usage of USB_ADD_BYTES()
Submitted by: Hans Petter Selasky
|
|
|
|
|
|
| |
Add ifdefs for making parts of usb conditional.
Submitted by: Hans Petter Selasky
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
- Do not recreate the device nodes in set_alt_interface as the endpoints do not
change.
Submitted by: Hans Petter Selasky
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
| |
Add support for setting and getting the USB template value through libusb20 and
usbconfig.
Submitted by: Hans Petter Selasky
|
|
|
|
|
|
| |
Changes to make implementing USB NDIS easier.
Submitted by: Hans Petter Selasky
|
|
|