Lines Matching defs:sc

372 	struct octeon_soft_command *sc;
393 sc = buf;
396 * process sc. Add sc to the ordered soft
404 list_add_tail(&sc->node, &oct->response_list
578 struct octeon_soft_command *sc,
598 ih3 = (struct octeon_instr_ih3 *)&sc->cmd.cmd3.ih3;
600 ih3->pkind = oct->instr_queue[sc->iq_no]->txpciq.s.pkind;
602 pki_ih3 = (struct octeon_instr_pki_ih3 *)&sc->cmd.cmd3.pki_ih3;
608 oct->instr_queue[sc->iq_no]->txpciq.s.use_qpg;
613 oct->instr_queue[sc->iq_no]->txpciq.s.ctrl_qpg;
618 if (sc->datasize)
619 ih3->dlengsz = sc->datasize;
621 irh = (struct octeon_instr_irh *)&sc->cmd.cmd3.irh;
627 sc->cmd.cmd3.ossp[0] = ossp0;
628 sc->cmd.cmd3.ossp[1] = ossp1;
630 if (sc->rdatasize) {
631 rdp = (struct octeon_instr_rdp *)&sc->cmd.cmd3.rdp;
633 rdp->rlen = sc->rdatasize;
647 ih2 = (struct octeon_instr_ih2 *)&sc->cmd.cmd2.ih2;
653 if (sc->datasize) {
654 ih2->dlengsz = sc->datasize;
658 irh = (struct octeon_instr_irh *)&sc->cmd.cmd2.irh;
664 sc->cmd.cmd2.ossp[0] = ossp0;
665 sc->cmd.cmd2.ossp[1] = ossp1;
667 if (sc->rdatasize) {
668 rdp = (struct octeon_instr_rdp *)&sc->cmd.cmd2.rdp;
670 rdp->rlen = sc->rdatasize;
685 struct octeon_soft_command *sc)
693 iq = oct->instr_queue[sc->iq_no];
696 sc->iq_no);
697 INCR_INSTRQUEUE_PKT_COUNT(oct, sc->iq_no, instr_dropped, 1);
702 ih3 = (struct octeon_instr_ih3 *)&sc->cmd.cmd3.ih3;
704 WARN_ON(!sc->dmadptr);
705 sc->cmd.cmd3.dptr = sc->dmadptr;
707 irh = (struct octeon_instr_irh *)&sc->cmd.cmd3.irh;
709 WARN_ON(!sc->dmarptr);
710 WARN_ON(!sc->status_word);
711 *sc->status_word = COMPLETION_WORD_INIT;
712 sc->cmd.cmd3.rptr = sc->dmarptr;
716 ih2 = (struct octeon_instr_ih2 *)&sc->cmd.cmd2.ih2;
718 WARN_ON(!sc->dmadptr);
719 sc->cmd.cmd2.dptr = sc->dmadptr;
721 irh = (struct octeon_instr_irh *)&sc->cmd.cmd2.irh;
723 WARN_ON(!sc->dmarptr);
724 WARN_ON(!sc->status_word);
725 *sc->status_word = COMPLETION_WORD_INIT;
726 sc->cmd.cmd2.rptr = sc->dmarptr;
731 sc->expiry_time = jiffies + msecs_to_jiffies(LIO_SC_MAX_TMO_MS);
733 return (octeon_send_command(oct, sc->iq_no, 1, &sc->cmd, sc,
742 struct octeon_soft_command *sc;
749 sc = (struct octeon_soft_command *)
753 if (!sc) {
758 sc->dma_addr = dma_addr;
759 sc->size = SOFT_COMMAND_BUFFER_SIZE;
761 list_add_tail(&sc->node, &oct->sc_buf_pool.head);
771 struct octeon_soft_command *sc;
786 sc = list_entry(tmp, struct octeon_soft_command, node);
788 if (READ_ONCE(sc->caller_is_done)) {
789 list_del(&sc->node);
792 if (*sc->status_word == COMPLETION_WORD_INIT) {
793 /* timeout; move sc to zombie list */
794 list_add_tail(&sc->node, &zombie_sc_list->head);
797 octeon_free_soft_command(oct, sc);
811 struct octeon_soft_command *sc;
823 sc = list_entry(tmp, struct octeon_soft_command, node);
824 octeon_free_soft_command(oct, sc);
836 struct octeon_soft_command *sc;
845 sc = (struct octeon_soft_command *)tmp;
847 lio_dma_free(oct, sc->size, sc, sc->dma_addr);
866 struct octeon_soft_command *sc = NULL;
891 sc = (struct octeon_soft_command *)tmp;
893 dma_addr = sc->dma_addr;
894 size = sc->size;
896 memset(sc, 0, sc->size);
898 sc->dma_addr = dma_addr;
899 sc->size = size;
902 sc->ctxptr = (u8 *)sc + offset;
903 sc->ctxsize = ctxsize;
910 sc->virtdptr = (u8 *)sc + offset;
911 sc->dmadptr = dma_addr + offset;
912 sc->datasize = datasize;
920 sc->virtrptr = (u8 *)sc + offset;
921 sc->dmarptr = dma_addr + offset;
922 sc->rdatasize = rdatasize;
923 sc->status_word = (u64 *)((u8 *)(sc->virtrptr) + rdatasize - 8);
926 return sc;
931 struct octeon_soft_command *sc)
935 list_add_tail(&sc->node, &oct->sc_buf_pool.head);