Re: Is UPS_PORT_POWER wrong?
Hi HPS, Do you have better idea? From: Kohji Okuno okuno.ko...@jp.panasonic.com Date: Tue, 24 Jan 2012 09:53:29 +0900 (JST) Hi HPS, On Monday 23 January 2012 09:12:46 Kohji Okuno wrote: Hi HPS, I think that UPS_PORT_POWER and UPS_PORT_LINK_STATE overlap. And, in xhci.c you set UPS_PORT_POWER as folows. When UPS_PORT_POWER is set, UPS_PORT_LINK_STATE_GET() macro will return incorrect value. if (v XHCI_PS_PP) { /* * The USB 3.0 RH is using the * USB 2.0's power bit */ i |= UPS_PORT_POWER; } Hi, The USB 3.0 root HUB is special because it defines FULL/HIGH and LOW speed, so I had to merge that into the port status register of the XHCI root HUB like this: 0: CONNECT_STATUS 1: PORT_ENABLED 2: SUSPEND 3: OVERCURRENT_INDICATOR 4: LINK STATE (USB 3.0) 5: - 6: - 7: - 8: PORT_POWER (USB 2.0) # Bit 9+10 have 4 combinations which are defined: FS, LW, HS, SS 9: LOW_SPEED (USB 2.0) 10: HIGH_SPEED (USB 2.0) 11: not implemented 12: PORT_INDICATOR 13: 14: 15: MODE_DEVICE (FreeBSD specific) If you have a better idea, it is possible to change this. I have a idea. -#define UPS_PORT_LINK_STATE_GET(x) (((x) 5) 0xF) -#define UPS_PORT_LINK_STATE_SET(x) (((x) 0xF) 5) +#define UPS_PORT_LINK_STATE_GET(x) x) 5) 0x7)|(((x) 11) 0x8)) +#define UPS_PORT_LINK_STATE_SET(x) x) 0x7) 5)|(((x) 0x8) 11)) +#define UPS_PORT_LS_SS 0x4000 /* currently FreeBSD specific */ But, this is not cool. Regards, Kohji Okuno ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org
Re: Is UPS_PORT_POWER wrong?
On Saturday 28 January 2012 12:53:39 Kohji Okuno wrote: Hi HPS, Do you have better idea? It might be we should implement a separate control request to get the information we need? Though that needs to be standardized. What do you think about that? --HPS ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org
Re: Is UPS_PORT_POWER wrong?
On Monday 23 January 2012 09:12:46 Kohji Okuno wrote: Hi HPS, I think that UPS_PORT_POWER and UPS_PORT_LINK_STATE overlap. And, in xhci.c you set UPS_PORT_POWER as folows. When UPS_PORT_POWER is set, UPS_PORT_LINK_STATE_GET() macro will return incorrect value. if (v XHCI_PS_PP) { /* * The USB 3.0 RH is using the * USB 2.0's power bit */ i |= UPS_PORT_POWER; } Hi, The USB 3.0 root HUB is special because it defines FULL/HIGH and LOW speed, so I had to merge that into the port status register of the XHCI root HUB like this: 0: CONNECT_STATUS 1: PORT_ENABLED 2: SUSPEND 3: OVERCURRENT_INDICATOR 4: LINK STATE (USB 3.0) 5: - 6: - 7: - 8: PORT_POWER (USB 2.0) # Bit 9+10 have 4 combinations which are defined: FS, LW, HS, SS 9: LOW_SPEED (USB 2.0) 10: HIGH_SPEED (USB 2.0) 11: not implemented 12: PORT_INDICATOR 13: 14: 15: MODE_DEVICE (FreeBSD specific) If you have a better idea, it is possible to change this. --HPS ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org
Re: Is UPS_PORT_POWER wrong?
Hi HPS, On Monday 23 January 2012 09:12:46 Kohji Okuno wrote: Hi HPS, I think that UPS_PORT_POWER and UPS_PORT_LINK_STATE overlap. And, in xhci.c you set UPS_PORT_POWER as folows. When UPS_PORT_POWER is set, UPS_PORT_LINK_STATE_GET() macro will return incorrect value. if (v XHCI_PS_PP) { /* * The USB 3.0 RH is using the * USB 2.0's power bit */ i |= UPS_PORT_POWER; } Hi, The USB 3.0 root HUB is special because it defines FULL/HIGH and LOW speed, so I had to merge that into the port status register of the XHCI root HUB like this: 0: CONNECT_STATUS 1: PORT_ENABLED 2: SUSPEND 3: OVERCURRENT_INDICATOR 4: LINK STATE (USB 3.0) 5: - 6: - 7: - 8: PORT_POWER (USB 2.0) # Bit 9+10 have 4 combinations which are defined: FS, LW, HS, SS 9: LOW_SPEED (USB 2.0) 10: HIGH_SPEED (USB 2.0) 11: not implemented 12: PORT_INDICATOR 13: 14: 15: MODE_DEVICE (FreeBSD specific) If you have a better idea, it is possible to change this. I have a idea. -#define UPS_PORT_LINK_STATE_GET(x) (((x) 5) 0xF) -#define UPS_PORT_LINK_STATE_SET(x) (((x) 0xF) 5) +#define UPS_PORT_LINK_STATE_GET(x) x) 5) 0x7)|(((x) 11) 0x8)) +#define UPS_PORT_LINK_STATE_SET(x) x) 0x7) 5)|(((x) 0x8) 11)) +#define UPS_PORT_LS_SS 0x4000 /* currently FreeBSD specific */ But, this is not cool. Regards, Kohji Okuno ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org