From owner-svn-src-stable-10@FreeBSD.ORG Fri Jul 4 15:09:57 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27DADB17; Fri, 4 Jul 2014 15:09:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEB7B2320; Fri, 4 Jul 2014 15:09:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s64F9usv008368; Fri, 4 Jul 2014 15:09:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s64F9uLg008365; Fri, 4 Jul 2014 15:09:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407041509.s64F9uLg008365@svn.freebsd.org> From: Alexander Motin Date: Fri, 4 Jul 2014 15:09:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268255 - in stable/10/sys: cam/scsi compat/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jul 2014 15:09:57 -0000 Author: mav Date: Fri Jul 4 15:09:56 2014 New Revision: 268255 URL: http://svnweb.freebsd.org/changeset/base/268255 Log: MFC r267051: - Add support for SG_GET_SG_TABLESIZE IOCTL to report that we don't support scatter/gather lists. - Return error for still unsupported SG 3.x API read/write calls. Modified: stable/10/sys/cam/scsi/scsi_sg.c stable/10/sys/compat/linux/linux_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_sg.c Fri Jul 4 14:49:40 2014 (r268254) +++ stable/10/sys/cam/scsi/scsi_sg.c Fri Jul 4 15:09:56 2014 (r268255) @@ -627,6 +627,13 @@ sgioctl(struct cdev *dev, u_long cmd, ca break; } + case SG_GET_SG_TABLESIZE: + { + int *size = (int *)arg; + *size = 0; + break; + } + case SG_EMULATED_HOST: case SG_SET_TRANSFORM: case SG_GET_TRANSFORM: @@ -638,7 +645,6 @@ sgioctl(struct cdev *dev, u_long cmd, ca case SG_GET_ACCESS_COUNT: case SG_SET_FORCE_LOW_DMA: case SG_GET_LOW_DMA: - case SG_GET_SG_TABLESIZE: case SG_SET_FORCE_PACK_ID: case SG_GET_PACK_ID: case SG_SET_RESERVED_SIZE: @@ -684,6 +690,12 @@ sgwrite(struct cdev *dev, struct uio *ui if (error) goto out_hdr; + /* XXX: We don't support SG 3.x read/write API. */ + if (hdr->reply_len < 0) { + error = ENODEV; + goto out_hdr; + } + ccb = xpt_alloc_ccb(); if (ccb == NULL) { error = ENOMEM; Modified: stable/10/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/10/sys/compat/linux/linux_ioctl.c Fri Jul 4 14:49:40 2014 (r268254) +++ stable/10/sys/compat/linux/linux_ioctl.c Fri Jul 4 15:09:56 2014 (r268255) @@ -2750,6 +2750,9 @@ linux_ioctl_sg(struct thread *td, struct case LINUX_SG_GET_SCSI_ID: args->cmd = SG_GET_SCSI_ID; break; + case LINUX_SG_GET_SG_TABLESIZE: + args->cmd = SG_GET_SG_TABLESIZE; + break; default: return (ENODEV); }