Lines Matching refs:mc

72 static int			mlx_v3_tryqueue(struct mlx_softc *sc, struct mlx_command *mc);
77 static int mlx_v4_tryqueue(struct mlx_softc *sc, struct mlx_command *mc);
82 static int mlx_v5_tryqueue(struct mlx_softc *sc, struct mlx_command *mc);
91 static void mlx_periodic_enquiry(struct mlx_command *mc);
93 static void mlx_periodic_eventlog_respond(struct mlx_command *mc);
94 static void mlx_periodic_rebuild(struct mlx_command *mc);
100 static void mlx_pause_done(struct mlx_command *mc);
106 void (*complete)(struct mlx_command *mc));
110 static int mlx_wait_command(struct mlx_command *mc);
111 static int mlx_poll_command(struct mlx_command *mc);
116 static void mlx_completeio(struct mlx_command *mc);
126 static void mlx_releasecmd(struct mlx_command *mc);
127 static void mlx_freecmd(struct mlx_command *mc);
132 static int mlx_getslot(struct mlx_command *mc);
133 static void mlx_setup_dmamap(struct mlx_command *mc,
136 static void mlx_unmapcmd(struct mlx_command *mc);
138 static int mlx_start(struct mlx_command *mc);
145 static char *mlx_diagnose_command(struct mlx_command *mc);
168 struct mlx_command *mc; in mlx_free() local
184 while ((mc = TAILQ_FIRST(&sc->mlx_freecmds)) != NULL) { in mlx_free()
185 TAILQ_REMOVE(&sc->mlx_freecmds, mc, mc_link); in mlx_free()
186 mlx_freecmd(mc); in mlx_free()
1144 mlx_periodic_enquiry(struct mlx_command *mc) in mlx_periodic_enquiry() argument
1146 struct mlx_softc *sc = mc->mc_sc; in mlx_periodic_enquiry()
1152 if (mc->mc_status != 0) { in mlx_periodic_enquiry()
1153 device_printf(sc->mlx_dev, "periodic enquiry failed - %s\n", mlx_diagnose_command(mc)); in mlx_periodic_enquiry()
1158 switch(mc->mc_mailbox[0]) { in mlx_periodic_enquiry()
1165 struct mlx_enquiry *me = (struct mlx_enquiry *)mc->mc_data; in mlx_periodic_enquiry()
1166 struct mlx_enquiry_old *meo = (struct mlx_enquiry_old *)mc->mc_data; in mlx_periodic_enquiry()
1203 struct mlx_enquiry *me = (struct mlx_enquiry *)mc->mc_data; in mlx_periodic_enquiry()
1223 struct mlx_enq_sys_drive *mes = (struct mlx_enq_sys_drive *)mc->mc_data; in mlx_periodic_enquiry()
1251 device_printf(sc->mlx_dev, "%s: unknown command 0x%x", __func__, mc->mc_mailbox[0]); in mlx_periodic_enquiry()
1256 free(mc->mc_data, M_DEVBUF); in mlx_periodic_enquiry()
1257 mlx_releasecmd(mc); in mlx_periodic_enquiry()
1263 struct mlx_command *mc; in mlx_eventlog_cb() local
1265 mc = (struct mlx_command *)arg; in mlx_eventlog_cb()
1266 mlx_setup_dmamap(mc, segs, nsegments, error); in mlx_eventlog_cb()
1269 mlx_make_type3(mc, MLX_CMD_LOGOP, MLX_LOGOP_GET, 1, in mlx_eventlog_cb()
1270 mc->mc_sc->mlx_lastevent, 0, 0, mc->mc_dataphys, 0); in mlx_eventlog_cb()
1271 mc->mc_complete = mlx_periodic_eventlog_respond; in mlx_eventlog_cb()
1272 mc->mc_private = mc; in mlx_eventlog_cb()
1275 if (mlx_start(mc) != 0) { in mlx_eventlog_cb()
1276 mlx_releasecmd(mc); in mlx_eventlog_cb()
1277 free(mc->mc_data, M_DEVBUF); in mlx_eventlog_cb()
1278 mc->mc_data = NULL; in mlx_eventlog_cb()
1290 struct mlx_command *mc; in mlx_periodic_eventlog_poll() local
1299 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_periodic_eventlog_poll()
1308 if (mlx_getslot(mc)) in mlx_periodic_eventlog_poll()
1312 mc->mc_data = result; in mlx_periodic_eventlog_poll()
1313 mc->mc_length = /*sizeof(struct mlx_eventlog_entry)*/1024; in mlx_periodic_eventlog_poll()
1314 error = bus_dmamap_load(sc->mlx_buffer_dmat, mc->mc_dmamap, mc->mc_data, in mlx_periodic_eventlog_poll()
1315 mc->mc_length, mlx_eventlog_cb, mc, BUS_DMA_NOWAIT); in mlx_periodic_eventlog_poll()
1319 if (mc != NULL) in mlx_periodic_eventlog_poll()
1320 mlx_releasecmd(mc); in mlx_periodic_eventlog_poll()
1321 if ((result != NULL) && (mc->mc_data != NULL)) in mlx_periodic_eventlog_poll()
1347 mlx_periodic_eventlog_respond(struct mlx_command *mc) in mlx_periodic_eventlog_respond() argument
1349 struct mlx_softc *sc = mc->mc_sc; in mlx_periodic_eventlog_respond()
1350 struct mlx_eventlog_entry *el = (struct mlx_eventlog_entry *)mc->mc_data; in mlx_periodic_eventlog_respond()
1357 if (mc->mc_status == 0) { in mlx_periodic_eventlog_respond()
1399 device_printf(sc->mlx_dev, "error reading message log - %s\n", mlx_diagnose_command(mc)); in mlx_periodic_eventlog_respond()
1405 free(mc->mc_data, M_DEVBUF); in mlx_periodic_eventlog_respond()
1406 mlx_releasecmd(mc); in mlx_periodic_eventlog_respond()
1421 mlx_periodic_rebuild(struct mlx_command *mc) in mlx_periodic_rebuild() argument
1423 struct mlx_softc *sc = mc->mc_sc; in mlx_periodic_rebuild()
1424 struct mlx_rebuild_status *mr = (struct mlx_rebuild_status *)mc->mc_data; in mlx_periodic_rebuild()
1427 switch(mc->mc_status) { in mlx_periodic_rebuild()
1457 free(mc->mc_data, M_DEVBUF); in mlx_periodic_rebuild()
1458 mlx_releasecmd(mc); in mlx_periodic_rebuild()
1474 struct mlx_command *mc; in mlx_pause_action() local
1504 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_pause_action()
1507 mc->mc_flags |= MLX_CMD_PRIORITY; in mlx_pause_action()
1508 if (mlx_getslot(mc)) in mlx_pause_action()
1512 mlx_make_type2(mc, command, (failsafe << 4) | i, 0, 0, 0, 0, 0, 0, 0); in mlx_pause_action()
1513 mc->mc_complete = mlx_pause_done; in mlx_pause_action()
1514 mc->mc_private = sc; /* XXX not needed */ in mlx_pause_action()
1515 if (mlx_start(mc)) in mlx_pause_action()
1523 if (mc != NULL) in mlx_pause_action()
1524 mlx_releasecmd(mc); in mlx_pause_action()
1530 mlx_pause_done(struct mlx_command *mc) in mlx_pause_done() argument
1532 struct mlx_softc *sc = mc->mc_sc; in mlx_pause_done()
1533 int command = mc->mc_mailbox[0]; in mlx_pause_done()
1534 int channel = mc->mc_mailbox[2] & 0xf; in mlx_pause_done()
1537 if (mc->mc_status != 0) { in mlx_pause_done()
1539 command == MLX_CMD_STOPCHANNEL ? "pause" : "resume", mlx_diagnose_command(mc)); in mlx_pause_done()
1546 mlx_releasecmd(mc); in mlx_pause_done()
1559 struct mlx_command *mc; in mlx_enquire_cb() local
1561 mc = (struct mlx_command *)arg; in mlx_enquire_cb()
1565 mlx_setup_dmamap(mc, segs, nsegments, error); in mlx_enquire_cb()
1568 sc = mc->mc_sc; in mlx_enquire_cb()
1569 mlx_make_type2(mc, mc->mc_command, 0, 0, 0, 0, 0, 0, mc->mc_dataphys, 0); in mlx_enquire_cb()
1572 if (mc->mc_complete != NULL) { in mlx_enquire_cb()
1573 if ((error = mlx_start(mc)) != 0) in mlx_enquire_cb()
1577 if ((sc->mlx_state & MLX_STATE_INTEN) ? mlx_wait_command(mc) : in mlx_enquire_cb()
1578 mlx_poll_command(mc)) in mlx_enquire_cb()
1582 if (mc->mc_status != 0) { in mlx_enquire_cb()
1584 mlx_diagnose_command(mc)); in mlx_enquire_cb()
1598 …quire(struct mlx_softc *sc, int command, size_t bufsize, void (* complete)(struct mlx_command *mc)) in mlx_enquire() argument
1600 struct mlx_command *mc; in mlx_enquire() local
1610 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_enquire()
1616 mc->mc_flags |= MLX_CMD_PRIORITY | MLX_CMD_DATAOUT; in mlx_enquire()
1617 if (mlx_getslot(mc)) in mlx_enquire()
1621 mc->mc_data = result; in mlx_enquire()
1622 mc->mc_length = bufsize; in mlx_enquire()
1623 mc->mc_command = command; in mlx_enquire()
1626 mc->mc_complete = complete; in mlx_enquire()
1627 mc->mc_private = mc; in mlx_enquire()
1630 error = bus_dmamap_load(sc->mlx_buffer_dmat, mc->mc_dmamap, mc->mc_data, in mlx_enquire()
1631 mc->mc_length, mlx_enquire_cb, mc, BUS_DMA_NOWAIT); in mlx_enquire()
1635 if ((mc != NULL) && (mc->mc_complete == NULL)) in mlx_enquire()
1636 mlx_releasecmd(mc); in mlx_enquire()
1655 struct mlx_command *mc; in mlx_flush() local
1663 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_flush()
1666 if (mlx_getslot(mc)) in mlx_flush()
1670 mlx_make_type2(mc, MLX_CMD_FLUSH, 0, 0, 0, 0, 0, 0, 0, 0); in mlx_flush()
1673 if (mlx_poll_command(mc)) in mlx_flush()
1677 if (mc->mc_status != 0) { in mlx_flush()
1678 device_printf(sc->mlx_dev, "FLUSH failed - %s\n", mlx_diagnose_command(mc)); in mlx_flush()
1684 if (mc != NULL) in mlx_flush()
1685 mlx_releasecmd(mc); in mlx_flush()
1698 struct mlx_command *mc; in mlx_check() local
1706 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_check()
1709 if (mlx_getslot(mc)) in mlx_check()
1713 mlx_make_type2(mc, MLX_CMD_CHECKASYNC, 0, 0, 0, 0, 0, drive | 0x80, 0, 0); in mlx_check()
1716 if (mlx_wait_command(mc)) in mlx_check()
1720 if (mc->mc_status != 0) { in mlx_check()
1721 device_printf(sc->mlx_dev, "CHECK ASYNC failed - %s\n", mlx_diagnose_command(mc)); in mlx_check()
1725 error = mc->mc_status; in mlx_check()
1728 if (mc != NULL) in mlx_check()
1729 mlx_releasecmd(mc); in mlx_check()
1742 struct mlx_command *mc; in mlx_rebuild() local
1750 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_rebuild()
1753 if (mlx_getslot(mc)) in mlx_rebuild()
1757 mlx_make_type2(mc, MLX_CMD_REBUILDASYNC, channel, target, 0, 0, 0, 0, 0, 0); in mlx_rebuild()
1760 if (mlx_wait_command(mc)) in mlx_rebuild()
1764 if (mc->mc_status != 0) { in mlx_rebuild()
1765 device_printf(sc->mlx_dev, "REBUILD ASYNC failed - %s\n", mlx_diagnose_command(mc)); in mlx_rebuild()
1769 error = mc->mc_status; in mlx_rebuild()
1772 if (mc != NULL) in mlx_rebuild()
1773 mlx_releasecmd(mc); in mlx_rebuild()
1783 mlx_wait_command(struct mlx_command *mc) in mlx_wait_command() argument
1785 struct mlx_softc *sc = mc->mc_sc; in mlx_wait_command()
1791 mc->mc_complete = NULL; in mlx_wait_command()
1792 mc->mc_private = mc; /* wake us when you're done */ in mlx_wait_command()
1793 if ((error = mlx_start(mc)) != 0) in mlx_wait_command()
1798 while ((mc->mc_status == MLX_STATUS_BUSY) && (count < 30)) { in mlx_wait_command()
1799 mtx_sleep(mc->mc_private, &sc->mlx_io_lock, PRIBIO | PCATCH, "mlxwcmd", hz); in mlx_wait_command()
1802 if (mc->mc_status != 0) { in mlx_wait_command()
1803 device_printf(sc->mlx_dev, "command failed - %s\n", mlx_diagnose_command(mc)); in mlx_wait_command()
1818 mlx_poll_command(struct mlx_command *mc) in mlx_poll_command() argument
1820 struct mlx_softc *sc = mc->mc_sc; in mlx_poll_command()
1826 mc->mc_complete = NULL; in mlx_poll_command()
1827 mc->mc_private = NULL; /* we will poll for it */ in mlx_poll_command()
1828 if ((error = mlx_start(mc)) != 0) in mlx_poll_command()
1834 mlx_done(mc->mc_sc, 1); in mlx_poll_command()
1836 } while ((mc->mc_status == MLX_STATUS_BUSY) && (count++ < 15000000)); in mlx_poll_command()
1837 if (mc->mc_status != MLX_STATUS_BUSY) { in mlx_poll_command()
1838 TAILQ_REMOVE(&sc->mlx_work, mc, mc_link); in mlx_poll_command()
1841 device_printf(sc->mlx_dev, "command failed - %s\n", mlx_diagnose_command(mc)); in mlx_poll_command()
1848 struct mlx_command *mc; in mlx_startio_cb() local
1856 mc = (struct mlx_command *)arg; in mlx_startio_cb()
1857 mlx_setup_dmamap(mc, segs, nsegments, error); in mlx_startio_cb()
1859 sc = mc->mc_sc; in mlx_startio_cb()
1860 bp = mc->mc_private; in mlx_startio_cb()
1863 mc->mc_flags |= MLX_CMD_DATAIN; in mlx_startio_cb()
1866 mc->mc_flags |= MLX_CMD_DATAOUT; in mlx_startio_cb()
1886 mlx_make_type1(mc, (cmd == MLX_CMD_WRITESG) ? MLX_CMD_WRITESG_OLD : in mlx_startio_cb()
1891 mc->mc_sgphys, /* location of SG list */ in mlx_startio_cb()
1892 mc->mc_nsgent & 0x3f); /* size of SG list */ in mlx_startio_cb()
1894 mlx_make_type5(mc, cmd, in mlx_startio_cb()
1899 mc->mc_sgphys, /* location of SG list */ in mlx_startio_cb()
1900 mc->mc_nsgent & 0x3f); /* size of SG list */ in mlx_startio_cb()
1904 if (mlx_start(mc) != 0) { in mlx_startio_cb()
1906 mc->mc_status = MLX_STATUS_WEDGED; in mlx_startio_cb()
1907 mlx_completeio(mc); in mlx_startio_cb()
1920 struct mlx_command *mc; in mlx_startio() local
1935 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_startio()
1938 if (mlx_getslot(mc) != 0) { in mlx_startio()
1939 mlx_releasecmd(mc); in mlx_startio()
1947 mc->mc_complete = mlx_completeio; in mlx_startio()
1948 mc->mc_private = bp; in mlx_startio()
1949 mc->mc_data = bp->bio_data; in mlx_startio()
1950 mc->mc_length = bp->bio_bcount; in mlx_startio()
1953 error = bus_dmamap_load(sc->mlx_buffer_dmat, mc->mc_dmamap, mc->mc_data, in mlx_startio()
1954 mc->mc_length, mlx_startio_cb, mc, 0); in mlx_startio()
1966 mlx_completeio(struct mlx_command *mc) in mlx_completeio() argument
1968 struct mlx_softc *sc = mc->mc_sc; in mlx_completeio()
1969 struct bio *bp = mc->mc_private; in mlx_completeio()
1973 if (mc->mc_status != MLX_STATUS_OK) { /* could be more verbose here? */ in mlx_completeio()
1977 switch(mc->mc_status) { in mlx_completeio()
1985 device_printf(sc->mlx_dev, "I/O error - %s\n", mlx_diagnose_command(mc)); in mlx_completeio()
1989 device_printf(sc->mlx_dev, " %13D\n", mc->mc_mailbox, " "); in mlx_completeio()
1994 mlx_releasecmd(mc); in mlx_completeio()
2002 struct mlx_command *mc; in mlx_user_cb() local
2005 mc = (struct mlx_command *)arg; in mlx_user_cb()
2009 mlx_setup_dmamap(mc, segs, nsegments, error); in mlx_user_cb()
2011 mu = (struct mlx_usercommand *)mc->mc_private; in mlx_user_cb()
2020 if (mc->mc_mailbox[0] == MLX_CMD_DIRECT_CDB) { in mlx_user_cb()
2021 dcdb = (struct mlx_dcdb *)mc->mc_data; in mlx_user_cb()
2022 dcdb->dcdb_physaddr = mc->mc_dataphys + sizeof(*dcdb); in mlx_user_cb()
2030 mc->mc_mailbox[mu->mu_bufptr ] = mc->mc_dataphys & 0xff; in mlx_user_cb()
2031 mc->mc_mailbox[mu->mu_bufptr + 1] = (mc->mc_dataphys >> 8) & 0xff; in mlx_user_cb()
2032 mc->mc_mailbox[mu->mu_bufptr + 2] = (mc->mc_dataphys >> 16) & 0xff; in mlx_user_cb()
2033 mc->mc_mailbox[mu->mu_bufptr + 3] = (mc->mc_dataphys >> 24) & 0xff; in mlx_user_cb()
2038 if (mlx_wait_command(mc) != 0) in mlx_user_cb()
2053 struct mlx_command *mc; in mlx_user_command() local
2060 mc = NULL; in mlx_user_command()
2065 if ((mc = mlx_alloccmd(sc)) == NULL) { in mlx_user_command()
2069 bcopy(mu->mu_command, mc->mc_mailbox, sizeof(mc->mc_mailbox)); in mlx_user_command()
2092 if (mlx_getslot(mc)) in mlx_user_command()
2107 mc->mc_data = kbuf; in mlx_user_command()
2108 mc->mc_length = mu->mu_datasize; in mlx_user_command()
2109 mc->mc_private = mu; in mlx_user_command()
2110 error = bus_dmamap_load(sc->mlx_buffer_dmat, mc->mc_dmamap, mc->mc_data, in mlx_user_command()
2111 mc->mc_length, mlx_user_cb, mc, BUS_DMA_NOWAIT); in mlx_user_command()
2116 mu->mu_status = mc->mc_status; in mlx_user_command()
2124 mlx_releasecmd(mc); in mlx_user_command()
2144 mlx_getslot(struct mlx_command *mc) in mlx_getslot() argument
2146 struct mlx_softc *sc = mc->mc_sc; in mlx_getslot()
2161 if (sc->mlx_busycmds >= ((mc->mc_flags & MLX_CMD_PRIORITY) ? limit : limit - 4)) in mlx_getslot()
2175 sc->mlx_busycmd[slot] = mc; in mlx_getslot()
2184 mc->mc_slot = slot; in mlx_getslot()
2192 mlx_setup_dmamap(struct mlx_command *mc, bus_dma_segment_t *segs, int nsegments, in mlx_setup_dmamap() argument
2195 struct mlx_softc *sc = mc->mc_sc; in mlx_setup_dmamap()
2207 sg = sc->mlx_sgtable + (mc->mc_slot * MLX_NSEG); in mlx_setup_dmamap()
2210 mc->mc_nsgent = nsegments; in mlx_setup_dmamap()
2211 mc->mc_sgphys = sc->mlx_sgbusaddr + in mlx_setup_dmamap()
2212 (mc->mc_slot * MLX_NSEG * sizeof(struct mlx_sgentry)); in mlx_setup_dmamap()
2213 mc->mc_dataphys = segs[0].ds_addr; in mlx_setup_dmamap()
2222 if (mc->mc_flags & MLX_CMD_DATAIN) in mlx_setup_dmamap()
2223 bus_dmamap_sync(sc->mlx_buffer_dmat, mc->mc_dmamap, in mlx_setup_dmamap()
2225 if (mc->mc_flags & MLX_CMD_DATAOUT) in mlx_setup_dmamap()
2226 bus_dmamap_sync(sc->mlx_buffer_dmat, mc->mc_dmamap, in mlx_setup_dmamap()
2231 mlx_unmapcmd(struct mlx_command *mc) in mlx_unmapcmd() argument
2233 struct mlx_softc *sc = mc->mc_sc; in mlx_unmapcmd()
2238 if (mc->mc_data != NULL) { in mlx_unmapcmd()
2240 if (mc->mc_flags & MLX_CMD_DATAIN) in mlx_unmapcmd()
2241 bus_dmamap_sync(sc->mlx_buffer_dmat, mc->mc_dmamap, BUS_DMASYNC_POSTREAD); in mlx_unmapcmd()
2242 if (mc->mc_flags & MLX_CMD_DATAOUT) in mlx_unmapcmd()
2243 bus_dmamap_sync(sc->mlx_buffer_dmat, mc->mc_dmamap, BUS_DMASYNC_POSTWRITE); in mlx_unmapcmd()
2245 bus_dmamap_unload(sc->mlx_buffer_dmat, mc->mc_dmamap); in mlx_unmapcmd()
2255 mlx_start(struct mlx_command *mc) in mlx_start() argument
2257 struct mlx_softc *sc = mc->mc_sc; in mlx_start()
2263 mc->mc_mailbox[0x1] = mc->mc_slot; in mlx_start()
2266 mc->mc_status = MLX_STATUS_BUSY; in mlx_start()
2269 mc->mc_timeout = time_second + 60; in mlx_start()
2273 if (sc->mlx_tryqueue(sc, mc)) { in mlx_start()
2275 TAILQ_INSERT_TAIL(&sc->mlx_work, mc, mc_link); in mlx_start()
2285 sc->mlx_busycmd[mc->mc_slot] = NULL; in mlx_start()
2287 mc->mc_status = MLX_STATUS_WEDGED; in mlx_start()
2302 struct mlx_command *mc; in mlx_done() local
2317 mc = sc->mlx_busycmd[slot]; /* find command */ in mlx_done()
2318 if (mc != NULL) { /* paranoia */ in mlx_done()
2319 if (mc->mc_status == MLX_STATUS_BUSY) { in mlx_done()
2320 mc->mc_status = status; /* save status */ in mlx_done()
2352 struct mlx_command *mc, *nc; in mlx_complete() local
2358 mc = TAILQ_FIRST(&sc->mlx_work); in mlx_complete()
2359 while (mc != NULL) { in mlx_complete()
2360 nc = TAILQ_NEXT(mc, mc_link); in mlx_complete()
2363 if (mc->mc_status != MLX_STATUS_BUSY) { in mlx_complete()
2366 mlx_unmapcmd(mc); in mlx_complete()
2370 if (mc->mc_complete != NULL) { in mlx_complete()
2372 TAILQ_REMOVE(&sc->mlx_work, mc, mc_link); in mlx_complete()
2373 mc->mc_complete(mc); in mlx_complete()
2378 } else if (mc->mc_private != NULL) { /* sleeping caller wants to know about it */ in mlx_complete()
2381 TAILQ_REMOVE(&sc->mlx_work, mc, mc_link); in mlx_complete()
2382 wakeup_one(mc->mc_private); in mlx_complete()
2390 mc = nc; in mlx_complete()
2417 struct mlx_command *mc; in mlx_alloccmd() local
2423 if ((mc = TAILQ_FIRST(&sc->mlx_freecmds)) != NULL) in mlx_alloccmd()
2424 TAILQ_REMOVE(&sc->mlx_freecmds, mc, mc_link); in mlx_alloccmd()
2427 if (mc == NULL) { in mlx_alloccmd()
2428 mc = (struct mlx_command *)malloc(sizeof(*mc), M_DEVBUF, M_NOWAIT | M_ZERO); in mlx_alloccmd()
2429 if (mc != NULL) { in mlx_alloccmd()
2430 mc->mc_sc = sc; in mlx_alloccmd()
2431 error = bus_dmamap_create(sc->mlx_buffer_dmat, 0, &mc->mc_dmamap); in mlx_alloccmd()
2433 free(mc, M_DEVBUF); in mlx_alloccmd()
2438 return(mc); in mlx_alloccmd()
2448 mlx_releasecmd(struct mlx_command *mc) in mlx_releasecmd() argument
2453 MLX_IO_ASSERT_LOCKED(mc->mc_sc); in mlx_releasecmd()
2454 TAILQ_INSERT_HEAD(&mc->mc_sc->mlx_freecmds, mc, mc_link); in mlx_releasecmd()
2461 mlx_freecmd(struct mlx_command *mc) in mlx_freecmd() argument
2463 struct mlx_softc *sc = mc->mc_sc; in mlx_freecmd()
2466 bus_dmamap_destroy(sc->mlx_buffer_dmat, mc->mc_dmamap); in mlx_freecmd()
2467 free(mc, M_DEVBUF); in mlx_freecmd()
2482 mlx_v3_tryqueue(struct mlx_softc *sc, struct mlx_command *mc) in mlx_v3_tryqueue() argument
2493 MLX_V3_PUT_MAILBOX(sc, i, mc->mc_mailbox[i]); in mlx_v3_tryqueue()
2597 mlx_v4_tryqueue(struct mlx_softc *sc, struct mlx_command *mc) in mlx_v4_tryqueue() argument
2608 MLX_V4_PUT_MAILBOX(sc, i, mc->mc_mailbox[i]); in mlx_v4_tryqueue()
2716 mlx_v5_tryqueue(struct mlx_softc *sc, struct mlx_command *mc) in mlx_v5_tryqueue() argument
2727 MLX_V5_PUT_MAILBOX(sc, i, mc->mc_mailbox[i]); in mlx_v5_tryqueue()
2896 mlx_diagnose_command(struct mlx_command *mc) in mlx_diagnose_command() argument
2903 if (((mc->mc_mailbox[0] == mlx_messages[i].command) || (mlx_messages[i].command == 0)) && in mlx_diagnose_command()
2904 (mc->mc_status == mlx_messages[i].status)) in mlx_diagnose_command()
2907 …sprintf(unkmsg, "unknown response 0x%x for command 0x%x", (int)mc->mc_status, (int)mc->mc_mailbox[… in mlx_diagnose_command()