292 "");
293 return (status);
294 }
295 }
296 }
297
298 /*
299 * nx1394_dma_allochdl()
300 * Merges the ddi_dma_attr_t passed in by the target (using
301 * ddi_dma_alloc_handle() call) with that of the hal and passes the alloc
302 * handle request up the device by calling ddi_dma_allochdl().
303 */
304 static int
305 nx1394_dma_allochdl(dev_info_t *dip, dev_info_t *rdip, ddi_dma_attr_t *attr,
306 int (*waitfnp)(caddr_t), caddr_t arg, ddi_dma_handle_t *handlep)
307 {
308 s1394_hal_t *hal;
309 ddi_dma_attr_t *hal_attr;
310 int status;
311
312 _NOTE(SCHEME_PROTECTS_DATA("unique (per thread)", ddi_dma_attr_t))
313
314 TNF_PROBE_0_DEBUG(nx1394_dma_allochdl_enter, S1394_TNF_SL_NEXUS_STACK,
315 "");
316
317 /*
318 * If hal calls ddi_dma_alloc_handle, dip == rdip == hal dip.
319 * Unfortunately, we cannot verify this (by way of looking up for hal
320 * dip) here because h1394_attach() may happen much later.
321 */
322 if (dip != rdip) {
323 hal = s1394_dip_to_hal(ddi_get_parent(rdip));
324 ASSERT(hal);
325 hal_attr = &hal->halinfo.dma_attr;
326 ASSERT(hal_attr);
327 ddi_dma_attr_merge(attr, hal_attr);
328 }
329 status = ddi_dma_allochdl(dip, rdip, attr, waitfnp, arg, handlep);
330 TNF_PROBE_1_DEBUG(nx1394_dma_allochdl_exit, S1394_TNF_SL_NEXUS_STACK,
331 "", tnf_int, status, status);
332 return (status);
333 }
|
292 "");
293 return (status);
294 }
295 }
296 }
297
298 /*
299 * nx1394_dma_allochdl()
300 * Merges the ddi_dma_attr_t passed in by the target (using
301 * ddi_dma_alloc_handle() call) with that of the hal and passes the alloc
302 * handle request up the device by calling ddi_dma_allochdl().
303 */
304 static int
305 nx1394_dma_allochdl(dev_info_t *dip, dev_info_t *rdip, ddi_dma_attr_t *attr,
306 int (*waitfnp)(caddr_t), caddr_t arg, ddi_dma_handle_t *handlep)
307 {
308 s1394_hal_t *hal;
309 ddi_dma_attr_t *hal_attr;
310 int status;
311
312 TNF_PROBE_0_DEBUG(nx1394_dma_allochdl_enter, S1394_TNF_SL_NEXUS_STACK,
313 "");
314
315 /*
316 * If hal calls ddi_dma_alloc_handle, dip == rdip == hal dip.
317 * Unfortunately, we cannot verify this (by way of looking up for hal
318 * dip) here because h1394_attach() may happen much later.
319 */
320 if (dip != rdip) {
321 hal = s1394_dip_to_hal(ddi_get_parent(rdip));
322 ASSERT(hal);
323 hal_attr = &hal->halinfo.dma_attr;
324 ASSERT(hal_attr);
325 ddi_dma_attr_merge(attr, hal_attr);
326 }
327 status = ddi_dma_allochdl(dip, rdip, attr, waitfnp, arg, handlep);
328 TNF_PROBE_1_DEBUG(nx1394_dma_allochdl_exit, S1394_TNF_SL_NEXUS_STACK,
329 "", tnf_int, status, status);
330 return (status);
331 }
|