Lines Matching refs:mc

68 static int			mlx_v3_tryqueue(struct mlx_softc *sc, struct mlx_command *mc);
73 static int mlx_v4_tryqueue(struct mlx_softc *sc, struct mlx_command *mc);
78 static int mlx_v5_tryqueue(struct mlx_softc *sc, struct mlx_command *mc);
87 static void mlx_periodic_enquiry(struct mlx_command *mc);
89 static void mlx_periodic_eventlog_respond(struct mlx_command *mc);
90 static void mlx_periodic_rebuild(struct mlx_command *mc);
96 static void mlx_pause_done(struct mlx_command *mc);
102 void (*complete)(struct mlx_command *mc));
106 static int mlx_wait_command(struct mlx_command *mc);
107 static int mlx_poll_command(struct mlx_command *mc);
112 static void mlx_completeio(struct mlx_command *mc);
122 static void mlx_releasecmd(struct mlx_command *mc);
123 static void mlx_freecmd(struct mlx_command *mc);
128 static int mlx_getslot(struct mlx_command *mc);
129 static void mlx_setup_dmamap(struct mlx_command *mc,
132 static void mlx_unmapcmd(struct mlx_command *mc);
134 static int mlx_start(struct mlx_command *mc);
141 static char *mlx_diagnose_command(struct mlx_command *mc);
164 struct mlx_command *mc; in mlx_free() local
180 while ((mc = TAILQ_FIRST(&sc->mlx_freecmds)) != NULL) { in mlx_free()
181 TAILQ_REMOVE(&sc->mlx_freecmds, mc, mc_link); in mlx_free()
182 mlx_freecmd(mc); in mlx_free()
1140 mlx_periodic_enquiry(struct mlx_command *mc) in mlx_periodic_enquiry() argument
1142 struct mlx_softc *sc = mc->mc_sc; in mlx_periodic_enquiry()
1148 if (mc->mc_status != 0) { in mlx_periodic_enquiry()
1149 device_printf(sc->mlx_dev, "periodic enquiry failed - %s\n", mlx_diagnose_command(mc)); in mlx_periodic_enquiry()
1154 switch(mc->mc_mailbox[0]) { in mlx_periodic_enquiry()
1161 struct mlx_enquiry *me = (struct mlx_enquiry *)mc->mc_data; in mlx_periodic_enquiry()
1162 struct mlx_enquiry_old *meo = (struct mlx_enquiry_old *)mc->mc_data; in mlx_periodic_enquiry()
1199 struct mlx_enquiry *me = (struct mlx_enquiry *)mc->mc_data; in mlx_periodic_enquiry()
1219 struct mlx_enq_sys_drive *mes = (struct mlx_enq_sys_drive *)mc->mc_data; in mlx_periodic_enquiry()
1247 device_printf(sc->mlx_dev, "%s: unknown command 0x%x", __func__, mc->mc_mailbox[0]); in mlx_periodic_enquiry()
1252 free(mc->mc_data, M_DEVBUF); in mlx_periodic_enquiry()
1253 mlx_releasecmd(mc); in mlx_periodic_enquiry()
1259 struct mlx_command *mc; in mlx_eventlog_cb() local
1261 mc = (struct mlx_command *)arg; in mlx_eventlog_cb()
1262 mlx_setup_dmamap(mc, segs, nsegments, error); in mlx_eventlog_cb()
1265 mlx_make_type3(mc, MLX_CMD_LOGOP, MLX_LOGOP_GET, 1, in mlx_eventlog_cb()
1266 mc->mc_sc->mlx_lastevent, 0, 0, mc->mc_dataphys, 0); in mlx_eventlog_cb()
1267 mc->mc_complete = mlx_periodic_eventlog_respond; in mlx_eventlog_cb()
1268 mc->mc_private = mc; in mlx_eventlog_cb()
1271 if (mlx_start(mc) != 0) { in mlx_eventlog_cb()
1272 mlx_releasecmd(mc); in mlx_eventlog_cb()
1273 free(mc->mc_data, M_DEVBUF); in mlx_eventlog_cb()
1274 mc->mc_data = NULL; in mlx_eventlog_cb()
1286 struct mlx_command *mc; in mlx_periodic_eventlog_poll() local
1295 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_periodic_eventlog_poll()
1304 if (mlx_getslot(mc)) in mlx_periodic_eventlog_poll()
1308 mc->mc_data = result; in mlx_periodic_eventlog_poll()
1309 mc->mc_length = /*sizeof(struct mlx_eventlog_entry)*/1024; in mlx_periodic_eventlog_poll()
1310 error = bus_dmamap_load(sc->mlx_buffer_dmat, mc->mc_dmamap, mc->mc_data, in mlx_periodic_eventlog_poll()
1311 mc->mc_length, mlx_eventlog_cb, mc, BUS_DMA_NOWAIT); in mlx_periodic_eventlog_poll()
1315 if (mc != NULL) in mlx_periodic_eventlog_poll()
1316 mlx_releasecmd(mc); in mlx_periodic_eventlog_poll()
1317 if ((result != NULL) && (mc->mc_data != NULL)) in mlx_periodic_eventlog_poll()
1343 mlx_periodic_eventlog_respond(struct mlx_command *mc) in mlx_periodic_eventlog_respond() argument
1345 struct mlx_softc *sc = mc->mc_sc; in mlx_periodic_eventlog_respond()
1346 struct mlx_eventlog_entry *el = (struct mlx_eventlog_entry *)mc->mc_data; in mlx_periodic_eventlog_respond()
1353 if (mc->mc_status == 0) { in mlx_periodic_eventlog_respond()
1395 device_printf(sc->mlx_dev, "error reading message log - %s\n", mlx_diagnose_command(mc)); in mlx_periodic_eventlog_respond()
1401 free(mc->mc_data, M_DEVBUF); in mlx_periodic_eventlog_respond()
1402 mlx_releasecmd(mc); in mlx_periodic_eventlog_respond()
1417 mlx_periodic_rebuild(struct mlx_command *mc) in mlx_periodic_rebuild() argument
1419 struct mlx_softc *sc = mc->mc_sc; in mlx_periodic_rebuild()
1420 struct mlx_rebuild_status *mr = (struct mlx_rebuild_status *)mc->mc_data; in mlx_periodic_rebuild()
1423 switch(mc->mc_status) { in mlx_periodic_rebuild()
1453 free(mc->mc_data, M_DEVBUF); in mlx_periodic_rebuild()
1454 mlx_releasecmd(mc); in mlx_periodic_rebuild()
1470 struct mlx_command *mc; in mlx_pause_action() local
1500 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_pause_action()
1503 mc->mc_flags |= MLX_CMD_PRIORITY; in mlx_pause_action()
1504 if (mlx_getslot(mc)) in mlx_pause_action()
1508 mlx_make_type2(mc, command, (failsafe << 4) | i, 0, 0, 0, 0, 0, 0, 0); in mlx_pause_action()
1509 mc->mc_complete = mlx_pause_done; in mlx_pause_action()
1510 mc->mc_private = sc; /* XXX not needed */ in mlx_pause_action()
1511 if (mlx_start(mc)) in mlx_pause_action()
1519 if (mc != NULL) in mlx_pause_action()
1520 mlx_releasecmd(mc); in mlx_pause_action()
1526 mlx_pause_done(struct mlx_command *mc) in mlx_pause_done() argument
1528 struct mlx_softc *sc = mc->mc_sc; in mlx_pause_done()
1529 int command = mc->mc_mailbox[0]; in mlx_pause_done()
1530 int channel = mc->mc_mailbox[2] & 0xf; in mlx_pause_done()
1533 if (mc->mc_status != 0) { in mlx_pause_done()
1535 command == MLX_CMD_STOPCHANNEL ? "pause" : "resume", mlx_diagnose_command(mc)); in mlx_pause_done()
1542 mlx_releasecmd(mc); in mlx_pause_done()
1555 struct mlx_command *mc; in mlx_enquire_cb() local
1557 mc = (struct mlx_command *)arg; in mlx_enquire_cb()
1561 mlx_setup_dmamap(mc, segs, nsegments, error); in mlx_enquire_cb()
1564 sc = mc->mc_sc; in mlx_enquire_cb()
1565 mlx_make_type2(mc, mc->mc_command, 0, 0, 0, 0, 0, 0, mc->mc_dataphys, 0); in mlx_enquire_cb()
1568 if (mc->mc_complete != NULL) { in mlx_enquire_cb()
1569 if ((error = mlx_start(mc)) != 0) in mlx_enquire_cb()
1573 if ((sc->mlx_state & MLX_STATE_INTEN) ? mlx_wait_command(mc) : in mlx_enquire_cb()
1574 mlx_poll_command(mc)) in mlx_enquire_cb()
1578 if (mc->mc_status != 0) { in mlx_enquire_cb()
1580 mlx_diagnose_command(mc)); in mlx_enquire_cb()
1594 …quire(struct mlx_softc *sc, int command, size_t bufsize, void (* complete)(struct mlx_command *mc)) in mlx_enquire() argument
1596 struct mlx_command *mc; in mlx_enquire() local
1606 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_enquire()
1612 mc->mc_flags |= MLX_CMD_PRIORITY | MLX_CMD_DATAOUT; in mlx_enquire()
1613 if (mlx_getslot(mc)) in mlx_enquire()
1617 mc->mc_data = result; in mlx_enquire()
1618 mc->mc_length = bufsize; in mlx_enquire()
1619 mc->mc_command = command; in mlx_enquire()
1622 mc->mc_complete = complete; in mlx_enquire()
1623 mc->mc_private = mc; in mlx_enquire()
1626 error = bus_dmamap_load(sc->mlx_buffer_dmat, mc->mc_dmamap, mc->mc_data, in mlx_enquire()
1627 mc->mc_length, mlx_enquire_cb, mc, BUS_DMA_NOWAIT); in mlx_enquire()
1631 if ((mc != NULL) && (mc->mc_complete == NULL)) in mlx_enquire()
1632 mlx_releasecmd(mc); in mlx_enquire()
1651 struct mlx_command *mc; in mlx_flush() local
1659 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_flush()
1662 if (mlx_getslot(mc)) in mlx_flush()
1666 mlx_make_type2(mc, MLX_CMD_FLUSH, 0, 0, 0, 0, 0, 0, 0, 0); in mlx_flush()
1669 if (mlx_poll_command(mc)) in mlx_flush()
1673 if (mc->mc_status != 0) { in mlx_flush()
1674 device_printf(sc->mlx_dev, "FLUSH failed - %s\n", mlx_diagnose_command(mc)); in mlx_flush()
1680 if (mc != NULL) in mlx_flush()
1681 mlx_releasecmd(mc); in mlx_flush()
1694 struct mlx_command *mc; in mlx_check() local
1702 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_check()
1705 if (mlx_getslot(mc)) in mlx_check()
1709 mlx_make_type2(mc, MLX_CMD_CHECKASYNC, 0, 0, 0, 0, 0, drive | 0x80, 0, 0); in mlx_check()
1712 if (mlx_wait_command(mc)) in mlx_check()
1716 if (mc->mc_status != 0) { in mlx_check()
1717 device_printf(sc->mlx_dev, "CHECK ASYNC failed - %s\n", mlx_diagnose_command(mc)); in mlx_check()
1721 error = mc->mc_status; in mlx_check()
1724 if (mc != NULL) in mlx_check()
1725 mlx_releasecmd(mc); in mlx_check()
1738 struct mlx_command *mc; in mlx_rebuild() local
1746 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_rebuild()
1749 if (mlx_getslot(mc)) in mlx_rebuild()
1753 mlx_make_type2(mc, MLX_CMD_REBUILDASYNC, channel, target, 0, 0, 0, 0, 0, 0); in mlx_rebuild()
1756 if (mlx_wait_command(mc)) in mlx_rebuild()
1760 if (mc->mc_status != 0) { in mlx_rebuild()
1761 device_printf(sc->mlx_dev, "REBUILD ASYNC failed - %s\n", mlx_diagnose_command(mc)); in mlx_rebuild()
1765 error = mc->mc_status; in mlx_rebuild()
1768 if (mc != NULL) in mlx_rebuild()
1769 mlx_releasecmd(mc); in mlx_rebuild()
1779 mlx_wait_command(struct mlx_command *mc) in mlx_wait_command() argument
1781 struct mlx_softc *sc = mc->mc_sc; in mlx_wait_command()
1787 mc->mc_complete = NULL; in mlx_wait_command()
1788 mc->mc_private = mc; /* wake us when you're done */ in mlx_wait_command()
1789 if ((error = mlx_start(mc)) != 0) in mlx_wait_command()
1794 while ((mc->mc_status == MLX_STATUS_BUSY) && (count < 30)) { in mlx_wait_command()
1795 mtx_sleep(mc->mc_private, &sc->mlx_io_lock, PRIBIO | PCATCH, "mlxwcmd", hz); in mlx_wait_command()
1798 if (mc->mc_status != 0) { in mlx_wait_command()
1799 device_printf(sc->mlx_dev, "command failed - %s\n", mlx_diagnose_command(mc)); in mlx_wait_command()
1814 mlx_poll_command(struct mlx_command *mc) in mlx_poll_command() argument
1816 struct mlx_softc *sc = mc->mc_sc; in mlx_poll_command()
1822 mc->mc_complete = NULL; in mlx_poll_command()
1823 mc->mc_private = NULL; /* we will poll for it */ in mlx_poll_command()
1824 if ((error = mlx_start(mc)) != 0) in mlx_poll_command()
1830 mlx_done(mc->mc_sc, 1); in mlx_poll_command()
1832 } while ((mc->mc_status == MLX_STATUS_BUSY) && (count++ < 15000000)); in mlx_poll_command()
1833 if (mc->mc_status != MLX_STATUS_BUSY) { in mlx_poll_command()
1834 TAILQ_REMOVE(&sc->mlx_work, mc, mc_link); in mlx_poll_command()
1837 device_printf(sc->mlx_dev, "command failed - %s\n", mlx_diagnose_command(mc)); in mlx_poll_command()
1844 struct mlx_command *mc; in mlx_startio_cb() local
1852 mc = (struct mlx_command *)arg; in mlx_startio_cb()
1853 mlx_setup_dmamap(mc, segs, nsegments, error); in mlx_startio_cb()
1855 sc = mc->mc_sc; in mlx_startio_cb()
1856 bp = mc->mc_private; in mlx_startio_cb()
1859 mc->mc_flags |= MLX_CMD_DATAIN; in mlx_startio_cb()
1862 mc->mc_flags |= MLX_CMD_DATAOUT; in mlx_startio_cb()
1882 mlx_make_type1(mc, (cmd == MLX_CMD_WRITESG) ? MLX_CMD_WRITESG_OLD : in mlx_startio_cb()
1887 mc->mc_sgphys, /* location of SG list */ in mlx_startio_cb()
1888 mc->mc_nsgent & 0x3f); /* size of SG list */ in mlx_startio_cb()
1890 mlx_make_type5(mc, cmd, in mlx_startio_cb()
1895 mc->mc_sgphys, /* location of SG list */ in mlx_startio_cb()
1896 mc->mc_nsgent & 0x3f); /* size of SG list */ in mlx_startio_cb()
1900 if (mlx_start(mc) != 0) { in mlx_startio_cb()
1902 mc->mc_status = MLX_STATUS_WEDGED; in mlx_startio_cb()
1903 mlx_completeio(mc); in mlx_startio_cb()
1916 struct mlx_command *mc; in mlx_startio() local
1931 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_startio()
1934 if (mlx_getslot(mc) != 0) { in mlx_startio()
1935 mlx_releasecmd(mc); in mlx_startio()
1943 mc->mc_complete = mlx_completeio; in mlx_startio()
1944 mc->mc_private = bp; in mlx_startio()
1945 mc->mc_data = bp->bio_data; in mlx_startio()
1946 mc->mc_length = bp->bio_bcount; in mlx_startio()
1949 error = bus_dmamap_load(sc->mlx_buffer_dmat, mc->mc_dmamap, mc->mc_data, in mlx_startio()
1950 mc->mc_length, mlx_startio_cb, mc, 0); in mlx_startio()
1962 mlx_completeio(struct mlx_command *mc) in mlx_completeio() argument
1964 struct mlx_softc *sc = mc->mc_sc; in mlx_completeio()
1965 struct bio *bp = mc->mc_private; in mlx_completeio()
1969 if (mc->mc_status != MLX_STATUS_OK) { /* could be more verbose here? */ in mlx_completeio()
1973 switch(mc->mc_status) { in mlx_completeio()
1981 device_printf(sc->mlx_dev, "I/O error - %s\n", mlx_diagnose_command(mc)); in mlx_completeio()
1985 device_printf(sc->mlx_dev, " %13D\n", mc->mc_mailbox, " "); in mlx_completeio()
1990 mlx_releasecmd(mc); in mlx_completeio()
1998 struct mlx_command *mc; in mlx_user_cb() local
2001 mc = (struct mlx_command *)arg; in mlx_user_cb()
2005 mlx_setup_dmamap(mc, segs, nsegments, error); in mlx_user_cb()
2007 mu = (struct mlx_usercommand *)mc->mc_private; in mlx_user_cb()
2016 if (mc->mc_mailbox[0] == MLX_CMD_DIRECT_CDB) { in mlx_user_cb()
2017 dcdb = (struct mlx_dcdb *)mc->mc_data; in mlx_user_cb()
2018 dcdb->dcdb_physaddr = mc->mc_dataphys + sizeof(*dcdb); in mlx_user_cb()
2026 mc->mc_mailbox[mu->mu_bufptr ] = mc->mc_dataphys & 0xff; in mlx_user_cb()
2027 mc->mc_mailbox[mu->mu_bufptr + 1] = (mc->mc_dataphys >> 8) & 0xff; in mlx_user_cb()
2028 mc->mc_mailbox[mu->mu_bufptr + 2] = (mc->mc_dataphys >> 16) & 0xff; in mlx_user_cb()
2029 mc->mc_mailbox[mu->mu_bufptr + 3] = (mc->mc_dataphys >> 24) & 0xff; in mlx_user_cb()
2034 if (mlx_wait_command(mc) != 0) in mlx_user_cb()
2049 struct mlx_command *mc; in mlx_user_command() local
2056 mc = NULL; in mlx_user_command()
2061 if ((mc = mlx_alloccmd(sc)) == NULL) { in mlx_user_command()
2065 bcopy(mu->mu_command, mc->mc_mailbox, sizeof(mc->mc_mailbox)); in mlx_user_command()
2088 if (mlx_getslot(mc)) in mlx_user_command()
2103 mc->mc_data = kbuf; in mlx_user_command()
2104 mc->mc_length = mu->mu_datasize; in mlx_user_command()
2105 mc->mc_private = mu; in mlx_user_command()
2106 error = bus_dmamap_load(sc->mlx_buffer_dmat, mc->mc_dmamap, mc->mc_data, in mlx_user_command()
2107 mc->mc_length, mlx_user_cb, mc, BUS_DMA_NOWAIT); in mlx_user_command()
2112 mu->mu_status = mc->mc_status; in mlx_user_command()
2120 mlx_releasecmd(mc); in mlx_user_command()
2140 mlx_getslot(struct mlx_command *mc) in mlx_getslot() argument
2142 struct mlx_softc *sc = mc->mc_sc; in mlx_getslot()
2157 if (sc->mlx_busycmds >= ((mc->mc_flags & MLX_CMD_PRIORITY) ? limit : limit - 4)) in mlx_getslot()
2171 sc->mlx_busycmd[slot] = mc; in mlx_getslot()
2180 mc->mc_slot = slot; in mlx_getslot()
2188 mlx_setup_dmamap(struct mlx_command *mc, bus_dma_segment_t *segs, int nsegments, in mlx_setup_dmamap() argument
2191 struct mlx_softc *sc = mc->mc_sc; in mlx_setup_dmamap()
2203 sg = sc->mlx_sgtable + (mc->mc_slot * MLX_NSEG); in mlx_setup_dmamap()
2206 mc->mc_nsgent = nsegments; in mlx_setup_dmamap()
2207 mc->mc_sgphys = sc->mlx_sgbusaddr + in mlx_setup_dmamap()
2208 (mc->mc_slot * MLX_NSEG * sizeof(struct mlx_sgentry)); in mlx_setup_dmamap()
2209 mc->mc_dataphys = segs[0].ds_addr; in mlx_setup_dmamap()
2218 if (mc->mc_flags & MLX_CMD_DATAIN) in mlx_setup_dmamap()
2219 bus_dmamap_sync(sc->mlx_buffer_dmat, mc->mc_dmamap, in mlx_setup_dmamap()
2221 if (mc->mc_flags & MLX_CMD_DATAOUT) in mlx_setup_dmamap()
2222 bus_dmamap_sync(sc->mlx_buffer_dmat, mc->mc_dmamap, in mlx_setup_dmamap()
2227 mlx_unmapcmd(struct mlx_command *mc) in mlx_unmapcmd() argument
2229 struct mlx_softc *sc = mc->mc_sc; in mlx_unmapcmd()
2234 if (mc->mc_data != NULL) { in mlx_unmapcmd()
2236 if (mc->mc_flags & MLX_CMD_DATAIN) in mlx_unmapcmd()
2237 bus_dmamap_sync(sc->mlx_buffer_dmat, mc->mc_dmamap, BUS_DMASYNC_POSTREAD); in mlx_unmapcmd()
2238 if (mc->mc_flags & MLX_CMD_DATAOUT) in mlx_unmapcmd()
2239 bus_dmamap_sync(sc->mlx_buffer_dmat, mc->mc_dmamap, BUS_DMASYNC_POSTWRITE); in mlx_unmapcmd()
2241 bus_dmamap_unload(sc->mlx_buffer_dmat, mc->mc_dmamap); in mlx_unmapcmd()
2251 mlx_start(struct mlx_command *mc) in mlx_start() argument
2253 struct mlx_softc *sc = mc->mc_sc; in mlx_start()
2259 mc->mc_mailbox[0x1] = mc->mc_slot; in mlx_start()
2262 mc->mc_status = MLX_STATUS_BUSY; in mlx_start()
2265 mc->mc_timeout = time_second + 60; in mlx_start()
2269 if (sc->mlx_tryqueue(sc, mc)) { in mlx_start()
2271 TAILQ_INSERT_TAIL(&sc->mlx_work, mc, mc_link); in mlx_start()
2281 sc->mlx_busycmd[mc->mc_slot] = NULL; in mlx_start()
2283 mc->mc_status = MLX_STATUS_WEDGED; in mlx_start()
2298 struct mlx_command *mc; in mlx_done() local
2313 mc = sc->mlx_busycmd[slot]; /* find command */ in mlx_done()
2314 if (mc != NULL) { /* paranoia */ in mlx_done()
2315 if (mc->mc_status == MLX_STATUS_BUSY) { in mlx_done()
2316 mc->mc_status = status; /* save status */ in mlx_done()
2348 struct mlx_command *mc, *nc; in mlx_complete() local
2354 mc = TAILQ_FIRST(&sc->mlx_work); in mlx_complete()
2355 while (mc != NULL) { in mlx_complete()
2356 nc = TAILQ_NEXT(mc, mc_link); in mlx_complete()
2359 if (mc->mc_status != MLX_STATUS_BUSY) { in mlx_complete()
2362 mlx_unmapcmd(mc); in mlx_complete()
2366 if (mc->mc_complete != NULL) { in mlx_complete()
2368 TAILQ_REMOVE(&sc->mlx_work, mc, mc_link); in mlx_complete()
2369 mc->mc_complete(mc); in mlx_complete()
2374 } else if (mc->mc_private != NULL) { /* sleeping caller wants to know about it */ in mlx_complete()
2377 TAILQ_REMOVE(&sc->mlx_work, mc, mc_link); in mlx_complete()
2378 wakeup_one(mc->mc_private); in mlx_complete()
2386 mc = nc; in mlx_complete()
2413 struct mlx_command *mc; in mlx_alloccmd() local
2419 if ((mc = TAILQ_FIRST(&sc->mlx_freecmds)) != NULL) in mlx_alloccmd()
2420 TAILQ_REMOVE(&sc->mlx_freecmds, mc, mc_link); in mlx_alloccmd()
2423 if (mc == NULL) { in mlx_alloccmd()
2424 mc = (struct mlx_command *)malloc(sizeof(*mc), M_DEVBUF, M_NOWAIT | M_ZERO); in mlx_alloccmd()
2425 if (mc != NULL) { in mlx_alloccmd()
2426 mc->mc_sc = sc; in mlx_alloccmd()
2427 error = bus_dmamap_create(sc->mlx_buffer_dmat, 0, &mc->mc_dmamap); in mlx_alloccmd()
2429 free(mc, M_DEVBUF); in mlx_alloccmd()
2434 return(mc); in mlx_alloccmd()
2444 mlx_releasecmd(struct mlx_command *mc) in mlx_releasecmd() argument
2449 MLX_IO_ASSERT_LOCKED(mc->mc_sc); in mlx_releasecmd()
2450 TAILQ_INSERT_HEAD(&mc->mc_sc->mlx_freecmds, mc, mc_link); in mlx_releasecmd()
2457 mlx_freecmd(struct mlx_command *mc) in mlx_freecmd() argument
2459 struct mlx_softc *sc = mc->mc_sc; in mlx_freecmd()
2462 bus_dmamap_destroy(sc->mlx_buffer_dmat, mc->mc_dmamap); in mlx_freecmd()
2463 free(mc, M_DEVBUF); in mlx_freecmd()
2478 mlx_v3_tryqueue(struct mlx_softc *sc, struct mlx_command *mc) in mlx_v3_tryqueue() argument
2489 MLX_V3_PUT_MAILBOX(sc, i, mc->mc_mailbox[i]); in mlx_v3_tryqueue()
2593 mlx_v4_tryqueue(struct mlx_softc *sc, struct mlx_command *mc) in mlx_v4_tryqueue() argument
2604 MLX_V4_PUT_MAILBOX(sc, i, mc->mc_mailbox[i]); in mlx_v4_tryqueue()
2712 mlx_v5_tryqueue(struct mlx_softc *sc, struct mlx_command *mc) in mlx_v5_tryqueue() argument
2723 MLX_V5_PUT_MAILBOX(sc, i, mc->mc_mailbox[i]); in mlx_v5_tryqueue()
2892 mlx_diagnose_command(struct mlx_command *mc) in mlx_diagnose_command() argument
2899 if (((mc->mc_mailbox[0] == mlx_messages[i].command) || (mlx_messages[i].command == 0)) && in mlx_diagnose_command()
2900 (mc->mc_status == mlx_messages[i].status)) in mlx_diagnose_command()
2903 …sprintf(unkmsg, "unknown response 0x%x for command 0x%x", (int)mc->mc_status, (int)mc->mc_mailbox[… in mlx_diagnose_command()