summaryrefslogtreecommitdiff
path: root/drivers/usb/usbip/vhci.h
diff options
context:
space:
mode:
authorYuyang Du <yuyang.du@intel.com>2017-06-08 08:04:13 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-06-13 11:51:10 +0300
commitb891245bff79583b9c69b14b4429362a5d54096e (patch)
treeb4fb6991d5b1d79cc6e6283081ac6fad7b5e4b05 /drivers/usb/usbip/vhci.h
parenta5c7f019c7d602c508b3eedc470568df4633c642 (diff)
downloadlinux-b891245bff79583b9c69b14b4429362a5d54096e.tar.xz
usbip: vhci-hcd: Clean up the code by adding a new macro
Each vhci has 2*VHCI_HC_PORTS ports, in which VHCI_HC_PORTS ports are HighSpeed (or below), and VHCI_HC_PORTS are SuperSpeed. This new macro VHCI_PORTS reflects this configuration. Signed-off-by: Yuyang Du <yuyang.du@intel.com> Acked-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/usbip/vhci.h')
-rw-r--r--drivers/usb/usbip/vhci.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/usbip/vhci.h b/drivers/usb/usbip/vhci.h
index db28eb531e8c..5cfb59e98e44 100644
--- a/drivers/usb/usbip/vhci.h
+++ b/drivers/usb/usbip/vhci.h
@@ -84,6 +84,9 @@ enum hub_speed {
#define VHCI_HC_PORTS 8
#endif
+/* Each VHCI has 2 hubs (USB2 and USB3), each has VHCI_HC_PORTS ports */
+#define VHCI_PORTS (VHCI_HC_PORTS*2)
+
#ifdef CONFIG_USBIP_VHCI_NR_HCS
#define VHCI_NR_HCS CONFIG_USBIP_VHCI_NR_HCS
#else
@@ -145,7 +148,7 @@ static inline __u32 port_to_rhport(__u32 port)
static inline int port_to_pdev_nr(__u32 port)
{
- return port / (VHCI_HC_PORTS * 2);
+ return port / VHCI_PORTS;
}
static inline struct vhci_hcd *hcd_to_vhci_hcd(struct usb_hcd *hcd)