1*9a14aa01SUlrich Spörlein# Copyright (c) 2004 - 2008 Søren Schmidt <sos@FreeBSD.org> 2d9e96e03SSøren Schmidt# All rights reserved. 3d9e96e03SSøren Schmidt# 4d9e96e03SSøren Schmidt# Redistribution and use in source and binary forms, with or without 5d9e96e03SSøren Schmidt# modification, are permitted provided that the following conditions 6d9e96e03SSøren Schmidt# are met: 7d9e96e03SSøren Schmidt# 1. Redistributions of source code must retain the above copyright 8d9e96e03SSøren Schmidt# notice, this list of conditions and the following disclaimer, 9d9e96e03SSøren Schmidt# without modification, immediately at the beginning of the file. 10d9e96e03SSøren Schmidt# 2. Redistributions in binary form must reproduce the above copyright 11d9e96e03SSøren Schmidt# notice, this list of conditions and the following disclaimer in the 12d9e96e03SSøren Schmidt# documentation and/or other materials provided with the distribution. 13d9e96e03SSøren Schmidt# 14d9e96e03SSøren Schmidt# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15d9e96e03SSøren Schmidt# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16d9e96e03SSøren Schmidt# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17d9e96e03SSøren Schmidt# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18d9e96e03SSøren Schmidt# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19d9e96e03SSøren Schmidt# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20d9e96e03SSøren Schmidt# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21d9e96e03SSøren Schmidt# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22d9e96e03SSøren Schmidt# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23d9e96e03SSøren Schmidt# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24d9e96e03SSøren Schmidt# 25d9e96e03SSøren Schmidt 26d9e96e03SSøren Schmidt#include <sys/bus.h> 27d9e96e03SSøren Schmidt#include <sys/kernel.h> 28d9e96e03SSøren Schmidt#include <sys/param.h> 29d9e96e03SSøren Schmidt#include <sys/types.h> 30d9e96e03SSøren Schmidt#include <sys/callout.h> 31d9e96e03SSøren Schmidt#include <sys/sema.h> 32d9e96e03SSøren Schmidt#include <sys/taskqueue.h> 33d9e96e03SSøren Schmidt#include <vm/uma.h> 34d9e96e03SSøren Schmidt#include <machine/bus.h> 35d9e96e03SSøren Schmidt#include <sys/ata.h> 36d9e96e03SSøren Schmidt#include <dev/ata/ata-all.h> 37d9e96e03SSøren Schmidt 38d9e96e03SSøren SchmidtINTERFACE ata; 39d9e96e03SSøren Schmidt 40d9e96e03SSøren SchmidtCODE { 41066f913aSAlexander Motin static int ata_null_setmode(device_t dev, int target, int mode) 42ca8c70e9SSøren Schmidt { 43ca8c70e9SSøren Schmidt 44066f913aSAlexander Motin if (mode > ATA_PIO_MAX) 45066f913aSAlexander Motin return (ATA_PIO_MAX); 46066f913aSAlexander Motin return (mode); 47ca8c70e9SSøren Schmidt } 48ca8c70e9SSøren Schmidt}; 49066f913aSAlexander MotinMETHOD int setmode { 50d9e96e03SSøren Schmidt device_t dev; 51066f913aSAlexander Motin int target; 52066f913aSAlexander Motin int mode; 53066f913aSAlexander Motin} DEFAULT ata_null_setmode; 54066f913aSAlexander Motin 554135f5cfSRui PauloCODE { 564135f5cfSRui Paulo static int ata_null_getrev(device_t dev, int target) 574135f5cfSRui Paulo { 584135f5cfSRui Paulo return (0); 594135f5cfSRui Paulo } 604135f5cfSRui Paulo}; 614135f5cfSRui Paulo 62066f913aSAlexander MotinMETHOD int getrev { 63066f913aSAlexander Motin device_t dev; 64066f913aSAlexander Motin int target; 654135f5cfSRui Paulo} DEFAULT ata_null_getrev; 66d9e96e03SSøren Schmidt 678dad6b7bSSøren SchmidtMETHOD void reset { 688dad6b7bSSøren Schmidt device_t channel; 698dad6b7bSSøren Schmidt} DEFAULT ata_generic_reset; 708dad6b7bSSøren Schmidt 71d9e96e03SSøren SchmidtMETHOD int reinit { 72d9e96e03SSøren Schmidt device_t dev; 73d9e96e03SSøren Schmidt}; 74