MLK-9617-19 usb: otg: test: show warning message for unsupported otg test dev
authorLi Jun <b47624@freescale.com>
Thu, 16 Oct 2014 14:17:56 +0000 (22:17 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:47:14 +0000 (14:47 -0500)
According to "USB On-The-Go and Embedded Host Automated Compliance Plan Version
1.2", chapter 6.7.23, unknown Device Not Supporting HNP:'Unsupported Device';
chapter 6.7.24 unknown Device Supporting HNP: 'Device No Response'

Signed-off-by: Li Jun <b47624@freescale.com>
(cherry picked from commit 3fb9b462769d44073078f3b29fe68e214896ea9e)

drivers/usb/core/otg_whitelist.h

index 67a4a78..68b4f7e 100644 (file)
@@ -89,6 +89,19 @@ static int is_targeted(struct usb_device *dev)
             le16_to_cpu(dev->descriptor.idProduct) == 0x0200))
                return 1;
 
+       /* Unknown Device Not Supporting HNP */
+       if ((le16_to_cpu(dev->descriptor.idVendor) == 0x1a0a &&
+               le16_to_cpu(dev->descriptor.idProduct) == 0x0201)) {
+               dev_warn(&dev->dev, "Unsupported Device\n");
+               return 0;
+       }
+       /* Unknown Device Supporting HNP */
+       if ((le16_to_cpu(dev->descriptor.idVendor) == 0x1a0a &&
+               le16_to_cpu(dev->descriptor.idProduct) == 0x0202)) {
+               dev_warn(&dev->dev, "Device no Responding\n");
+               return 0;
+       }
+
        /* NOTE: can't use usb_match_id() since interface caches
         * aren't set up yet. this is cut/paste from that code.
         */