mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-13 23:29:10 -04:00
greybus: ap: process the UniPro link up message
The link up message is the event that tells the AP what device ID has been assigned to a particular interface on a module during enumeration. The link up is sent *only* after the hotplug event for a particular module has been sent to the AP. The link up payload must carry the Module ID and Interface ID to uniquely identify the struct gb_interface to which the Device ID has been assigned. After processing of the link up message, the interface's device_id field will contain the assigned Device ID so that the AP has the information necessary to issue network route commands. Signed-off-by: Matt Porter <mporter@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1a4c013a44
commit
6232b073d4
@@ -106,6 +106,9 @@ static void svc_handshake(struct svc_function_handshake *handshake,
|
||||
static void svc_management(struct svc_function_unipro_management *management,
|
||||
int payload_length, struct greybus_host_device *hd)
|
||||
{
|
||||
struct gb_module *module;
|
||||
struct gb_interface *interface;
|
||||
|
||||
if (payload_length != sizeof(struct svc_function_unipro_management)) {
|
||||
dev_err(hd->parent,
|
||||
"Illegal size of svc management message %d\n",
|
||||
@@ -114,6 +117,22 @@ static void svc_management(struct svc_function_unipro_management *management,
|
||||
}
|
||||
|
||||
switch (management->management_packet_type) {
|
||||
case SVC_MANAGEMENT_LINK_UP:
|
||||
module = gb_module_find(hd, management->link_up.module_id);
|
||||
if (!module) {
|
||||
dev_err(hd->parent, "Module ID %d not found\n",
|
||||
management->link_up.module_id);
|
||||
return;
|
||||
}
|
||||
interface = gb_interface_find(module,
|
||||
management->link_up.interface_id);
|
||||
if (!interface) {
|
||||
dev_err(hd->parent, "Interface ID %d not found\n",
|
||||
management->link_up.interface_id);
|
||||
return;
|
||||
}
|
||||
interface->device_id = management->link_up.device_id;
|
||||
break;
|
||||
case SVC_MANAGEMENT_AP_DEVICE_ID:
|
||||
hd->device_id = management->ap_device_id.device_id;
|
||||
break;
|
||||
|
||||
@@ -55,6 +55,8 @@ struct svc_function_unipro_set_route {
|
||||
};
|
||||
|
||||
struct svc_function_unipro_link_up {
|
||||
__u8 module_id;
|
||||
__u8 interface_id;
|
||||
__u8 device_id;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user