appeared to rely on all kinds of non-guaranteed behaviours: the
transfer abort code assumed that TDs with no interrupt timeout
configured would end up on the done queue within 20ms, the done
queue processing assumed that all TDs from a transfer would appear
at the same time, and there were access-after-free bugs triggered
on failed transfers.
Attempt to fix these problems by the following changes:
- Use a maximum (6-frame) interrupt delay instead of no interrupt
delay to ensure that the 20ms wait in ohci_abort_xfer() is enough
for the TDs to have been taken off the hardware done queue.
- Defer cancellation of timeouts and freeing of TDs until we either
hit an error or reach the final TD.
- Remove TDs from the done queue before freeing them so that it
is safe to continue traversing the done queue.
This appears to fix a hang that was reproducable with revision 1.67
or 1.68 of ulpt.c (earlier revisions had a different transfer
pattern). With certain HP printers, the command "true > /dev/ulpt0"
would cause ohci_add_done() to spin because the done queue had a
loop. The list corruption was caused by a 3-TD transfer where the
first TD completed but remained on the internal host controller
done queue because it had no interrupt timeout. When the transfer
timed out, the TD got freed and reused, so it caused a loop in the
done queue when it was inserted a second time from a different
transfer.
Reported by: Alex Pivovarov
MFC after: 1 week
just discard the received frame and reuse the old mbuf.
This should prevent the connection from stalling after high network traffic.
MFC after: 2 weeks
from the printer and discarding the data even if the ulpt device
was opened for reading. This resulted in crashes because two
conconcurrent read transfers were using the same transfer structure.
PR: usb/88886
Reported By: Alex Pivovarov
MFC after: 1 week
rather than in ifindex_table[]; all (except one) accesses are
through ifp anyway. IF_LLADDR() works faster, and all (except
one) ifaddr_byindex() users were converted to use ifp->if_addr.
- Stop storing a (pointer to) Ethernet address in "struct arpcom",
and drop the IFP2ENADDR() macro; all users have been converted
to use IF_LLADDR() instead.
---snip---
FYI this bit isn't needed for FreeBSD - I think it came from either
OpenBSD or NetBSD where arc4random() wasn't available during cold
boot.
---snip---
Explained by: iedowse
Synchronise with NetBSD upto rev 1.19:
- Allow 32 chars in the saved vendor string.
- Some NetBSD-only changes.
- Some missing parts (define, variable).
ehci_pci.c:
Add vendor ids for ATI and Philips.
Add identification strings for the following:
o ALi's M5239
o AMD 8111
o ATI SB200, SB400
o Intel 6300ESB, ICH4, ICH5, ICH7
o NVIDIA nForce 2, nForce 3, nForce 4
o Philips ISP156x
ehcireg.h:
We're at the same level as rev 1.18 from NetBSD.
usb_port.h:
NetBSD/OpenBSD specific things
Obtained from: NetBSD via DragonFly
No comment from: usb@
so that devd can match on it. This field was already available to
usbd and is used by a number of usbd.conf entries, so now it is
possible to transfer those entries to devd.conf.
Submitted by: Anish Mistry
o add ic_curchan and use it uniformly for specifying the current
channel instead of overloading ic->ic_bss->ni_chan (or in some
drivers ic_ibss_chan)
o add ieee80211_scanparams structure to encapsulate scanning-related
state captured for rx frames
o move rx beacon+probe response frame handling into separate routines
o change beacon+probe response handling to treat the scan table
more like a scan cache--look for an existing entry before adding
a new one; this combined with ic_curchan use corrects handling of
stations that were previously found at a different channel
o move adhoc neighbor discovery by beacon+probe response frames to
a new ieee80211_add_neighbor routine
Reviewed by: avatar
Tested by: avatar, Michal Mertl
MFC after: 2 weeks
IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to
ifnet.if_drv_flags. Device drivers are now responsible for
synchronizing access to these flags, as they are in if_drv_flags. This
helps prevent races between the network stack and device driver in
maintaining the interface flags field.
Many __FreeBSD__ and __FreeBSD_version checks maintained and continued;
some less so.
Reviewed by: pjd, bz
MFC after: 7 days
when using mice containing a tilt movement: there was a missing
usb_callout_init() for the UMS_SPUR_BUT_UP quirk code, and UMS_T
was defined to the same flag value as UMS_SPUR_BUT_UP.
Reported by: flz
MFC after: 3 days
over iteration of their multicast address lists when synchronizing the
hardware address filter with the network stack-maintained list.
Problem reported by: Ed Maste (emaste at phaedrus dot sandvine dot ca>
MFC after: 1 week
through umass(4), in order to make cdcontrol(1) to issue commands to
a USB CD driver.
The command IDs were obtained from the CAM subsystem. This was tested
on half dozen of USB CD drivers from different vendors.
Suggested by: "intron" <intron at intron dot ac>
PR: usb/83439
Reviewed by: sanpei
MFC After: 1 week
succeed. There are many printers that return status over the read
channel, and if we wait for the status to become ready, then we can't
find the status automatically. Linux doesn't wait, nor does it ever
seem to really check the status in any meaningful way... If there
really is a problem, the writes to the bulk out endpoint will still
fail (like they would if the printer was ready and then ran out of
paper or became unready).
In addition, there are a number of printers being made that emulate
the 'status' byte by returning '0' always rather than '0x18'. This
fixes the EBUSY on open timeouts on those printer as well.
Reviewed by: the defining silence on usb@