-static __inline int
-ahd_linux_map_seg(struct ahd_softc *ahd, struct scb *scb,
- struct ahd_dma_seg *sg, bus_addr_t addr, bus_size_t len)
-{
- int consumed;
-
- if ((scb->sg_count + 1) > AHD_NSEG)
- panic("Too few segs for dma mapping. "
- "Increase AHD_NSEG\n");
-
- consumed = 1;
- sg->addr = ahd_htole32(addr & 0xFFFFFFFF);
- scb->platform_data->xfer_len += len;
-
- if (sizeof(bus_addr_t) > 4
- && (ahd->flags & AHD_39BIT_ADDRESSING) != 0)
- len |= (addr >> 8) & AHD_SG_HIGH_ADDR_MASK;
-
- sg->len = ahd_htole32(len);
- return (consumed);
-}
-