Lines Matching refs:buff
138 struct attribute *attr, char *buff, \
146 length = __batadv_store_bool_attr(buff, count, _post_func, attr,\
156 struct attribute *attr, char *buff) \
161 return sprintf(buff, "%s\n", \
177 struct attribute *attr, char *buff, \
185 length = __batadv_store_uint_attr(buff, count, _min, _max, \
197 struct attribute *attr, char *buff) \
202 return sprintf(buff, "%i\n", atomic_read(&bat_priv->_var)); \
216 struct attribute *attr, char *buff, \
222 size_t res = __batadv_store_bool_attr(buff, count, _post_func, \
238 struct attribute *attr, char *buff) \
243 size_t res = sprintf(buff, "%s\n", \
261 struct attribute *attr, char *buff, \
274 length = __batadv_store_uint_attr(buff, count, _min, _max, \
291 struct attribute *attr, char *buff) \
302 length = sprintf(buff, "%i\n", atomic_read(&hard_iface->_var)); \
318 static int batadv_store_bool_attr(char *buff, size_t count,
327 if (buff[count - 1] == '\n')
328 buff[count - 1] = '\0';
330 if ((strncmp(buff, "1", 2) == 0) ||
331 (strncmp(buff, "enable", 7) == 0) ||
332 (strncmp(buff, "enabled", 8) == 0))
335 if ((strncmp(buff, "0", 2) == 0) ||
336 (strncmp(buff, "disable", 8) == 0) ||
337 (strncmp(buff, "disabled", 9) == 0))
342 attr_name, buff);
360 __batadv_store_bool_attr(char *buff, size_t count,
368 ret = batadv_store_bool_attr(buff, count, net_dev, attr->name,
376 static int batadv_store_uint_attr(const char *buff, size_t count,
387 ret = kstrtoul(buff, 10, &uint_val);
390 attr_name, buff);
419 static ssize_t __batadv_store_uint_attr(const char *buff, size_t count,
429 ret = batadv_store_uint_attr(buff, count, net_dev, slave_dev,
438 struct attribute *attr, char *buff)
443 return sprintf(buff, "%s\n", bat_priv->algo_ops->name);
454 char *buff)
470 bytes_written = sprintf(buff, "%s\n",
474 bytes_written = sprintf(buff, "%s\n",
478 bytes_written = sprintf(buff, "%s\n",
487 struct attribute *attr, char *buff,
504 if (buff[count - 1] == '\n')
505 buff[count - 1] = '\0';
507 if (strncmp(buff, BATADV_GW_MODE_OFF_NAME,
511 if (strncmp(buff, BATADV_GW_MODE_CLIENT_NAME,
515 if (strncmp(buff, BATADV_GW_MODE_SERVER_NAME,
522 buff);
542 curr_gw_mode_str, buff);
567 struct attribute *attr, char *buff)
581 return bat_priv->algo_ops->gw.show_sel_class(bat_priv, buff);
583 return sprintf(buff, "%i\n", atomic_read(&bat_priv->gw.sel_class));
587 struct attribute *attr, char *buff,
602 if (buff[count - 1] == '\n')
603 buff[count - 1] = '\0';
606 return bat_priv->algo_ops->gw.store_sel_class(bat_priv, buff,
609 length = __batadv_store_uint_attr(buff, count, 1, BATADV_TQ_MAX_VALUE,
620 struct attribute *attr, char *buff)
630 return sprintf(buff, "%u.%u/%u.%u MBit\n", down / 10,
635 struct attribute *attr, char *buff,
644 if (buff[count - 1] == '\n')
645 buff[count - 1] = '\0';
647 length = batadv_gw_bandwidth_set(net_dev, buff, count);
658 * @buff: the buffer that will contain the data to send back to the user
660 * Return: the number of bytes written into 'buff' on success or a negative
664 struct attribute *attr, char *buff)
669 return sprintf(buff, "%#.8x/%#.8x\n", bat_priv->isolation_mark,
678 * @buff: the buffer containing the user data
684 struct attribute *attr, char *buff,
698 mask_ptr = strchr(buff, '/');
711 if (kstrtou32(buff, 0, &mark) < 0)
942 struct attribute *attr, char *buff)
960 length = sprintf(buff, "%s\n", ifname);
1049 struct attribute *attr, char *buff,
1057 if (buff[count - 1] == '\n')
1058 buff[count - 1] = '\0';
1060 if (strlen(buff) >= IFNAMSIZ) {
1062 buff);
1073 strscpy(store_work->soft_iface_name, buff,
1082 struct attribute *attr, char *buff)
1096 length = sprintf(buff, "disabling\n");
1099 length = sprintf(buff, "inactive\n");
1102 length = sprintf(buff, "active\n");
1105 length = sprintf(buff, "enabling\n");
1109 length = sprintf(buff, "not in use\n");
1125 * @buff: the buffer containing the user data
1132 char *buff, size_t count)
1147 if (buff[count - 1] == '\n')
1148 buff[count - 1] = '\0';
1150 ret = batadv_parse_throughput(net_dev, buff, "throughput_override",
1179 char *buff)
1194 return sprintf(buff, "%u.%u MBit\n", tp_override / 10,