From: Don Zickus <dzickus@xxxxxxxxxx> Now that the conversion to struct visor_device is complete, remove all the cruft left behind. Signed-off-by: Don Zickus <dzickus@xxxxxxxxxx> Signed-off-by: Benjamin Romer <benjamin.romer@xxxxxxxxxx> --- drivers/staging/unisys/visorbus/visorbus_main.c | 53 --------- drivers/staging/unisys/visorbus/visorbus_private.h | 79 ------------ drivers/staging/unisys/visorbus/visorchipset.c | 132 --------------------- 3 files changed, 264 deletions(-) diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index cc2ed58..a79996a 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -37,18 +37,6 @@ int visorbus_devicetest; int visorbus_debugref; #define SERIALLOOPBACKCHANADDR (100 * 1024 * 1024) -/** This is the private data that we store for each bus device instance. - */ -struct visorbus_devdata { - int devno; /* this is the chipset busNo */ - struct list_head list_all; - struct device dev; - struct kobject kobj; - struct visorchannel *chan; /* channel area for bus itself */ - bool vbus_valid; - struct spar_vbus_headerinfo vbus_hdr_info; -}; - #define CURRENT_FILE_PC VISOR_BUS_PC_visorbus_main_c #define POLLJIFFIES_TESTWORK 100 #define POLLJIFFIES_NORMALCHANNEL 10 @@ -475,33 +463,12 @@ static ssize_t typename_show(struct device *dev, struct device_attribute *attr, return snprintf(buf, PAGE_SIZE, "%s\n", drv->channel_types[i - 1].name); } -static ssize_t dump_show(struct device *dev, struct device_attribute *attr, - char *buf) -{ - struct visor_device *vdev = to_visor_device(dev); - int count = 0; -/* TODO: replace this with debugfs code - struct seq_file *m = NULL; - if (vdev->visorchannel == NULL) - return 0; - m = visor_seq_file_new_buffer(buf, PAGE_SIZE - 1); - if (m == NULL) - return 0; - visorchannel_debug(vdev->visorchannel, 1, m, 0); - count = m->count; - visor_seq_file_done_buffer(m); - m = NULL; -*/ - return count; -} - static DEVICE_ATTR_RO(physaddr); static DEVICE_ATTR_RO(nbytes); static DEVICE_ATTR_RO(clientpartition); static DEVICE_ATTR_RO(typeguid); static DEVICE_ATTR_RO(zoneguid); static DEVICE_ATTR_RO(typename); -static DEVICE_ATTR_RO(dump); static struct attribute *channel_attrs[] = { &dev_attr_physaddr.attr, @@ -510,7 +477,6 @@ static struct attribute *channel_attrs[] = { &dev_attr_typeguid.attr, &dev_attr_zoneguid.attr, &dev_attr_typename.attr, - &dev_attr_dump.attr, }; static struct attribute_group channel_attr_grp = { @@ -718,25 +684,6 @@ unregister_driver_attributes(struct visor_driver *drv) driver_remove_file(&drv->driver, &drv->version_attr); } -/* DEVICE attributes - * - * define & implement display of device attributes under - * /sys/bus/visorbus/devices/<devicename>. - * - */ - -#define DEVATTR(nam, func) { \ - .attr = { .name = __stringify(nam), \ - .mode = 0444, \ - .owner = THIS_MODULE }, \ - .show = func, \ -} - -static struct device_attribute visor_device_attrs[] = { - /* DEVATTR(channel_nbytes, DEVICE_ATTR_channel_nbytes), */ - __ATTR_NULL -}; - static void dev_periodic_work(void *xdev) { diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h b/drivers/staging/unisys/visorbus/visorbus_private.h index 5b3c0cd..4422d42 100644 --- a/drivers/staging/unisys/visorbus/visorbus_private.h +++ b/drivers/staging/unisys/visorbus/visorbus_private.h @@ -25,80 +25,6 @@ #include "vbusdeviceinfo.h" #include "vbushelper.h" -struct visorchannel; - -enum visorchipset_addresstype { - /** address is guest physical, but outside of the physical memory - * region that is controlled by the running OS (this is the normal - * address type for Supervisor channels) - */ - ADDRTYPE_LOCALPHYSICAL, - - /** address is guest physical, and withIN the confines of the - * physical memory controlled by the running OS. - */ - ADDRTYPE_LOCALTEST, -}; - -/** Attributes for a particular Supervisor channel. - */ -struct visorchipset_channel_info { - enum visorchipset_addresstype addr_type; - u64 channel_addr; - struct irq_info intr; - u64 n_channel_bytes; - uuid_le channel_type_uuid; - uuid_le channel_inst_uuid; -}; - -/** Attributes for a particular Supervisor device. - * Any visorchipset client can query these attributes using - * visorchipset_get_client_device_info() or - * visorchipset_get_server_device_info(). - */ -struct visorchipset_device_info { - struct list_head entry; - u32 bus_no; - u32 dev_no; - uuid_le dev_inst_uuid; - struct visorchipset_state state; - struct visorchipset_channel_info chan_info; - u32 reserved1; /* control_vm_id */ - u64 reserved2; - u32 switch_no; /* when devState.attached==1 */ - u32 internal_port_no; /* when devState.attached==1 */ - struct controlvm_message_header pending_msg_hdr;/* CONTROLVM_MESSAGE */ - /** For private use by the bus driver */ - void *bus_driver_context; -}; - -/** Attributes for a particular Supervisor bus. - * (For a service partition acting as the server for buses/devices, there - * is a 1-to-1 relationship between busses and guest partitions.) - * Any visorchipset client can query these attributes using - * visorchipset_get_client_bus_info() or visorchipset_get_bus_info(). - */ -struct visorchipset_bus_info { - struct list_head entry; - u32 bus_no; - struct visorchipset_state state; - struct visorchipset_channel_info chan_info; - uuid_le partition_uuid; - u64 partition_handle; - u8 *name; /* UTF8 */ - u8 *description; /* UTF8 */ - u64 reserved1; - u32 reserved2; - struct { - u32 server:1; - /* Add new fields above. */ - /* Remaining bits in this 32-bit word are unused. */ - } flags; - struct controlvm_message_header pending_msg_hdr;/* CONTROLVM MsgHdr */ - /** For private use by the bus driver */ - void *bus_driver_context; -}; - /* These functions will be called from within visorchipset when certain * events happen. (The implementation of these functions is outside of * visorchipset.) @@ -138,11 +64,6 @@ visorchipset_register_busdev( struct visorchipset_busdev_responders *responders, struct ultra_vbus_deviceinfo *driver_info); -bool visorchipset_get_bus_info(u32 bus_no, - struct visorchipset_bus_info *bus_info); -bool visorchipset_get_device_info(u32 bus_no, u32 dev_no, - struct visorchipset_device_info *dev_info); -bool visorchipset_set_bus_context(u32 bus_no, void *context); /* visorbus init and exit functions */ int visorbus_init(void); diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c index 84b47a1..3d6e471 100644 --- a/drivers/staging/unisys/visorbus/visorchipset.c +++ b/drivers/staging/unisys/visorbus/visorchipset.c @@ -692,25 +692,6 @@ static ssize_t remaining_steps_store(struct device *dev, return count; } -static void -bus_info_clear(void *v) -{ - struct visorchipset_bus_info *p = (struct visorchipset_bus_info *) v; - - kfree(p->name); - kfree(p->description); - memset(p, 0, sizeof(struct visorchipset_bus_info)); -} - -static void -dev_info_clear(void *v) -{ - struct visorchipset_device_info *p = - (struct visorchipset_device_info *) v; - - memset(p, 0, sizeof(struct visorchipset_device_info)); -} - struct visor_busdev { u32 bus_no; u32 dev_no; @@ -750,44 +731,6 @@ struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no, } EXPORT_SYMBOL(visorbus_get_device_by_id); -static struct visorchipset_bus_info * -bus_find(struct list_head *list, u32 bus_no) -{ - struct visorchipset_bus_info *p; - - list_for_each_entry(p, list, entry) { - if (p->bus_no == bus_no) - return p; - } - - return NULL; -} - -static struct visorchipset_device_info * -device_find(struct list_head *list, u32 bus_no, u32 dev_no) -{ - struct visorchipset_device_info *p; - - list_for_each_entry(p, list, entry) { - if (p->bus_no == bus_no && p->dev_no == dev_no) - return p; - } - - return NULL; -} - -static void busdevices_del(struct list_head *list, u32 bus_no) -{ - struct visorchipset_device_info *p, *tmp; - - list_for_each_entry_safe(p, tmp, list, entry) { - if (p->bus_no == bus_no) { - list_del(&p->entry); - kfree(p); - } - } -} - static u8 check_chipset_events(void) { @@ -834,25 +777,6 @@ visorchipset_register_busdev( EXPORT_SYMBOL_GPL(visorchipset_register_busdev); static void -cleanup_controlvm_structures(void) -{ - struct visorchipset_bus_info *bi, *tmp_bi; - struct visorchipset_device_info *di, *tmp_di; - - list_for_each_entry_safe(bi, tmp_bi, &bus_info_list, entry) { - bus_info_clear(bi); - list_del(&bi->entry); - kfree(bi); - } - - list_for_each_entry_safe(di, tmp_di, &dev_info_list, entry) { - dev_info_clear(di); - list_del(&di->entry); - kfree(di); - } -} - -static void chipset_init(struct controlvm_message *inmsg) { static int chipset_inited; @@ -878,8 +802,6 @@ chipset_init(struct controlvm_message *inmsg) features |= ULTRA_CHIPSET_FEATURE_REPLY; cleanup: - if (rc < 0) - cleanup_controlvm_structures(); if (inmsg->hdr.flags.response_expected) controlvm_respond_chipset_init(&inmsg->hdr, rc, features); } @@ -2111,58 +2033,6 @@ device_resume_response(struct visor_device *dev, int response) dev, response, segment_state_running); } - -bool -visorchipset_get_bus_info(u32 bus_no, struct visorchipset_bus_info *bus_info) -{ - void *p = bus_find(&bus_info_list, bus_no); - - if (!p) - return false; - memcpy(bus_info, p, sizeof(struct visorchipset_bus_info)); - return true; -} -EXPORT_SYMBOL_GPL(visorchipset_get_bus_info); - -bool -visorchipset_set_bus_context(u32 bus_no, void *context) -{ - struct visorchipset_bus_info *p = bus_find(&bus_info_list, bus_no); - - if (!p) - return false; - p->bus_driver_context = context; - return true; -} -EXPORT_SYMBOL_GPL(visorchipset_set_bus_context); - -bool -visorchipset_get_device_info(u32 bus_no, u32 dev_no, - struct visorchipset_device_info *dev_info) -{ - void *p = device_find(&dev_info_list, bus_no, dev_no); - - if (!p) - return false; - memcpy(dev_info, p, sizeof(struct visorchipset_device_info)); - return true; -} -EXPORT_SYMBOL_GPL(visorchipset_get_device_info); - -bool -visorchipset_set_device_context(u32 bus_no, u32 dev_no, void *context) -{ - struct visorchipset_device_info *p; - - p = device_find(&dev_info_list, bus_no, dev_no); - - if (!p) - return false; - p->bus_driver_context = context; - return true; -} -EXPORT_SYMBOL_GPL(visorchipset_set_device_context); - static ssize_t chipsetready_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) @@ -2436,8 +2306,6 @@ visorchipset_exit(struct acpi_device *acpi_device) periodic_controlvm_workqueue = NULL; destroy_controlvm_payload_info(&controlvm_payload_info); - cleanup_controlvm_structures(); - memset(&g_chipset_msg_hdr, 0, sizeof(struct controlvm_message_header)); visorchannel_destroy(controlvm_channel); -- 2.1.4 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel