summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg: Improve formatting of DEBUG messages in UsbBusDxeRebecca Cran2023-03-071-1/+1
| | | | | | | | Improve the formatting of DEBUG messages in UsbBusDxe by adding a hyphen to separate the EFI_STATUS code. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Fix imbalanced debug macrosMichael Kubacki2022-09-091-4/+4
| | | | | | | | | | | | | | | | | | | Updates debug macros in the package that have an imbalanced number of print specifiers to arguments. These changes try to preserve what was likely intended by the author. In cases information was missing due to the bug, the specifier may be removed since it was not previously accurately printing the expected value. Cc: Dandan Bi <dandan.bi@intel.com> Cc: Guomin Jiang <guomin.jiang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg: Apply uncrustify changesMichael Kubacki2021-12-071-163/+169
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdeModulePkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg: Change use of EFI_D_* to DEBUG_*Michael D Kinney2021-12-071-39/+39
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3739 Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg/UsbBus: Fix various typosAntoine Coeur2020-02-101-1/+1
| | | | | | | | | | | | | Fix various typos in comments and documentation. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Antoine Coeur <coeur@gmx.fr> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Acked-by: Liming Gao <liming.gao@intel.com> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com> Message-Id: <20200207010831.9046-22-philmd@redhat.com>
* MdeModulePkg: fix UninstallMultipleProtocolInterfaces() callsLaszlo Ersek2019-10-091-1/+1
| | | | | | | | | | | | | | | | | | Unlike the InstallMultipleProtocolInterfaces() boot service, which takes an (EFI_HANDLE*) as first parameter, the UninstallMultipleProtocolInterfaces() boot service takes an EFI_HANDLE as first parameter. These are actual bugs. They must have remained hidden until now because they are on error paths. Fix the UninstallMultipleProtocolInterfaces() calls. Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/UsbBusDxe: Return error when the device is not presentMarcin Wojtas2019-08-051-0/+1
| | | | | | | | | | | Until now, during the USB device enumeration when its PortState USB_PORT_STAT_CONNECTION bit was not set, the stack was not informed that the device is not present. Fix that by returning appropriate error code. Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-091-7/+1
| | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg: Clean up source filesLiming Gao2018-06-281-30/+30
| | | | | | | | | | 1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/UsbBusDxe: log warning message at DEBUG_WARN levelLaszlo Ersek2017-09-111-1/+5
| | | | | | | | | | | | "UsbSelectConfig: failed to connect driver %r, ignored" is an error message, but it states at once that the error condition will not affect the control flow. Degrade the report to DEBUG_WARN. Cc: Star Zeng <star.zeng@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/UsbBus: Fix system hang when failed to uninstall UsbIoRuiyu Ni2017-06-021-16/+27
| | | | | | | | | | | | | | | | | | | | | | | When "reconnect -r" is typed in shell, UsbFreeInterface() is called to uninstall the UsbIo and DevicePath. But When a UsbIo is opened by a driver and that driver rejects to close the UsbIo in Stop(), the uninstall doesn't succeed. But UsbFreeInterface () frees the DevicePath memory without check whether the uninstall succeeds. It leads to the DXE core database contain a DevicePath instance but that instance's memory is freed. Assertion happens when someone calls InstallProtocol(DevicePath) because the InstallProtocol() checks all DevicePath instance to find whether the same one exits in database. We haven't seen any USB device driver which rejects to close UsbIo in Stop(), but it's very likely. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/UsbBus: reduce the port status polling before port resetFeng Tian2016-07-251-10/+18
| | | | | | | | | | | | | | | | | | This change is used to remove the port status polling in port reset functions. Why it's needed is because: 1) The same polling on same port has taken place prior to this removed one. See UsbEnumeratePort()->GetPortStatus(). So this polling in UsbEnumerateNewDev()->ResetPort() is redundant. 2) EDKII Xhci driver hooks all GetPortStatus() operations. If we don't remove this one, XHCI driver's XhcPollPortStatusChange() may enter twice in reset process and wrongly think the device is unplugged. Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg/UsbBusDxe: Update Device->NumOfInterface at error handling path ↵Feng Tian2014-09-181-1/+2
| | | | | | | | | | | to avoid system hang when DisconnectController is invoked to free resource occupied by usb device whose interface descriptor format doesn't follow usb spec. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16128 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg/UsbBusDxe: Fixed Clang build error.Nikolai Saoukh2014-09-101-1/+1
| | | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Nikolai Saoukh <nms@otdel-1.org> Reviewed-by: Feng Tian <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16084 6f19259b-4bc3-4df7-8a09-765794883524
* MdeMdeModulePkg/UsbBusDxe: If DisconnectController() returns an error the ↵Feng Tian2013-10-301-18/+58
| | | | | | | | | | | USB Bus Driver would retry the DisconnectController() from a timer event until it succeeds Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14819 6f19259b-4bc3-4df7-8a09-765794883524
* Fix several DEBUG_ERROR messages that are unnecessarily verbose. Several of ↵Samer El-Haj-Mahmoud2013-10-081-1/+1
| | | | | | | | | | | these are marked as DEBUG_ERROR when they are really not errors. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hp.com> reviewed-by: Zeng, Star <star.zeng@intel.com> reviewed-by: Tian, Feng <feng.tian@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14751 6f19259b-4bc3-4df7-8a09-765794883524
* MdeMdeModulePkg/UsbBusDxe: Fixed a possible memory leak bug introduced at r14226erictian2013-04-071-5/+14
| | | | | | | | | | | The r14226 check-in indeed has memory leak in allocated "Child" pointer. UsbBusDriverBindingStop() may dereference this pointer and may bring exception on invalid memory access Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14251 6f19259b-4bc3-4df7-8a09-765794883524
* MdeMdeModulePkg/Usb: Fixed two usb issueserictian2013-03-291-4/+1
| | | | | | | | | | | 1.Fix the bug in interface parser logic for usb camera device. Reserve device address if the device doesn’t get disconnected. 2.Some usb 1.1 devices require the context evaluation immediately with actual max packet size after detecting the device max packet size. Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Elvin Li <elvin.li@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14226 6f19259b-4bc3-4df7-8a09-765794883524
* Add missing status code in several modules.li-elvin2012-10-301-0/+8
| | | | | | | | | | | | Signed-off-by: Li Elvin <elvin.li@intel.com> Reviewed-by: Yao Jiewen <jiewen.yao@intel.com> Reviewed-by: Ni Ruiyu <ruiyu.ni@intel.com> Reviewed-by: Gao Liming <liming.gao@intel.com> Reviewed-by: Tian Feng <feng.tian@intel.com> Reviewed-by: Fan Jeff <jeff.fan@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13890 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg/UsbBusDxe:Correct typos in usb debug messageerictian2012-03-301-2/+2
| | | | | | | | Signed-off-by: erictian Reviewed-by: rsun3 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13155 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg/XhciDxe: Event Ring traverse algorithm enhancement to avoid ↵erictian2012-03-271-1/+1
| | | | | | | | | | that those completed async transfer events don't get handled in time and are flushed by newer coming events. Signed-off-by: erictian Reviewed-by: li-elvin git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13145 6f19259b-4bc3-4df7-8a09-765794883524
* MdeModulePkg: add support for ORICO PEUS3-2P carderictian2012-03-071-14/+11
| | | | | | | | | | | 1) Fix a bug on missing hub context evaluation operation. 2) If the usb keyboard device configuration has been set successfully, then don’t set configuration again. Signed-off-by: erictian Reviewed-by: li-elvin git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13087 6f19259b-4bc3-4df7-8a09-765794883524
* 1) remove wrong global variable usage because it will bring data corrupt if ↵erictian2011-09-141-9/+10
| | | | | | | | | | | | there are multiple XHCI host controllers. 2) coding style clean up. Signed-off-by: erictian Reviewed-by: ydong10 Reviewed-by: jshi19 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12351 6f19259b-4bc3-4df7-8a09-765794883524
* Fixed build error reported by ICC and GCCerictian2011-08-251-1/+1
| | | | | | | | Signed-off-by: erictian Reviewed-by: li-elvin git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12209 6f19259b-4bc3-4df7-8a09-765794883524
* Enabling usb3.0 XHCI support.erictian2011-08-231-36/+47
| | | | | | | Signed-off-by: erictian Reviewed-by: jshi19 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12185 6f19259b-4bc3-4df7-8a09-765794883524
* Update the copyright notice formathhtian2010-04-241-2/+2
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10420 6f19259b-4bc3-4df7-8a09-765794883524
* In various archs, Processor memory address may not be same with Pci memory ↵eric_tian2009-09-141-2/+2
| | | | | | address. For usb host controller, we should use pci memory address to initialize framelist register and all address field in QH/TD. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9259 6f19259b-4bc3-4df7-8a09-765794883524
* add assert logic to avoid Klocwork fake reporteric_tian2009-02-121-0/+1
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7513 6f19259b-4bc3-4df7-8a09-765794883524
* add assert logic to avoid Klocwork fake reporteric_tian2009-02-121-6/+12
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7511 6f19259b-4bc3-4df7-8a09-765794883524
* 3) Doxygen comment cleanup.qwang122009-02-041-12/+0
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7430 6f19259b-4bc3-4df7-8a09-765794883524
* Check Library usage and fix some typo.gikidy2008-12-261-8/+11
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7137 6f19259b-4bc3-4df7-8a09-765794883524
* Coding style checkedjji42008-12-261-1/+1
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7136 6f19259b-4bc3-4df7-8a09-765794883524
* check the usage of %d,%x,%ld,%lx and so on in debug print statement.jji42008-12-181-4/+4
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7080 6f19259b-4bc3-4df7-8a09-765794883524
* modify coding style to pass ecc tool and provide comments that complied with ↵eric_tian2008-07-091-80/+58
| | | | | | Doxgen. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5436 6f19259b-4bc3-4df7-8a09-765794883524
* Clean up for GCC and Intel ICC build.qwang122008-06-261-1/+1
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5373 6f19259b-4bc3-4df7-8a09-765794883524
* [Description]:vanjeff2008-06-251-3/+4
| | | | | | | | | | | | | | | | Sync 3 trackers. 1. A bug that may cause the low/full speed device behind 2.0 hub will not work. 2. MajorRevision and MinorRevision need updating. 3. Misuse UhciConvertPollRate in UHCI driver. [Impaction]: EhicDxe, UhciDxe and UsbBusDxe. [Reference Info]: EDK tracker 1122 - A bug that may cause the low/full speed device behind 2.0 hub will not work . EDK tracker 1101 - Phoenix found issue in USB and Misuse UhciConvertPollRate in UHCI driver. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5370 6f19259b-4bc3-4df7-8a09-765794883524
* De-unicode in comment for all source files.qhuang82008-05-271-3/+3
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5302 6f19259b-4bc3-4df7-8a09-765794883524
* Enhance the Usb bus driver to support Star with Remaining device path.vanjeff2007-12-261-8/+14
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4437 6f19259b-4bc3-4df7-8a09-765794883524
* Fixed unexpected timeout in Usb MassStorage Driver.yshang12007-10-081-35/+25
| | | | | | Fixed unexpected timeout in Uhci/Ehci driver. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4038 6f19259b-4bc3-4df7-8a09-765794883524
* Added EFIAPI to eventAJFISH2007-08-301-0/+1
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3748 6f19259b-4bc3-4df7-8a09-765794883524
* Merge in some fix from R8 on USB Bus driver:qwang122007-08-201-35/+35
| | | | | | | | 1) Signal event immediately after HUB UsbRootHubEnumeration event is installed 2) Move UsbHcReset and UsbHcSetState before mUsbRootHubApi.Init 3) Change USB_DEBUG and USB_ERROR to R9 DEBUG macro. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3680 6f19259b-4bc3-4df7-8a09-765794883524
* Sync USB modules with main trunk.vanjeff2007-07-241-26/+57
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3423 6f19259b-4bc3-4df7-8a09-765794883524
* 1. Fixed tools_def.template to meet ICC build for IA32vanjeff2007-07-171-1/+1
| | | | | | 2. Modified some source files to meet ICC build for IA32 and IPF. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3271 6f19259b-4bc3-4df7-8a09-765794883524
* fixed memcpy link issue.vanjeff2007-07-121-1/+6
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3203 6f19259b-4bc3-4df7-8a09-765794883524
* Import Usb/UsbBusDxe and Usb/UsbMassStorageDxe into MdeModulePkg.vanjeff2007-07-111-0/+991
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3193 6f19259b-4bc3-4df7-8a09-765794883524