ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2018
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
25 participants
436 discussions
Start a n
N
ew thread
49/77: [USBPORT] Implement USB2_DeallocateHS().
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c48093573bd6eb660ff83…
commit c48093573bd6eb660ff83022029db1276a70daa1 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Sun Dec 10 11:49:40 2017 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:51 2018 +0100 [USBPORT] Implement USB2_DeallocateHS(). --- drivers/usb/usbport/usb2.c | 118 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 116 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c index f0bee68394..14512d771d 100644 --- a/drivers/usb/usbport/usb2.c +++ b/drivers/usb/usbport/usb2.c @@ -508,8 +508,122 @@ NTAPI USB2_DeallocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint, IN ULONG Frame) { - DPRINT("USB2_DeallocateHS: UNIMPLEMENTED FIXME\n"); - ASSERT(FALSE); + PUSB2_TT Tt; + PUSB2_HC_EXTENSION HcExtension; + ULONG OverheadCS; + ULONG OverheadSS; + ULONG Direction; + ULONG ix; + ULONG CurrentDataTime; + ULONG RemainDataTime; + ULONG DataTime; + ULONG DataSize; + USHORT PktSize; + USHORT PktSizeBitStuff; + UCHAR uframe; + UCHAR frame; + + DPRINT("USB2_DeallocateHS: TtEndpoint - %p, Frame - %X\n", + TtEndpoint, + Frame); + + Tt = TtEndpoint->Tt; + HcExtension = Tt->HcExtension; + + USB2_GetHsOverhead(TtEndpoint, &OverheadSS, &OverheadCS); + + frame = TtEndpoint->StartFrame + Frame; + uframe = TtEndpoint->StartMicroframe; + + if (TtEndpoint->StartMicroframe == 0xFF) + { + USB2_GetPrevMicroFrame(&frame, &uframe); + } + + for (ix = 0; ix < TtEndpoint->Nums.NumStarts; ix++) + { + HcExtension->TimeUsed[frame][uframe] -= OverheadSS; + --Tt->NumStartSplits[frame][uframe]; + USB2_IncMicroFrame(&frame, &uframe); + } + + frame = TtEndpoint->StartFrame + Frame; + uframe = TtEndpoint->StartMicroframe + TtEndpoint->Nums.NumStarts + 1; + + for (ix = 0; ix < TtEndpoint->Nums.NumCompletes; ix++) + { + HcExtension->TimeUsed[frame][uframe] -= OverheadCS; + USB2_IncMicroFrame(&frame, &uframe); + } + + Direction = TtEndpoint->TtEndpointParams.Direction; + PktSize = TtEndpoint->MaxPacketSize; + PktSizeBitStuff = USB2_AddDataBitStuff(PktSize); + + if (Direction == USBPORT_TRANSFER_DIRECTION_OUT) + { + frame = TtEndpoint->StartFrame + Frame; + uframe = TtEndpoint->StartMicroframe; + + if (TtEndpoint->StartMicroframe == 0xFF) + { + USB2_GetPrevMicroFrame(&frame, &uframe); + } + + DataTime = 0; + + for (ix = 0; ix < TtEndpoint->Nums.NumStarts; ix++) + { + DataSize = PktSizeBitStuff - DataTime; + + if (DataSize <= USB2_FS_RAW_BYTES_IN_MICROFRAME) + { + CurrentDataTime = PktSizeBitStuff - DataTime; + } + else + { + CurrentDataTime = USB2_FS_RAW_BYTES_IN_MICROFRAME; + } + + HcExtension->TimeUsed[frame][uframe] -= CurrentDataTime; + USB2_IncMicroFrame(&frame, &uframe); + DataTime += USB2_FS_RAW_BYTES_IN_MICROFRAME; + } + } + else + { + frame = TtEndpoint->StartFrame + Frame; + uframe = TtEndpoint->StartMicroframe + TtEndpoint->Nums.NumStarts + 1; + + for (ix = 0; ix < TtEndpoint->Nums.NumCompletes; ix++) + { + if (PktSizeBitStuff >= USB2_FS_RAW_BYTES_IN_MICROFRAME) + { + CurrentDataTime = USB2_FS_RAW_BYTES_IN_MICROFRAME; + } + else + { + CurrentDataTime = PktSizeBitStuff; + } + + Tt->TimeCS[frame][uframe] -= CurrentDataTime; + + if (Tt->TimeCS[frame][uframe] < USB2_FS_RAW_BYTES_IN_MICROFRAME) + { + RemainDataTime = USB2_FS_RAW_BYTES_IN_MICROFRAME - + Tt->TimeCS[frame][uframe]; + + if (RemainDataTime >= PktSizeBitStuff) + RemainDataTime = PktSizeBitStuff; + + HcExtension->TimeUsed[frame][uframe] -= RemainDataTime; + } + + USB2_IncMicroFrame(&frame, &uframe); + } + } + + return; } BOOLEAN
6 years, 9 months
1
0
0
0
48/77: [USBPORT] Correcting USB2_AllocateHS().
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=00dd0c67b6a7365872b6f…
commit 00dd0c67b6a7365872b6fbbd79f85992189d65b7 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Sat Dec 9 18:42:16 2017 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:51 2018 +0100 [USBPORT] Correcting USB2_AllocateHS(). --- drivers/usb/usbport/usb2.c | 82 +++++++++++++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 30 deletions(-) diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c index f440c0355a..f0bee68394 100644 --- a/drivers/usb/usbport/usb2.c +++ b/drivers/usb/usbport/usb2.c @@ -315,16 +315,18 @@ USB2_AllocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint, ULONG TransferType; ULONG Direction; ULONG DataTime; + ULONG DataSize; ULONG RemainDataTime; ULONG OverheadCS; ULONG OverheadSS; ULONG ix; USHORT PktSize; + USHORT PktSizeBitStuff; UCHAR frame; UCHAR uframe; BOOL Result = TRUE; - DPRINT("USB2_AllocateHS: TtEndpoint - %p, Frame - %X, TtEndpoint->StartFrame - %X\n", + DPRINT("USB2_AllocateHS: TtEndpoint - %p, Frame - %X, StartFrame - %X\n", TtEndpoint, Frame, TtEndpoint->StartFrame); @@ -352,14 +354,10 @@ USB2_AllocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint, { TtEndpoint->Nums.NumStarts = 1; - if ((CHAR)TtEndpoint->StartMicroframe < 5) - { + if ((CHAR)TtEndpoint->StartMicroframe < (USB2_MICROFRAMES - 3)) TtEndpoint->Nums.NumCompletes = 3; - } else - { TtEndpoint->Nums.NumCompletes = 2; - } } } else @@ -391,7 +389,8 @@ USB2_AllocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint, Result = FALSE; } - if (Tt->NumStartSplits[frame][uframe] > (USB2_MAX_FS_LS_TRANSACTIONS_IN_UFRAME - 1)) + if (Tt->NumStartSplits[frame][uframe] > + (USB2_MAX_FS_LS_TRANSACTIONS_IN_UFRAME - 1)) { DPRINT1("USB2_AllocateHS: Num Start Splits - %X\n", Tt->NumStartSplits[frame][uframe] + 1); @@ -419,10 +418,44 @@ USB2_AllocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint, USB2_IncMicroFrame(&frame, &uframe); } + PktSize = TtEndpoint->MaxPacketSize; + PktSizeBitStuff = USB2_AddDataBitStuff(PktSize); + if (Direction == USBPORT_TRANSFER_DIRECTION_OUT) { - DPRINT("USB2_AllocateHS: DIRECTION OUT UNIMPLEMENTED\n"); - ASSERT(FALSE); + frame = TtEndpoint->StartFrame + Frame; + uframe = TtEndpoint->StartMicroframe; + + if (uframe == 0xFF) + USB2_GetPrevMicroFrame(&frame, &uframe); + + DataTime = 0; + + for (ix = 0; ix < TtEndpoint->Nums.NumStarts; ix++) + { + DataSize = PktSizeBitStuff - DataTime; + + if (DataSize <= USB2_FS_RAW_BYTES_IN_MICROFRAME) + DataTime = DataSize; + else + DataTime = USB2_FS_RAW_BYTES_IN_MICROFRAME; + + DPRINT("USB2_AllocateHS: ix - %X, frame - %X, uframe - %X, TimeUsed - %X\n", + ix, + frame, + uframe, + HcExtension->TimeUsed[frame][uframe]); + + if (!USB2_AllocateCheck(&HcExtension->TimeUsed[frame][uframe], + DataTime, + USB2_MAX_MICROFRAME_ALLOCATION)) + { + Result = FALSE; + } + + USB2_IncMicroFrame(&frame, &uframe); + DataTime += USB2_FS_RAW_BYTES_IN_MICROFRAME; + } } else { @@ -433,25 +466,20 @@ USB2_AllocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint, { if (Tt->TimeCS[frame][uframe] < USB2_FS_RAW_BYTES_IN_MICROFRAME) { - if (Tt->TimeCS[frame][uframe] < USB2_FS_RAW_BYTES_IN_MICROFRAME) + RemainDataTime = USB2_FS_RAW_BYTES_IN_MICROFRAME - + Tt->TimeCS[frame][uframe]; + + if (RemainDataTime >= PktSizeBitStuff) { - RemainDataTime = USB2_FS_RAW_BYTES_IN_MICROFRAME - - Tt->TimeCS[frame][uframe]; + DataTime = PktSizeBitStuff; } - else + else if (RemainDataTime > 0) { - RemainDataTime = 0; - } - - PktSize = TtEndpoint->MaxPacketSize; - - if (RemainDataTime >= USB2_AddDataBitStuff(PktSize)) - { - DataTime = USB2_AddDataBitStuff(PktSize); + DataTime = RemainDataTime; } else { - DataTime = RemainDataTime; + DataTime = 0; } if (!USB2_AllocateCheck(&HcExtension->TimeUsed[frame][uframe], @@ -462,16 +490,10 @@ USB2_AllocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint, } } - PktSize = TtEndpoint->MaxPacketSize; - - if (USB2_AddDataBitStuff(PktSize) < USB2_FS_RAW_BYTES_IN_MICROFRAME) - { - Tt->TimeCS[frame][uframe] += USB2_AddDataBitStuff(PktSize); - } + if (PktSizeBitStuff < USB2_FS_RAW_BYTES_IN_MICROFRAME) + Tt->TimeCS[frame][uframe] += PktSizeBitStuff; else - { Tt->TimeCS[frame][uframe] += USB2_FS_RAW_BYTES_IN_MICROFRAME; - } USB2_IncMicroFrame(&frame, &uframe); }
6 years, 9 months
1
0
0
0
47/77: [USBPORT] Reduces output of debug messages.
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1926238056b4926375698…
commit 1926238056b49263756988c6dc6f1bd2528aebb3 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Sat Dec 9 17:23:25 2017 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:51 2018 +0100 [USBPORT] Reduces output of debug messages. --- drivers/usb/usbport/usb2.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c index d234c7e390..f440c0355a 100644 --- a/drivers/usb/usbport/usb2.c +++ b/drivers/usb/usbport/usb2.c @@ -200,9 +200,9 @@ USB2_GetHsOverhead(IN PUSB2_TT_ENDPOINT TtEndpoint, *OverheadCS = HostDelay + USB2_HS_CS_INTERRUPT_IN_OVERHEAD; } - DPRINT("USB2_GetHsOverhead: *OverheadSS - %X, *OverheadCS - %X\n", - *OverheadSS, - *OverheadCS); + //DPRINT("USB2_GetHsOverhead: *OverheadSS - %X, *OverheadCS - %X\n", + // *OverheadSS, + // *OverheadCS); } } @@ -214,9 +214,9 @@ USB2_GetLastIsoTime(IN PUSB2_TT_ENDPOINT TtEndpoint, PUSB2_TT_ENDPOINT nextTtEndpoint; ULONG Result; - DPRINT("USB2_GetLastIsoTime: TtEndpoint - %p, Frame - %X\n", - TtEndpoint, - Frame); + //DPRINT("USB2_GetLastIsoTime: TtEndpoint - %p, Frame - %X\n", + // TtEndpoint, + // Frame); nextTtEndpoint = TtEndpoint->Tt->FrameBudget[Frame].IsoEndpoint->NextTtEndpoint;
6 years, 9 months
1
0
0
0
46/77: [USBPORT] Add USB2_GetCMASK().
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5ffefbe9456217f4dbeb6…
commit 5ffefbe9456217f4dbeb655137fc040605ba89c0 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Sat Dec 9 17:15:40 2017 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:50 2018 +0100 [USBPORT] Add USB2_GetCMASK(). --- drivers/usb/usbport/usb2.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c index d974238854..d234c7e390 100644 --- a/drivers/usb/usbport/usb2.c +++ b/drivers/usb/usbport/usb2.c @@ -564,6 +564,79 @@ USB2_GetSMASK(IN PUSB2_TT_ENDPOINT TtEndpoint) return SMask; } +UCHAR +NTAPI +USB2_GetCMASK(IN PUSB2_TT_ENDPOINT TtEndpoint) +{ + ULONG NumCompletes; + ULONG TransferType; + ULONG DeviceSpeed; + ULONG Direction; + UCHAR Result; + UCHAR MicroFrameCS; + UCHAR HcFrame; + UCHAR HcMicroFrame; + UCHAR MaskCS = 0; + static const UCHAR CMASKS[USB2_MICROFRAMES] = { + 0x1C, 0x38, 0x70, 0xE0, 0xC1, 0x83, 0x07, 0x0E + }; + + TransferType = TtEndpoint->TtEndpointParams.TransferType; + DeviceSpeed = TtEndpoint->TtEndpointParams.DeviceSpeed; + Direction = TtEndpoint->TtEndpointParams.Direction; + + if (DeviceSpeed == UsbHighSpeed) + { + return 0; + } + + if (TransferType == USBPORT_TRANSFER_TYPE_INTERRUPT) + { + USB2_ConvertFrame(TtEndpoint->StartFrame, + TtEndpoint->StartMicroframe, + &HcFrame, + &HcMicroFrame); + + Result = CMASKS[HcMicroFrame]; + } + else + { + if (Direction == USBPORT_TRANSFER_DIRECTION_OUT) + { + return 0; + } + + USB2_ConvertFrame(TtEndpoint->StartFrame, + TtEndpoint->StartMicroframe, + &HcFrame, + &HcMicroFrame); + + NumCompletes = TtEndpoint->Nums.NumCompletes; + + for (MicroFrameCS = HcMicroFrame + 2; + MicroFrameCS < USB2_MICROFRAMES; + MicroFrameCS++) + { + MaskCS |= (1 << MicroFrameCS); + NumCompletes--; + + if (!NumCompletes) + { + return MaskCS; + } + } + + for (; NumCompletes; NumCompletes--) + { + MaskCS |= (1 << (MicroFrameCS - USB2_MICROFRAMES)); + } + + Result = MaskCS; + } + + return Result; +} + BOOLEAN NTAPI USB2_DeallocateEndpointBudget(IN PUSB2_TT_ENDPOINT TtEndpoint,
6 years, 9 months
1
0
0
0
45/77: [USBPORT] Add USB2_GetSMASK()and USB2_ConvertFrame().
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f3c869a16bed36e267e28…
commit f3c869a16bed36e267e2838f7349cd78d5019b10 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Sat Dec 9 17:06:52 2017 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:50 2018 +0100 [USBPORT] Add USB2_GetSMASK()and USB2_ConvertFrame(). --- drivers/usb/usbport/usb2.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c index 79ae518ca1..d974238854 100644 --- a/drivers/usb/usbport/usb2.c +++ b/drivers/usb/usbport/usb2.c @@ -503,6 +503,67 @@ USB2_MoveTtEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint, return FALSE; } +VOID +NTAPI +USB2_ConvertFrame(IN UCHAR Frame, + IN UCHAR Microframe, + OUT PUCHAR HcFrame, + OUT PUCHAR HcMicroframe) +{ + DPRINT("USB2_ConvertFrame: Frame - %x, Microframe - %x\n", + Frame, + Microframe); + + if (Microframe == 0xFF) + { + *HcFrame = Frame; + *HcMicroframe = 0; + } + + if (Microframe >= 0 && + Microframe <= (USB2_MICROFRAMES - 2)) + { + *HcFrame = Frame; + *HcMicroframe = Microframe + 1; + } + + if (Microframe == (USB2_MICROFRAMES - 1)) + { + *HcFrame = Frame + 1; + *HcMicroframe = 0; + } +} + +UCHAR +NTAPI +USB2_GetSMASK(IN PUSB2_TT_ENDPOINT TtEndpoint) +{ + ULONG ix; + UCHAR SMask = 0; + UCHAR HcFrame; + UCHAR HcMicroFrame; + + if (TtEndpoint->TtEndpointParams.DeviceSpeed == UsbHighSpeed) + { + SMask = (1 << TtEndpoint->StartMicroframe); + } + else + { + USB2_ConvertFrame(TtEndpoint->StartFrame, + TtEndpoint->StartMicroframe, + &HcFrame, + &HcMicroFrame); + + for (ix = 0; ix < TtEndpoint->Nums.NumStarts; ix++) + { + SMask |= (1 << HcMicroFrame); + HcMicroFrame++; + } + } + + return SMask; +} + BOOLEAN NTAPI USB2_DeallocateEndpointBudget(IN PUSB2_TT_ENDPOINT TtEndpoint,
6 years, 9 months
1
0
0
0
44/77: [USBPORT] Add stub for USB2_MoveTtEndpoint().
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=df44bc6d845d8411c2b26…
commit df44bc6d845d8411c2b26e88dbed036e7f071397 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Sat Dec 9 17:00:22 2017 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:50 2018 +0100 [USBPORT] Add stub for USB2_MoveTtEndpoint(). --- drivers/usb/usbport/usb2.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c index e36bf1b165..79ae518ca1 100644 --- a/drivers/usb/usbport/usb2.c +++ b/drivers/usb/usbport/usb2.c @@ -490,6 +490,19 @@ USB2_DeallocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint, ASSERT(FALSE); } +BOOLEAN +NTAPI +USB2_MoveTtEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint, + IN USHORT BusTime, + IN PUSB2_REBALANCE Rebalance, + IN ULONG RebalanceListEntries, + OUT BOOLEAN * OutResult) +{ + DPRINT("USB2_MoveTtEndpoint: UNIMPLEMENTED FIXME\n"); + ASSERT(FALSE); + return FALSE; +} + BOOLEAN NTAPI USB2_DeallocateEndpointBudget(IN PUSB2_TT_ENDPOINT TtEndpoint,
6 years, 9 months
1
0
0
0
43/77: [USBPORT] Add stub for USB2_DeallocateHS().
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ab5810576f96491af5ecc…
commit ab5810576f96491af5ecc24fc1b2870c491bf7d0 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Sat Dec 9 16:58:52 2017 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:49 2018 +0100 [USBPORT] Add stub for USB2_DeallocateHS(). --- drivers/usb/usbport/usb2.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c index b3d7f4d80c..e36bf1b165 100644 --- a/drivers/usb/usbport/usb2.c +++ b/drivers/usb/usbport/usb2.c @@ -481,6 +481,15 @@ USB2_AllocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint, return Result; } +VOID +NTAPI +USB2_DeallocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint, + IN ULONG Frame) +{ + DPRINT("USB2_DeallocateHS: UNIMPLEMENTED FIXME\n"); + ASSERT(FALSE); +} + BOOLEAN NTAPI USB2_DeallocateEndpointBudget(IN PUSB2_TT_ENDPOINT TtEndpoint,
6 years, 9 months
1
0
0
0
42/77: [USBPORT] Correcting USB2_InitTtEndpoint().
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8b9d5d1514d2e9ee6a8d1…
commit 8b9d5d1514d2e9ee6a8d1814939ed0191e5a1186 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Sat Dec 9 16:46:34 2017 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:49 2018 +0100 [USBPORT] Correcting USB2_InitTtEndpoint(). --- drivers/usb/usbport/usb2.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c index b942325874..b3d7f4d80c 100644 --- a/drivers/usb/usbport/usb2.c +++ b/drivers/usb/usbport/usb2.c @@ -284,8 +284,6 @@ USB2_InitTtEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint, IN USHORT MaxPacketSize, IN PUSB2_TT Tt) { - RtlZeroMemory(TtEndpoint, sizeof(USB2_TT_ENDPOINT)); - TtEndpoint->TtEndpointParams.TransferType = TransferType; TtEndpoint->TtEndpointParams.Direction = Direction; TtEndpoint->TtEndpointParams.DeviceSpeed = DeviceSpeed; @@ -293,6 +291,18 @@ USB2_InitTtEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint, TtEndpoint->Period = Period; TtEndpoint->MaxPacketSize = MaxPacketSize; TtEndpoint->Tt = Tt; + + TtEndpoint->CalcBusTime = 0; + TtEndpoint->StartTime = 0; + TtEndpoint->ActualPeriod = 0; + TtEndpoint->StartFrame = 0; + TtEndpoint->StartMicroframe = 0; + + TtEndpoint->Nums.AsULONG = 0; + TtEndpoint->NextTtEndpoint = NULL; + TtEndpoint->Reserved2 = 0; + TtEndpoint->PreviosPeriod = 0; + TtEndpoint->IsPromoted = FALSE; } BOOLEAN
6 years, 9 months
1
0
0
0
41/77: [USBPORT] End implementation USB2_AllocateTimeForEndpoint().
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e262bb610dfb13f2b4e65…
commit e262bb610dfb13f2b4e65ef8d7e750a9ad3cff60 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Sat Dec 9 16:27:19 2017 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:49 2018 +0100 [USBPORT] End implementation USB2_AllocateTimeForEndpoint(). --- drivers/usb/usbport/usb2.c | 190 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 187 insertions(+), 3 deletions(-) diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c index edc91c1d70..b942325874 100644 --- a/drivers/usb/usbport/usb2.c +++ b/drivers/usb/usbport/usb2.c @@ -500,6 +500,12 @@ USB2_AllocateTimeForEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint, ULONG Microframe; ULONG TransferType; ULONG Overhead; + ULONG LatestStart; + PUSB2_TT_ENDPOINT prevTtEndpoint; + PUSB2_TT_ENDPOINT nextTtEndpoint; + PUSB2_TT_ENDPOINT IntEndpoint; + ULONG StartTime; + ULONG calcBusTime; BOOLEAN Result = TRUE; DPRINT("USB2_AllocateTimeForEndpoint: TtEndpoint - %p\n", TtEndpoint); @@ -649,10 +655,188 @@ USB2_AllocateTimeForEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint, TtEndpoint->CalcBusTime = TtEndpoint->MaxPacketSize + Overhead; } + LatestStart = USB2_HUB_DELAY + USB2_FS_SOF_TIME; - DPRINT("USB2_AllocateTimeForEndpoint: UNIMPLEMENTED. FIXME\n"); - ASSERT(FALSE); - return FALSE; + for (ix = 0; + (TtEndpoint->StartFrame + ix) < USB2_FRAMES; + ix += TtEndpoint->ActualPeriod) + { + frame = TtEndpoint->StartFrame + ix; + + if (Tt->FrameBudget[frame].AltEndpoint && + TtEndpoint->CalcBusTime >= (USB2_FS_MAX_PERIODIC_ALLOCATION / 2)) + { + DPRINT("USB2_AllocateTimeForEndpoint: return FALSE\n"); + return FALSE; + } + + if (TransferType == USBPORT_TRANSFER_TYPE_ISOCHRONOUS) + prevTtEndpoint = Tt->FrameBudget[frame].IsoEndpoint; + else + prevTtEndpoint = Tt->FrameBudget[frame].IntEndpoint; + + for (nextTtEndpoint = prevTtEndpoint->NextTtEndpoint; + nextTtEndpoint; + nextTtEndpoint = nextTtEndpoint->NextTtEndpoint) + { + if (USB2_CheckTtEndpointInsert(nextTtEndpoint, TtEndpoint)) + { + break; + } + + prevTtEndpoint = nextTtEndpoint; + } + + StartTime = USB2_GetStartTime(nextTtEndpoint, + TtEndpoint, + prevTtEndpoint, + frame); + + if (StartTime > LatestStart) + LatestStart = StartTime; + } + + TtEndpoint->StartTime = LatestStart; + + if ((LatestStart + TtEndpoint->CalcBusTime) > USB2_FS_MAX_PERIODIC_ALLOCATION) + { + TtEndpoint->CalcBusTime = 0; + DPRINT("USB2_AllocateTimeForEndpoint: return FALSE\n"); + return FALSE; + } + + for (ix = 0, frame = -TtEndpoint->StartFrame; + ix < USB2_FRAMES; + ix++, frame++) + { + DPRINT("USB2_AllocateTimeForEndpoint: ix - %X, frame - %X, StartFrame - %X\n", + ix, + frame, + TtEndpoint->StartFrame); + + if (TransferType == USBPORT_TRANSFER_TYPE_ISOCHRONOUS) + { + DPRINT1("USB2_AllocateTimeForEndpoint: Iso Ep UNIMPLEMENTED. FIXME\n"); + ASSERT(FALSE); + } + else + { + IntEndpoint = Tt->FrameBudget[ix].IntEndpoint; + nextTtEndpoint = IntEndpoint->NextTtEndpoint; + + for (nextTtEndpoint = IntEndpoint->NextTtEndpoint; + nextTtEndpoint; + nextTtEndpoint = nextTtEndpoint->NextTtEndpoint) + { + if (USB2_CheckTtEndpointInsert(nextTtEndpoint, TtEndpoint)) + break; + IntEndpoint = nextTtEndpoint; + } + + if ((frame % TtEndpoint->ActualPeriod) == 0) + { + calcBusTime = 0; + } + else + { + if (nextTtEndpoint) + { + calcBusTime = LatestStart + TtEndpoint->CalcBusTime - + nextTtEndpoint->StartTime; + } + else + { + calcBusTime = TtEndpoint->CalcBusTime; + } + + if (calcBusTime > 0) + { + TimeUsed = Tt->FrameBudget[ix].TimeUsed; + + if (!USB2_AllocateCheck(&TimeUsed, + calcBusTime, + USB2_FS_MAX_PERIODIC_ALLOCATION)) + { + DPRINT("USB2_AllocateTimeForEndpoint: Result = FALSE\n"); + Result = FALSE; + } + } + } + + if (nextTtEndpoint != TtEndpoint) + { + if ((frame % TtEndpoint->ActualPeriod) == 0) + { + if (frame == 0) + { + DPRINT("USB2_AllocateTimeForEndpoint: frame == 0\n"); + TtEndpoint->NextTtEndpoint = nextTtEndpoint; + } + + IntEndpoint->NextTtEndpoint = TtEndpoint; + + DPRINT("USB2_AllocateTimeForEndpoint: TtEndpoint - %p, nextTtEndpoint - %p\n", + TtEndpoint, + nextTtEndpoint); + } + + if (calcBusTime > 0) + { + BOOLEAN IsMoved; + BOOLEAN MoveResult; + + DPRINT("USB2_AllocateTimeForEndpoint: nextTtEndpoint - %p, calcBusTime - %X\n", + nextTtEndpoint, + calcBusTime); + + for (; + nextTtEndpoint; + nextTtEndpoint = nextTtEndpoint->NextTtEndpoint) + { + MoveResult = USB2_MoveTtEndpoint(nextTtEndpoint, + calcBusTime, + Rebalance, + *RebalanceListEntries, + &IsMoved); + + if (!IsMoved) + { + DPRINT("USB2_AllocateTimeForEndpoint: Result = FALSE\n"); + Result = FALSE; + } + + if (!MoveResult) + break; + } + } + } + } + + if ((frame % TtEndpoint->ActualPeriod) == 0) + { + if (!USB2_AllocateHS(TtEndpoint, frame)) + { + DPRINT1("USB2_AllocateTimeForEndpoint: USB2_AllocateHS return FALSE\n"); + Result = FALSE; + } + + Tt->FrameBudget[ix].TimeUsed += TtEndpoint->CalcBusTime; + } + + if (Result == FALSE) + { + USB2_DeallocateEndpointBudget(TtEndpoint, + Rebalance, + RebalanceListEntries, + ix + 1); + + DPRINT("USB2_AllocateTimeForEndpoint: return FALSE\n"); + return FALSE; + } + } + + DPRINT("USB2_AllocateTimeForEndpoint: Result - %X\n", Result); + return Result; } BOOLEAN
6 years, 9 months
1
0
0
0
40/77: [USBPORT] Correcting USB2_GetStartTime().
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2be475db5d374d6a54d6a…
commit 2be475db5d374d6a54d6a8d58027f510c2eb9b54 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Sat Dec 9 15:00:04 2017 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:48 2018 +0100 [USBPORT] Correcting USB2_GetStartTime(). --- drivers/usb/usbport/usb2.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c index 1811b541c0..edc91c1d70 100644 --- a/drivers/usb/usbport/usb2.c +++ b/drivers/usb/usbport/usb2.c @@ -251,13 +251,11 @@ USB2_GetStartTime(IN PUSB2_TT_ENDPOINT nextTtEndpoint, TransferType = TtEndpoint->TtEndpointParams.TransferType; - if (nextTtEndpoint && TransferType == USBPORT_TRANSFER_TYPE_ISOCHRONOUS) - { - return nextTtEndpoint->StartTime + nextTtEndpoint->CalcBusTime; - } - if (TransferType == USBPORT_TRANSFER_TYPE_ISOCHRONOUS) { + if (nextTtEndpoint) + return nextTtEndpoint->StartTime + nextTtEndpoint->CalcBusTime; + ttEndpoint = TtEndpoint->Tt->FrameBudget[Frame].AltEndpoint; if (ttEndpoint)
6 years, 9 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
...
44
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Results per page:
10
25
50
100
200