Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Jan 2012 18:50:01 GMT
From:      Bartosz Fabianowski <freebsd@chillt.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/163932: [PATCH] [cam] Fix detection of LUN 1 for Garmin GPS devices
Message-ID:  <201201081850.q08Io1aC092547@red.freebsd.org>
Resent-Message-ID: <201201081900.q08J0KuH015280@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 08 19:00:20 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Bartosz Fabianowski
>Release:        9-STABLE
>Organization:
>Environment:
>Description:
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:
http://lists.freebsd.org/pipermail/freebsd-usb/2012-January/010971.html

The same problem was as reported with a Garmin Edge 705:
http://lists.freebsd.org/pipermail/freebsd-scsi/2011-December/005159.html

The problem exists in FreeBSD 9 and 10.
>How-To-Repeat:
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
0
0
>Fix:
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 */
 		{
 		  T_ANY, SIP_MEDIA_REMOVABLE|SIP_MEDIA_FIXED,


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201081850.q08Io1aC092547>