Lines Matching refs:trc
18 struct snic_trc *trc = &snic_glob->trc; in snic_get_trc_buf() local
22 spin_lock_irqsave(&trc->lock, flags); in snic_get_trc_buf()
23 td = &trc->buf[trc->wr_idx]; in snic_get_trc_buf()
24 trc->wr_idx++; in snic_get_trc_buf()
26 if (trc->wr_idx == trc->max_idx) in snic_get_trc_buf()
27 trc->wr_idx = 0; in snic_get_trc_buf()
29 if (trc->wr_idx != trc->rd_idx) { in snic_get_trc_buf()
30 spin_unlock_irqrestore(&trc->lock, flags); in snic_get_trc_buf()
35 trc->rd_idx++; in snic_get_trc_buf()
36 if (trc->rd_idx == trc->max_idx) in snic_get_trc_buf()
37 trc->rd_idx = 0; in snic_get_trc_buf()
40 spin_unlock_irqrestore(&trc->lock, flags); in snic_get_trc_buf()
78 struct snic_trc *trc = &snic_glob->trc; in snic_get_trc_data() local
81 spin_lock_irqsave(&trc->lock, flags); in snic_get_trc_data()
82 if (trc->rd_idx == trc->wr_idx) { in snic_get_trc_data()
83 spin_unlock_irqrestore(&trc->lock, flags); in snic_get_trc_data()
87 td = &trc->buf[trc->rd_idx]; in snic_get_trc_data()
91 spin_unlock_irqrestore(&trc->lock, flags); in snic_get_trc_data()
96 trc->rd_idx++; in snic_get_trc_data()
97 if (trc->rd_idx == trc->max_idx) in snic_get_trc_data()
98 trc->rd_idx = 0; in snic_get_trc_data()
99 spin_unlock_irqrestore(&trc->lock, flags); in snic_get_trc_data()
110 struct snic_trc *trc = &snic_glob->trc; in snic_trc_init() local
124 trc->buf = (struct snic_trc_data *) tbuf; in snic_trc_init()
125 spin_lock_init(&trc->lock); in snic_trc_init()
129 trc->max_idx = (tbuf_sz / SNIC_TRC_ENTRY_SZ); in snic_trc_init()
130 trc->rd_idx = trc->wr_idx = 0; in snic_trc_init()
131 trc->enable = true; in snic_trc_init()
145 struct snic_trc *trc = &snic_glob->trc; in snic_trc_free() local
147 trc->enable = false; in snic_trc_free()
150 if (trc->buf) { in snic_trc_free()
151 vfree(trc->buf); in snic_trc_free()
152 trc->buf = NULL; in snic_trc_free()