Drivers: hv: vmbus: suppress some "hv_vmbus: Unknown GUID" warnings
[cascardo/linux.git] / drivers / hv / channel_mgmt.c
index bbd812e..759ba4d 100644 (file)
@@ -139,10 +139,32 @@ static const struct vmbus_device vmbus_devs[] = {
        },
 };
 
-static u16 hv_get_dev_type(const uuid_le *guid)
+static const struct {
+       uuid_le guid;
+} vmbus_unsupported_devs[] = {
+       { HV_AVMA1_GUID },
+       { HV_AVMA2_GUID },
+       { HV_RDV_GUID   },
+};
+
+static bool is_unsupported_vmbus_devs(const uuid_le *guid)
+{
+       int i;
+
+       for (i = 0; i < ARRAY_SIZE(vmbus_unsupported_devs); i++)
+               if (!uuid_le_cmp(*guid, vmbus_unsupported_devs[i].guid))
+                       return true;
+       return false;
+}
+
+static u16 hv_get_dev_type(const struct vmbus_channel *channel)
 {
+       const uuid_le *guid = &channel->offermsg.offer.if_type;
        u16 i;
 
+       if (is_hvsock_channel(channel) || is_unsupported_vmbus_devs(guid))
+               return HV_UNKOWN;
+
        for (i = HV_IDE; i < HV_UNKOWN; i++) {
                if (!uuid_le_cmp(*guid, vmbus_devs[i].guid))
                        return i;
@@ -426,7 +448,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel)
                        goto err_free_chan;
        }
 
-       dev_type = hv_get_dev_type(&newchannel->offermsg.offer.if_type);
+       dev_type = hv_get_dev_type(newchannel);
        if (dev_type == HV_NIC)
                set_channel_signal_state(newchannel, HV_SIGNAL_POLICY_EXPLICIT);