Lines Matching refs:rx
109 struct slim_ctrl_buf rx; member
136 spin_lock_irqsave(&ctrl->rx.lock, flags); in slim_alloc_rxbuf()
137 if ((ctrl->rx.tail + 1) % ctrl->rx.n == ctrl->rx.head) { in slim_alloc_rxbuf()
138 spin_unlock_irqrestore(&ctrl->rx.lock, flags); in slim_alloc_rxbuf()
142 idx = ctrl->rx.tail; in slim_alloc_rxbuf()
143 ctrl->rx.tail = (ctrl->rx.tail + 1) % ctrl->rx.n; in slim_alloc_rxbuf()
144 spin_unlock_irqrestore(&ctrl->rx.lock, flags); in slim_alloc_rxbuf()
146 return ctrl->rx.base + (idx * ctrl->rx.sl_sz); in slim_alloc_rxbuf()
425 spin_lock_irqsave(&ctrl->rx.lock, flags); in slim_get_current_rxbuf()
426 if (ctrl->rx.tail == ctrl->rx.head) { in slim_get_current_rxbuf()
427 spin_unlock_irqrestore(&ctrl->rx.lock, flags); in slim_get_current_rxbuf()
430 memcpy(buf, ctrl->rx.base + (ctrl->rx.head * ctrl->rx.sl_sz), in slim_get_current_rxbuf()
431 ctrl->rx.sl_sz); in slim_get_current_rxbuf()
433 ctrl->rx.head = (ctrl->rx.head + 1) % ctrl->rx.n; in slim_get_current_rxbuf()
434 spin_unlock_irqrestore(&ctrl->rx.lock, flags); in slim_get_current_rxbuf()
530 ctrl->rx.n = QCOM_RX_MSGS; in qcom_slim_probe()
531 ctrl->rx.sl_sz = SLIM_MSGQ_BUF_LEN; in qcom_slim_probe()
537 spin_lock_init(&ctrl->rx.lock); in qcom_slim_probe()
576 ctrl->rx.base = devm_kcalloc(&pdev->dev,ctrl->rx.n, ctrl->rx.sl_sz, in qcom_slim_probe()
578 if (!ctrl->rx.base) { in qcom_slim_probe()