if (!slave)
slave = dev;
if (!slave)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (slave->ndev)
seq_printf(m, "%s\n", slave->ndev->name);
return 0;
bpctl_dev_t *dev = m->private;
int ret = get_bypass_caps_fn(dev);
if (ret == BP_NOT_CAP)
- seq_printf(m, "-1\n");
+ seq_puts(m, "-1\n");
else
seq_printf(m, "0x%x\n", ret);
return 0;
bpctl_dev_t *dev = m->private;
int ret = get_wd_set_caps_fn(dev);
if (ret == BP_NOT_CAP)
- seq_printf(m, "-1\n");
+ seq_puts(m, "-1\n");
else
seq_printf(m, "0x%x\n", ret);
return 0;
bpctl_dev_t *dev = m->private;
int ret = get_bypass_fn(dev);
if (ret == BP_NOT_CAP)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (ret == 1)
- seq_printf(m, "on\n");
+ seq_puts(m, "on\n");
else if (ret == 0)
- seq_printf(m, "off\n");
+ seq_puts(m, "off\n");
return 0;
}
RW_FOPS(bypass)
bpctl_dev_t *dev = m->private;
int ret = get_tap_fn(dev);
if (ret == BP_NOT_CAP)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (ret == 1)
- seq_printf(m, "on\n");
+ seq_puts(m, "on\n");
else if (ret == 0)
- seq_printf(m, "off\n");
+ seq_puts(m, "off\n");
return 0;
}
RW_FOPS(tap)
bpctl_dev_t *dev = m->private;
int ret = get_disc_fn(dev);
if (ret == BP_NOT_CAP)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (ret == 1)
- seq_printf(m, "on\n");
+ seq_puts(m, "on\n");
else if (ret == 0)
- seq_printf(m, "off\n");
+ seq_puts(m, "off\n");
return 0;
}
RW_FOPS(disc)
bpctl_dev_t *dev = m->private;
int ret = get_bypass_change_fn(dev);
if (ret == 1)
- seq_printf(m, "on\n");
+ seq_puts(m, "on\n");
else if (ret == 0)
- seq_printf(m, "off\n");
+ seq_puts(m, "off\n");
else
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
return 0;
}
RO_FOPS(bypass_change)
bpctl_dev_t *dev = m->private;
int ret = get_tap_change_fn(dev);
if (ret == 1)
- seq_printf(m, "on\n");
+ seq_puts(m, "on\n");
else if (ret == 0)
- seq_printf(m, "off\n");
+ seq_puts(m, "off\n");
else
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
return 0;
}
RO_FOPS(tap_change)
bpctl_dev_t *dev = m->private;
int ret = get_disc_change_fn(dev);
if (ret == 1)
- seq_printf(m, "on\n");
+ seq_puts(m, "on\n");
else if (ret == 0)
- seq_printf(m, "off\n");
+ seq_puts(m, "off\n");
else
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
return 0;
}
RO_FOPS(disc_change)
ret = get_bypass_wd_fn(dev, &timeout);
if (ret == BP_NOT_CAP)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (timeout == -1)
- seq_printf(m, "unknown\n");
+ seq_puts(m, "unknown\n");
else if (timeout == 0)
- seq_printf(m, "disable\n");
+ seq_puts(m, "disable\n");
else
seq_printf(m, "%d\n", timeout);
return 0;
int ret = 0, timeout = 0;
ret = get_wd_expire_time_fn(dev, &timeout);
if (ret == BP_NOT_CAP)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (timeout == -1)
- seq_printf(m, "expire\n");
+ seq_puts(m, "expire\n");
else if (timeout == 0)
- seq_printf(m, "disable\n");
+ seq_puts(m, "disable\n");
else
seq_printf(m, "%d\n", timeout);
return 0;
bpctl_dev_t *dev = m->private;
int ret = get_tpl_fn(dev);
if (ret == BP_NOT_CAP)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (ret == 1)
- seq_printf(m, "on\n");
+ seq_puts(m, "on\n");
else if (ret == 0)
- seq_printf(m, "off\n");
+ seq_puts(m, "off\n");
return 0;
}
RW_FOPS(tpl)
bpctl_dev_t *dev = m->private;
int ret = get_bp_wait_at_pwup_fn(dev);
if (ret == BP_NOT_CAP)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (ret == 1)
- seq_printf(m, "on\n");
+ seq_puts(m, "on\n");
else if (ret == 0)
- seq_printf(m, "off\n");
+ seq_puts(m, "off\n");
return 0;
}
RW_FOPS(wait_at_pwup)
bpctl_dev_t *dev = m->private;
int ret = get_bp_hw_reset_fn(dev);
if (ret == BP_NOT_CAP)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (ret == 1)
- seq_printf(m, "on\n");
+ seq_puts(m, "on\n");
else if (ret == 0)
- seq_printf(m, "off\n");
+ seq_puts(m, "off\n");
return 0;
}
RW_FOPS(hw_reset)
bpctl_dev_t *dev = m->private;
int ret = reset_bypass_wd_timer_fn(dev);
if (ret == BP_NOT_CAP)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (ret == 0)
- seq_printf(m, "disable\n");
+ seq_puts(m, "disable\n");
else if (ret == 1)
- seq_printf(m, "success\n");
+ seq_puts(m, "success\n");
return 0;
}
RO_FOPS(reset_bypass_wd)
bpctl_dev_t *dev = m->private;
int ret = get_dis_bypass_fn(dev);
if (ret == BP_NOT_CAP)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (ret == 0)
- seq_printf(m, "off\n");
+ seq_puts(m, "off\n");
else
- seq_printf(m, "on\n");
+ seq_puts(m, "on\n");
return 0;
}
RW_FOPS(dis_bypass)
bpctl_dev_t *dev = m->private;
int ret = get_dis_tap_fn(dev);
if (ret == BP_NOT_CAP)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (ret == 0)
- seq_printf(m, "off\n");
+ seq_puts(m, "off\n");
else
- seq_printf(m, "on\n");
+ seq_puts(m, "on\n");
return 0;
}
RW_FOPS(dis_tap)
bpctl_dev_t *dev = m->private;
int ret = get_dis_disc_fn(dev);
if (ret == BP_NOT_CAP)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (ret == 0)
- seq_printf(m, "off\n");
+ seq_puts(m, "off\n");
else
- seq_printf(m, "on\n");
+ seq_puts(m, "on\n");
return 0;
}
RW_FOPS(dis_disc)
bpctl_dev_t *dev = m->private;
int ret = get_bypass_pwup_fn(dev);
if (ret == BP_NOT_CAP)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (ret == 0)
- seq_printf(m, "off\n");
+ seq_puts(m, "off\n");
else
- seq_printf(m, "on\n");
+ seq_puts(m, "on\n");
return 0;
}
RW_FOPS(bypass_pwup)
bpctl_dev_t *dev = m->private;
int ret = get_bypass_pwoff_fn(dev);
if (ret == BP_NOT_CAP)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (ret == 0)
- seq_printf(m, "off\n");
+ seq_puts(m, "off\n");
else
- seq_printf(m, "on\n");
+ seq_puts(m, "on\n");
return 0;
}
RW_FOPS(bypass_pwoff)
bpctl_dev_t *dev = m->private;
int ret = get_tap_pwup_fn(dev);
if (ret == BP_NOT_CAP)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (ret == 0)
- seq_printf(m, "off\n");
+ seq_puts(m, "off\n");
else
- seq_printf(m, "on\n");
+ seq_puts(m, "on\n");
return 0;
}
RW_FOPS(tap_pwup)
bpctl_dev_t *dev = m->private;
int ret = get_disc_pwup_fn(dev);
if (ret == BP_NOT_CAP)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (ret == 0)
- seq_printf(m, "off\n");
+ seq_puts(m, "off\n");
else
- seq_printf(m, "on\n");
+ seq_puts(m, "on\n");
return 0;
}
RW_FOPS(disc_pwup)
bpctl_dev_t *dev = m->private;
int ret = get_std_nic_fn(dev);
if (ret == BP_NOT_CAP)
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
else if (ret == 0)
- seq_printf(m, "off\n");
+ seq_puts(m, "off\n");
else
- seq_printf(m, "on\n");
+ seq_puts(m, "on\n");
return 0;
}
RW_FOPS(std_nic)
bpctl_dev_t *dev = m->private;
int ret = get_wd_exp_mode_fn(dev);
if (ret == 1)
- seq_printf(m, "tap\n");
+ seq_puts(m, "tap\n");
else if (ret == 0)
- seq_printf(m, "bypass\n");
+ seq_puts(m, "bypass\n");
else if (ret == 2)
- seq_printf(m, "disc\n");
+ seq_puts(m, "disc\n");
else
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
return 0;
}
RW_FOPS(wd_exp_mode)
if (ret >= 0)
seq_printf(m, "%d\n", ret);
else
- seq_printf(m, "fail\n");
+ seq_puts(m, "fail\n");
return 0;
}
RW_FOPS(wd_autoreset)