Deleted Added
full compact
ata-national.c (230132) ata-national.c (233282)
1/*-
2 * Copyright (c) 1998 - 2008 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

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

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1998 - 2008 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

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

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/dev/ata/chipsets/ata-national.c 230132 2012-01-15 13:23:18Z uqs $");
28__FBSDID("$FreeBSD: head/sys/dev/ata/chipsets/ata-national.c 233282 2012-03-21 16:59:39Z marius $");
29
30#include "opt_ata.h"
31#include <sys/param.h>
32#include <sys/module.h>
33#include <sys/systm.h>
34#include <sys/kernel.h>
35#include <sys/ata.h>
36#include <sys/bus.h>

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

98
99static int
100ata_national_setmode(device_t dev, int target, int mode)
101{
102 device_t parent = device_get_parent(dev);
103 struct ata_channel *ch = device_get_softc(dev);
104 int devno = (ch->unit << 1) + target;
105 int piomode;
29
30#include "opt_ata.h"
31#include <sys/param.h>
32#include <sys/module.h>
33#include <sys/systm.h>
34#include <sys/kernel.h>
35#include <sys/ata.h>
36#include <sys/bus.h>

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

98
99static int
100ata_national_setmode(device_t dev, int target, int mode)
101{
102 device_t parent = device_get_parent(dev);
103 struct ata_channel *ch = device_get_softc(dev);
104 int devno = (ch->unit << 1) + target;
105 int piomode;
106 u_int32_t piotiming[] =
106 static const uint32_t piotiming[] =
107 { 0x9172d132, 0x21717121, 0x00803020, 0x20102010, 0x00100010,
108 0x9172d132, 0x20102010, 0x00100010 };
107 { 0x9172d132, 0x21717121, 0x00803020, 0x20102010, 0x00100010,
108 0x9172d132, 0x20102010, 0x00100010 };
109 u_int32_t dmatiming[] = { 0x80077771, 0x80012121, 0x80002020 };
110 u_int32_t udmatiming[] = { 0x80921250, 0x80911140, 0x80911030 };
109 static const uint32_t dmatiming[] =
110 { 0x80077771, 0x80012121, 0x80002020 };
111 static const uint32_t udmatiming[] =
112 { 0x80921250, 0x80911140, 0x80911030 };
111
112 mode = min(mode, ATA_UDMA2);
113
114 if (mode >= ATA_UDMA0) {
115 pci_write_config(parent, 0x44 + (devno << 3),
116 udmatiming[mode & ATA_MODE_MASK], 4);
117 piomode = ATA_PIO4;
118 } else if (mode >= ATA_WDMA0) {

--- 15 unchanged lines hidden ---
113
114 mode = min(mode, ATA_UDMA2);
115
116 if (mode >= ATA_UDMA0) {
117 pci_write_config(parent, 0x44 + (devno << 3),
118 udmatiming[mode & ATA_MODE_MASK], 4);
119 piomode = ATA_PIO4;
120 } else if (mode >= ATA_WDMA0) {

--- 15 unchanged lines hidden ---