1*0a6a1f1dSLionel Sambuc /* $NetBSD: mlyio.h,v 1.5 2015/09/06 06:01:00 dholland Exp $ */ 27eb99bdaSLionel Sambuc 37eb99bdaSLionel Sambuc /*- 47eb99bdaSLionel Sambuc * Copyright (c) 2001 The NetBSD Foundation, Inc. 57eb99bdaSLionel Sambuc * All rights reserved. 67eb99bdaSLionel Sambuc * 77eb99bdaSLionel Sambuc * This code is derived from software contributed to The NetBSD Foundation 87eb99bdaSLionel Sambuc * by Andrew Doran, Thor Lancelot Simon, and Eric Haszlakiewicz. 97eb99bdaSLionel Sambuc * 107eb99bdaSLionel Sambuc * Redistribution and use in source and binary forms, with or without 117eb99bdaSLionel Sambuc * modification, are permitted provided that the following conditions 127eb99bdaSLionel Sambuc * are met: 137eb99bdaSLionel Sambuc * 1. Redistributions of source code must retain the above copyright 147eb99bdaSLionel Sambuc * notice, this list of conditions and the following disclaimer. 157eb99bdaSLionel Sambuc * 2. Redistributions in binary form must reproduce the above copyright 167eb99bdaSLionel Sambuc * notice, this list of conditions and the following disclaimer in the 177eb99bdaSLionel Sambuc * documentation and/or other materials provided with the distribution. 187eb99bdaSLionel Sambuc * 197eb99bdaSLionel Sambuc * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 207eb99bdaSLionel Sambuc * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 217eb99bdaSLionel Sambuc * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 227eb99bdaSLionel Sambuc * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 237eb99bdaSLionel Sambuc * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 247eb99bdaSLionel Sambuc * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 257eb99bdaSLionel Sambuc * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 267eb99bdaSLionel Sambuc * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 277eb99bdaSLionel Sambuc * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 287eb99bdaSLionel Sambuc * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 297eb99bdaSLionel Sambuc * POSSIBILITY OF SUCH DAMAGE. 307eb99bdaSLionel Sambuc */ 317eb99bdaSLionel Sambuc 327eb99bdaSLionel Sambuc /*- 337eb99bdaSLionel Sambuc * Copyright (c) 2001 Michael Smith 347eb99bdaSLionel Sambuc * All rights reserved. 357eb99bdaSLionel Sambuc * 367eb99bdaSLionel Sambuc * Redistribution and use in source and binary forms, with or without 377eb99bdaSLionel Sambuc * modification, are permitted provided that the following conditions 387eb99bdaSLionel Sambuc * are met: 397eb99bdaSLionel Sambuc * 1. Redistributions of source code must retain the above copyright 407eb99bdaSLionel Sambuc * notice, this list of conditions and the following disclaimer. 417eb99bdaSLionel Sambuc * 2. Redistributions in binary form must reproduce the above copyright 427eb99bdaSLionel Sambuc * notice, this list of conditions and the following disclaimer in the 437eb99bdaSLionel Sambuc * documentation and/or other materials provided with the distribution. 447eb99bdaSLionel Sambuc * 457eb99bdaSLionel Sambuc * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 467eb99bdaSLionel Sambuc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 477eb99bdaSLionel Sambuc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 487eb99bdaSLionel Sambuc * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 497eb99bdaSLionel Sambuc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 507eb99bdaSLionel Sambuc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 517eb99bdaSLionel Sambuc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 527eb99bdaSLionel Sambuc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 537eb99bdaSLionel Sambuc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 547eb99bdaSLionel Sambuc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 557eb99bdaSLionel Sambuc * SUCH DAMAGE. 567eb99bdaSLionel Sambuc * 577eb99bdaSLionel Sambuc * from FreeBSD: mlyio.h,v 1.2 2001/07/14 00:12:22 msmith Exp 587eb99bdaSLionel Sambuc */ 597eb99bdaSLionel Sambuc 607eb99bdaSLionel Sambuc /* 617eb99bdaSLionel Sambuc * Control structures exchanged through the GAM interface with userland 627eb99bdaSLionel Sambuc * management tools. 637eb99bdaSLionel Sambuc * 647eb99bdaSLionel Sambuc * The member naming here is consistent with the Linux driver, with which this 657eb99bdaSLionel Sambuc * interface is basically compatible. 667eb99bdaSLionel Sambuc */ 677eb99bdaSLionel Sambuc 687eb99bdaSLionel Sambuc #ifndef _PCI_MLYIO_H_ 697eb99bdaSLionel Sambuc #define _PCI_MLYIO_H_ 707eb99bdaSLionel Sambuc 71*0a6a1f1dSLionel Sambuc #include <sys/ioccom.h> 72*0a6a1f1dSLionel Sambuc 73*0a6a1f1dSLionel Sambuc 747eb99bdaSLionel Sambuc struct mly_user_command { 757eb99bdaSLionel Sambuc unsigned char ControllerNumber; 767eb99bdaSLionel Sambuc union mly_cmd_packet CommandMailbox; 777eb99bdaSLionel Sambuc int DataTransferLength; 787eb99bdaSLionel Sambuc int RequestSenseLength; 797eb99bdaSLionel Sambuc void *DataTransferBuffer; 807eb99bdaSLionel Sambuc void *RequestSenseBuffer; 817eb99bdaSLionel Sambuc int CommandStatus; /* not in the Linux structure */ 827eb99bdaSLionel Sambuc }; 837eb99bdaSLionel Sambuc 847eb99bdaSLionel Sambuc #define MLYIO_COMMAND _IOWR('M', 200, struct mly_user_command) 857eb99bdaSLionel Sambuc 867eb99bdaSLionel Sambuc struct mly_user_health { 877eb99bdaSLionel Sambuc unsigned char ControllerNumber; 887eb99bdaSLionel Sambuc void *HealthStatusBuffer; 897eb99bdaSLionel Sambuc }; 907eb99bdaSLionel Sambuc 917eb99bdaSLionel Sambuc #define MLYIO_HEALTH _IOW('M', 201, struct mly_user_health) 927eb99bdaSLionel Sambuc 937eb99bdaSLionel Sambuc /* 947eb99bdaSLionel Sambuc * Command queue statistics 957eb99bdaSLionel Sambuc */ 967eb99bdaSLionel Sambuc 977eb99bdaSLionel Sambuc #define MLYQ_FREE 0 987eb99bdaSLionel Sambuc #define MLYQ_BUSY 1 997eb99bdaSLionel Sambuc #define MLYQ_COMPLETE 2 1007eb99bdaSLionel Sambuc #define MLYQ_COUNT 3 1017eb99bdaSLionel Sambuc 1027eb99bdaSLionel Sambuc struct mly_qstat { 1037eb99bdaSLionel Sambuc u_int32_t q_length; 1047eb99bdaSLionel Sambuc u_int32_t q_max; 1057eb99bdaSLionel Sambuc }; 1067eb99bdaSLionel Sambuc 1077eb99bdaSLionel Sambuc #endif /* !defined _PCI_MLYIO_ */ 108