static inline void _rmnet_netlink_get_link_ingress_data_format (struct rmnet_nl_msg_s *rmnet_header, struct rmnet_nl_msg_s *resp_rmnet) { struct net_device *dev; struct rmnet_phys_ep_conf_s *config; _RMNET_NETLINK_NULL_CHECKS(); resp_rmnet->crd = RMNET_NETLINK_MSG_RETURNCODE; dev = dev_get_by_name(&init_net, rmnet_header->data_format.dev); if (!dev) { resp_rmnet->return_code = RMNET_CONFIG_NO_SUCH_DEVICE; return; } config = _rmnet_get_phys_ep_config(dev); if (!config) { resp_rmnet->return_code = RMNET_CONFIG_INVALID_REQUEST; return; } /* Begin Data */ resp_rmnet->crd = RMNET_NETLINK_MSG_RETURNDATA; resp_rmnet->arg_length = RMNET_NL_MSG_SIZE(data_format); resp_rmnet->data_format.flags = config->ingress_data_format; }
static void _rmnet_netlink_get_vnd_name (struct rmnet_nl_msg_s *rmnet_header, struct rmnet_nl_msg_s *resp_rmnet) { int r; _RMNET_NETLINK_NULL_CHECKS(); resp_rmnet->crd = RMNET_NETLINK_MSG_RETURNCODE; r = rmnet_vnd_get_name(rmnet_header->vnd.id, resp_rmnet->vnd.vnd_name, RMNET_MAX_STR_LEN); if (r != 0) { resp_rmnet->return_code = RMNET_CONFIG_INVALID_REQUEST; return; } /* Begin Data */ resp_rmnet->crd = RMNET_NETLINK_MSG_RETURNDATA; resp_rmnet->arg_length = RMNET_NL_MSG_SIZE(vnd); }
static void _rmnet_netlink_get_logical_ep_config (struct rmnet_nl_msg_s *rmnet_header, struct rmnet_nl_msg_s *resp_rmnet) { struct net_device *dev; _RMNET_NETLINK_NULL_CHECKS(); resp_rmnet->crd = RMNET_NETLINK_MSG_RETURNCODE; if (rmnet_header->local_ep_config.ep_id < -1 || rmnet_header->local_ep_config.ep_id > 254) { resp_rmnet->return_code = RMNET_CONFIG_BAD_ARGUMENTS; return; } dev = dev_get_by_name(&init_net, rmnet_header->local_ep_config.dev); if (dev) resp_rmnet->return_code = rmnet_get_logical_endpoint_config( dev, rmnet_header->local_ep_config.ep_id, &resp_rmnet->local_ep_config.operating_mode, resp_rmnet->local_ep_config.next_dev, sizeof(resp_rmnet->local_ep_config.next_dev)); else { resp_rmnet->return_code = RMNET_CONFIG_NO_SUCH_DEVICE; return; } if (resp_rmnet->return_code == RMNET_CONFIG_OK) { /* Begin Data */ resp_rmnet->crd = RMNET_NETLINK_MSG_RETURNDATA; resp_rmnet->arg_length = RMNET_NL_MSG_SIZE(local_ep_config); } dev_put(dev); }