aboutsummaryrefslogtreecommitdiff
path: root/hw/spapr_llan.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2011-12-12 18:24:28 +0000
committerAlexander Graf <agraf@suse.de>2012-01-03 15:49:11 +0100
commit1fc02533e73ad66f756f07efdf80fa9bef5afbc8 (patch)
tree4b82e136708cf7facb574811e8d617ef67f4d016 /hw/spapr_llan.c
parent157feeadbaec09fe4dca539a24f6f6d327d6eeb6 (diff)
pseries: Remove hcalls callback
For forgotten historical reasons, PAPR hypercalls for specific virtual IO devices (oh which there are quite a number) are registered via a callback in the VIOsPAPRDeviceInfo structure. This is kind of ugly, so this patch instead registers hypercalls from device_init() functions for each device type. This works just as well, and is cleaner. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/spapr_llan.c')
-rw-r--r--hw/spapr_llan.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/hw/spapr_llan.c b/hw/spapr_llan.c
index abe12973e6..45674c4cb9 100644
--- a/hw/spapr_llan.c
+++ b/hw/spapr_llan.c
@@ -474,16 +474,6 @@ static target_ulong h_multicast_ctrl(CPUState *env, sPAPREnvironment *spapr,
return H_SUCCESS;
}
-static void vlan_hcalls(VIOsPAPRBus *bus)
-{
- spapr_register_hypercall(H_REGISTER_LOGICAL_LAN, h_register_logical_lan);
- spapr_register_hypercall(H_FREE_LOGICAL_LAN, h_free_logical_lan);
- spapr_register_hypercall(H_SEND_LOGICAL_LAN, h_send_logical_lan);
- spapr_register_hypercall(H_ADD_LOGICAL_LAN_BUFFER,
- h_add_logical_lan_buffer);
- spapr_register_hypercall(H_MULTICAST_CTRL, h_multicast_ctrl);
-}
-
static VIOsPAPRDeviceInfo spapr_vlan = {
.init = spapr_vlan_init,
.devnode = spapr_vlan_devnode,
@@ -491,7 +481,6 @@ static VIOsPAPRDeviceInfo spapr_vlan = {
.dt_type = "network",
.dt_compatible = "IBM,l-lan",
.signal_mask = 0x1,
- .hcalls = vlan_hcalls,
.qdev.name = "spapr-vlan",
.qdev.size = sizeof(VIOsPAPRVLANDevice),
.qdev.props = (Property[]) {
@@ -504,5 +493,11 @@ static VIOsPAPRDeviceInfo spapr_vlan = {
static void spapr_vlan_register(void)
{
spapr_vio_bus_register_withprop(&spapr_vlan);
+ spapr_register_hypercall(H_REGISTER_LOGICAL_LAN, h_register_logical_lan);
+ spapr_register_hypercall(H_FREE_LOGICAL_LAN, h_free_logical_lan);
+ spapr_register_hypercall(H_SEND_LOGICAL_LAN, h_send_logical_lan);
+ spapr_register_hypercall(H_ADD_LOGICAL_LAN_BUFFER,
+ h_add_logical_lan_buffer);
+ spapr_register_hypercall(H_MULTICAST_CTRL, h_multicast_ctrl);
}
device_init(spapr_vlan_register);