Sun Oct 2 19:40:35 2016 UTC ()
change scsipi_execute_xs() to default to simple tags for !XS_CTL_URGENT
if not specified by caller; this is mostly for documentation purposes
only, as sd(4) and cd(4) explicitly use simple tags already


(jdolecek)
diff -r1.165 -r1.166 src/sys/dev/scsipi/scsipi_base.c

cvs diff -r1.165 -r1.166 src/sys/dev/scsipi/scsipi_base.c (expand / switch to unified diff)

--- src/sys/dev/scsipi/scsipi_base.c 2015/08/24 23:13:15 1.165
+++ src/sys/dev/scsipi/scsipi_base.c 2016/10/02 19:40:35 1.166
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: scsipi_base.c,v 1.165 2015/08/24 23:13:15 pooka Exp $ */ 1/* $NetBSD: scsipi_base.c,v 1.166 2016/10/02 19:40:35 jdolecek Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Charles M. Hannum; by Jason R. Thorpe of the Numerical Aerospace 8 * by Charles M. Hannum; by Jason R. Thorpe of the Numerical Aerospace
9 * Simulation Facility, NASA Ames Research Center. 9 * Simulation Facility, NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE. 30 * POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.165 2015/08/24 23:13:15 pooka Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.166 2016/10/02 19:40:35 jdolecek Exp $");
35 35
36#ifdef _KERNEL_OPT 36#ifdef _KERNEL_OPT
37#include "opt_scsi.h" 37#include "opt_scsi.h"
38#endif 38#endif
39 39
40#include <sys/param.h> 40#include <sys/param.h>
41#include <sys/systm.h> 41#include <sys/systm.h>
42#include <sys/kernel.h> 42#include <sys/kernel.h>
43#include <sys/buf.h> 43#include <sys/buf.h>
44#include <sys/uio.h> 44#include <sys/uio.h>
45#include <sys/malloc.h> 45#include <sys/malloc.h>
46#include <sys/pool.h> 46#include <sys/pool.h>
47#include <sys/errno.h> 47#include <sys/errno.h>
@@ -1913,34 +1913,34 @@ scsipi_execute_xs(struct scsipi_xfer *xs @@ -1913,34 +1913,34 @@ scsipi_execute_xs(struct scsipi_xfer *xs
1913 * 1913 *
1914 * - If the device's current operating mode *does* 1914 * - If the device's current operating mode *does*
1915 * include tagged queueing, set the tag_type in 1915 * include tagged queueing, set the tag_type in
1916 * the xfer to the appropriate byte for the tag 1916 * the xfer to the appropriate byte for the tag
1917 * message. 1917 * message.
1918 */ 1918 */
1919 if ((PERIPH_XFER_MODE(periph) & PERIPH_CAP_TQING) == 0 || 1919 if ((PERIPH_XFER_MODE(periph) & PERIPH_CAP_TQING) == 0 ||
1920 (xs->xs_control & XS_CTL_REQSENSE)) { 1920 (xs->xs_control & XS_CTL_REQSENSE)) {
1921 xs->xs_control &= ~XS_CTL_TAGMASK; 1921 xs->xs_control &= ~XS_CTL_TAGMASK;
1922 xs->xs_tag_type = 0; 1922 xs->xs_tag_type = 0;
1923 } else { 1923 } else {
1924 /* 1924 /*
1925 * If the request doesn't specify a tag, give Head 1925 * If the request doesn't specify a tag, give Head
1926 * tags to URGENT operations and Ordered tags to 1926 * tags to URGENT operations and Simple tags to
1927 * everything else. 1927 * everything else.
1928 */ 1928 */
1929 if (XS_CTL_TAGTYPE(xs) == 0) { 1929 if (XS_CTL_TAGTYPE(xs) == 0) {
1930 if (xs->xs_control & XS_CTL_URGENT) 1930 if (xs->xs_control & XS_CTL_URGENT)
1931 xs->xs_control |= XS_CTL_HEAD_TAG; 1931 xs->xs_control |= XS_CTL_HEAD_TAG;
1932 else 1932 else
1933 xs->xs_control |= XS_CTL_ORDERED_TAG; 1933 xs->xs_control |= XS_CTL_SIMPLE_TAG;
1934 } 1934 }
1935 1935
1936 switch (XS_CTL_TAGTYPE(xs)) { 1936 switch (XS_CTL_TAGTYPE(xs)) {
1937 case XS_CTL_ORDERED_TAG: 1937 case XS_CTL_ORDERED_TAG:
1938 xs->xs_tag_type = MSG_ORDERED_Q_TAG; 1938 xs->xs_tag_type = MSG_ORDERED_Q_TAG;
1939 break; 1939 break;
1940 1940
1941 case XS_CTL_SIMPLE_TAG: 1941 case XS_CTL_SIMPLE_TAG:
1942 xs->xs_tag_type = MSG_SIMPLE_Q_TAG; 1942 xs->xs_tag_type = MSG_SIMPLE_Q_TAG;
1943 break; 1943 break;
1944 1944
1945 case XS_CTL_HEAD_TAG: 1945 case XS_CTL_HEAD_TAG:
1946 xs->xs_tag_type = MSG_HEAD_OF_Q_TAG; 1946 xs->xs_tag_type = MSG_HEAD_OF_Q_TAG;