diff --git a/drivers/staging/greybus/ap.c b/drivers/staging/greybus/ap.c index f4470b5b2972..5b6335643bc0 100644 --- a/drivers/staging/greybus/ap.c +++ b/drivers/staging/greybus/ap.c @@ -113,8 +113,13 @@ static void svc_management(struct svc_function_unipro_management *management, return; } - /* What? An AP should not get this message */ - dev_err(hd->parent, "Got an svc management message???\n"); + switch (management->management_packet_type) { + case SVC_MANAGEMENT_AP_DEVICE_ID: + hd->device_id = management->ap_device_id.device_id; + break; + default: + dev_err(hd->parent, "Unhandled UniPro management message\n"); + } } static void svc_hotplug(struct svc_function_hotplug *hotplug, diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h index bbd90b4cec91..a4e1f4b2b18e 100644 --- a/drivers/staging/greybus/greybus.h +++ b/drivers/staging/greybus/greybus.h @@ -180,6 +180,7 @@ struct greybus_host_device { struct rb_root connections; struct ida cport_id_map; spinlock_t cport_id_map_lock; + u8 device_id; /* Private data for the host driver */ unsigned long hd_priv[0] __aligned(sizeof(s64)); diff --git a/drivers/staging/greybus/svc_msg.h b/drivers/staging/greybus/svc_msg.h index 57d0a91ff60b..4aa7e177f076 100644 --- a/drivers/staging/greybus/svc_msg.h +++ b/drivers/staging/greybus/svc_msg.h @@ -58,9 +58,14 @@ struct svc_function_unipro_link_up { __u8 device_id; }; +struct svc_function_ap_device_id { + __u8 device_id; +}; + enum svc_function_management_event { SVC_MANAGEMENT_SET_ROUTE = 0x00, SVC_MANAGEMENT_LINK_UP = 0x01, + SVC_MANAGEMENT_AP_DEVICE_ID = 0x02, }; struct svc_function_unipro_management { @@ -68,6 +73,7 @@ struct svc_function_unipro_management { union { struct svc_function_unipro_set_route set_route; struct svc_function_unipro_link_up link_up; + struct svc_function_ap_device_id ap_device_id; }; };