static int dump_ch(char *buf, int max, int n, struct smd_half_channel *s, struct smd_half_channel *r, unsigned size) { return scnprintf( buf, max, "ch%02d:" " %8s(%04d/%04d) %c%c%c%c%c%c%c%c <->" " %8s(%04d/%04d) %c%c%c%c%c%c%c%c : %5x\n", n, chstate(s->state), s->tail, s->head, s->fDSR ? 'D' : 'd', s->fCTS ? 'C' : 'c', s->fCD ? 'C' : 'c', s->fRI ? 'I' : 'i', s->fHEAD ? 'W' : 'w', s->fTAIL ? 'R' : 'r', s->fSTATE ? 'S' : 's', s->fBLOCKREADINTR ? 'B' : 'b', chstate(r->state), r->tail, r->head, r->fDSR ? 'D' : 'd', r->fCTS ? 'R' : 'r', r->fCD ? 'C' : 'c', r->fRI ? 'I' : 'i', r->fHEAD ? 'W' : 'w', r->fTAIL ? 'R' : 'r', r->fSTATE ? 'S' : 's', r->fBLOCKREADINTR ? 'B' : 'b', size ); }
static int dump_ch(char *buf, int max, struct smd_channel *ch) { volatile struct smd_half_channel *s = ch->send; volatile struct smd_half_channel *r = ch->recv; return scnprintf(buf, max, "ch%02d:" " %8s(%05d/%05d) %c%c%c%c%c%c%c <->" " %8s(%05d/%05d) %c%c%c%c%c%c%c '%s'\n", ch->n, chstate(s->state), s->tail, s->head, s->fDSR ? 'D' : 'd', s->fCTS ? 'C' : 'c', s->fCD ? 'C' : 'c', s->fRI ? 'I' : 'i', s->fHEAD ? 'W' : 'w', s->fTAIL ? 'R' : 'r', s->fSTATE ? 'S' : 's', chstate(r->state), r->tail, r->head, r->fDSR ? 'D' : 'd', r->fCTS ? 'R' : 'r', r->fCD ? 'C' : 'c', r->fRI ? 'I' : 'i', r->fHEAD ? 'W' : 'w', r->fTAIL ? 'R' : 'r', r->fSTATE ? 'S' : 's', ch->name); }
static int dump_ch(char *buf, int max, int n, void *half_ch_s, void *half_ch_r, struct smd_half_channel_access *half_ch_funcs, unsigned size) { return scnprintf( buf, max, "ch%02d:" " %8s(%04d/%04d) %c%c%c%c%c%c%c%c <->" " %8s(%04d/%04d) %c%c%c%c%c%c%c%c : %5x\n", n, chstate(half_ch_funcs->get_state(half_ch_s)), half_ch_funcs->get_tail(half_ch_s), half_ch_funcs->get_head(half_ch_s), half_ch_funcs->get_fDSR(half_ch_s) ? 'D' : 'd', half_ch_funcs->get_fCTS(half_ch_s) ? 'C' : 'c', half_ch_funcs->get_fCD(half_ch_s) ? 'C' : 'c', half_ch_funcs->get_fRI(half_ch_s) ? 'I' : 'i', half_ch_funcs->get_fHEAD(half_ch_s) ? 'W' : 'w', half_ch_funcs->get_fTAIL(half_ch_s) ? 'R' : 'r', half_ch_funcs->get_fSTATE(half_ch_s) ? 'S' : 's', half_ch_funcs->get_fBLOCKREADINTR(half_ch_s) ? 'B' : 'b', chstate(half_ch_funcs->get_state(half_ch_r)), half_ch_funcs->get_tail(half_ch_r), half_ch_funcs->get_head(half_ch_r), half_ch_funcs->get_fDSR(half_ch_r) ? 'D' : 'd', half_ch_funcs->get_fCTS(half_ch_r) ? 'C' : 'c', half_ch_funcs->get_fCD(half_ch_r) ? 'C' : 'c', half_ch_funcs->get_fRI(half_ch_r) ? 'I' : 'i', half_ch_funcs->get_fHEAD(half_ch_r) ? 'W' : 'w', half_ch_funcs->get_fTAIL(half_ch_r) ? 'R' : 'r', half_ch_funcs->get_fSTATE(half_ch_r) ? 'S' : 's', half_ch_funcs->get_fBLOCKREADINTR(half_ch_r) ? 'B' : 'b', size ); }
/** * print_half_ch_state - Print the state of half of a SMD channel in a human * readable format. * * @s: the sequential file to print to * @half_ch: half of a SMD channel that should have its state printed * @half_ch_funcs: the relevant channel access functions for @half_ch * @size: size of the fifo in bytes associated with @half_ch * @proc: the processor id that owns the part of the SMD channel associated with * @half_ch */ static void print_half_ch_state(struct seq_file *s, void *half_ch, struct smd_half_channel_access *half_ch_funcs, unsigned size, int proc) { seq_printf(s, "%-5s|%-7s|0x%05X|0x%05X|0x%05X|%c%c%c%c%c%c%c%c|0x%05X", pid_to_str(proc), chstate(half_ch_funcs->get_state(half_ch)), size, half_ch_funcs->get_tail(half_ch), half_ch_funcs->get_head(half_ch), half_ch_funcs->get_fDSR(half_ch) ? 'D' : 'd', half_ch_funcs->get_fCTS(half_ch) ? 'C' : 'c', half_ch_funcs->get_fCD(half_ch) ? 'C' : 'c', half_ch_funcs->get_fRI(half_ch) ? 'I' : 'i', half_ch_funcs->get_fHEAD(half_ch) ? 'W' : 'w', half_ch_funcs->get_fTAIL(half_ch) ? 'R' : 'r', half_ch_funcs->get_fSTATE(half_ch) ? 'S' : 's', half_ch_funcs->get_fBLOCKREADINTR(half_ch) ? 'B' : 'b', (half_ch_funcs->get_head(half_ch) - half_ch_funcs->get_tail(half_ch)) & (size - 1)); }