summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Mikhailov <mvp@users.noreply.github.com>2017-06-12 15:09:17 -0700
committerVadim Mikhailov <mvp@users.noreply.github.com>2017-06-13 09:30:29 -0700
commitc3da09da55e1919c875b45b9aa05bf38593ffbcd (patch)
treefebcbb55ee5b341bd2d8f104b0d2b4697e523f3c
parent3ef7749d7655cd9f43e5650f23bd106903df5f98 (diff)
Relax OCPM check to enable Raspberry Pi support
We only really require LPSM supported per port. OCPM can be supported per port or ganged. This is necessary to support Raspberry Pi. Bump version to 1.7.
-rw-r--r--README.md3
-rw-r--r--uhubctl.c7
2 files changed, 6 insertions, 4 deletions
diff --git a/README.md b/README.md
index 716fae2..bb13cfc 100644
--- a/README.md
+++ b/README.md
@@ -32,8 +32,9 @@ This is list of known compatible USB hubs:
| Lenovo | ThinkPad EU Ultra Dockingstation (40A20090EU) |`17EF:100F`| 2015 | |
| Lenovo | ThinkPad X200 Ultrabase 42X4963 |`17EF:1005`| 2008 | 2011 |
| Linksys | USB2HUB4 | | 2004 | 2010 |
-| Microchip | EVB-USB2517 | | 2012 | |
+| Microchip | EVB-USB2517 | | 2008 | |
| Plugable | USB2-HUB10S | | 2010 | |
+| Raspberry Pi | Model B+, Model 2 B, Model 3 B | | 2011 | |
| Rosewill | RHUB-210 |`0409:005A`| 2011 | 2014 |
| Sanwa Supply | USB-HUB14GPH | | 2001 | 2003 |
| Sunix | SHB4200MA |`0409:0058`| 2006 | 2009 |
diff --git a/uhubctl.c b/uhubctl.c
index 78a6a68..55ba783 100644
--- a/uhubctl.c
+++ b/uhubctl.c
@@ -9,7 +9,7 @@
*
*/
-#define PROGRAM_VERSION "1.6"
+#define PROGRAM_VERSION "1.7"
#include <stdio.h>
#include <stdlib.h>
@@ -211,9 +211,10 @@ int is_smart_hub(struct libusb_device *dev, int min_current)
int lpsm = uhd->wHubCharacteristics[0] & HUB_CHAR_LPSM;
/* Over-Current Protection Mode */
int ocpm = uhd->wHubCharacteristics[0] & HUB_CHAR_OCPM;
- /* Both LPSM and OCPM must be supported per-port: */
+ /* LPSM must be supported per-port, and OCPM per port or ganged */
if ((lpsm == HUB_CHAR_INDV_PORT_LPSM) &&
- (ocpm == HUB_CHAR_INDV_PORT_OCPM))
+ (ocpm == HUB_CHAR_INDV_PORT_OCPM ||
+ ocpm == HUB_CHAR_COMMON_OCPM))
{
rc = uhd->bNbrPorts;
/* Internal hubs have zero bHubContrCurrent.