Deleted Added
full compact
ata-all.c (119651) ata-all.c (119877)
1/*-
2 * Copyright (c) 1998 - 2003 S�ren Schmidt <sos@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1998 - 2003 S�ren Schmidt <sos@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29#include <sys/cdefs.h>
30__FBSDID("$FreeBSD: head/sys/dev/ata/ata-all.c 119651 2003-09-01 11:13:21Z sos $");
30__FBSDID("$FreeBSD: head/sys/dev/ata/ata-all.c 119877 2003-09-08 08:30:43Z sos $");
31
32#include "opt_ata.h"
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/ata.h>
36#include <sys/kernel.h>
37#include <sys/endian.h>
38#include <sys/conf.h>

--- 788 unchanged lines hidden (view full) ---

827ata_pmode(struct ata_params *ap)
828{
829 if (ap->atavalid & ATA_FLAG_64_70) {
830 if (ap->apiomodes & 0x02)
831 return ATA_PIO4;
832 if (ap->apiomodes & 0x01)
833 return ATA_PIO3;
834 }
31
32#include "opt_ata.h"
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/ata.h>
36#include <sys/kernel.h>
37#include <sys/endian.h>
38#include <sys/conf.h>

--- 788 unchanged lines hidden (view full) ---

827ata_pmode(struct ata_params *ap)
828{
829 if (ap->atavalid & ATA_FLAG_64_70) {
830 if (ap->apiomodes & 0x02)
831 return ATA_PIO4;
832 if (ap->apiomodes & 0x01)
833 return ATA_PIO3;
834 }
835 if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 2)
835 if (ap->mwdmamodes & 0x04)
836 return ATA_PIO4;
837 if (ap->mwdmamodes & 0x02)
838 return ATA_PIO3;
839 if (ap->mwdmamodes & 0x01)
836 return ATA_PIO2;
840 return ATA_PIO2;
837 if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 1)
841 if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 0x200)
842 return ATA_PIO2;
843 if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 0x100)
838 return ATA_PIO1;
844 return ATA_PIO1;
839 if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 0)
845 if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 0x000)
840 return ATA_PIO0;
846 return ATA_PIO0;
841 if (ap->capabilities1 & ATA_SUPPORT_DMA)
842 return ATA_PIO4;
843 return ATA_PIO0;
844}
845
846int
847ata_wmode(struct ata_params *ap)
848{
849 if (ap->mwdmamodes & 0x04)
850 return ATA_WDMA2;
851 if (ap->mwdmamodes & 0x02)
852 return ATA_WDMA1;
853 if (ap->mwdmamodes & 0x01)
854 return ATA_WDMA0;
847 return ATA_PIO0;
848}
849
850int
851ata_wmode(struct ata_params *ap)
852{
853 if (ap->mwdmamodes & 0x04)
854 return ATA_WDMA2;
855 if (ap->mwdmamodes & 0x02)
856 return ATA_WDMA1;
857 if (ap->mwdmamodes & 0x01)
858 return ATA_WDMA0;
855 if (ap->capabilities1 & ATA_SUPPORT_DMA)
856 return ATA_WDMA2;
857 return -1;
858}
859
860int
861ata_umode(struct ata_params *ap)
862{
863 if (ap->atavalid & ATA_FLAG_88) {
864 if (ap->udmamodes & 0x40)

--- 61 unchanged lines hidden ---
859 return -1;
860}
861
862int
863ata_umode(struct ata_params *ap)
864{
865 if (ap->atavalid & ATA_FLAG_88) {
866 if (ap->udmamodes & 0x40)

--- 61 unchanged lines hidden ---