Ticket #2243: patch2

File patch2, 2.2 KB (added by absabs, 17 years ago)
Line 
1Index: src/add-ons/kernel/bus_managers/firewire/fwohci_pci.c
2===================================================================
3--- src/add-ons/kernel/bus_managers/firewire/fwohci_pci.c (revision 25566)
4+++ src/add-ons/kernel/bus_managers/firewire/fwohci_pci.c (working copy)
5@@ -57,10 +57,13 @@
6 #include "fwohcireg.h"
7 #include "fwohcivar.h"
8
9+#define PCIM_CMD_IOS 0x0001
10 #define PCIM_CMD_MEMEN 0x0002
11 #define PCIM_CMD_BUSMASTEREN 0x0004
12 #define PCIM_CMD_MWRICEN 0x0010
13-#define PCIM_CMD_IOS 0x0001
14+#define PCIM_CMD_PERRESPEN 0x0040
15+#define PCIM_CMD_SERRESPEN 0x0100
16+
17 extern pci_module_info *gPci;
18 extern pci_info *pciInfo[MAX_CARDS];
19 extern fwohci_softc_t *gFwohci_softc[MAX_CARDS];
20@@ -149,6 +152,7 @@
21
22 #if 1 /* for broken hardware */
23 val &= ~PCIM_CMD_MWRICEN;
24+ val &= ~(PCIM_CMD_SERRESPEN | PCIM_CMD_PERRESPEN);
25 #endif
26 gPci->write_pci_config(info->bus, info->device, info->function,
27 PCI_command, 2, val);
28Index: src/add-ons/kernel/bus_managers/firewire/fwohci.c
29===================================================================
30--- src/add-ons/kernel/bus_managers/firewire/fwohci.c (revision 25566)
31+++ src/add-ons/kernel/bus_managers/firewire/fwohci.c (working copy)
32@@ -412,7 +412,7 @@
33 * number of port supported by core-logic.
34 * It is not actually available port on your PC .
35 */
36- OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_LPS);
37+ OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_LPS | OHCI_HCC_POSTWR);
38 DELAY(500);
39
40 reg = fwphy_rddata(sc, FW_PHY_SPD_REG);
41@@ -706,10 +706,10 @@
42 sc->sid_buf = sc->sid_dma.v_addr = buf_virt;
43 sc->sid_dma.bus_addr = (bus_addr_t)buf_phy;
44 sc->fc.config_rom = sc->crom_dma.v_addr = buf_virt + OHCI_SIDSIZE;
45- sc->crom_dma.bus_addr = (bus_addr_t)((char *)buf_phy + OHCI_SIDSIZE);
46- sc->dummy_dma.v_addr = (char *)buf_virt + OHCI_SIDSIZE + sizeof(uint32_t);
47- sc->dummy_dma.bus_addr = (bus_addr_t)((char *)buf_phy +
48- OHCI_SIDSIZE + sizeof(uint32_t));
49+ sc->crom_dma.bus_addr = (bus_addr_t)(buf_phy + OHCI_SIDSIZE);
50+ sc->dummy_dma.v_addr = buf_virt + OHCI_SIDSIZE + CROMSIZE;
51+ sc->dummy_dma.bus_addr = (bus_addr_t)(buf_phy +
52+ OHCI_SIDSIZE + CROMSIZE);
53
54 fwohci_db_init(sc, &sc->arrq);
55 if ((sc->arrq.flags & FWOHCI_DBCH_INIT) == 0)