linux/drivers/platform/x86/uv_sysfs.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * This file supports the /sys/firmware/sgi_uv topology tree on HPE UV.
 *
 *  Copyright (c) 2020 Hewlett Packard Enterprise.  All Rights Reserved.
 *  Copyright (c) Justin Ernst
 */

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/slab.h>
#include <linux/kobject.h>
#include <linux/vmalloc.h>
#include <asm/uv/bios.h>
#include <asm/uv/uv.h>
#include <asm/uv/uv_hub.h>
#include <asm/uv/uv_geo.h>

#define INVALID_CNODE

struct kobject *sgi_uv_kobj;
static struct kset *uv_pcibus_kset;
static struct kset *uv_hubs_kset;
static struct uv_bios_hub_info *hub_buf;
static struct uv_bios_port_info **port_buf;
static struct uv_hub **uv_hubs;
static struct uv_pci_top_obj **uv_pci_objs;
static int num_pci_lines;
static int num_cnodes;
static int *prev_obj_to_cnode;
static int uv_bios_obj_cnt;
static signed short uv_master_nasid =;
static void *uv_biosheap;

static const char *uv_type_string(void)
{}

static int ordinal_to_nasid(int ordinal)
{}

static union geoid_u cnode_to_geoid(int cnode)
{}

static int location_to_bpos(char *location, int *rack, int *slot, int *blade)
{}

static int cache_obj_to_cnode(struct uv_bios_hub_info *obj)
{}

static int get_obj_to_cnode(int obj_id)
{}

struct uv_hub {};

#define to_uv_hub(kobj_ptr)

static ssize_t hub_name_show(struct uv_bios_hub_info *hub_info, char *buf)
{}

static ssize_t hub_location_show(struct uv_bios_hub_info *hub_info, char *buf)
{}

static ssize_t hub_partition_show(struct uv_bios_hub_info *hub_info, char *buf)
{}

static ssize_t hub_shared_show(struct uv_bios_hub_info *hub_info, char *buf)
{}
static ssize_t hub_nasid_show(struct uv_bios_hub_info *hub_info, char *buf)
{}
static ssize_t hub_cnode_show(struct uv_bios_hub_info *hub_info, char *buf)
{}

struct hub_sysfs_entry {};

static struct hub_sysfs_entry name_attribute =;
static struct hub_sysfs_entry location_attribute =;
static struct hub_sysfs_entry partition_attribute =;
static struct hub_sysfs_entry shared_attribute =;
static struct hub_sysfs_entry nasid_attribute =;
static struct hub_sysfs_entry cnode_attribute =;

static struct attribute *uv_hub_attrs[] =;
ATTRIBUTE_GROUPS();

static void hub_release(struct kobject *kobj)
{}

static ssize_t hub_type_show(struct kobject *kobj, struct attribute *attr,
				char *buf)
{}

static const struct sysfs_ops hub_sysfs_ops =;

static const struct kobj_type hub_attr_type =;

static int uv_hubs_init(void)
{}

static void uv_hubs_exit(void)
{}

struct uv_port {};

#define to_uv_port(kobj_ptr)

static ssize_t uv_port_conn_hub_show(struct uv_bios_port_info *port, char *buf)
{}

static ssize_t uv_port_conn_port_show(struct uv_bios_port_info *port, char *buf)
{}

struct uv_port_sysfs_entry {};

static struct uv_port_sysfs_entry uv_port_conn_hub_attribute =;
static struct uv_port_sysfs_entry uv_port_conn_port_attribute =;

static struct attribute *uv_port_attrs[] =;
ATTRIBUTE_GROUPS();

static void uv_port_release(struct kobject *kobj)
{}

static ssize_t uv_port_type_show(struct kobject *kobj, struct attribute *attr,
				char *buf)
{}

static const struct sysfs_ops uv_port_sysfs_ops =;

static const struct kobj_type uv_port_attr_type =;

static int uv_ports_init(void)
{}

static void uv_ports_exit(void)
{}

struct uv_pci_top_obj {};

#define to_uv_pci_top_obj(kobj_ptr)

static ssize_t uv_pci_type_show(struct uv_pci_top_obj *top_obj, char *buf)
{}

static ssize_t uv_pci_location_show(struct uv_pci_top_obj *top_obj, char *buf)
{}

static ssize_t uv_pci_iio_stack_show(struct uv_pci_top_obj *top_obj, char *buf)
{}

static ssize_t uv_pci_ppb_addr_show(struct uv_pci_top_obj *top_obj, char *buf)
{}

static ssize_t uv_pci_slot_show(struct uv_pci_top_obj *top_obj, char *buf)
{}

struct uv_pci_top_sysfs_entry {};

static struct uv_pci_top_sysfs_entry uv_pci_type_attribute =;
static struct uv_pci_top_sysfs_entry uv_pci_location_attribute =;
static struct uv_pci_top_sysfs_entry uv_pci_iio_stack_attribute =;
static struct uv_pci_top_sysfs_entry uv_pci_ppb_addr_attribute =;
static struct uv_pci_top_sysfs_entry uv_pci_slot_attribute =;

static void uv_pci_top_release(struct kobject *kobj)
{}

static ssize_t pci_top_type_show(struct kobject *kobj,
			struct attribute *attr, char *buf)
{}

static const struct sysfs_ops uv_pci_top_sysfs_ops =;

static const struct kobj_type uv_pci_top_attr_type =;

static int init_pci_top_obj(struct uv_pci_top_obj *top_obj, char *line)
{}

static int pci_topology_init(void)
{}

static void pci_topology_exit(void)
{}

static ssize_t partition_id_show(struct kobject *kobj,
			struct kobj_attribute *attr, char *buf)
{}

static ssize_t coherence_id_show(struct kobject *kobj,
			struct kobj_attribute *attr, char *buf)
{}

static ssize_t uv_type_show(struct kobject *kobj,
			struct kobj_attribute *attr, char *buf)
{}

static ssize_t uv_archtype_show(struct kobject *kobj,
			struct kobj_attribute *attr, char *buf)
{}

static ssize_t uv_hub_type_show(struct kobject *kobj,
			struct kobj_attribute *attr, char *buf)
{}

static ssize_t uv_hubless_show(struct kobject *kobj,
			struct kobj_attribute *attr, char *buf)
{}

static struct kobj_attribute partition_id_attr =;
static struct kobj_attribute coherence_id_attr =;
static struct kobj_attribute uv_type_attr =;
static struct kobj_attribute uv_archtype_attr =;
static struct kobj_attribute uv_hub_type_attr =;
static struct kobj_attribute uv_hubless_attr =;

static struct attribute *base_attrs[] =;

static const struct attribute_group base_attr_group =;

static int initial_bios_setup(void)
{}

static struct attribute *hubless_base_attrs[] =;

static const struct attribute_group hubless_base_attr_group =;


static int __init uv_sysfs_hubless_init(void)
{}

static int __init uv_sysfs_init(void)
{}

static void __exit uv_sysfs_hubless_exit(void)
{}

static void __exit uv_sysfs_exit(void)
{}

#ifndef MODULE
device_initcall(uv_sysfs_init);
#else
module_init(uv_sysfs_init);
#endif
module_exit(uv_sysfs_exit);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();