void t3e3_if_config(struct channel *sc, u32 cmd, char *set, t3e3_resp_t *ret, int *rlen) { t3e3_param_t *param = (t3e3_param_t *)set; u32 *data = (u32 *)set; switch (cmd) { case SBE_2T3E3_PORT_GET: t3e3_port_get(sc, &(ret->u.param)); *rlen = sizeof(ret->u.param); break; case SBE_2T3E3_PORT_SET: t3e3_port_set(sc, param); *rlen = 0; break; case SBE_2T3E3_PORT_GET_STATS: t3e3_port_get_stats(sc, &(ret->u.stats)); *rlen = sizeof(ret->u.stats); break; case SBE_2T3E3_PORT_DEL_STATS: t3e3_port_del_stats(sc); *rlen = 0; break; case SBE_2T3E3_PORT_READ_REGS: t3e3_reg_read(sc, data, &(ret->u.data)); *rlen = sizeof(ret->u.data); break; case SBE_2T3E3_PORT_WRITE_REGS: #if 0 printk(KERN_DEBUG "SBE_2T3E3_PORT_WRITE_REGS, 0x%x, 0x%x, 0x%x\n", ((int*)data)[0], ((int*)data)[1], ((int*)data)[2]); #endif t3e3_reg_write(sc, data); *rlen = 0; break; case SBE_2T3E3_LOG_LEVEL: *rlen = 0; break; default: *rlen = 0; break; } }
void t3e3_if_config(struct channel *sc, u32 cmd, char *set, struct t3e3_resp *ret, int *rlen) { struct t3e3_param *param = (struct t3e3_param *)set; u32 *data = (u32 *)set; /* turn off all interrupt */ /* cpld_stop_intr(sc); */ switch (cmd) { case SBE_2T3E3_PORT_GET: t3e3_port_get(sc, &(ret->u.param)); *rlen = sizeof(ret->u.param); break; case SBE_2T3E3_PORT_SET: t3e3_port_set(sc, param); *rlen = 0; break; case SBE_2T3E3_PORT_GET_STATS: t3e3_port_get_stats(sc, &(ret->u.stats)); *rlen = sizeof(ret->u.stats); break; case SBE_2T3E3_PORT_DEL_STATS: t3e3_port_del_stats(sc); *rlen = 0; break; case SBE_2T3E3_PORT_READ_REGS: t3e3_reg_read(sc, data, &(ret->u.data)); *rlen = sizeof(ret->u.data); break; case SBE_2T3E3_PORT_WRITE_REGS: t3e3_reg_write(sc, data); *rlen = 0; break; case SBE_2T3E3_LOG_LEVEL: *rlen = 0; break; default: *rlen = 0; break; } }