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