DragonFly BSD

CVS log for src/sys/dev/usbmisc/umass/umass.c

[BACK] Up to [DragonFly] / src / sys / dev / usbmisc / umass

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.40: download - view: text, markup, annotated - select for diffs
Sat Aug 16 21:42:19 2008 UTC (5 years, 11 months ago) by thomas
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.39: preferred, unified
Changes since revision 1.39: +1 -1 lines
Add missing `)'.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Sat Aug 16 17:48:16 2008 UTC (5 years, 11 months ago) by hasso
Branches: MAIN
Diff to: previous 1.38: preferred, unified
Changes since revision 1.38: +12 -13 lines
Fix some NULL pointer dereferences, most of the in debug code though.

Found-by: LLVM/Clang Static Analyzer

Revision 1.38: download - view: text, markup, annotated - select for diffs
Sun May 18 20:30:23 2008 UTC (6 years, 2 months ago) by pavalos
Branches: MAIN
CVS tags: DragonFly_RELEASE_2_0_Slip, DragonFly_RELEASE_2_0, DragonFly_Preview
Diff to: previous 1.37: preferred, unified
Changes since revision 1.37: +1 -0 lines
Sync CAM with FreeBSD using lockmgr locks instead of mutexes.
Note:  This is mostly a code sync with FreeBSD which improves stability
in addition to the items listed below.  This provides a framework for
releasing the mplock, but for now it's still there.

Add an xpt_print function to reduce most of the xpt_print_path/printf
pairs. Convert the core code to use it.

Initial cut at Basic Domain Validation.

Make cam_xpt's pronouncements match camcontrol (Tagged -> Command) Queueing.

Pay attention to return value from xpt_bus_register in xpt_init.

Add an xpt_rescan function and a thread that will field rescan requests.
The purpose of this is to allow a SIM (or other entities) to request a bus
rescan and have it then fielded in a different (process) context from the
caller.

Check the return value from cam_periph_acquire.

Drop the periph/sim lock when calling disk_destroy().

Drop the topology lock before calling the periph oninvalidate and dtor
vectors.

For the XPT_SASYNC_CB operation, only decouple the broadcast to the bus
and device lists instead of decoupling the whole operation.  This avoids
problems with SIMs going away.

Split the camisr into per-SIM done queues.  This optimizes the locking a
little bit and allows for direct dispatch of the doneq from certain
contexts that would otherwise face recursive locking problems.

Zero the CCBs when mallocing them.

Only schedule the xpt_finishconfig_task once.

Eliminate the use of M_TEMP.

Add a helper function for registering async callbacks.

Release the bus reference that is acquired when doing a CAMIOCOMMAND ioctl.

Zero scsi_readcapacity allocations so we can really tell if there has
been data returned.

Remove duplicate includes and fix typos.

Add a bunch of definitions and structures to support newer drivers.

When probing a newly found device, don't automatically assume that the
device supports retrieving a serial number.  Instead, first query the
list of VPD pages it does support, and only query the serial number if
it's supported, else silently move on.  This eliminates a lot of noise
during verbose booting, and will likely eliminate the need for most
NOSERIAL quirks.

Reduce diffs from FreeBSD.

Obtained-from: FreeBSD

Revision 1.37: download - view: text, markup, annotated - select for diffs
Sun Feb 10 00:01:03 2008 UTC (6 years, 5 months ago) by pavalos
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_12_Slip, DragonFly_RELEASE_1_12
Diff to: previous 1.36: preferred, unified
Changes since revision 1.36: +0 -10 lines
Make CAM_NEW_TRAN_CODE default.

As previously mentioned, this makes a huge performance difference for one
of my disks, and future work depends on this change.

Obtained-from: FreeBSD

Revision 1.36: download - view: text, markup, annotated - select for diffs
Wed Jan 16 12:27:49 2008 UTC (6 years, 6 months ago) by matthias
Branches: MAIN
Diff to: previous 1.35: preferred, unified
Changes since revision 1.35: +524 -8 lines
Update the list of USB device IDs for umass(4) and needed routines.

Reviewed-by: hasso@
Taken-from: FreeBSD

Revision 1.35: download - view: text, markup, annotated - select for diffs
Wed Jan 2 19:29:59 2008 UTC (6 years, 6 months ago) by hasso
Branches: MAIN
Diff to: previous 1.34: preferred, unified
Changes since revision 1.34: +14 -9 lines
Pay attention to the timeout value passed down by the upper layer. This
fix makes USB CD/DVD writers work.

Obtained-from: NetBSD via FreeBSD

Revision 1.34: download - view: text, markup, annotated - select for diffs
Wed Jan 2 10:45:31 2008 UTC (6 years, 6 months ago) by hasso
Branches: MAIN
Diff to: previous 1.33: preferred, unified
Changes since revision 1.33: +2 -1 lines
Make NO_GETMAXLUN quirk really do something useful.

Obtained-from: FreeBSD

Revision 1.33: download - view: text, markup, annotated - select for diffs
Wed Jan 2 10:43:28 2008 UTC (6 years, 6 months ago) by hasso
Branches: MAIN
Diff to: previous 1.32: preferred, unified
Changes since revision 1.32: +11 -3 lines
When attached to a high-speed device, report a more appropriate
base transfer speed to CAM. The actual value used (40MB/s) is fairly
arbitrary, but assumes the same 33% overhead as was implied by the
1MB/s figure we used for USB1 devices.

Obtained-from: FreeBSD

Revision 1.32: download - view: text, markup, annotated - select for diffs
Wed Jan 2 10:31:53 2008 UTC (6 years, 6 months ago) by hasso
Branches: MAIN
Diff to: previous 1.31: preferred, unified
Changes since revision 1.31: +5 -40 lines
Pass all ATAPI commands through. Fixes detecting capabilities of DVD
writers.

Obtained-from: FreeBSD with modifications.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Sun Dec 23 07:00:57 2007 UTC (6 years, 7 months ago) by pavalos
Branches: MAIN
Diff to: previous 1.30: preferred, unified
Changes since revision 1.30: +8 -0 lines
Fixes for CAM_NEW_TRAN_CODE.

This commit is taken from a FreeBSD changeset, and is not intended to
be comprehensive.  Some drivers will still not compile/work with the
CAM_NEW_TRAN_CODE option, but this opens the door for wider testing.

Obtained-from: FreeBSD

Revision 1.30: download - view: text, markup, annotated - select for diffs
Tue Nov 6 07:37:01 2007 UTC (6 years, 8 months ago) by hasso
Branches: MAIN
Diff to: previous 1.29: preferred, unified
Changes since revision 1.29: +0 -4 lines
Kill devinfo handling in drivers, set device description in one place -
usbd_probe_and_attach() and let generic device code to output descriptions.

Obtained-from: FreeBSD with modifications

Revision 1.29: download - view: text, markup, annotated - select for diffs
Mon Nov 5 19:09:43 2007 UTC (6 years, 8 months ago) by hasso
Branches: MAIN
Diff to: previous 1.28: preferred, unified
Changes since revision 1.28: +0 -1 lines
Nuke usbdevs and references to it.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Mon Nov 5 13:32:28 2007 UTC (6 years, 8 months ago) by hasso
Branches: MAIN
Diff to: previous 1.27: preferred, unified
Changes since revision 1.27: +138 -119 lines
Kill usage of USB_VENDOR_FOO and USB_PRODUCT_BAR defines mostly using two
methods:

  - USB_DEVICE(vendor_id, product_id) macro.
  - Using C99 structure initialisers.

While at it, kill all custom "vendor and product id pair" structures and
custom walkthrough methods for these structures.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Mon Jul 2 23:52:05 2007 UTC (7 years, 1 month ago) by hasso
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_10_Slip, DragonFly_RELEASE_1_10
Diff to: previous 1.26: preferred, unified
Changes since revision 1.26: +22 -1 lines
Nuke USB_DECLARE_DRIVER and USB_DECLARE_DRIVER_INIT macros.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sun Jul 1 21:24:03 2007 UTC (7 years, 1 month ago) by hasso
Branches: MAIN
Diff to: previous 1.25: preferred, unified
Changes since revision 1.25: +23 -18 lines
Nuke USB_MATCH*, USB_ATTACH* and USB_DETACH* macros.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Thu Jun 28 13:55:13 2007 UTC (7 years, 1 month ago) by hasso
Branches: MAIN
Diff to: previous 1.24: preferred, unified
Changes since revision 1.24: +1 -1 lines
Nuke SIMPLEQ_* and logprintf.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Thu Jun 28 06:32:32 2007 UTC (7 years, 1 month ago) by hasso
Branches: MAIN
Diff to: previous 1.23: preferred, unified
Changes since revision 1.23: +172 -172 lines
Nuke device_ptr_t, USBBASEDEVICE, USBDEVNAME(), USBDEVUNIT(), USBGETSOFTC(),
USBDEVPTRNAME() and Static with help from sed(1).

Revision 1.23: download - view: text, markup, annotated - select for diffs
Wed Jun 27 12:28:00 2007 UTC (7 years, 1 month ago) by hasso
Branches: MAIN
Diff to: previous 1.22: preferred, unified
Changes since revision 1.22: +0 -2 lines
Nuke the code specific to NetBSD/OpenBSD/FreeBSD at first. I doubt anyone
will update these pieces and I don't intend to review macros for all
platforms.

There is the chance though that I might kill something which should stay
in the code in form "TODO: port it to DF". So, please review and kick me.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Thu Jun 14 01:10:25 2007 UTC (7 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.21: preferred, unified
Changes since revision 1.21: +3 -9 lines
xpt_bus_deregister() never returns 0, don't test for it.

Assert that the sim is attached if a backend sim function is called,
because cam_sim_free() now replaces the functions when the sim is
detached.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Wed Jun 13 20:45:24 2007 UTC (7 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.20: preferred, unified
Changes since revision 1.20: +6 -0 lines
Refuse to poll a detached sim.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Fri Dec 22 23:26:26 2006 UTC (7 years, 7 months ago) by swildner
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_8_Slip, DragonFly_RELEASE_1_8
Diff to: previous 1.19: preferred, unified
Changes since revision 1.19: +38 -38 lines
Rename printf -> kprintf in sys/ and add some defines where necessary
(files which are used in userland, too).

Revision 1.19: download - view: text, markup, annotated - select for diffs
Wed Dec 20 18:14:41 2006 UTC (7 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.18: preferred, unified
Changes since revision 1.18: +3 -3 lines
Rename sprintf  -> ksprintf
Rename snprintf -> knsprintf

Make allowances for source files that are compiled for both userland and
the kernel.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Tue Sep 5 00:55:44 2006 UTC (7 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.17: preferred, unified
Changes since revision 1.17: +3 -3 lines
Rename malloc->kmalloc, free->kfree, and realloc->krealloc.  Pass 1

Revision 1.17: download - view: text, markup, annotated - select for diffs
Wed May 3 15:08:43 2006 UTC (8 years, 2 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_6_Slip, DragonFly_RELEASE_1_6
Diff to: previous 1.16: preferred, unified
Changes since revision 1.16: +3 -7 lines
Add a missing ohci_waitintr() call that allows polled operation of
bulk transfers to have a chance of working.  Kernel crash dumps
to umass() work with this change.

Submitted-by: Gary <gary@velocity-servers.net>
Taken-from: FreeBSD PR:usb/93720

Revision 1.16: download - view: text, markup, annotated - select for diffs
Tue May 2 16:08:44 2006 UTC (8 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.15: preferred, unified
Changes since revision 1.15: +4 -2 lines
Plug memory leak in umass.

Submitted-by: Gary <gary@velocity-servers.net>
Taken-from: FreeBSD/NetBSD

Revision 1.15: download - view: text, markup, annotated - select for diffs
Sat Oct 8 11:34:25 2005 UTC (8 years, 9 months ago) by corecode
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_4_Slip, DragonFly_RELEASE_1_4
Diff to: previous 1.14: preferred, unified
Changes since revision 1.14: +24 -0 lines
Bring in FreeBSD rev 1.123:
  revision 1.123
  date: 2005-07-19 07:18:23 +0200;  author: delphij;  state: Exp;  lines: +5 -0;
  PLAY_MSF, PLAY_TRACK, PLAY_TRACK_REL, PAUSE, PLAY_12 commands to pass
  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

Submitted-by: Xin Li <delphij@freebsd.org>

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sat Dec 18 06:22:48 2004 UTC (9 years, 7 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_Stable, DragonFly_RELEASE_1_2_Slip, DragonFly_RELEASE_1_2
Diff to: previous 1.13: preferred, unified
Changes since revision 1.13: +1 -1 lines
Cleanup missing and duplicate defines from the last commit, rename an
entry in umass to conform.

Reported-by: "Alexander \"alxl\" Lobachov" <alxl@alxl.info>

Revision 1.13: download - view: text, markup, annotated - select for diffs
Wed Sep 15 01:38:13 2004 UTC (9 years, 10 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_Snap29Sep2004
Diff to: previous 1.12: preferred, unified
Changes since revision 1.12: +19 -0 lines
When a umass storage device is unplugged there might be pending requests
which either fail or wind up in limbo.  The state machine will attempt to
issue a BBB RESET, but since this does not occur on our bulk or interrupt
pipes simply aborting the pipes is not sufficient to ensure that all of our
xfer requests have been idled.

We must also wait for any in-progress RESET's to complete, which is
accomplished by testing sc->transfer_state.  Otherwise we may wind up
freeing an active xfer request and blow up.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Tue Sep 14 23:48:27 2004 UTC (9 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.11: preferred, unified
Changes since revision 1.11: +6 -9 lines
timeout/untimeout ==> callout_*

Revision 1.11: download - view: text, markup, annotated - select for diffs
Mon Mar 15 05:45:19 2004 UTC (10 years, 4 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_Snap13Sep2004, DragonFly_1_0_REL, DragonFly_1_0_RC1, DragonFly_1_0A_REL
Diff to: previous 1.10: preferred, unified
Changes since revision 1.10: +16 -2 lines
When detaching UMASS, abort all the pipes before detaching the sim.  Note
sim detachment path is:  umass_cam_detach_sim -> xpt_bus_deregister ->
cam_sim_free.  If there is anything pending as of the cam_sim_free() bad
things will happen.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Mon Mar 15 02:27:57 2004 UTC (10 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.9: preferred, unified
Changes since revision 1.9: +1 -1 lines
Do some M_WAITOK<->M_INTWAIT cleanups.  Code entered from userland, such as
device open and device ioctl, generally use M_WAITOK, while low level
structures such as the capacity structure are allocated using M_INTWAIT.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Mon Mar 15 01:10:45 2004 UTC (10 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.8: preferred, unified
Changes since revision 1.8: +13 -6 lines
The cam_sim structure was being deallocated unconditionally by device
driver detach routines.  The problem with this is that part of the CAM
bus structure may still be active (for example, with pending timeout()'s),
and even though the bus, target, and device is freed, since the sim IS
freed any accesses through the sim will hit 0xdeadc0de.  This case most often
occurs with USB UMASS devices.

The CAM_XPT and CAM_SIM layer has been revamped.  CAM_DEV_UNCONFIGURED is now
accounted for in the device->refcount, and the cam_sim structure is now
ref-counted as well.  Additionally, the cam_simq* code which handles the
device queues has been revamped to refcount as well, so shared device queues
(raid and multi-channel devices) are not free()'d before all references have
gone away.

scsi_low free'd its cam_sim twice.  Fixed.

USB was improperly using M_NOWAIT.  All M_NOWAIT instances have been renamed
to M_INTWAIT.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Sat Feb 14 19:56:28 2004 UTC (10 years, 5 months ago) by dillon
Branches: MAIN
Diff to: previous 1.7: preferred, unified
Changes since revision 1.7: +12 -8 lines
Actively manage cam rescan timeouts in the usb subsystem.  This does not
fix any known issues but it should make things a bit more robust.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Wed Feb 11 15:13:06 2004 UTC (10 years, 5 months ago) by joerg
Branches: MAIN
Diff to: previous 1.6: preferred, unified
Changes since revision 1.6: +1 -1 lines
Add defined(__FreeBSD__) and defined(__DragonFly__) where appropiriate.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Tue Dec 30 01:01:47 2003 UTC (10 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.5: preferred, unified
Changes since revision 1.5: +541 -544 lines
Bring in the entire FreeBSD-5 USB infrastructure.  As of this commit my
USB camera, Hard Drive, Mouse, and Sony memory key all work and I can even
unplug and replug them in without crashing the port.

Not all drivers and subsystems compile as of this commit, but the ones that
do not are very close.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Mon Dec 29 06:42:19 2003 UTC (10 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.4: preferred, unified
Changes since revision 1.4: +33 -6 lines
Synchronize the USB, CAM, and TASKQUEUE subsystems with FreeBSD RELENG_4.
Also update the $FreeBSD$ ids in the files to the synchronized rev numbers.

This has the side effect of bringing in some additional SCSI robustness
checks, bug fixes, quirk inheritance between subsystems (e.g. USB now sets
PIM_NO_6_BYTE by default and CAM now understands it).

This also brings in a huge amount of SCSI CD code that had been MFCd to
FreeBSD-4 from FreeBSD-5.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sat Nov 15 21:05:42 2003 UTC (10 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.3: preferred, unified
Changes since revision 1.3: +1 -0 lines
Misc cleanups to take care of GCC3.x warnings.  Missing 'U' and 'LL'
postfixes on large unsigned or 64 bit constants, non-storage structural
declarations embedded in structures, deprecated use of __FUNCTION__,
missing 'break' statements in the last switch case, goto label ops where
the label occurs just before an end-brace (many of which appear to be
fixable with 'break' or 'continue' instead and existed simply due to
programmer-paranoia), garbage data in #endif lines that was not commented
out.  GCC3 also caught some argument count issues in kernel printfs.

Many of these (obvious) fixes are similar to or copied from 5.x.

Also fix a few other minor issues such as certain drivers declaring a
proc pointer instead of a thread pointer.

Move -ffreestanding from CWARNFLAGS to CFLAGS.  It doesn't belong in
CWARNFLAGS.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Thu Aug 7 21:17:14 2003 UTC (10 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.2: preferred, unified
Changes since revision 1.2: +13 -13 lines
kernel tree reorganization stage 1: Major cvs repository work (not logged as
commits) plus a major reworking of the #include's to accomodate the
relocations.

    * CVS repository files manually moved.  Old directories left intact
      and empty (temporary).

    * Reorganize all filesystems into vfs/, most devices into dev/,
      sub-divide devices by function.

    * Begin to move device-specific architecture files to the device
      subdirs rather then throwing them all into, e.g. i386/include

    * Reorganize files related to system busses, placing the related code
      in a new bus/ directory.  Also move cam to bus/cam though this may
      not have been the best idea in retrospect.

    * Reorganize emulation code and place it in a new emulation/ directory.

    * Remove the -I- compiler option in order to allow #include file
      localization, rename all config generated X.h files to use_X.h to
      clean up the conflicts.

    * Remove /usr/src/include (or /usr/include) dependancies during the
      kernel build, beyond what is normally needed to compile helper
      programs.

    * Make config create 'machine' softlinks for architecture specific
      directories outside of the standard <arch>/include.

    * Bump the config rev.

    WARNING! after this commit /usr/include and /usr/src/sys/compile/*
    should be regenerated from scratch.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Tue Jun 17 04:28:32 2003 UTC (11 years, 1 month ago) by dillon
Branches: MAIN
CVS tags: PRE_MP
Diff to: previous 1.1: preferred, unified
Changes since revision 1.1: +1 -0 lines
Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids.  Most
ids have been removed from !lint sections and moved into comment sections.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Tue Jun 17 02:54:30 2003 UTC (11 years, 1 month ago) by dillon
Branches: MAIN
CVS tags: FREEBSD_4_FORK
import from FreeBSD RELENG_4 1.11.2.19

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options