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()
1133 mlx_periodic_enquiry(struct mlx_command *mc) in mlx_periodic_enquiry() argument
1135 struct mlx_softc *sc = mc->mc_sc; in mlx_periodic_enquiry()
1141 if (mc->mc_status != 0) { in mlx_periodic_enquiry()
1142 device_printf(sc->mlx_dev, "periodic enquiry failed - %s\n", mlx_diagnose_command(mc)); in mlx_periodic_enquiry()
1147 switch(mc->mc_mailbox[0]) { in mlx_periodic_enquiry()
1154 struct mlx_enquiry *me = (struct mlx_enquiry *)mc->mc_data; in mlx_periodic_enquiry()
1155 struct mlx_enquiry_old *meo = (struct mlx_enquiry_old *)mc->mc_data; in mlx_periodic_enquiry()
1192 struct mlx_enquiry *me = (struct mlx_enquiry *)mc->mc_data; in mlx_periodic_enquiry()
1212 struct mlx_enq_sys_drive *mes = (struct mlx_enq_sys_drive *)mc->mc_data; in mlx_periodic_enquiry()
1240 device_printf(sc->mlx_dev, "%s: unknown command 0x%x", __func__, mc->mc_mailbox[0]); in mlx_periodic_enquiry()
1245 free(mc->mc_data, M_DEVBUF); in mlx_periodic_enquiry()
1246 mlx_releasecmd(mc); in mlx_periodic_enquiry()
1252 struct mlx_command *mc; in mlx_eventlog_cb() local
1254 mc = (struct mlx_command *)arg; in mlx_eventlog_cb()
1255 mlx_setup_dmamap(mc, segs, nsegments, error); in mlx_eventlog_cb()
1258 mlx_make_type3(mc, MLX_CMD_LOGOP, MLX_LOGOP_GET, 1, in mlx_eventlog_cb()
1259 mc->mc_sc->mlx_lastevent, 0, 0, mc->mc_dataphys, 0); in mlx_eventlog_cb()
1260 mc->mc_complete = mlx_periodic_eventlog_respond; in mlx_eventlog_cb()
1261 mc->mc_private = mc; in mlx_eventlog_cb()
1264 if (mlx_start(mc) != 0) { in mlx_eventlog_cb()
1265 mlx_releasecmd(mc); in mlx_eventlog_cb()
1266 free(mc->mc_data, M_DEVBUF); in mlx_eventlog_cb()
1267 mc->mc_data = NULL; in mlx_eventlog_cb()
1279 struct mlx_command *mc; in mlx_periodic_eventlog_poll() local
1288 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_periodic_eventlog_poll()
1297 if (mlx_getslot(mc)) in mlx_periodic_eventlog_poll()
1301 mc->mc_data = result; in mlx_periodic_eventlog_poll()
1302 mc->mc_length = /*sizeof(struct mlx_eventlog_entry)*/1024; in mlx_periodic_eventlog_poll()
1303 error = bus_dmamap_load(sc->mlx_buffer_dmat, mc->mc_dmamap, mc->mc_data, in mlx_periodic_eventlog_poll()
1304 mc->mc_length, mlx_eventlog_cb, mc, BUS_DMA_NOWAIT); in mlx_periodic_eventlog_poll()
1308 if (mc != NULL) in mlx_periodic_eventlog_poll()
1309 mlx_releasecmd(mc); in mlx_periodic_eventlog_poll()
1310 if ((result != NULL) && (mc->mc_data != NULL)) in mlx_periodic_eventlog_poll()
1336 mlx_periodic_eventlog_respond(struct mlx_command *mc) in mlx_periodic_eventlog_respond() argument
1338 struct mlx_softc *sc = mc->mc_sc; in mlx_periodic_eventlog_respond()
1339 struct mlx_eventlog_entry *el = (struct mlx_eventlog_entry *)mc->mc_data; in mlx_periodic_eventlog_respond()
1346 if (mc->mc_status == 0) { in mlx_periodic_eventlog_respond()
1388 device_printf(sc->mlx_dev, "error reading message log - %s\n", mlx_diagnose_command(mc)); in mlx_periodic_eventlog_respond()
1394 free(mc->mc_data, M_DEVBUF); in mlx_periodic_eventlog_respond()
1395 mlx_releasecmd(mc); in mlx_periodic_eventlog_respond()
1410 mlx_periodic_rebuild(struct mlx_command *mc) in mlx_periodic_rebuild() argument
1412 struct mlx_softc *sc = mc->mc_sc; in mlx_periodic_rebuild()
1413 struct mlx_rebuild_status *mr = (struct mlx_rebuild_status *)mc->mc_data; in mlx_periodic_rebuild()
1416 switch(mc->mc_status) { in mlx_periodic_rebuild()
1446 free(mc->mc_data, M_DEVBUF); in mlx_periodic_rebuild()
1447 mlx_releasecmd(mc); in mlx_periodic_rebuild()
1463 struct mlx_command *mc; in mlx_pause_action() local
1493 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_pause_action()
1496 mc->mc_flags |= MLX_CMD_PRIORITY; in mlx_pause_action()
1497 if (mlx_getslot(mc)) in mlx_pause_action()
1501 mlx_make_type2(mc, command, (failsafe << 4) | i, 0, 0, 0, 0, 0, 0, 0); in mlx_pause_action()
1502 mc->mc_complete = mlx_pause_done; in mlx_pause_action()
1503 mc->mc_private = sc; /* XXX not needed */ in mlx_pause_action()
1504 if (mlx_start(mc)) in mlx_pause_action()
1512 if (mc != NULL) in mlx_pause_action()
1513 mlx_releasecmd(mc); in mlx_pause_action()
1519 mlx_pause_done(struct mlx_command *mc) in mlx_pause_done() argument
1521 struct mlx_softc *sc = mc->mc_sc; in mlx_pause_done()
1522 int command = mc->mc_mailbox[0]; in mlx_pause_done()
1523 int channel = mc->mc_mailbox[2] & 0xf; in mlx_pause_done()
1526 if (mc->mc_status != 0) { in mlx_pause_done()
1528 command == MLX_CMD_STOPCHANNEL ? "pause" : "resume", mlx_diagnose_command(mc)); in mlx_pause_done()
1535 mlx_releasecmd(mc); in mlx_pause_done()
1548 struct mlx_command *mc; in mlx_enquire_cb() local
1550 mc = (struct mlx_command *)arg; in mlx_enquire_cb()
1554 mlx_setup_dmamap(mc, segs, nsegments, error); in mlx_enquire_cb()
1557 sc = mc->mc_sc; in mlx_enquire_cb()
1558 mlx_make_type2(mc, mc->mc_command, 0, 0, 0, 0, 0, 0, mc->mc_dataphys, 0); in mlx_enquire_cb()
1561 if (mc->mc_complete != NULL) { in mlx_enquire_cb()
1562 if ((error = mlx_start(mc)) != 0) in mlx_enquire_cb()
1566 if ((sc->mlx_state & MLX_STATE_INTEN) ? mlx_wait_command(mc) : in mlx_enquire_cb()
1567 mlx_poll_command(mc)) in mlx_enquire_cb()
1571 if (mc->mc_status != 0) { in mlx_enquire_cb()
1573 mlx_diagnose_command(mc)); in mlx_enquire_cb()
1587 …quire(struct mlx_softc *sc, int command, size_t bufsize, void (* complete)(struct mlx_command *mc)) in mlx_enquire() argument
1589 struct mlx_command *mc; in mlx_enquire() local
1599 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_enquire()
1605 mc->mc_flags |= MLX_CMD_PRIORITY | MLX_CMD_DATAOUT; in mlx_enquire()
1606 if (mlx_getslot(mc)) in mlx_enquire()
1610 mc->mc_data = result; in mlx_enquire()
1611 mc->mc_length = bufsize; in mlx_enquire()
1612 mc->mc_command = command; in mlx_enquire()
1615 mc->mc_complete = complete; in mlx_enquire()
1616 mc->mc_private = mc; in mlx_enquire()
1619 error = bus_dmamap_load(sc->mlx_buffer_dmat, mc->mc_dmamap, mc->mc_data, in mlx_enquire()
1620 mc->mc_length, mlx_enquire_cb, mc, BUS_DMA_NOWAIT); in mlx_enquire()
1624 if ((mc != NULL) && (mc->mc_complete == NULL)) in mlx_enquire()
1625 mlx_releasecmd(mc); in mlx_enquire()
1644 struct mlx_command *mc; in mlx_flush() local
1652 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_flush()
1655 if (mlx_getslot(mc)) in mlx_flush()
1659 mlx_make_type2(mc, MLX_CMD_FLUSH, 0, 0, 0, 0, 0, 0, 0, 0); in mlx_flush()
1662 if (mlx_poll_command(mc)) in mlx_flush()
1666 if (mc->mc_status != 0) { in mlx_flush()
1667 device_printf(sc->mlx_dev, "FLUSH failed - %s\n", mlx_diagnose_command(mc)); in mlx_flush()
1673 if (mc != NULL) in mlx_flush()
1674 mlx_releasecmd(mc); in mlx_flush()
1687 struct mlx_command *mc; in mlx_check() local
1695 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_check()
1698 if (mlx_getslot(mc)) in mlx_check()
1702 mlx_make_type2(mc, MLX_CMD_CHECKASYNC, 0, 0, 0, 0, 0, drive | 0x80, 0, 0); in mlx_check()
1705 if (mlx_wait_command(mc)) in mlx_check()
1709 if (mc->mc_status != 0) { in mlx_check()
1710 device_printf(sc->mlx_dev, "CHECK ASYNC failed - %s\n", mlx_diagnose_command(mc)); in mlx_check()
1714 error = mc->mc_status; in mlx_check()
1717 if (mc != NULL) in mlx_check()
1718 mlx_releasecmd(mc); in mlx_check()
1731 struct mlx_command *mc; in mlx_rebuild() local
1739 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_rebuild()
1742 if (mlx_getslot(mc)) in mlx_rebuild()
1746 mlx_make_type2(mc, MLX_CMD_REBUILDASYNC, channel, target, 0, 0, 0, 0, 0, 0); in mlx_rebuild()
1749 if (mlx_wait_command(mc)) in mlx_rebuild()
1753 if (mc->mc_status != 0) { in mlx_rebuild()
1754 device_printf(sc->mlx_dev, "REBUILD ASYNC failed - %s\n", mlx_diagnose_command(mc)); in mlx_rebuild()
1758 error = mc->mc_status; in mlx_rebuild()
1761 if (mc != NULL) in mlx_rebuild()
1762 mlx_releasecmd(mc); in mlx_rebuild()
1772 mlx_wait_command(struct mlx_command *mc) in mlx_wait_command() argument
1774 struct mlx_softc *sc = mc->mc_sc; in mlx_wait_command()
1780 mc->mc_complete = NULL; in mlx_wait_command()
1781 mc->mc_private = mc; /* wake us when you're done */ in mlx_wait_command()
1782 if ((error = mlx_start(mc)) != 0) in mlx_wait_command()
1787 while ((mc->mc_status == MLX_STATUS_BUSY) && (count < 30)) { in mlx_wait_command()
1788 mtx_sleep(mc->mc_private, &sc->mlx_io_lock, PRIBIO | PCATCH, "mlxwcmd", hz); in mlx_wait_command()
1791 if (mc->mc_status != 0) { in mlx_wait_command()
1792 device_printf(sc->mlx_dev, "command failed - %s\n", mlx_diagnose_command(mc)); in mlx_wait_command()
1807 mlx_poll_command(struct mlx_command *mc) in mlx_poll_command() argument
1809 struct mlx_softc *sc = mc->mc_sc; in mlx_poll_command()
1815 mc->mc_complete = NULL; in mlx_poll_command()
1816 mc->mc_private = NULL; /* we will poll for it */ in mlx_poll_command()
1817 if ((error = mlx_start(mc)) != 0) in mlx_poll_command()
1823 mlx_done(mc->mc_sc, 1); in mlx_poll_command()
1825 } while ((mc->mc_status == MLX_STATUS_BUSY) && (count++ < 15000000)); in mlx_poll_command()
1826 if (mc->mc_status != MLX_STATUS_BUSY) { in mlx_poll_command()
1827 TAILQ_REMOVE(&sc->mlx_work, mc, mc_link); in mlx_poll_command()
1830 device_printf(sc->mlx_dev, "command failed - %s\n", mlx_diagnose_command(mc)); in mlx_poll_command()
1837 struct mlx_command *mc; in mlx_startio_cb() local
1845 mc = (struct mlx_command *)arg; in mlx_startio_cb()
1846 mlx_setup_dmamap(mc, segs, nsegments, error); in mlx_startio_cb()
1848 sc = mc->mc_sc; in mlx_startio_cb()
1849 bp = mc->mc_private; in mlx_startio_cb()
1852 mc->mc_flags |= MLX_CMD_DATAIN; in mlx_startio_cb()
1855 mc->mc_flags |= MLX_CMD_DATAOUT; in mlx_startio_cb()
1875 mlx_make_type1(mc, (cmd == MLX_CMD_WRITESG) ? MLX_CMD_WRITESG_OLD : in mlx_startio_cb()
1880 mc->mc_sgphys, /* location of SG list */ in mlx_startio_cb()
1881 mc->mc_nsgent & 0x3f); /* size of SG list */ in mlx_startio_cb()
1883 mlx_make_type5(mc, cmd, in mlx_startio_cb()
1888 mc->mc_sgphys, /* location of SG list */ in mlx_startio_cb()
1889 mc->mc_nsgent & 0x3f); /* size of SG list */ in mlx_startio_cb()
1893 if (mlx_start(mc) != 0) { in mlx_startio_cb()
1895 mc->mc_status = MLX_STATUS_WEDGED; in mlx_startio_cb()
1896 mlx_completeio(mc); in mlx_startio_cb()
1909 struct mlx_command *mc; in mlx_startio() local
1924 if ((mc = mlx_alloccmd(sc)) == NULL) in mlx_startio()
1927 if (mlx_getslot(mc) != 0) { in mlx_startio()
1928 mlx_releasecmd(mc); in mlx_startio()
1936 mc->mc_complete = mlx_completeio; in mlx_startio()
1937 mc->mc_private = bp; in mlx_startio()
1938 mc->mc_data = bp->bio_data; in mlx_startio()
1939 mc->mc_length = bp->bio_bcount; in mlx_startio()
1942 error = bus_dmamap_load(sc->mlx_buffer_dmat, mc->mc_dmamap, mc->mc_data, in mlx_startio()
1943 mc->mc_length, mlx_startio_cb, mc, 0); in mlx_startio()
1955 mlx_completeio(struct mlx_command *mc) in mlx_completeio() argument
1957 struct mlx_softc *sc = mc->mc_sc; in mlx_completeio()
1958 struct bio *bp = mc->mc_private; in mlx_completeio()
1962 if (mc->mc_status != MLX_STATUS_OK) { /* could be more verbose here? */ in mlx_completeio()
1966 switch(mc->mc_status) { in mlx_completeio()
1974 device_printf(sc->mlx_dev, "I/O error - %s\n", mlx_diagnose_command(mc)); in mlx_completeio()
1978 device_printf(sc->mlx_dev, " %13D\n", mc->mc_mailbox, " "); in mlx_completeio()
1983 mlx_releasecmd(mc); in mlx_completeio()
1991 struct mlx_command *mc; in mlx_user_cb() local
1994 mc = (struct mlx_command *)arg; in mlx_user_cb()
1998 mlx_setup_dmamap(mc, segs, nsegments, error); in mlx_user_cb()
2000 mu = (struct mlx_usercommand *)mc->mc_private; in mlx_user_cb()
2009 if (mc->mc_mailbox[0] == MLX_CMD_DIRECT_CDB) { in mlx_user_cb()
2010 dcdb = (struct mlx_dcdb *)mc->mc_data; in mlx_user_cb()
2011 dcdb->dcdb_physaddr = mc->mc_dataphys + sizeof(*dcdb); in mlx_user_cb()
2019 mc->mc_mailbox[mu->mu_bufptr ] = mc->mc_dataphys & 0xff; in mlx_user_cb()
2020 mc->mc_mailbox[mu->mu_bufptr + 1] = (mc->mc_dataphys >> 8) & 0xff; in mlx_user_cb()
2021 mc->mc_mailbox[mu->mu_bufptr + 2] = (mc->mc_dataphys >> 16) & 0xff; in mlx_user_cb()
2022 mc->mc_mailbox[mu->mu_bufptr + 3] = (mc->mc_dataphys >> 24) & 0xff; in mlx_user_cb()
2027 if (mlx_wait_command(mc) != 0) in mlx_user_cb()
2042 struct mlx_command *mc; in mlx_user_command() local
2049 mc = NULL; in mlx_user_command()
2054 if ((mc = mlx_alloccmd(sc)) == NULL) { in mlx_user_command()
2058 bcopy(mu->mu_command, mc->mc_mailbox, sizeof(mc->mc_mailbox)); in mlx_user_command()
2081 if (mlx_getslot(mc)) in mlx_user_command()
2096 mc->mc_data = kbuf; in mlx_user_command()
2097 mc->mc_length = mu->mu_datasize; in mlx_user_command()
2098 mc->mc_private = mu; in mlx_user_command()
2099 error = bus_dmamap_load(sc->mlx_buffer_dmat, mc->mc_dmamap, mc->mc_data, in mlx_user_command()
2100 mc->mc_length, mlx_user_cb, mc, BUS_DMA_NOWAIT); in mlx_user_command()
2105 mu->mu_status = mc->mc_status; in mlx_user_command()
2113 mlx_releasecmd(mc); in mlx_user_command()
2133 mlx_getslot(struct mlx_command *mc) in mlx_getslot() argument
2135 struct mlx_softc *sc = mc->mc_sc; in mlx_getslot()
2150 if (sc->mlx_busycmds >= ((mc->mc_flags & MLX_CMD_PRIORITY) ? limit : limit - 4)) in mlx_getslot()
2164 sc->mlx_busycmd[slot] = mc; in mlx_getslot()
2173 mc->mc_slot = slot; in mlx_getslot()
2181 mlx_setup_dmamap(struct mlx_command *mc, bus_dma_segment_t *segs, int nsegments, in mlx_setup_dmamap() argument
2184 struct mlx_softc *sc = mc->mc_sc; in mlx_setup_dmamap()
2196 sg = sc->mlx_sgtable + (mc->mc_slot * MLX_NSEG); in mlx_setup_dmamap()
2199 mc->mc_nsgent = nsegments; in mlx_setup_dmamap()
2200 mc->mc_sgphys = sc->mlx_sgbusaddr + in mlx_setup_dmamap()
2201 (mc->mc_slot * MLX_NSEG * sizeof(struct mlx_sgentry)); in mlx_setup_dmamap()
2202 mc->mc_dataphys = segs[0].ds_addr; in mlx_setup_dmamap()
2211 if (mc->mc_flags & MLX_CMD_DATAIN) in mlx_setup_dmamap()
2212 bus_dmamap_sync(sc->mlx_buffer_dmat, mc->mc_dmamap, in mlx_setup_dmamap()
2214 if (mc->mc_flags & MLX_CMD_DATAOUT) in mlx_setup_dmamap()
2215 bus_dmamap_sync(sc->mlx_buffer_dmat, mc->mc_dmamap, in mlx_setup_dmamap()
2220 mlx_unmapcmd(struct mlx_command *mc) in mlx_unmapcmd() argument
2222 struct mlx_softc *sc = mc->mc_sc; in mlx_unmapcmd()
2227 if (mc->mc_data != NULL) { in mlx_unmapcmd()
2229 if (mc->mc_flags & MLX_CMD_DATAIN) in mlx_unmapcmd()
2230 bus_dmamap_sync(sc->mlx_buffer_dmat, mc->mc_dmamap, BUS_DMASYNC_POSTREAD); in mlx_unmapcmd()
2231 if (mc->mc_flags & MLX_CMD_DATAOUT) in mlx_unmapcmd()
2232 bus_dmamap_sync(sc->mlx_buffer_dmat, mc->mc_dmamap, BUS_DMASYNC_POSTWRITE); in mlx_unmapcmd()
2234 bus_dmamap_unload(sc->mlx_buffer_dmat, mc->mc_dmamap); in mlx_unmapcmd()
2244 mlx_start(struct mlx_command *mc) in mlx_start() argument
2246 struct mlx_softc *sc = mc->mc_sc; in mlx_start()
2252 mc->mc_mailbox[0x1] = mc->mc_slot; in mlx_start()
2255 mc->mc_status = MLX_STATUS_BUSY; in mlx_start()
2258 mc->mc_timeout = time_second + 60; in mlx_start()
2262 if (sc->mlx_tryqueue(sc, mc)) { in mlx_start()
2264 TAILQ_INSERT_TAIL(&sc->mlx_work, mc, mc_link); in mlx_start()
2274 sc->mlx_busycmd[mc->mc_slot] = NULL; in mlx_start()
2276 mc->mc_status = MLX_STATUS_WEDGED; in mlx_start()
2291 struct mlx_command *mc; in mlx_done() local
2306 mc = sc->mlx_busycmd[slot]; /* find command */ in mlx_done()
2307 if (mc != NULL) { /* paranoia */ in mlx_done()
2308 if (mc->mc_status == MLX_STATUS_BUSY) { in mlx_done()
2309 mc->mc_status = status; /* save status */ in mlx_done()
2341 struct mlx_command *mc, *nc; in mlx_complete() local
2347 mc = TAILQ_FIRST(&sc->mlx_work); in mlx_complete()
2348 while (mc != NULL) { in mlx_complete()
2349 nc = TAILQ_NEXT(mc, mc_link); in mlx_complete()
2352 if (mc->mc_status != MLX_STATUS_BUSY) { in mlx_complete()
2355 mlx_unmapcmd(mc); in mlx_complete()
2359 if (mc->mc_complete != NULL) { in mlx_complete()
2361 TAILQ_REMOVE(&sc->mlx_work, mc, mc_link); in mlx_complete()
2362 mc->mc_complete(mc); in mlx_complete()
2367 } else if (mc->mc_private != NULL) { /* sleeping caller wants to know about it */ in mlx_complete()
2370 TAILQ_REMOVE(&sc->mlx_work, mc, mc_link); in mlx_complete()
2371 wakeup_one(mc->mc_private); in mlx_complete()
2379 mc = nc; in mlx_complete()
2406 struct mlx_command *mc; in mlx_alloccmd() local
2412 if ((mc = TAILQ_FIRST(&sc->mlx_freecmds)) != NULL) in mlx_alloccmd()
2413 TAILQ_REMOVE(&sc->mlx_freecmds, mc, mc_link); in mlx_alloccmd()
2416 if (mc == NULL) { in mlx_alloccmd()
2417 mc = (struct mlx_command *)malloc(sizeof(*mc), M_DEVBUF, M_NOWAIT | M_ZERO); in mlx_alloccmd()
2418 if (mc != NULL) { in mlx_alloccmd()
2419 mc->mc_sc = sc; in mlx_alloccmd()
2420 error = bus_dmamap_create(sc->mlx_buffer_dmat, 0, &mc->mc_dmamap); in mlx_alloccmd()
2422 free(mc, M_DEVBUF); in mlx_alloccmd()
2427 return(mc); in mlx_alloccmd()
2437 mlx_releasecmd(struct mlx_command *mc) in mlx_releasecmd() argument
2442 MLX_IO_ASSERT_LOCKED(mc->mc_sc); in mlx_releasecmd()
2443 TAILQ_INSERT_HEAD(&mc->mc_sc->mlx_freecmds, mc, mc_link); in mlx_releasecmd()
2450 mlx_freecmd(struct mlx_command *mc) in mlx_freecmd() argument
2452 struct mlx_softc *sc = mc->mc_sc; in mlx_freecmd()
2455 bus_dmamap_destroy(sc->mlx_buffer_dmat, mc->mc_dmamap); in mlx_freecmd()
2456 free(mc, M_DEVBUF); in mlx_freecmd()
2471 mlx_v3_tryqueue(struct mlx_softc *sc, struct mlx_command *mc) in mlx_v3_tryqueue() argument
2482 MLX_V3_PUT_MAILBOX(sc, i, mc->mc_mailbox[i]); in mlx_v3_tryqueue()
2586 mlx_v4_tryqueue(struct mlx_softc *sc, struct mlx_command *mc) in mlx_v4_tryqueue() argument
2597 MLX_V4_PUT_MAILBOX(sc, i, mc->mc_mailbox[i]); in mlx_v4_tryqueue()
2705 mlx_v5_tryqueue(struct mlx_softc *sc, struct mlx_command *mc) in mlx_v5_tryqueue() argument
2716 MLX_V5_PUT_MAILBOX(sc, i, mc->mc_mailbox[i]); in mlx_v5_tryqueue()
2885 mlx_diagnose_command(struct mlx_command *mc) in mlx_diagnose_command() argument
2892 if (((mc->mc_mailbox[0] == mlx_messages[i].command) || (mlx_messages[i].command == 0)) && in mlx_diagnose_command()
2893 (mc->mc_status == mlx_messages[i].status)) in mlx_diagnose_command()
2896 …sprintf(unkmsg, "unknown response 0x%x for command 0x%x", (int)mc->mc_status, (int)mc->mc_mailbox[… in mlx_diagnose_command()