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
69/77: [USBPORT] Moving array CMASKS[] to start file.
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fd5beb559374007e51747…
commit fd5beb559374007e51747917cdb09828ff970927 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Thu Jan 11 03:18:17 2018 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:59 2018 +0100 [USBPORT] Moving array CMASKS[] to start file. --- drivers/usb/usbport/usb2.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c index 4de18b7b12..cc833e308f 100644 --- a/drivers/usb/usbport/usb2.c +++ b/drivers/usb/usbport/usb2.c @@ -10,6 +10,10 @@ #define NDEBUG #include <debug.h> +static const UCHAR CMASKS[USB2_MICROFRAMES] = { + 0x1C, 0x38, 0x70, 0xE0, 0xC1, 0x83, 0x07, 0x0E +}; + BOOLEAN NTAPI USB2_AllocateCheck(IN OUT PULONG OutTimeUsed, @@ -792,9 +796,6 @@ USB2_GetCMASK(IN PUSB2_TT_ENDPOINT TtEndpoint) 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;
6 years, 8 months
1
0
0
0
68/77: [USBPORT] Removing optional braces.
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2c73523b76abb1fe03fa1…
commit 2c73523b76abb1fe03fa14b45dc3924460876375 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Thu Jan 11 03:14:22 2018 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:59 2018 +0100 [USBPORT] Removing optional braces. --- drivers/usb/usbport/usb2.c | 47 ++++------------------------------------------ 1 file changed, 4 insertions(+), 43 deletions(-) diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c index 8158c70d61..4de18b7b12 100644 --- a/drivers/usb/usbport/usb2.c +++ b/drivers/usb/usbport/usb2.c @@ -199,10 +199,6 @@ USB2_GetHsOverhead(IN PUSB2_TT_ENDPOINT TtEndpoint, *OverheadSS = HostDelay + USB2_HS_SS_INTERRUPT_IN_OVERHEAD; *OverheadCS = HostDelay + USB2_HS_CS_INTERRUPT_IN_OVERHEAD; } - - //DPRINT("USB2_GetHsOverhead: *OverheadSS - %X, *OverheadCS - %X\n", - // *OverheadSS, - // *OverheadCS); } } @@ -536,9 +532,7 @@ USB2_DeallocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint, uframe = TtEndpoint->StartMicroframe; if (TtEndpoint->StartMicroframe == 0xFF) - { USB2_GetPrevMicroFrame(&frame, &uframe); - } for (ix = 0; ix < TtEndpoint->Nums.NumStarts; ix++) { @@ -566,9 +560,7 @@ USB2_DeallocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint, uframe = TtEndpoint->StartMicroframe; if (TtEndpoint->StartMicroframe == 0xFF) - { USB2_GetPrevMicroFrame(&frame, &uframe); - } DataTime = 0; @@ -577,13 +569,9 @@ USB2_DeallocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint, 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); @@ -598,13 +586,9 @@ USB2_DeallocateHS(IN PUSB2_TT_ENDPOINT TtEndpoint, 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; @@ -727,13 +711,9 @@ USB2_CommonFrames(IN PUSB2_TT_ENDPOINT NextTtEndpoint, } if (NextTtEndpoint->ActualPeriod < TtEndpoint->ActualPeriod) - { Frame = TtEndpoint->StartFrame % TtEndpoint->ActualPeriod; - } else - { Frame = NextTtEndpoint->StartFrame % TtEndpoint->ActualPeriod; - } return (Frame == TtEndpoint->StartFrame); } @@ -821,9 +801,7 @@ USB2_GetCMASK(IN PUSB2_TT_ENDPOINT TtEndpoint) Direction = TtEndpoint->TtEndpointParams.Direction; if (DeviceSpeed == UsbHighSpeed) - { return 0; - } if (TransferType == USBPORT_TRANSFER_TYPE_INTERRUPT) { @@ -837,9 +815,7 @@ USB2_GetCMASK(IN PUSB2_TT_ENDPOINT TtEndpoint) else { if (Direction == USBPORT_TRANSFER_DIRECTION_OUT) - { return 0; - } USB2_ConvertFrame(TtEndpoint->StartFrame, TtEndpoint->StartMicroframe, @@ -856,9 +832,7 @@ USB2_GetCMASK(IN PUSB2_TT_ENDPOINT TtEndpoint) NumCompletes--; if (!NumCompletes) - { return MaskCS; - } } for (; NumCompletes; NumCompletes--) @@ -926,8 +900,8 @@ USB2_RebalanceEndpoint(IN PDEVICE_OBJECT FdoDevice, if (Endpoint->EndpointProperties.Period != NewPeriod) { + ASSERT(Endpoint->EndpointProperties.Period); Factor = USB2_FRAMES / Endpoint->EndpointProperties.Period; - ASSERT(Factor); for (ix = 0; ix < Factor; ix++) { @@ -940,8 +914,8 @@ USB2_RebalanceEndpoint(IN PDEVICE_OBJECT FdoDevice, Endpoint->EndpointProperties.ScheduleOffset = ScheduleOffset; Endpoint->EndpointProperties.UsbBandwidth = EndpointBandwidth; + ASSERT(NewPeriod); Factor = USB2_FRAMES / NewPeriod; - ASSERT(Factor); for (ix = 0; ix < Factor; ix++) { @@ -1135,13 +1109,9 @@ USB2_DeallocateEndpointBudget(IN PUSB2_TT_ENDPOINT TtEndpoint, } if (TransferType == USBPORT_TRANSFER_TYPE_INTERRUPT) - { endpoint = Tt->FrameBudget[frame].IntEndpoint; - } else - { endpoint = Tt->FrameBudget[frame].IsoEndpoint; - } nextEndpoint = endpoint->NextTtEndpoint; @@ -1481,13 +1451,9 @@ USB2_AllocateTimeForEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint, } if (Speed == UsbLowSpeed) - { TtEndpoint->CalcBusTime = TtEndpoint->MaxPacketSize * 8 + Overhead; - } else - { TtEndpoint->CalcBusTime = TtEndpoint->MaxPacketSize + Overhead; - } LatestStart = USB2_HUB_DELAY + USB2_FS_SOF_TIME; @@ -1514,9 +1480,7 @@ USB2_AllocateTimeForEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint, nextEndpoint = nextEndpoint->NextTtEndpoint) { if (USB2_CheckTtEndpointInsert(nextEndpoint, TtEndpoint)) - { break; - } prevEndpoint = nextEndpoint; } @@ -1526,8 +1490,7 @@ USB2_AllocateTimeForEndpoint(IN PUSB2_TT_ENDPOINT TtEndpoint, prevEndpoint, frame); - if (StartTime > LatestStart) - LatestStart = StartTime; + LatestStart = max(LatestStart, StartTime); } TtEndpoint->StartTime = LatestStart; @@ -2026,8 +1989,8 @@ USBPORT_AllocateBandwidthUSB2(IN PDEVICE_OBJECT FdoDevice, ScheduleOffset = Endpoint->TtEndpoint->StartFrame; EndpointProperties->ScheduleOffset = ScheduleOffset; + ASSERT(ActualPeriod); Factor = USB2_FRAMES / ActualPeriod; - ASSERT(Factor); n = ScheduleOffset * Factor; @@ -2183,9 +2146,7 @@ USBPORT_FreeBandwidthUSB2(IN PDEVICE_OBJECT FdoDevice, USB2_Rebalance(FdoDevice, &RebalanceList); if (!TtExtension) - { return; - } for (ix = 0; ix < USB2_FRAMES; ix++) {
6 years, 8 months
1
0
0
0
67/77: [USBPORT] Correcting check Period.
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c86210e8003b9af41fa9f…
commit c86210e8003b9af41fa9f33f70682e246010d06a Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Thu Jan 11 02:40:56 2018 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:58 2018 +0100 [USBPORT] Correcting check Period. --- drivers/usb/usbport/usb2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c index 92568f7e48..8158c70d61 100644 --- a/drivers/usb/usbport/usb2.c +++ b/drivers/usb/usbport/usb2.c @@ -7,7 +7,7 @@ #include "usbport.h" -//#define NDEBUG +#define NDEBUG #include <debug.h> BOOLEAN @@ -2104,8 +2104,6 @@ USBPORT_FreeBandwidthUSB2(IN PDEVICE_OBJECT FdoDevice, FdoExtension = FdoDevice->DeviceExtension; Period = Endpoint->EndpointProperties.Period; - ASSERT(Period != 0); - ScheduleOffset = Endpoint->EndpointProperties.ScheduleOffset; EndpointBandwidth = Endpoint->EndpointProperties.UsbBandwidth; @@ -2132,6 +2130,7 @@ USBPORT_FreeBandwidthUSB2(IN PDEVICE_OBJECT FdoDevice, RtlZeroMemory(Rebalance, sizeof(USB2_REBALANCE)); + ASSERT(Period != 0); Factor = USB2_FRAMES / Period; n = ScheduleOffset * Factor;
6 years, 8 months
1
0
0
0
66/77: [USBPORT] Use min(), max() macro.
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dd1297f0d0f47a6f1ac8a…
commit dd1297f0d0f47a6f1ac8a894b283308b7ecc9874 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Thu Jan 11 02:01:21 2018 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:58 2018 +0100 [USBPORT] Use min(), max() macro. --- drivers/usb/usbport/usb2.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c index 6259cf487e..92568f7e48 100644 --- a/drivers/usb/usbport/usb2.c +++ b/drivers/usb/usbport/usb2.c @@ -1821,11 +1821,8 @@ USBPORT_UpdateAllocatedBwTt(IN PUSB2_TT_EXTENSION TtExtension) { NewBusBandwidth = BusBandwidth - TtExtension->Bandwidth[ix]; - if (NewBusBandwidth > MaxBusBandwidth) - MaxBusBandwidth = NewBusBandwidth; - - if (NewBusBandwidth < MinBusBandwidth) - MinBusBandwidth = NewBusBandwidth; + MaxBusBandwidth = max(MaxBusBandwidth, NewBusBandwidth); + MinBusBandwidth = min(MinBusBandwidth, NewBusBandwidth); } TtExtension->MaxBandwidth = MaxBusBandwidth;
6 years, 8 months
1
0
0
0
65/77: [USBPORT] Check Period instead Factor.
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ab88f25048d3b34ae7039…
commit ab88f25048d3b34ae7039581368b2ac2e166376e Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Thu Jan 11 01:53:45 2018 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:58 2018 +0100 [USBPORT] Check Period instead Factor. --- drivers/usb/usbport/endpoint.c | 7 ++++--- drivers/usb/usbport/usb2.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/usb/usbport/endpoint.c b/drivers/usb/usbport/endpoint.c index 18293a763d..2e9881bff2 100644 --- a/drivers/usb/usbport/endpoint.c +++ b/drivers/usb/usbport/endpoint.c @@ -96,9 +96,10 @@ USBPORT_AllocateBandwidth(IN PDEVICE_OBJECT FdoDevice, TotalBusBandwidth = FdoExtension->TotalBusBandwidth; EndpointBandwidth = EndpointProperties->UsbBandwidth; + Period = EndpointProperties->Period; + ASSERT(Period != 0); Factor = USB2_FRAMES / Period; - ASSERT(Factor); for (Offset = 0; Offset < Period; Offset++) { @@ -197,9 +198,9 @@ USBPORT_FreeBandwidth(IN PDEVICE_OBJECT FdoDevice, Offset = Endpoint->EndpointProperties.ScheduleOffset; EndpointBandwidth = Endpoint->EndpointProperties.UsbBandwidth; - Period = Endpoint->EndpointProperties.Period; - ASSERT(USB2_FRAMES / Period); + Period = Endpoint->EndpointProperties.Period; + ASSERT(Period != 0); for (Factor = USB2_FRAMES / Period; Factor; Factor--) { diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c index a382d519bb..6259cf487e 100644 --- a/drivers/usb/usbport/usb2.c +++ b/drivers/usb/usbport/usb2.c @@ -2107,6 +2107,8 @@ USBPORT_FreeBandwidthUSB2(IN PDEVICE_OBJECT FdoDevice, FdoExtension = FdoDevice->DeviceExtension; Period = Endpoint->EndpointProperties.Period; + ASSERT(Period != 0); + ScheduleOffset = Endpoint->EndpointProperties.ScheduleOffset; EndpointBandwidth = Endpoint->EndpointProperties.UsbBandwidth; @@ -2134,8 +2136,6 @@ USBPORT_FreeBandwidthUSB2(IN PDEVICE_OBJECT FdoDevice, RtlZeroMemory(Rebalance, sizeof(USB2_REBALANCE)); Factor = USB2_FRAMES / Period; - ASSERT(Factor); - n = ScheduleOffset * Factor; TtExtension = Endpoint->TtExtension;
6 years, 8 months
1
0
0
0
64/77: [USBPORT] Proper naming.
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=954cc021dad0497937244…
commit 954cc021dad049793724487124b6bc5f12c18b29 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Thu Jan 11 01:44:38 2018 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:57 2018 +0100 [USBPORT] Proper naming. --- drivers/usb/usbport/endpoint.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/usbport/endpoint.c b/drivers/usb/usbport/endpoint.c index e599e87b50..18293a763d 100644 --- a/drivers/usb/usbport/endpoint.c +++ b/drivers/usb/usbport/endpoint.c @@ -151,11 +151,11 @@ USBPORT_AllocateBandwidth(IN PDEVICE_OBJECT FdoDevice, } } - DPRINT("USBPORT_AllocateBandwidth: FIXME AllocedInterrupt_XXms\n"); + DPRINT("USBPORT_AllocateBandwidth: FIXME AllocatedInterrupt_XXms\n"); } else { - DPRINT("USBPORT_AllocateBandwidth: FIXME AllocedIso\n"); + DPRINT("USBPORT_AllocateBandwidth: FIXME AllocatedIso\n"); } } @@ -219,11 +219,11 @@ USBPORT_FreeBandwidth(IN PDEVICE_OBJECT FdoDevice, ASSERT(Period != 0); - DPRINT("USBPORT_AllocateBandwidth: FIXME AllocedInterrupt_XXms\n"); + DPRINT("USBPORT_AllocateBandwidth: FIXME AllocatedInterrupt_XXms\n"); } else { - DPRINT("USBPORT_AllocateBandwidth: FIXME AllocedIso\n"); + DPRINT("USBPORT_AllocateBandwidth: FIXME AllocatedIso\n"); } DPRINT1("USBPORT_FreeBandwidth: FIXME USBPORT_UpdateAllocatedBw\n");
6 years, 8 months
1
0
0
0
63/77: [USBPORT] Use min() macro.
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=18f4fc71c85ac817d224d…
commit 18f4fc71c85ac817d224d6b5b30b4742a2e71cba Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Thu Jan 11 01:31:47 2018 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:57 2018 +0100 [USBPORT] Use min() macro. --- drivers/usb/usbport/endpoint.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/usb/usbport/endpoint.c b/drivers/usb/usbport/endpoint.c index 8bf9ca9cf7..e599e87b50 100644 --- a/drivers/usb/usbport/endpoint.c +++ b/drivers/usb/usbport/endpoint.c @@ -107,10 +107,7 @@ USBPORT_AllocateBandwidth(IN PDEVICE_OBJECT FdoDevice, for (ix = 1; *Bandwidth >= EndpointBandwidth; ix++) { - if (MinBandwidth > *Bandwidth) - { - MinBandwidth = *Bandwidth; - } + MinBandwidth = min(MinBandwidth, *Bandwidth); Bandwidth++;
6 years, 8 months
1
0
0
0
62/77: [USBPORT] Fixing calculation pointer for FdoExtension->Usb2Extension.
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9426d2986de5174b73bf4…
commit 9426d2986de5174b73bf470372bfc84fcd6bdb95 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Mon Dec 25 15:19:43 2017 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:56 2018 +0100 [USBPORT] Fixing calculation pointer for FdoExtension->Usb2Extension. --- drivers/usb/usbport/usbport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/usbport/usbport.c b/drivers/usb/usbport/usbport.c index 1dbe779daa..3be8e951ef 100644 --- a/drivers/usb/usbport/usbport.c +++ b/drivers/usb/usbport/usbport.c @@ -1907,8 +1907,8 @@ USBPORT_AddDevice(IN PDRIVER_OBJECT DriverObject, if (MiniPortInterface->Packet.MiniPortFlags & USB_MINIPORT_FLAGS_USB2) { FdoExtension->Usb2Extension = - (PUSB2_HC_EXTENSION)FdoExtension->MiniPortExt + - MiniPortInterface->Packet.MiniPortExtensionSize; + (PUSB2_HC_EXTENSION)((ULONG_PTR)FdoExtension->MiniPortExt + + MiniPortInterface->Packet.MiniPortExtensionSize); DPRINT("USBPORT_AddDevice: Usb2Extension - %p\n", FdoExtension->Usb2Extension);
6 years, 8 months
1
0
0
0
61/77: [USBPORT] Implement USBPORT_FreeBandwidthUSB2().
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7b92b8a6e241b323cbddf…
commit 7b92b8a6e241b323cbddfec8a57f1ecf2a557281 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Sun Dec 17 18:57:34 2017 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:56 2018 +0100 [USBPORT] Implement USBPORT_FreeBandwidthUSB2(). --- drivers/usb/usbport/usb2.c | 124 ++++++++++++++++++++++++++++++++++++++++-- drivers/usb/usbport/usbport.h | 1 + 2 files changed, 121 insertions(+), 4 deletions(-) diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c index c0a218b867..a382d519bb 100644 --- a/drivers/usb/usbport/usb2.c +++ b/drivers/usb/usbport/usb2.c @@ -1075,13 +1075,14 @@ USB2_DeallocateEndpointBudget(IN PUSB2_TT_ENDPOINT TtEndpoint, USHORT Period; BOOLEAN IsMoved = FALSE; - DPRINT("USB2_DeallocateEndpointBudget: TtEndpoint - %p, MaxFrames - %X\n", + DPRINT("USB2_DeallocateEndpointBudget: TtEndpoint - %p, MaxFrames - %X, CalcBusTime - %X\n", TtEndpoint, - MaxFrames); + MaxFrames, + TtEndpoint->CalcBusTime); if (TtEndpoint->CalcBusTime == 0) { - DPRINT("USB2_DeallocateEndpointBudget: endpoint not allocated\n");//error((int)"endpoint not allocated"); + DPRINT("USB2_DeallocateEndpointBudget: TtEndpoint not allocated!\n"); return FALSE; } @@ -2087,7 +2088,122 @@ NTAPI USBPORT_FreeBandwidthUSB2(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_ENDPOINT Endpoint) { - DPRINT1("USBPORT_FreeBandwidthUSB2: UNIMPLEMENTED. FIXME. \n"); + PUSBPORT_DEVICE_EXTENSION FdoExtension; + ULONG Period; + ULONG ScheduleOffset; + ULONG EndpointBandwidth; + LIST_ENTRY RebalanceList; + ULONG TransferType; + PUSB2_REBALANCE Rebalance; + ULONG RebalanceListEntries; + ULONG Factor; + ULONG ix; + ULONG n; + PUSB2_TT_EXTENSION TtExtension; + PUSB2_TT_ENDPOINT RebalanceTtEndpoint; + + DPRINT("USBPORT_FreeBandwidthUSB2: Endpoint - %p\n", Endpoint); + + FdoExtension = FdoDevice->DeviceExtension; + + Period = Endpoint->EndpointProperties.Period; + ScheduleOffset = Endpoint->EndpointProperties.ScheduleOffset; + EndpointBandwidth = Endpoint->EndpointProperties.UsbBandwidth; + + InitializeListHead(&RebalanceList); + + TransferType = Endpoint->EndpointProperties.TransferType; + + if (TransferType == USBPORT_TRANSFER_TYPE_CONTROL || + TransferType == USBPORT_TRANSFER_TYPE_BULK || + (Endpoint->Flags & ENDPOINT_FLAG_ROOTHUB_EP0)) + { + return; + } + + Rebalance = ExAllocatePoolWithTag(NonPagedPool, + sizeof(USB2_REBALANCE), + USB_PORT_TAG); + + if (!Rebalance) + { + DPRINT1("USBPORT_FreeBandwidthUSB2: Rebalance == NULL!\n"); + return; + } + + RtlZeroMemory(Rebalance, sizeof(USB2_REBALANCE)); + + Factor = USB2_FRAMES / Period; + ASSERT(Factor); + + n = ScheduleOffset * Factor; + + TtExtension = Endpoint->TtExtension; + + if (TtExtension) + { + for (ix = 0; ix < Factor; ix++) + { + TtExtension->Bandwidth[n + ix] += EndpointBandwidth; + } + } + else + { + for (ix = 1; ix < Factor; ix++) + { + FdoExtension->Bandwidth[n + ix] += EndpointBandwidth; + } + } + + RebalanceListEntries = USB2_FRAMES - 2; + + USB2_DeallocateEndpointBudget(Endpoint->TtEndpoint, + Rebalance, + &RebalanceListEntries, + USB2_FRAMES); + + RebalanceListEntries = 0; + + for (ix = 0; Rebalance->RebalanceEndpoint[ix]; ix++) + { + RebalanceListEntries = ix + 1; + } + + for (ix = 0; ix < RebalanceListEntries; ix++) + { + RebalanceTtEndpoint = Rebalance->RebalanceEndpoint[ix]; + + DPRINT("USBPORT_AllocateBandwidthUSB2: RebalanceTtEndpoint[%X] - %p, RebalanceTtEndpoint - %p, RebalanceLink - %p\n", + ix, + RebalanceTtEndpoint, + &RebalanceTtEndpoint->Endpoint->RebalanceLink); + + InsertTailList(&RebalanceList, + &RebalanceTtEndpoint->Endpoint->RebalanceLink); + } + + ExFreePoolWithTag(Rebalance, USB_PORT_TAG); + + USB2_Rebalance(FdoDevice, &RebalanceList); + + if (!TtExtension) + { + return; + } + + for (ix = 0; ix < USB2_FRAMES; ix++) + { + FdoExtension->Bandwidth[ix] += TtExtension->MaxBandwidth; + } + + USBPORT_UpdateAllocatedBwTt(TtExtension); + + for (ix = 0; ix < USB2_FRAMES; ix++) + { + FdoExtension->Bandwidth[ix] -= TtExtension->MaxBandwidth; + } + + DPRINT1("USBPORT_FreeBandwidthUSB2: exit\n"); } VOID diff --git a/drivers/usb/usbport/usbport.h b/drivers/usb/usbport/usbport.h index b98ac15e00..682e4e1f74 100644 --- a/drivers/usb/usbport/usbport.h +++ b/drivers/usb/usbport/usbport.h @@ -508,6 +508,7 @@ typedef struct _USB2_TT_ENDPOINT { struct _USB2_TT_ENDPOINT * NextTtEndpoint; USB2_TT_ENDPOINT_PARAMS TtEndpointParams; USB2_TT_ENDPOINT_NUMS Nums; + BOOL IsPromoted; USHORT MaxPacketSize; USHORT PreviosPeriod; USHORT Period;
6 years, 8 months
1
0
0
0
60/77: [USBPORT] Correcting USB2_DeallocateEndpointBudget().
by Vadim Galyant
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=57f092106a86643726140…
commit 57f092106a86643726140a60cb2e217d2496c816 Author: Vadim Galyant <vgal(a)rambler.ru> AuthorDate: Sun Dec 17 14:54:46 2017 +0900 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Sun Jan 21 19:35:56 2018 +0100 [USBPORT] Correcting USB2_DeallocateEndpointBudget(). --- drivers/usb/usbport/usb2.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/usb/usbport/usb2.c b/drivers/usb/usbport/usb2.c index cfaf122fba..c0a218b867 100644 --- a/drivers/usb/usbport/usb2.c +++ b/drivers/usb/usbport/usb2.c @@ -1057,11 +1057,23 @@ USB2_DeallocateEndpointBudget(IN PUSB2_TT_ENDPOINT TtEndpoint, PUSB2_TT Tt; PUSB2_HC_EXTENSION HcExtension; ULONG Speed; + ULONG TransferType; + ULONG Frame; ULONG StartMicroframe; ULONG ix; - + PUSB2_TT_ENDPOINT endpoint; + PUSB2_TT_ENDPOINT nextEndpoint; + PUSB2_TT_ENDPOINT lastEndpoint; + PUSB2_TT_ENDPOINT tmpEndpoint; + ULONG endTime; + ULONG maxEndTime; + ULONG lastEndTime; + ULONG Factor; + ULONG jx; UCHAR frame; UCHAR uframe; + USHORT Period; + BOOLEAN IsMoved = FALSE; DPRINT("USB2_DeallocateEndpointBudget: TtEndpoint - %p, MaxFrames - %X\n", TtEndpoint,
6 years, 8 months
1
0
0
0
← Newer
1
2
3
4
5
6
...
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