kern/163932: [PATCH] [cam] Fix detection of LUN 1 for Garmin GPS devices

Bartosz Fabianowski freebsd at
Sun Jan 8 19:00:20 UTC 2012

>Number:         163932
>Category:       kern
>Synopsis:       [PATCH] [cam] Fix detection of LUN 1 for Garmin GPS devices
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 08 19:00:20 UTC 2012
>Originator:     Bartosz Fabianowski
>Release:        9-STABLE
Recent Garmin GPS units present as two USB mass storage devices, representing internal storage (LUN 0) and SD card (LUN 1). However, the list of LUNs is incorrectly reported by the firmware so that FreeBSD sees LUN 0 only.

I noticed this problem with a Garmin Dakota 20:

The same problem was as reported with a Garmin Edge 705:

The problem exists in FreeBSD 9 and 10.
Plug in a Garmin GPS unit with two LUNs.

1. Notice that only one umass device appears.

2. Notice that "camcontrol reportluns" reports LUN 0 twice instead of LUN 0 and LUN 1:

%camcontrol reportluns da0
2 LUNs found
The attached patch enables the CAM_QUIRK_NOLUNS quirk. With this, FreeBSD assumes that the device's two LUNs are consecutively numbered and therefore correctly probes LUN 0 and LUN 1.

Patch attached with submission follows:

--- sys/cam/scsi/scsi_xpt.c.orig	2012-01-08 20:20:11.000000000 +0200
+++ sys/cam/scsi/scsi_xpt.c	2012-01-08 19:54:16.000000000 +0200
@@ -527,6 +527,10 @@
 		CAM_QUIRK_NOLUNS, /*mintags*/0, /*maxtags*/0
+		{ T_DIRECT, SIP_MEDIA_REMOVABLE, "Garmin", "*", "*" },
+		  CAM_QUIRK_NORPTLUNS, /*mintags*/2, /*maxtags*/255
+	},
+	{
 		/* Default tagged queuing parameters for all devices */


More information about the freebsd-bugs mailing list