Lines Matching refs:omsg_ring

1679 	spin_lock_irqsave(&priv->omsg_ring[mbox].lock, flags);  in tsi721_add_outb_message()
1681 tx_slot = priv->omsg_ring[mbox].tx_slot; in tsi721_add_outb_message()
1684 memcpy(priv->omsg_ring[mbox].omq_base[tx_slot], buffer, len); in tsi721_add_outb_message()
1690 desc = priv->omsg_ring[mbox].omd_base; in tsi721_add_outb_message()
1701 cpu_to_le32((u64)priv->omsg_ring[mbox].omq_phys[tx_slot] & in tsi721_add_outb_message()
1704 cpu_to_le32((u64)priv->omsg_ring[mbox].omq_phys[tx_slot] >> 32); in tsi721_add_outb_message()
1706 priv->omsg_ring[mbox].wr_count++; in tsi721_add_outb_message()
1709 if (++priv->omsg_ring[mbox].tx_slot == priv->omsg_ring[mbox].size) { in tsi721_add_outb_message()
1710 priv->omsg_ring[mbox].tx_slot = 0; in tsi721_add_outb_message()
1712 priv->omsg_ring[mbox].wr_count++; in tsi721_add_outb_message()
1718 iowrite32(priv->omsg_ring[mbox].wr_count, in tsi721_add_outb_message()
1722 spin_unlock_irqrestore(&priv->omsg_ring[mbox].lock, flags); in tsi721_add_outb_message()
1742 spin_lock(&priv->omsg_ring[ch].lock); in tsi721_omsg_handler()
1760 srd_ptr = priv->omsg_ring[ch].sts_rdptr; in tsi721_omsg_handler()
1761 sts_ptr = priv->omsg_ring[ch].sts_base; in tsi721_omsg_handler()
1771 srd_ptr %= priv->omsg_ring[ch].sts_size; in tsi721_omsg_handler()
1778 priv->omsg_ring[ch].sts_rdptr = srd_ptr; in tsi721_omsg_handler()
1786 tx_slot = (last_ptr - (u64)priv->omsg_ring[ch].omd_phys)/ in tsi721_omsg_handler()
1794 if (tx_slot == priv->omsg_ring[ch].size) { in tsi721_omsg_handler()
1797 (u64)priv->omsg_ring[ch].omd_phys)/ in tsi721_omsg_handler()
1803 if (tx_slot >= priv->omsg_ring[ch].size) in tsi721_omsg_handler()
1806 tx_slot, priv->omsg_ring[ch].size); in tsi721_omsg_handler()
1807 WARN_ON(tx_slot >= priv->omsg_ring[ch].size); in tsi721_omsg_handler()
1811 if (tx_slot == priv->omsg_ring[ch].size) in tsi721_omsg_handler()
1814 dev_id = priv->omsg_ring[ch].dev_id; in tsi721_omsg_handler()
1836 dev_id = priv->omsg_ring[ch].dev_id; in tsi721_omsg_handler()
1837 tx_slot = priv->omsg_ring[ch].tx_slot; in tsi721_omsg_handler()
1841 iowrite32(priv->omsg_ring[ch].tx_slot, in tsi721_omsg_handler()
1844 priv->omsg_ring[ch].wr_count = priv->omsg_ring[ch].tx_slot; in tsi721_omsg_handler()
1845 priv->omsg_ring[ch].sts_rdptr = 0; in tsi721_omsg_handler()
1860 spin_unlock(&priv->omsg_ring[ch].lock); in tsi721_omsg_handler()
1892 priv->omsg_ring[mbox].dev_id = dev_id; in tsi721_open_outb_mbox()
1893 priv->omsg_ring[mbox].size = entries; in tsi721_open_outb_mbox()
1894 priv->omsg_ring[mbox].sts_rdptr = 0; in tsi721_open_outb_mbox()
1895 spin_lock_init(&priv->omsg_ring[mbox].lock); in tsi721_open_outb_mbox()
1900 priv->omsg_ring[mbox].omq_base[i] = in tsi721_open_outb_mbox()
1903 &priv->omsg_ring[mbox].omq_phys[i], in tsi721_open_outb_mbox()
1905 if (priv->omsg_ring[mbox].omq_base[i] == NULL) { in tsi721_open_outb_mbox()
1914 priv->omsg_ring[mbox].omd_base = dma_alloc_coherent( in tsi721_open_outb_mbox()
1917 &priv->omsg_ring[mbox].omd_phys, GFP_KERNEL); in tsi721_open_outb_mbox()
1918 if (priv->omsg_ring[mbox].omd_base == NULL) { in tsi721_open_outb_mbox()
1925 priv->omsg_ring[mbox].tx_slot = 0; in tsi721_open_outb_mbox()
1928 priv->omsg_ring[mbox].sts_size = roundup_pow_of_two(entries + 1); in tsi721_open_outb_mbox()
1929 priv->omsg_ring[mbox].sts_base = dma_alloc_coherent(&priv->pdev->dev, in tsi721_open_outb_mbox()
1930 priv->omsg_ring[mbox].sts_size * sizeof(struct tsi721_dma_sts), in tsi721_open_outb_mbox()
1931 &priv->omsg_ring[mbox].sts_phys, in tsi721_open_outb_mbox()
1933 if (priv->omsg_ring[mbox].sts_base == NULL) { in tsi721_open_outb_mbox()
1945 iowrite32(((u64)priv->omsg_ring[mbox].omd_phys >> 32), in tsi721_open_outb_mbox()
1947 iowrite32(((u64)priv->omsg_ring[mbox].omd_phys & in tsi721_open_outb_mbox()
1952 iowrite32(((u64)priv->omsg_ring[mbox].sts_phys >> 32), in tsi721_open_outb_mbox()
1954 iowrite32(((u64)priv->omsg_ring[mbox].sts_phys & in tsi721_open_outb_mbox()
1957 iowrite32(TSI721_DMAC_DSSZ_SIZE(priv->omsg_ring[mbox].sts_size), in tsi721_open_outb_mbox()
1994 bd_ptr = priv->omsg_ring[mbox].omd_base; in tsi721_open_outb_mbox()
1998 cpu_to_le32((u64)priv->omsg_ring[mbox].omd_phys & in tsi721_open_outb_mbox()
2001 cpu_to_le32((u64)priv->omsg_ring[mbox].omd_phys >> 32); in tsi721_open_outb_mbox()
2002 priv->omsg_ring[mbox].wr_count = 0; in tsi721_open_outb_mbox()
2018 priv->omsg_ring[mbox].sts_size * sizeof(struct tsi721_dma_sts), in tsi721_open_outb_mbox()
2019 priv->omsg_ring[mbox].sts_base, in tsi721_open_outb_mbox()
2020 priv->omsg_ring[mbox].sts_phys); in tsi721_open_outb_mbox()
2022 priv->omsg_ring[mbox].sts_base = NULL; in tsi721_open_outb_mbox()
2028 priv->omsg_ring[mbox].omd_base, in tsi721_open_outb_mbox()
2029 priv->omsg_ring[mbox].omd_phys); in tsi721_open_outb_mbox()
2031 priv->omsg_ring[mbox].omd_base = NULL; in tsi721_open_outb_mbox()
2034 for (i = 0; i < priv->omsg_ring[mbox].size; i++) { in tsi721_open_outb_mbox()
2035 if (priv->omsg_ring[mbox].omq_base[i]) { in tsi721_open_outb_mbox()
2038 priv->omsg_ring[mbox].omq_base[i], in tsi721_open_outb_mbox()
2039 priv->omsg_ring[mbox].omq_phys[i]); in tsi721_open_outb_mbox()
2041 priv->omsg_ring[mbox].omq_base[i] = NULL; in tsi721_open_outb_mbox()
2078 priv->omsg_ring[mbox].sts_size * sizeof(struct tsi721_dma_sts), in tsi721_close_outb_mbox()
2079 priv->omsg_ring[mbox].sts_base, in tsi721_close_outb_mbox()
2080 priv->omsg_ring[mbox].sts_phys); in tsi721_close_outb_mbox()
2082 priv->omsg_ring[mbox].sts_base = NULL; in tsi721_close_outb_mbox()
2086 (priv->omsg_ring[mbox].size + 1) * in tsi721_close_outb_mbox()
2088 priv->omsg_ring[mbox].omd_base, in tsi721_close_outb_mbox()
2089 priv->omsg_ring[mbox].omd_phys); in tsi721_close_outb_mbox()
2091 priv->omsg_ring[mbox].omd_base = NULL; in tsi721_close_outb_mbox()
2094 for (i = 0; i < priv->omsg_ring[mbox].size; i++) { in tsi721_close_outb_mbox()
2095 if (priv->omsg_ring[mbox].omq_base[i]) { in tsi721_close_outb_mbox()
2098 priv->omsg_ring[mbox].omq_base[i], in tsi721_close_outb_mbox()
2099 priv->omsg_ring[mbox].omq_phys[i]); in tsi721_close_outb_mbox()
2101 priv->omsg_ring[mbox].omq_base[i] = NULL; in tsi721_close_outb_mbox()