/** @file\r
- Copyright (c) 2006, Intel Corporation\r
- All rights reserved. This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
Module Name: AtapiPassThru.h\r
\r
#include <Library/PcdLib.h>\r
#include <Library/DevicePathLib.h>\r
\r
-#include <IndustryStandard/Pci22.h>\r
-\r
-\r
-///\r
-/// bit definition\r
-///\r
-#define bit(a) (1 << (a))\r
+#include <IndustryStandard/Pci.h>\r
\r
#define MAX_TARGET_ID 4\r
\r
UINT16 DriveAddress;\r
} IDE_BASE_REGISTERS;\r
\r
-#define ATAPI_SCSI_PASS_THRU_DEV_SIGNATURE EFI_SIGNATURE_32 ('a', 's', 'p', 't')\r
+#define ATAPI_SCSI_PASS_THRU_DEV_SIGNATURE SIGNATURE_32 ('a', 's', 'p', 't')\r
\r
typedef struct {\r
UINTN Signature;\r
//\r
// ATA Err Reg bitmap\r
//\r
-#define BBK_ERR bit (7) ///< Bad block detected\r
-#define UNC_ERR bit (6) ///< Uncorrectable Data\r
-#define MC_ERR bit (5) ///< Media Change\r
-#define IDNF_ERR bit (4) ///< ID Not Found\r
-#define MCR_ERR bit (3) ///< Media Change Requested\r
-#define ABRT_ERR bit (2) ///< Aborted Command\r
-#define TK0NF_ERR bit (1) ///< Track 0 Not Found\r
-#define AMNF_ERR bit (0) ///< Address Mark Not Found\r
+#define BBK_ERR BIT7 ///< Bad block detected\r
+#define UNC_ERR BIT6 ///< Uncorrectable Data\r
+#define MC_ERR BIT5 ///< Media Change\r
+#define IDNF_ERR BIT4 ///< ID Not Found\r
+#define MCR_ERR BIT3 ///< Media Change Requested\r
+#define ABRT_ERR BIT2 ///< Aborted Command\r
+#define TK0NF_ERR BIT1 ///< Track 0 Not Found\r
+#define AMNF_ERR BIT0 ///< Address Mark Not Found\r
\r
//\r
// ATAPI Err Reg bitmap\r
//\r
-#define SENSE_KEY_ERR (bit (7) | bit (6) | bit (5) | bit (4))\r
-#define EOM_ERR bit (1) ///< End of Media Detected\r
-#define ILI_ERR bit (0) ///< Illegal Length Indication\r
+#define SENSE_KEY_ERR (BIT7 | BIT6 | BIT5 | BIT4)\r
+#define EOM_ERR BIT1 ///< End of Media Detected\r
+#define ILI_ERR BIT0 ///< Illegal Length Indication\r
\r
//\r
// Device/Head Reg\r
//\r
-#define LBA_MODE bit (6)\r
-#define DEV bit (4)\r
-#define HS3 bit (3)\r
-#define HS2 bit (2)\r
-#define HS1 bit (1)\r
-#define HS0 bit (0)\r
+#define LBA_MODE BIT6\r
+#define DEV BIT4\r
+#define HS3 BIT3\r
+#define HS2 BIT2\r
+#define HS1 BIT1\r
+#define HS0 BIT0\r
#define CHS_MODE (0)\r
#define DRV0 (0)\r
#define DRV1 (1)\r
//\r
// Status Reg\r
//\r
-#define BSY bit (7) ///< Controller Busy\r
-#define DRDY bit (6) ///< Drive Ready\r
-#define DWF bit (5) ///< Drive Write Fault\r
-#define DSC bit (4) ///< Disk Seek Complete\r
-#define DRQ bit (3) ///< Data Request\r
-#define CORR bit (2) ///< Corrected Data\r
-#define IDX bit (1) ///< Index\r
-#define ERR bit (0) ///< Error\r
-#define CHECK bit (0) ///< Check bit for ATAPI Status Reg\r
+#define BSY BIT7 ///< Controller Busy\r
+#define DRDY BIT6 ///< Drive Ready\r
+#define DWF BIT5 ///< Drive Write Fault\r
+#define DSC BIT4 ///< Disk Seek Complete\r
+#define DRQ BIT3 ///< Data Request\r
+#define CORR BIT2 ///< Corrected Data\r
+#define IDX BIT1 ///< Index\r
+#define ERR BIT0 ///< Error\r
+#define CHECK BIT0 ///< Check bit for ATAPI Status Reg\r
\r
//\r
// Device Control Reg\r
//\r
-#define SRST bit (2) ///< Software Reset\r
-#define IEN_L bit (1) ///< Interrupt Enable\r
+#define SRST BIT2 ///< Software Reset\r
+#define IEN_L BIT1 ///< Interrupt Enable\r
\r
//\r
// ATAPI Feature Register\r
//\r
-#define OVERLAP bit (1)\r
-#define DMA bit (0)\r
+#define OVERLAP BIT1\r
+#define DMA BIT0\r
\r
//\r
// ATAPI Interrupt Reason Reson Reg (ATA Sector Count Register)\r
//\r
-#define RELEASE bit (2)\r
-#define IO bit (1)\r
-#define CoD bit (0)\r
+#define RELEASE BIT2\r
+#define IO BIT1\r
+#define CoD BIT0\r
\r
#define PACKET_CMD 0xA0\r
\r
languages specified in SupportedLanguages. The\r
number of languages supported by a driver is up\r
to the driver writer. Language is specified\r
- in RFC 3066 or ISO 639-2 language code format.\r
+ in RFC 4646 or ISO 639-2 language code format.\r
\r
@param DriverName[out] A pointer to the Unicode string to return.\r
This Unicode string is the name of the\r
languages specified in SupportedLanguages. The\r
number of languages supported by a driver is up\r
to the driver writer. Language is specified in\r
- RFC 3066 or ISO 639-2 language code format.\r
+ RFC 4646 or ISO 639-2 language code format.\r
\r
@param ControllerName[out] A pointer to the Unicode string to return.\r
This Unicode string is the name of the\r
driver specified by This was returned in\r
DriverName.\r
\r
- @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+ @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.\r
\r
@retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r
EFI_HANDLE.\r
\r
Routine Description:\r
\r
- Sumbit request sense command\r
+ Submit request sense command\r
\r
Arguments:\r
\r
- AtapiScsiPrivate - The pionter of ATAPI_SCSI_PASS_THRU_DEV\r
+ AtapiScsiPrivate - The pointer of ATAPI_SCSI_PASS_THRU_DEV\r
Target - The target ID\r
Timeout - The time to complete the command\r
SenseData - The buffer to fill in sense data\r