Lines Matching refs:sc

374 	struct octeon_soft_command *sc;  in lio_process_iq_request_list()  local
395 sc = buf; in lio_process_iq_request_list()
397 irh = (struct octeon_instr_irh *)&sc->cmd.irh; in lio_process_iq_request_list()
410 list_add_tail(&sc->node, &oct->response_list in lio_process_iq_request_list()
415 if (sc->callback) { in lio_process_iq_request_list()
416 sc->callback(oct, OCTEON_REQUEST_DONE, in lio_process_iq_request_list()
417 sc->callback_arg); in lio_process_iq_request_list()
552 struct octeon_soft_command *sc, in octeon_prepare_soft_command() argument
569 ih = (struct octeon_instr_ih *)&sc->cmd.ih; in octeon_prepare_soft_command()
575 if (sc->datasize) { in octeon_prepare_soft_command()
576 ih->dlengsz = sc->datasize; in octeon_prepare_soft_command()
580 irh = (struct octeon_instr_irh *)&sc->cmd.irh; in octeon_prepare_soft_command()
586 sc->cmd.ossp[0] = ossp0; in octeon_prepare_soft_command()
587 sc->cmd.ossp[1] = ossp1; in octeon_prepare_soft_command()
589 if (sc->rdatasize) { in octeon_prepare_soft_command()
590 rdp = (struct octeon_instr_rdp *)&sc->cmd.rdp; in octeon_prepare_soft_command()
592 rdp->rlen = sc->rdatasize; in octeon_prepare_soft_command()
603 while (!(oct->io_qmask.iq & (1 << sc->iq_no))) in octeon_prepare_soft_command()
604 sc->iq_no++; in octeon_prepare_soft_command()
608 struct octeon_soft_command *sc) in octeon_send_soft_command() argument
614 ih = (struct octeon_instr_ih *)&sc->cmd.ih; in octeon_send_soft_command()
616 BUG_ON(!sc->dmadptr); in octeon_send_soft_command()
617 sc->cmd.dptr = sc->dmadptr; in octeon_send_soft_command()
620 irh = (struct octeon_instr_irh *)&sc->cmd.irh; in octeon_send_soft_command()
622 BUG_ON(!sc->dmarptr); in octeon_send_soft_command()
623 BUG_ON(!sc->status_word); in octeon_send_soft_command()
624 *sc->status_word = COMPLETION_WORD_INIT; in octeon_send_soft_command()
626 rdp = (struct octeon_instr_rdp *)&sc->cmd.rdp; in octeon_send_soft_command()
628 sc->cmd.rptr = sc->dmarptr; in octeon_send_soft_command()
631 if (sc->wait_time) in octeon_send_soft_command()
632 sc->timeout = jiffies + sc->wait_time; in octeon_send_soft_command()
634 return octeon_send_command(oct, sc->iq_no, 1, &sc->cmd, sc, in octeon_send_soft_command()
642 struct octeon_soft_command *sc; in octeon_setup_sc_buffer_pool() local
649 sc = (struct octeon_soft_command *) in octeon_setup_sc_buffer_pool()
653 if (!sc) in octeon_setup_sc_buffer_pool()
656 sc->dma_addr = dma_addr; in octeon_setup_sc_buffer_pool()
657 sc->size = SOFT_COMMAND_BUFFER_SIZE; in octeon_setup_sc_buffer_pool()
659 list_add_tail(&sc->node, &oct->sc_buf_pool.head); in octeon_setup_sc_buffer_pool()
668 struct octeon_soft_command *sc; in octeon_free_sc_buffer_pool() local
675 sc = (struct octeon_soft_command *)tmp; in octeon_free_sc_buffer_pool()
677 lio_dma_free(oct, sc->size, sc, sc->dma_addr); in octeon_free_sc_buffer_pool()
695 struct octeon_soft_command *sc = NULL; in octeon_alloc_soft_command() local
717 sc = (struct octeon_soft_command *)tmp; in octeon_alloc_soft_command()
719 dma_addr = sc->dma_addr; in octeon_alloc_soft_command()
720 size = sc->size; in octeon_alloc_soft_command()
722 memset(sc, 0, sc->size); in octeon_alloc_soft_command()
724 sc->dma_addr = dma_addr; in octeon_alloc_soft_command()
725 sc->size = size; in octeon_alloc_soft_command()
728 sc->ctxptr = (u8 *)sc + offset; in octeon_alloc_soft_command()
729 sc->ctxsize = ctxsize; in octeon_alloc_soft_command()
736 sc->virtdptr = (u8 *)sc + offset; in octeon_alloc_soft_command()
737 sc->dmadptr = dma_addr + offset; in octeon_alloc_soft_command()
738 sc->datasize = datasize; in octeon_alloc_soft_command()
746 sc->virtrptr = (u8 *)sc + offset; in octeon_alloc_soft_command()
747 sc->dmarptr = dma_addr + offset; in octeon_alloc_soft_command()
748 sc->rdatasize = rdatasize; in octeon_alloc_soft_command()
749 sc->status_word = (u64 *)((u8 *)(sc->virtrptr) + rdatasize - 8); in octeon_alloc_soft_command()
752 return sc; in octeon_alloc_soft_command()
756 struct octeon_soft_command *sc) in octeon_free_soft_command() argument
760 list_add_tail(&sc->node, &oct->sc_buf_pool.head); in octeon_free_soft_command()