664 Commits

Author SHA1 Message Date
mjacob
0d1e5370c4 MFC xpt_rescan functionality. 2007-03-08 05:30:26 +00:00
n_hibma
f876e34691 MFC:
1.203     +6 -2      src/sys/cam/scsi/scsi_da.c
1.101     +1 -1      src/sys/geom/geom_disk.c

Reduce the noise when plugging in (USB) mass storage devices, like a 4 port
flash card reader.
Also remove an 'Opened da0 -> <random number>' which is not needed on a daily
basis (available through bootverbose).
2007-02-27 12:15:51 +00:00
mjacob
9a3bb80628 MFC 1.171-1.173- check in xpt_init for result of xpt_bus_register. 2006-12-24 03:23:43 +00:00
mjacob
37b4f91fb6 MFC 1.10: avoid some divide by zero cases in calculating geometry. 2006-12-21 19:51:53 +00:00
maxim
46f8d04086 MFC rev. 1.197: X-Micro Flash Disk quirk. 2006-12-19 19:19:16 +00:00
mjacob
7c066d8aa0 MFC the xpt_print function. 2006-12-16 07:05:54 +00:00
flz
0082e4026d MFC:
Add support for Epson USB Scanners (3590 [1] and 4990 [2]).
  Add entries in the uscanner.4 man page (along with missing 3500).
  Add quirk for Logitech iFeel MouseMan USB mouse. [3]
  Add support for Familiar Linux powered iPaq handhelds to cdce(4). [4]
  Add a quirk for the Belkin FC6550-AVR UPS. [5]
  Add support for Netgear FA101 ethernet USB NIC. [6]
  Add support for Psion Gold Port Ethernet USB NIC. [7]
  Add support for Epson Stylus CX4200 in uscanner(4). [8]
  Add support for Novatech NV902 wireless NIC in ural(4). [9]
  Add SCSI da(4) quirk for the iRiver H10. [10]
  Add a SCSI da(4) quirk for Rekam USB Camera. [11]
  Add a USB quirk for Motorola A41x/V32x USB phones. [12]
  Add a USB quirk for CMOTECH CDMA USB modem. [13]
  Add a USB umass(4) quirk for Panasonic KXL-840AN CD-R drive. [14]

      src/share/man/man4/aue.4: rev 1.24 -> 1.25
      src/sys/dev/usb/if_aue.c: rev 1.99 -> 1.100
      src/sys/dev/usb/usbdevs: rev 1.264 -> 1.275
      src/sys/dev/usb/if_cdce.c: rev 1.15 -> 1.16
      src/sys/dev/usb/umass.c: rev 1.137 -> 1.138
      src/share/man/man4/uscanner.4: rev 1.27 -> 1.29
      src/share/man/man4/ural.4: rev 1.10 -> 1.11
      src/sys/dev/usb/usb_quirks.c: rev 1.50 -> 1.54
      src/sys/dev/usb/uscanner.c: rev 1.74 -> 1.76
      src/sys/cam/scsi/scsi_da.c: rev 1.192 -> 1.194
      src/sys/dev/usb/if_kue.c: rev 1.70 -> 1.71
      src/share/man/man4/kue.4: rev 1.23 -> 1.24
      src/sys/dev/usb/if_ural.c: rev 1.45 -> 1.46

PR:		usb/100957 [1], usb/100992 [2], usb/101066 [3],
		usb/103865 [4], usb/102260 [5], usb/102286 [6],
		usb/102296 [7], usb/102851 [8], usb/102852 [9],
		usb/102547 [10], usb/98713 [11], usb/97512 [12],
		usb/97948 [13], usb/81073 [14]
Submitted by:	Jim Teresco <terescoj@teresco.org> [1],
		Walter C. Pelissero <walter.pelissero@iesy.net> [2],
		Heiko Przybyl <zuxez@uni.de> [3],
		Alexey Roslyakov <internetworking@mail.ru> [4],
		David Grochowski <grocho98@students.rowan.edu> [5],
		Volker <volker@vwsoft.com> [6,7],
		Jonathan Fosburgh <jonathan@fosburgh.org> [8,9],
		Sven Esbjerg <freebsd-pr@xbsd.net> [10],
		Alex <goo@t72.ru> [11],
		Mark Diekhans <markd@kermodei.com> [12],
		Alexei Volkov <kot@kotzone.ru> [13],
		James E. Flemer <jflemer@alum.rpi.edu> [14]
Approved by:	re (kensmith)
2006-11-14 12:54:39 +00:00
mjacob
d7043966d1 MFC 1.63: Put a bit of hysteresis into both BUSY SCSI status returns
and CAM_RESRC_UNAVAIL returns.
Approved by:	re (kensmith)
2006-10-09 21:44:23 +00:00
mjacob
87bae196d5 MFC 1.165: New Dell 1950/2950 SES backplane drops off
the bus if you poke at greater then lun 0.

Approved by:	re (hrs)
2006-09-23 18:42:08 +00:00
mjacob
2aa3c36777 MFC 1.163- give VMware disks min/max tags in their quirk.
Approved by:	releng
2006-09-15 20:44:39 +00:00
ken
ee3ba3fa39 MFC, camcontrol reportluns support:
camcontrol.8: rev 1.42
camcontrol.c: rev 1.54
scsi_all.c:   rev 1.49
scsi_all.h:   rev 1.26

Implement 'camcontrol reportluns'.  This allows users to send the SCSI
REPORT LUNS command to a device.

camcontrol.[c8]:	Implement reportluns.  This tries to print the LUNs
			out in a reasonable format.  Only the periph
			addressing method has been tested, since very little
			hardware that I know of supports the other methods.

scsi_all.[ch]:		Revamp the report luns CDB structure and helper
			functions.  This constitutes a little bit of an API
			change, but since the old CDB length was 10 bytes,
			and the REPORT LUNS CDB length is actually 12 bytes,
			it's clear that no one was using this API in the
			first place.
2006-09-09 07:21:18 +00:00
jhb
f43913bbec MFC: Typo fix. 2006-08-17 19:55:35 +00:00
delphij
24b9613a50 MFC scsi_cd.c,v 1.96 and scsi_da.c,v 1.191
Drop Giant before returning in error path, thus eliminates
two mutex leaks.

Submitted by:   Beyond Luo <fedora ercist iscas ac cn>
PR:             kern/100046
2006-07-26 07:49:37 +00:00
mjacob
4fb0d8444f MFC Basic Queueing model fixes. 2006-06-29 18:12:18 +00:00
mjacob
c5e8c5905e MFC 1.162: Grumble. VMWare ESX and VMWare WorkStation have *slightly*
different inquiry data (pointlessly different I might add). Pick
the common parts.
2006-06-26 05:42:54 +00:00
mjacob
bf5c32871a MFC 1.161: VMware disk volumes are only on LUN 0, and
some VMware HBAs have known bugs with commands sent to
other than LUN 0.
2006-06-25 02:03:18 +00:00
mjacob
d70a82fe55 MFC sequential scan probing changes 2006-06-08 17:51:27 +00:00
maxim
066d85f5e5 MFC rev. 1.95: do not double i/o stats for cd(4).
Approved by:	re (kensmith)
2006-05-01 19:55:13 +00:00
joerg
21ede35923 Add reference to PR for TOSHIBA TransMemory quirk entry.
Approved by:	re (implicitly)
2006-03-18 21:15:40 +00:00
flz
59e6f5d5cc MFC:
- Add a scsi_da.c and a umass.c quirk for Genesys 6-in-1 Card Reader.

      src/sys/dev/usb/usbdevs: rev 1.250 -> 1.251
      src/sys/cam/scsi/scsi_da.c: rev 1.185 -> 1.186
      src/sys/dev/usb/umass.c: rev 1.130 -> 1.131

Approved by:	re (mux)
2006-03-18 20:30:26 +00:00
joerg
95a2ca40ce MFC rev 1.187: Add no synchronize cache quirk for TOSHIBA TransMemory
USB stick.

Approved by:	re (scottl)
2006-03-17 21:30:03 +00:00
mjacob
1c024f228c MFC 1.4 to make sure the ioctl doesn't get smushed.
Approved by:	re@freebsd.org
2006-03-09 21:43:10 +00:00
iedowse
b78ca41482 MFC: when deregistering a bus, attempt to flush out all outstanding
operations before returning, and point the bus at a dummy cam_sim
structure. This avoids crashes in camisr() when umass devices are
unplugged during probing.

It may however be better to simply sleep in xpt_bus_deregister()
until all operations have completed, but it is still useful to have
this MFC'd in the meantime.

Approved by:	re (scottl)
2006-02-26 22:38:39 +00:00
flz
107394df65 MFC:
Add Product IDs :
  - Sandisk Cruzer Micro 128MB [5]
  - DANE-ELEC zMate 512MB USB flash drive [7]
  - Attache 256MB USB 2.0 Flash Drive [8]
  - Sandisk Cruzer Micro 256MB [9]

  Add scsi_da.c quirks :
  - Samsung USB key 128Mb [1]
  - Kingston DataTraveler 2.0 [2]
  - Creative MuVo Slim [3]
  - United MP 5512 Portable MP3 Player [4]
  - Sandisk Cruzer Micro 128MB [5], [9]
  - PNY USB Flash keys [6], [7], [8]

  Add umass.c quirks :
  - Sandisk Cruzer Micro 128MB [5]
  - DANE-ELEC zMate 512MB USB flash drive [7]
  - Attache 256MB USB 2.0 Flash Drive [8]
  - Sandisk Cruzer Micro 256MB [9]

      src/sys/dev/usb/usbdevs: rev 1.249 -> 1.250
      src/sys/cam/scsi/scsi_da.c: rev 1.184 -> 1.185
      src/sys/dev/usb/umass.c: rev 1.128 -> 1.130

PR:		usb/90081 [1],
		usb/89196 [2],
		kern/86131 [3],
		usb/80487 [4],
		usb/75970 [5],
		usb/75578 [6],
		usb/72344 [7],
		usb/65436 [8],
		usb/70835 [9]
Submitted by:	Henri-Pierre CHARLES <hpc@prism.uvsq.fr> [1],
		Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua> [2],
		Erich Rickheit KSC <rickheit-fbp@numachi.com> [3],
		tnu@chania.di.uoa.gr [4],
		Bram Abbekerk <bram@abbekerk.demon.nl> [5],
		Thomas Pornin <pornin@bolet.org> [6],
		parv <parv@pair.com> [7],
		Peter D. Quilty <pdquilty@adelphia.net> [8],
		Raymundo M. Vega <rvega@ms-smtp-03-eri0.socal.rr.com> [9]
2006-01-29 00:46:57 +00:00
mjacob
2be2ae5bdf (MFC 1.106)
Incorporate the O_NONBLOCK open semantics of Linux and Solaris.
2006-01-26 04:57:04 +00:00
mnag
2654b13145 MFC: src/sys/cam/scsi/scsi_da.c 1.184
Allow to use Time DPA20B 1GB MP3 Player [1]
Allow to use Qware BeatZkey! Pro [2]

PR:		usb/81846 [1], usb/79164 [2]
Submitted by:	Ruben de Groot <rdg@bzerk.org> [1], Radek Kozlowski <radek@raadradd.com> [2]
Approved by:	njl (implict)
2006-01-20 19:23:47 +00:00
pjd
8e11cbfa32 MFC: share/man/man4/umass.4 1.41
sys/cam/scsi/scsi_da.c	1.182
	sys/dev/usb/umass.c	1.125
	sys/dev/usb/usbdevs	1.238

Allow to use TransFlash drive, which can be found in Motorola E398 Mobile Phone.

PR:		usb/89889
Submitted by:	Wojciech A. Koszek <dunstan@freebsd.czest.pl>
2006-01-20 14:52:13 +00:00
jdp
9bb59aa42a MFC: Fix a bug that caused some /dev entries to continue to exist after
the underlying drive had been hot-unplugged from the system.

This merges the following revisions:

  Revision  Path
  1.94      src/sys/cam/scsi/scsi_cd.c
  1.181     src/sys/cam/scsi/scsi_da.c
  1.98      src/sys/geom/geom_disk.c
  1.5       src/sys/geom/geom_disk.h
  1.88      src/sys/geom/geom_subr.c
2005-11-26 22:55:20 +00:00
mjacob
d8758cacdd MFC 1.156 (mjacob). Original log:
>Make the exploring of all luns supported by an HBA more of a
>tunable (until we get REPORT LUNS in place).
>
>If we're probing luns, and each probe succeeds, we keep going past
>lun 7 if we're a SCSI3 or better device (until we fail to probe).
>
>If we're probing luns, and a probe fails, we only keep going if
>we're quirked *for* it (CAM_QUIRK_HILUNS), and if we're not quirked
>*against* it (CAM_QUIRK_NOHILUNS), or we're a SCSI3 or better device
>and the tunable (kern.cam.cam_srch_hi) is set non-zero.

Approved by: re (scottl)
2005-09-18 02:29:27 +00:00
rwatson
71a8cbcb20 Merge two sets of changes relating to devfs device node cloning from
HEAD to RELENG_6: changes to introduce a credentialed version of the
clone event handler, and then changes to merge the regular and
credentialed versions into a single interface (along with updates to
existing consumers).  With this merge, 6.x and 7.x are in sync.

First batch merges devfs_devs.c:1.37, devfs_vnops.c:1.115,
kern_conf.c:1.187, tty_pty.c:1.138, mac_vfs.c:1.109, mac_biba.c:1.36,
mac_lomac.c:1.36, mac_mls.c:1.73, mac_stub.c:1.53, mac_test.c:1.61,
conf.h:1.223, mac.h:1.68, mac_policy.h:1.67 from HEAD to RELENG_6:

  When devfs cloning takes place, provide access to the credential of the
  process that caused the clone event to take place for the device driver
  creating the device.  This allows cloned device drivers to adapt the
  device node based on security aspects of the process, such as the uid,
  gid, and MAC label.

  - Add a cred reference to struct cdev, so that when a device node is
    instantiated as a vnode, the cloning credential can be exposed to
    MAC.

  - Add make_dev_cred(), a version of make_dev() that additionally
    accepts the credential to stick in the struct cdev.  Implement it and
    make_dev() in terms of a back-end make_dev_credv().

  - Add a new event handler, dev_clone_cred, which can be registered to
    receive the credential instead of dev_clone, if desired.

  - Modify the MAC entry point mac_create_devfs_device() to accept an
    optional credential pointer (may be NULL), so that MAC policies can
    inspect and act on the label or other elements of the credential
    when initializing the skeleton device protections.

  - Modify tty_pty.c to register clone_dev_cred and invoke make_dev_cred(),
    so that the pty clone credential is exposed to the MAC Framework.

  While currently primarily focussed on MAC policies, this change is also
  a prerequisite for changes to allow ptys to be instantiated with the UID
  of the process looking up the pty.  This requires further changes to the
  pty driver -- in particular, to immediately recycle pty nodes on last
  close so that the credential-related state can be recreated on next
  lookup.

  Submitted by:   Andrew Reisse <andrew.reisse@sparta.com>
  Obtained from:  TrustedBSD Project
  Sponsored by:   SPAWAR, SPARTA

Second batch merges scsi_target.c:1.68, coda_fbsd.c:1.43,
firewirereg.h:1.38, fwdev.c:1.47, nmdm.c:1.36, snp.c:1.100, dsp.c:1.82,
mixer.c:1.45, vkbd.c:1.9, devfs_vnops.c:1.117, tty_pty.c:1.139,
tty_tty.c:1.57, bpf.c:1.156, if_tap.c:1.56, if_tun.c:1.153,
smb_dev.c:1.28, conf.h:1.224 from HEAD to RELENG_6:

  Merge the dev_clone and dev_clone_cred event handlers into a single
  event handler, dev_clone, which accepts a credential argument.
  Implementors of the event can ignore it if they're not interested,
  and most do.  This avoids having multiple event handler types and
  fall-back/precedence logic in devfs.

  This changes the kernel API for /dev cloning, and may affect third
  party packages containg cloning kernel modules.

  Requested by:   phk

These changes modifies the kernel device driver API for device cloning,
and might require minor modifications to third party device drivers that
make use of devfs cloning.  It will not be merged to RELENG_5.

Approved by:	re (scottl)
2005-08-13 21:24:18 +00:00
ssouhlal
efe31cd3da Fix the recent panics/LORs/hangs created by my kqueue commit by:
- Introducing the possibility of using locks different than mutexes
for the knlist locking. In order to do this, we add three arguments to
knlist_init() to specify the functions to use to lock, unlock and
check if the lock is owned. If these arguments are NULL, we assume
mtx_lock, mtx_unlock and mtx_owned, respectively.

- Using the vnode lock for the knlist locking, when doing kqueue operations
on a vnode. This way, we don't have to lock the vnode while holding a
mutex, in filt_vfsread.

Reviewed by:	jmg
Approved by:	re (scottl), scottl (mentor override)
Pointyhat to:	ssouhlal
Will be happy:	everyone
2005-07-01 16:28:32 +00:00
avatar
cd4bfad3f4 - Providing fine-grained malloc statistic by replacing M_DEVBUF with
module-specific malloc types.  These should help us to pinpoint the
  possible memory leakage in the future.
- Implementing xpt_alloc_ccb_nowait() and replacing all malloc/free based
  CCB memory management with xpt_alloc_ccb[_nowait]/xpt_free_ccb.  Hopefully
  this would be helpful if someday we move the CCB allocator to use UMA
  instead of malloc().

Encouraged by:	jeffr, rwatson
Reviewed by:	gibbs, scottl
Approved by:	re (scottl)
2005-07-01 15:21:30 +00:00
avatar
a05d8837d1 Fixing a memory leak in xpt_release_device(), which can be quickly
(depends on how many memory you have) observed through "tar -tvf /dev/sa0."

   Without this patch, RELENG_5 and HEAD panics with something like:

     kmem_malloc(4096): kmem_map too small: 42258432 total allocated

   RELENG_4 doesn't panic but spews following errors:

     camq_init: - cannot malloc array!

Reviewed by:	gibbs, scottl
Approved by:	re (scottl)
MFC after:	3 days
2005-06-24 08:09:05 +00:00
pjd
5abe7a6d1e Add a quirk for my pen-drive. 2005-06-09 17:35:04 +00:00
kan
11168a6089 Do not initialize path variable with useless value just before
xpt_create_path overwrites it anyway.

Noticed by:     Coverity Prevent analysis tool
2005-05-11 17:39:33 +00:00
dwhite
83360b1ca4 Add quirk for TEAC USB floppy drives. 2005-05-05 18:48:41 +00:00
mjacob
986da5a2b4 Make sure we look at the correct sub op codes when
deciding whether it's an operation we can perform
via the control device.

PR:		kern/72010
MFC after:	1 week
2005-04-14 04:51:18 +00:00
mjacob
884a26e90b Take constructive advice from njl && reformat
previously added quirks slightly.
2005-04-14 04:46:46 +00:00
njl
4ad8bb1acf Quirk for ZICPlay USB MP3 Player.
PR:		kern/75057
Submitted by:	Aurelien Nephtali <aurelien.nephtali wanadoo.fr>
2005-04-14 04:31:48 +00:00
mjacob
12b04c7246 Apply quirk.
PR:		57469
Submitted by:	walter@pelissero.de
MFC after:	1 week
2005-04-14 04:12:45 +00:00
mjacob
8080f86744 Applied conservative version of suggested quirk.
PR:		57468
Submitted by:	walter@pelissero.de
MFC after:	1 week
2005-04-14 04:05:00 +00:00
mjacob
59934d265d Apply quirk suggested by submitter.
PR:		75486
Submitted by:	no_bs@web.de
MFC after:	1 week
2005-04-14 03:59:48 +00:00
mjacob
524960baf8 The divide by zero panic must have been due to a bogus
period value. I suppose the BT adapter driver should be
fixed, but more importantly we should protect against
dividing by zero.

PR:		kern/75603
MFC after:	1 week
2005-04-14 03:52:50 +00:00
sam
4fe3104d70 avoid use after free
Submitted by:	gibbs
Reviewed by:	mdodd
Approved by:	Coverity Prevent analysis tool
2005-03-31 21:43:19 +00:00
sam
861e0f363c avoid use after free
Submitted by:	gibbs
Reviewed by:	mdodd
Noticed by:	Coverity Prevent analysis tool
2005-03-31 21:42:49 +00:00
phk
7af1e31761 Explicitly hold a reference to the cdev we have just cloned. This
closes the race where the cdev was reclaimed before it ever made it
back to devfs lookup.
2005-03-31 12:19:44 +00:00
ken
43981486c2 Fix a problem with the cd(4) driver -- the CAMGETPASSTHRU ioctl wouldn't
succeed if there was no media in the drive.

This was broken in rev 1.72 when the media check was added to cdioctl().

For now, check the ioctl group to decide whether to check for media or not.
(We only need to check for media on CD-specific ioctls.)

Reported by:	bland
MFC after:	3 days
2005-03-26 06:05:06 +00:00
ken
45abe5fea1 Fix a place where we were referencing a pointer after it had been freed.
Submitted by:	"Henry Miller" <hank@blackhole.com>
MFC after:	3 days
2005-03-26 04:21:11 +00:00
gibbs
15f1e17020 Restore queue depth settings across tag disable events. The system often
disables tag queuing temporarily in order to allow controllers a window
to safely perform transfer negotiation with non-compliant devices.  Before
this change, CAM would restore the queue depth to the controller specified
maximum or device quirk level rather than any depth determined by reactions
to QUEUE FULL/BUSY events or an explicit user setting.

During device probe, initialize the flags field for XPT_SCAN_BUS.
The uninitialized value often confused CAM into not bothering to
issue an AC_FOUND_DEVICE async event for new devices.  The reason
this bug wasn't reported earlier is that CAM manually announces
devices after the initial system bus scans.

MFC: 3 days
2005-03-23 16:43:29 +00:00
scottl
2cb43d3de1 Don't free the SIM object twice.
Submitted by: Coverity Prevent analysis tool
2005-03-19 06:32:57 +00:00