Lines Matching refs:command

96 static int ips_ioctl(struct cdev *dev, u_long command, caddr_t addr, int32_t flags, struct thread *td)
101 return ips_ioctl_request(sc, command, addr, flags);
106 ips_command_t *command = cmdptr;
109 command->command_phys_addr = segments[0].ds_addr;
117 ips_command_t *command;
122 command = &sc->commandarray[i];
124 if(command->command_phys_addr == 0)
127 command->command_dmamap);
129 command->command_buffer,
130 command->command_dmamap);
131 if (command->data_dmamap != NULL)
132 bus_dmamap_destroy(command->data_dmatag,
133 command->data_dmamap);
143 /* places all ips command structs on the free command queue. No locking as if someone else tries
148 ips_command_t *command;
157 command = &sc->commandarray[i];
158 command->id = i;
159 command->sc = sc;
161 if(bus_dmamem_alloc(sc->command_dmatag,&command->command_buffer,
162 BUS_DMA_NOWAIT, &command->command_dmamap))
164 bus_dmamap_load(sc->command_dmatag, command->command_dmamap,
165 command->command_buffer,IPS_COMMAND_LEN,
166 ips_cmd_dmaload, command, BUS_DMA_NOWAIT);
167 if(!command->command_phys_addr){
169 command->command_buffer, command->command_dmamap);
174 command->data_dmatag = sc->sg_dmatag;
175 if (bus_dmamap_create(command->data_dmatag, 0,
176 &command->data_dmamap))
178 SLIST_INSERT_HEAD(&sc->free_cmd_list, command, next);
180 sc->staticcmd = command;
189 /* returns a free command struct if one is available.
191 * Also, command buffers are not freed. They are
196 ips_command_t *command;
202 command = SLIST_FIRST(&sc->free_cmd_list);
203 if(!command || (sc->state & IPS_TIMEOUT)){
211 command = sc->staticcmd;
214 clear_ips_command(command);
215 bzero(command->command_buffer, IPS_COMMAND_LEN);
216 *cmd = command;
220 /* adds a command back to the free command queue */
221 void ips_insert_free_cmd(ips_softc_t *sc, ips_command_t *command)
225 panic("ips: command returned non-zero semaphore");
227 if (command != sc->staticcmd) {
228 SLIST_INSERT_HEAD(&sc->free_cmd_list, command, next);
298 * to the card have become stuck. If it finds a stuck command, it
308 ips_command_t *command;
311 command = &sc->commandarray[0];
313 if(!command[i].timeout){
316 command[i].timeout--;
317 if(!command[i].timeout){
320 device_printf(sc->dev, "WARNING: command timeout. Adapter is in toaster mode, resetting to known state\n");
322 ips_set_error(&command[i], ETIMEDOUT);
323 command[i].callback(&command[i]);
365 device_printf(sc->dev, "can't alloc command dma tag\n");
385 /* create one command buffer until we know how many commands this card
419 device_printf(sc->dev, "failed to initialize command buffers\n");
497 "trying to exit when command queue is not empty!\n");
516 ips_command_t *command;
523 DEVICE_PRINTF(2,sc->dev, "got a non-command irq\n");
528 command = &sc->commandarray[cmdnumber];
529 command->status.value = status.value;
530 command->timeout = 0;
531 command->callback(command);
547 void ips_morpheus_poll(ips_command_t *command)
555 ts = time_second + command->timeout;
556 while ((command->timeout != 0)
557 && (ips_morpheus_check_intr(command->sc) == 0)
562 void ips_issue_morpheus_cmd(ips_command_t *command)
565 if(command->sc->state & IPS_OFFLINE){
566 ips_set_error(command, EINVAL);
567 command->callback(command);
570 command->timeout = 10;
571 ips_write_4(command->sc, MORPHEUS_REG_IQPR, command->command_phys_addr);
722 PRINTF(9, "ips: got command %d\n", cmdnumber);
728 void ips_issue_copperhead_cmd(ips_command_t *command)
732 if(command->sc->state & IPS_OFFLINE){
733 ips_set_error(command, EINVAL);
734 command->callback(command);
737 command->timeout = 10;
738 for(i = 0; ips_read_4(command->sc, COPPER_REG_CCCR) & COPPER_SEM_BIT;
741 printf("sem bit still set, can't send a command\n");
746 ips_write_4(command->sc, COPPER_REG_CCSAR, command->command_phys_addr);
747 ips_write_2(command->sc, COPPER_REG_CCCR, COPPER_CMD_START);
750 void ips_copperhead_poll(ips_command_t *command)