View | Details | Raw Unified | Return to bug 267654 | Differences between
and this patch

Collapse All | Expand All

(-)b/sys/dev/hyperv/vmbus/vmbus.c (-2 / +31 lines)
Lines 139-144 static void vmbus_intr_teardown(struct vmbus_softc *); Link Here
139
static int                     vmbus_doattach(struct vmbus_softc *);
139
static int                     vmbus_doattach(struct vmbus_softc *);
140
static void                    vmbus_event_proc_dummy(struct vmbus_softc *,
140
static void                    vmbus_event_proc_dummy(struct vmbus_softc *,
141
                                   int);
141
                                   int);
142
static bus_dma_tag_t           vmbus_get_dma_tag(device_t parent, device_t child);
142
static struct vmbus_softc      *vmbus_sc;
143
static struct vmbus_softc      *vmbus_sc;
143
SYSCTL_NODE(_hw, OID_AUTO, vmbus, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
144
SYSCTL_NODE(_hw, OID_AUTO, vmbus, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
Lines 198-203 static device_method_t vmbus_methods[] = { Link Here
198
       DEVMETHOD(vmbus_probe_guid,             vmbus_probe_guid_method),
199
       DEVMETHOD(vmbus_probe_guid,             vmbus_probe_guid_method),
199
       DEVMETHOD(vmbus_get_vcpu_id,            vmbus_get_vcpu_id_method),
200
       DEVMETHOD(vmbus_get_vcpu_id,            vmbus_get_vcpu_id_method),
200
       DEVMETHOD(vmbus_get_event_taskq,        vmbus_get_eventtq_method),
201
       DEVMETHOD(vmbus_get_event_taskq,        vmbus_get_eventtq_method),
202
       DEVMETHOD(bus_get_dma_tag,              vmbus_get_dma_tag),
201
       DEVMETHOD_END
203
       DEVMETHOD_END
202
};
204
};
Lines 236-241 vmbus_msghc_reset(struct vmbus_msghc *mh, size_t dsize) Link Here
236
       inprm->hc_dsize = dsize;
238
       inprm->hc_dsize = dsize;
237
}
239
}
240
static bus_dma_tag_t
241
vmbus_get_dma_tag(device_t dev, device_t child)
242
{
243
       struct vmbus_softc *sc = vmbus_get_softc();
244
       return (sc->dmat);
245
}
238
struct vmbus_msghc *
246
struct vmbus_msghc *
239
vmbus_msghc_get(struct vmbus_softc *sc, size_t dsize)
247
vmbus_msghc_get(struct vmbus_softc *sc, size_t dsize)
240
{
248
{
Lines 1195-1200 vmbus_get_crs(device_t dev, device_t vmbus_dev, enum parse_pass pass) Link Here
1195
       if (bootverbose && ACPI_FAILURE(status))
1203
       if (bootverbose && ACPI_FAILURE(status))
1196
               device_printf(dev, "_CRS: not found, pass=%d\n", pass);
1204
               device_printf(dev, "_CRS: not found, pass=%d\n", pass);
1205
1197
}
1206
}
1198
static void
1207
static void
Lines 1384-1389 vmbus_doattach(struct vmbus_softc *sc) Link Here
1384
       struct sysctl_oid_list *child;
1393
       struct sysctl_oid_list *child;
1385
       struct sysctl_ctx_list *ctx;
1394
       struct sysctl_ctx_list *ctx;
1386
       int ret;
1395
       int ret;
1396
       device_t dev;
1397
       ACPI_HANDLE handle;
1387
       if (sc->vmbus_flags & VMBUS_FLAG_ATTACHED)
1398
       if (sc->vmbus_flags & VMBUS_FLAG_ATTACHED)
1388
               return (0);
1399
               return (0);
Lines 1392-1398 vmbus_doattach(struct vmbus_softc *sc) Link Here
1392
       vmbus_get_mmio_res(sc->vmbus_dev);
1403
       vmbus_get_mmio_res(sc->vmbus_dev);
1393
       vmbus_fb_mmio_res(sc->vmbus_dev);
1404
       vmbus_fb_mmio_res(sc->vmbus_dev);
1394
#endif
1405
#endif
1395
1396
       sc->vmbus_flags |= VMBUS_FLAG_ATTACHED;
1406
       sc->vmbus_flags |= VMBUS_FLAG_ATTACHED;
1397
       sc->vmbus_gpadl = VMBUS_GPADL_START;
1407
       sc->vmbus_gpadl = VMBUS_GPADL_START;
Lines 1421-1427 vmbus_doattach(struct vmbus_softc *sc) Link Here
1421
       ret = vmbus_dma_alloc(sc);
1431
       ret = vmbus_dma_alloc(sc);
1422
       if (ret != 0)
1432
       if (ret != 0)
1423
               goto cleanup;
1433
               goto cleanup;
1424
1434
               /* Coherency attribute */
1435
       dev =  devclass_get_device(devclass_find("vmbus_res"), 0);
1436
       handle = acpi_get_handle(dev);
1437
       if (ACPI_FAILURE(acpi_GetInteger(handle, "_CCA", &sc->coherent)))
1438
               sc->coherent = 0;
1439
        if (bootverbose)
1440
                device_printf(sc->vmbus_dev, "Bus is%s cache-coherent\n",
1441
                    sc->coherent ? "" : " not");
1442
        bus_dma_tag_create(NULL, /* parent */
1443
            1, 0,                               /* alignment, bounds */
1444
            BUS_SPACE_MAXADDR,                  /* lowaddr */
1445
            BUS_SPACE_MAXADDR,                  /* highaddr */
1446
            NULL, NULL,                         /* filter, filterarg */
1447
            BUS_SPACE_MAXSIZE,                  /* maxsize */
1448
            BUS_SPACE_UNRESTRICTED,             /* nsegments */
1449
            BUS_SPACE_MAXSIZE,                  /* maxsegsize */
1450
            sc->coherent ? BUS_DMA_COHERENT : 0, /* flags */
1451
            NULL, NULL,                         /* lockfunc, lockarg */
1452
            &sc->dmat);
1453
1425
       /*
1454
       /*
1426
        * Setup interrupt.
1455
        * Setup interrupt.
1427
        */
1456
        */
(-)b/sys/dev/hyperv/vmbus/vmbus_var.h (+2 lines)
Lines 130-135 struct vmbus_softc { Link Here
130
       struct resource *ires;
130
       struct resource *ires;
131
       void *icookie;
131
       void *icookie;
132
       int vector;
132
       int vector;
133
       bus_dma_tag_t   dmat;
134
       int     coherent;
133
#endif
135
#endif
134
};
136
};

Return to bug 267654