hnat: show hnat hook status with seqfile instead of pr_info

This commit is contained in:
hanwckf
2023-08-07 19:54:23 +08:00
parent 7268ecd1fa
commit 9c7feea3e0
2 changed files with 6 additions and 6 deletions

View File

@@ -2047,7 +2047,7 @@ static const struct file_operations hnat_mape_toggle_fops = {
static int hnat_hook_toggle_read(struct seq_file *m, void *private)
{
pr_info("value=%d, hook is %s now!\n", hook_toggle, (hook_toggle) ? "enabled" : "disabled");
seq_printf(m, "%s\n", (hook_toggle) ? "enabled" : "disabled");
return 0;
}
@@ -2068,7 +2068,7 @@ static ssize_t hnat_hook_toggle_write(struct file *file, const char __user *buff
return -EFAULT;
if (buf[0] == '1' && !hook_toggle) {
pr_info("hook is going to be enabled !\n");
pr_info("hnat hook is going to be enabled !\n");
hnat_enable_hook();
if (IS_PPPQ_MODE) {
@@ -2076,7 +2076,7 @@ static ssize_t hnat_hook_toggle_write(struct file *file, const char __user *buff
hnat_qos_shaper_ebl(id, 1);
}
} else if (buf[0] == '0' && hook_toggle) {
pr_info("hook is going to be disabled !\n");
pr_info("hnat hook is going to be disabled !\n");
hnat_disable_hook();
if (IS_PPPQ_MODE) {
@@ -2098,7 +2098,7 @@ static const struct file_operations hnat_hook_toggle_fops = {
static int hnat_qos_toggle_read(struct seq_file *m, void *private)
{
pr_info("value=%d, HQoS is %s now!\n", qos_toggle, (qos_toggle) ? "enabled" : "disabled");
seq_printf(m, "%s\n", (qos_toggle) ? "enabled" : "disabled");
return 0;
}

View File

@@ -1569,7 +1569,7 @@ static unsigned int skb_to_hnat_info(struct sk_buff *skb,
NR_GMAC2_PORT : NR_GMAC1_PORT;
else {
if (of_machine_is_compatible("glinet,gl-mt3000")||of_machine_is_compatible("glinet,mt3000-snand"))
gmac = NR_GMAC2_PORT;
gmac = NR_GMAC2_PORT;
else
gmac = NR_GMAC1_PORT;
}
@@ -1584,7 +1584,7 @@ static unsigned int skb_to_hnat_info(struct sk_buff *skb,
entry.ipv4_hnapt.act_dp = dev->ifindex;
} else {
if (of_machine_is_compatible("glinet,gl-mt3000")||of_machine_is_compatible("glinet,mt3000-snand"))
gmac = NR_GMAC1_PORT;
gmac = NR_GMAC1_PORT;
else
gmac = (IS_GMAC1_MODE) ? NR_GMAC1_PORT : NR_GMAC2_PORT;
}