]>
Commit | Line | Data |
---|---|---|
8dde1f6e | 1 | /** @file\r |
2 | Definitions for ASIX AX88772 Ethernet adapter.\r | |
3 | \r | |
bce3e2ab HT |
4 | Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r |
5 | This program and the accompanying materials\r | |
8dde1f6e | 6 | are licensed and made available under the terms and conditions of the BSD License\r |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _AX88772_H_\r | |
16 | #define _AX88772_H_\r | |
17 | \r | |
18 | #include <Uefi.h>\r | |
19 | \r | |
20 | #include <Guid/EventGroup.h>\r | |
21 | #include <Guid/NicIp4ConfigNvData.h>\r | |
22 | \r | |
23 | #include <IndustryStandard/Pci.h>\r | |
24 | \r | |
25 | #include <Library/BaseMemoryLib.h>\r | |
26 | #include <Library/DebugLib.h>\r | |
27 | #include <Library/DevicePathLib.h>\r | |
28 | #include <Library/UefiBootServicesTableLib.h>\r | |
29 | #include <Library/UefiDriverEntryPoint.h>\r | |
30 | #include <Library/UefiLib.h>\r | |
31 | #include <Library/UefiRuntimeLib.h>\r | |
32 | \r | |
33 | #include <Protocol/DevicePath.h>\r | |
34 | #include <Protocol/LoadedImage.h>\r | |
35 | #include <Protocol/NetworkInterfaceIdentifier.h>\r | |
36 | #include <Protocol/SimpleNetwork.h>\r | |
37 | #include <Protocol/UsbIo.h>\r | |
38 | \r | |
39 | //------------------------------------------------------------------------------\r | |
40 | // Macros\r | |
41 | //------------------------------------------------------------------------------\r | |
4986bbaf YP |
42 | //\r |
43 | //Too many output debug info hangs system in Debug tip\r | |
44 | //\r | |
45 | //#if defined(_MSC_VER) /* Handle Microsoft VC++ compiler specifics. */\r | |
46 | //#define DBG_ENTER() DEBUG (( DEBUG_INFO, "Entering " __FUNCTION__ "\n" )) ///< Display routine entry\r | |
47 | //#define DBG_EXIT() DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ "\n" )) ///< Display routine exit\r | |
48 | //#define DBG_EXIT_DEC(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: %d\n", Status )) ///< Display routine exit with decimal value\r | |
49 | //#define DBG_EXIT_HEX(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: 0x%08x\n", Status )) ///< Display routine exit with hex value\r | |
50 | //#define DBG_EXIT_STATUS(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", Status: %r\n", Status )) ///< Display routine exit with status value\r | |
51 | //#define DBG_EXIT_TF(Status) DEBUG (( DEBUG_INFO, "Exiting " __FUNCTION__ ", returning %s\n", (FALSE == Status) ? L"FALSE" : L"TRUE" )) ///< Display routine with TRUE/FALSE value\r | |
52 | //#else // _MSC_VER\r | |
8dde1f6e | 53 | #define DBG_ENTER() ///< Display routine entry\r |
54 | #define DBG_EXIT() ///< Display routine exit\r | |
55 | #define DBG_EXIT_DEC(Status) ///< Display routine exit with decimal value\r | |
56 | #define DBG_EXIT_HEX(Status) ///< Display routine exit with hex value\r | |
57 | #define DBG_EXIT_STATUS(Status) ///< Display routine exit with status value\r | |
58 | #define DBG_EXIT_TF(Status) ///< Display routine with TRUE/FALSE value\r | |
4986bbaf | 59 | //#endif // _MSC_VER\r |
8dde1f6e | 60 | \r |
61 | #define USB_IS_IN_ENDPOINT(EndPointAddr) (((EndPointAddr) & BIT7) != 0) ///< Return TRUE/FALSE for IN direction\r | |
62 | #define USB_IS_OUT_ENDPOINT(EndPointAddr) (((EndPointAddr) & BIT7) == 0) ///< Return TRUE/FALSE for OUT direction\r | |
63 | #define USB_IS_BULK_ENDPOINT(Attribute) (((Attribute) & (BIT0 | BIT1)) == USB_ENDPOINT_BULK) ///< Return TRUE/FALSE for BULK type\r | |
64 | #define USB_IS_INTERRUPT_ENDPOINT(Attribute) (((Attribute) & (BIT0 | BIT1)) == USB_ENDPOINT_INTERRUPT) ///< Return TRUE/FALSE for INTERRUPT type\r | |
65 | \r | |
66 | //------------------------------------------------------------------------------\r | |
67 | // Constants\r | |
68 | //------------------------------------------------------------------------------\r | |
69 | \r | |
70 | #define DEBUG_RX_BROADCAST 0x40000000 ///< Display RX broadcast messages\r | |
71 | #define DEBUG_RX_MULTICAST 0x20000000 ///< Display RX multicast messages\r | |
72 | #define DEBUG_RX_UNICAST 0x10000000 ///< Display RX unicast messages\r | |
73 | #define DEBUG_MAC_ADDRESS 0x08000000 ///< Display the MAC address\r | |
74 | #define DEBUG_LINK 0x04000000 ///< Display the link status\r | |
75 | #define DEBUG_TX 0x02000000 ///< Display the TX messages\r | |
76 | #define DEBUG_PHY 0x01000000 ///< Display the PHY register values\r | |
77 | #define DEBUG_SROM 0x00800000 ///< Display the SROM contents\r | |
78 | #define DEBUG_TIMER 0x00400000 ///< Display the timer routine entry/exit\r | |
79 | #define DEBUG_TPL 0x00200000 ///< Display the timer routine entry/exit\r | |
80 | \r | |
81 | #define AX88772_MAX_PKT_SIZE ( 2048 - 4 ) ///< Maximum packet size\r | |
82 | #define ETHERNET_HEADER_SIZE sizeof ( ETHERNET_HEADER ) ///< Size in bytes of the Ethernet header\r | |
83 | #define MIN_ETHERNET_PKT_SIZE 60 ///< Minimum packet size including Ethernet header\r | |
84 | #define MAX_ETHERNET_PKT_SIZE 1500 ///< Ethernet spec 3.1.1: Minimum packet size\r | |
4986bbaf YP |
85 | #define MAX_BULKIN_SIZE 2048 ///< Maximum size of one UsbBulk \r |
86 | \r | |
8dde1f6e | 87 | \r |
88 | #define USB_NETWORK_CLASS 0x09 ///< USB Network class code\r | |
89 | #define USB_BUS_TIMEOUT 1000 ///< USB timeout in milliseconds\r | |
90 | \r | |
91 | #define TIMER_MSEC 20 ///< Polling interval for the NIC\r | |
92 | #define TPL_AX88772 TPL_CALLBACK ///< TPL for routine synchronization\r | |
93 | \r | |
94 | /**\r | |
95 | Verify new TPL value\r | |
96 | \r | |
97 | This macro which is enabled when debug is enabled verifies that\r | |
98 | the new TPL value is >= the current TPL value.\r | |
99 | **/\r | |
100 | #ifdef VERIFY_TPL\r | |
101 | #undef VERIFY_TPL\r | |
102 | #endif // VERIFY_TPL\r | |
103 | \r | |
104 | #if !defined(MDEPKG_NDEBUG)\r | |
105 | \r | |
106 | #define VERIFY_TPL(tpl) \\r | |
107 | { \\r | |
108 | EFI_TPL PreviousTpl; \\r | |
109 | \\r | |
110 | PreviousTpl = gBS->RaiseTPL ( TPL_HIGH_LEVEL ); \\r | |
111 | gBS->RestoreTPL ( PreviousTpl ); \\r | |
112 | if ( PreviousTpl > tpl ) { \\r | |
113 | DEBUG (( DEBUG_ERROR, "Current TPL: %d, New TPL: %d\r\n", PreviousTpl, tpl )); \\r | |
114 | ASSERT ( PreviousTpl <= tpl ); \\r | |
115 | } \\r | |
116 | }\r | |
117 | \r | |
118 | #else // MDEPKG_NDEBUG\r | |
119 | \r | |
120 | #define VERIFY_TPL(tpl)\r | |
121 | \r | |
122 | #endif // MDEPKG_NDEBUG\r | |
123 | \r | |
124 | //------------------------------------------------------------------------------\r | |
125 | // Hardware Definition\r | |
126 | //------------------------------------------------------------------------------\r | |
127 | \r | |
128 | #define DEV_SIGNATURE SIGNATURE_32 ('A','X','8','8') ///< Signature of data structures in memory\r | |
129 | \r | |
130 | #define VENDOR_ID 0x0b95 ///< Vendor ID for Asix\r | |
131 | #define PRODUCT_ID 0x7720 ///< Product ID for the AX88772 USB 10/100 Ethernet controller\r | |
132 | \r | |
133 | #define RESET_MSEC 1000 ///< Reset duration\r | |
134 | #define PHY_RESET_MSEC 500 ///< PHY reset duration\r | |
135 | \r | |
136 | //\r | |
137 | // RX Control register\r | |
138 | //\r | |
139 | \r | |
140 | #define RXC_PRO 0x0001 ///< Receive all packets\r | |
141 | #define RXC_AMALL 0x0002 ///< Receive all multicast packets\r | |
142 | #define RXC_SEP 0x0004 ///< Save error packets\r | |
143 | #define RXC_AB 0x0008 ///< Receive broadcast packets\r | |
144 | #define RXC_AM 0x0010 ///< Use multicast destination address hash table\r | |
145 | #define RXC_AP 0x0020 ///< Accept physical address from Multicast Filter\r | |
146 | #define RXC_SO 0x0080 ///< Start operation\r | |
147 | #define RXC_MFB 0x0300 ///< Maximum frame burst\r | |
148 | #define RXC_MFB_2048 0 ///< Maximum frame size: 2048 bytes\r | |
149 | #define RXC_MFB_4096 0x0100 ///< Maximum frame size: 4096 bytes\r | |
150 | #define RXC_MFB_8192 0x0200 ///< Maximum frame size: 8192 bytes\r | |
151 | #define RXC_MFB_16384 0x0300 ///< Maximum frame size: 16384 bytes\r | |
152 | \r | |
153 | //\r | |
154 | // Medium Status register\r | |
155 | //\r | |
156 | \r | |
157 | #define MS_FD 0x0002 ///< Full duplex\r | |
158 | #define MS_ONE 0x0004 ///< Must be one\r | |
159 | #define MS_RFC 0x0010 ///< RX flow control enable\r | |
160 | #define MS_TFC 0x0020 ///< TX flow control enable\r | |
161 | #define MS_PF 0x0080 ///< Pause frame enable\r | |
162 | #define MS_RE 0x0100 ///< Receive enable\r | |
163 | #define MS_PS 0x0200 ///< Port speed 1=100, 0=10 Mbps\r | |
164 | #define MS_SBP 0x0800 ///< Stop back pressure\r | |
165 | #define MS_SM 0x1000 ///< Super MAC support\r | |
166 | \r | |
167 | //\r | |
168 | // Software PHY Select register\r | |
169 | //\r | |
170 | \r | |
171 | #define SPHY_PSEL 0x01 ///< Select internal PHY\r | |
172 | #define SPHY_ASEL 0x02 ///< 1=Auto select, 0=Manual select\r | |
173 | \r | |
174 | //\r | |
175 | // Software Reset register\r | |
176 | //\r | |
177 | \r | |
178 | #define SRR_RR 0x01 ///< Clear receive frame length error\r | |
179 | #define SRR_RT 0x02 ///< Clear transmit frame length error\r | |
180 | #define SRR_PRTE 0x04 ///< External PHY reset pin tri-state enable\r | |
181 | #define SRR_PRL 0x08 ///< External PHY reset pin level\r | |
182 | #define SRR_BZ 0x10 ///< Force Bulk to return zero length packet\r | |
183 | #define SRR_IPRL 0x20 ///< Internal PHY reset control\r | |
184 | #define SRR_IPPD 0x40 ///< Internal PHY power down\r | |
185 | \r | |
186 | //\r | |
187 | // PHY ID values\r | |
188 | //\r | |
189 | \r | |
190 | #define PHY_ID_INTERNAL 0x0010 ///< Internal PHY\r | |
191 | \r | |
192 | //\r | |
193 | // USB Commands\r | |
194 | //\r | |
195 | \r | |
196 | #define CMD_PHY_ACCESS_SOFTWARE 0x06 ///< Software in control of PHY\r | |
197 | #define CMD_PHY_REG_READ 0x07 ///< Read PHY register, Value: PHY, Index: Register, Data: Register value\r | |
198 | #define CMD_PHY_REG_WRITE 0x08 ///< Write PHY register, Value: PHY, Index: Register, Data: New 16-bit value\r | |
199 | #define CMD_PHY_ACCESS_HARDWARE 0x0a ///< Hardware in control of PHY\r | |
200 | #define CMD_SROM_READ 0x0b ///< Read SROM register: Value: Address, Data: Value\r | |
201 | #define CMD_RX_CONTROL_WRITE 0x10 ///< Set the RX control register, Value: New value\r | |
202 | #define CMD_GAPS_WRITE 0x12 ///< Write the gaps register, Value: New value\r | |
203 | #define CMD_MAC_ADDRESS_READ 0x13 ///< Read the MAC address, Data: 6 byte MAC address\r | |
204 | #define CMD_MAC_ADDRESS_WRITE 0x14 ///< Set the MAC address, Data: New 6 byte MAC address\r | |
205 | #define CMD_MULTICAST_HASH_WRITE 0x16 ///< Write the multicast hash table, Data: New 8 byte value\r | |
206 | #define CMD_MEDIUM_STATUS_READ 0x1a ///< Read medium status register, Data: Register value\r | |
207 | #define CMD_MEDIUM_STATUS_WRITE 0x1b ///< Write medium status register, Value: New value\r | |
208 | #define CMD_RESET 0x20 ///< Reset register, Value: New value\r | |
209 | #define CMD_PHY_SELECT 0x22 ///< PHY select register, Value: New value\r | |
210 | \r | |
211 | //------------------------------\r | |
212 | // USB Endpoints\r | |
213 | //------------------------------\r | |
214 | \r | |
215 | #define CONTROL_ENDPOINT 0 ///< Control endpoint\r | |
216 | #define INTERRUPT_ENDPOINT 1 ///< Interrupt endpoint\r | |
217 | #define BULK_IN_ENDPOINT 2 ///< Receive endpoint\r | |
218 | #define BULK_OUT_ENDPOINT 3 ///< Transmit endpoint\r | |
219 | \r | |
220 | //------------------------------\r | |
221 | // PHY Registers\r | |
222 | //------------------------------\r | |
223 | \r | |
224 | #define PHY_BMCR 0 ///< Control register\r | |
225 | #define PHY_BMSR 1 ///< Status register\r | |
226 | #define PHY_ANAR 4 ///< Autonegotiation advertisement register\r | |
227 | #define PHY_ANLPAR 5 ///< Autonegotiation link parter ability register\r | |
228 | #define PHY_ANER 6 ///< Autonegotiation expansion register\r | |
229 | \r | |
230 | // BMCR - Register 0\r | |
231 | \r | |
232 | #define BMCR_RESET 0x8000 ///< 1 = Reset the PHY, bit clears after reset\r | |
233 | #define BMCR_LOOPBACK 0x4000 ///< 1 = Loopback enabled\r | |
234 | #define BMCR_100MBPS 0x2000 ///< 100 Mbits/Sec\r | |
235 | #define BMCR_10MBPS 0 ///< 10 Mbits/Sec\r | |
236 | #define BMCR_AUTONEGOTIATION_ENABLE 0x1000 ///< 1 = Enable autonegotiation\r | |
237 | #define BMCR_POWER_DOWN 0x0800 ///< 1 = Power down\r | |
238 | #define BMCR_ISOLATE 0x0400 ///< 0 = Isolate PHY\r | |
239 | #define BMCR_RESTART_AUTONEGOTIATION 0x0200 ///< 1 = Restart autonegotiation\r | |
240 | #define BMCR_FULL_DUPLEX 0x0100 ///< Full duplex operation\r | |
241 | #define BMCR_HALF_DUPLEX 0 ///< Half duplex operation\r | |
242 | #define BMCR_COLLISION_TEST 0x0080 ///< 1 = Collision test enabled\r | |
243 | \r | |
244 | // BSMR - Register 1\r | |
245 | \r | |
246 | #define BMSR_100BASET4 0x8000 ///< 1 = 100BASE-T4 mode\r | |
247 | #define BMSR_100BASETX_FDX 0x4000 ///< 1 = 100BASE-TX full duplex\r | |
248 | #define BMSR_100BASETX_HDX 0x2000 ///< 1 = 100BASE-TX half duplex\r | |
249 | #define BMSR_10BASET_FDX 0x1000 ///< 1 = 10BASE-T full duplex\r | |
250 | #define BMSR_10BASET_HDX 0x0800 ///< 1 = 10BASE-T half duplex\r | |
251 | #define BMSR_MF 0x0040 ///< 1 = PHY accepts frames with preamble suppressed\r | |
252 | #define BMSR_AUTONEG_CMPLT 0x0020 ///< 1 = Autonegotiation complete\r | |
253 | #define BMSR_RF 0x0010 ///< 1 = Remote fault\r | |
254 | #define BMSR_AUTONEG 0x0008 ///< 1 = Able to perform autonegotiation\r | |
255 | #define BMSR_LINKST 0x0004 ///< 1 = Link up\r | |
256 | #define BMSR_JABBER_DETECT 0x0002 ///< 1 = jabber condition detected\r | |
257 | #define BMSR_EXTENDED_CAPABILITY 0x0001 ///< 1 = Extended register capable\r | |
258 | \r | |
259 | // ANAR and ANLPAR Registers 4, 5\r | |
260 | \r | |
261 | #define AN_NP 0x8000 ///< 1 = Next page available\r | |
262 | #define AN_ACK 0x4000 ///< 1 = Link partner acknowledged\r | |
263 | #define AN_RF 0x2000 ///< 1 = Remote fault indicated by link partner\r | |
264 | #define AN_FCS 0x0400 ///< 1 = Flow control ability\r | |
265 | #define AN_T4 0x0200 ///< 1 = 100BASE-T4 support\r | |
266 | #define AN_TX_FDX 0x0100 ///< 1 = 100BASE-TX Full duplex\r | |
267 | #define AN_TX_HDX 0x0080 ///< 1 = 100BASE-TX support\r | |
268 | #define AN_10_FDX 0x0040 ///< 1 = 10BASE-T Full duplex\r | |
269 | #define AN_10_HDX 0x0020 ///< 1 = 10BASE-T support\r | |
270 | #define AN_CSMA_CD 0x0001 ///< 1 = IEEE 802.3 CSMA/CD support\r | |
271 | \r | |
272 | //------------------------------------------------------------------------------\r | |
273 | // Data Types\r | |
274 | //------------------------------------------------------------------------------\r | |
275 | \r | |
276 | /**\r | |
277 | Ethernet header layout\r | |
278 | \r | |
279 | IEEE 802.3-2002 Part 3 specification, section 3.1.1.\r | |
280 | **/\r | |
281 | #pragma pack(1)\r | |
282 | typedef struct {\r | |
283 | UINT8 dest_addr[PXE_HWADDR_LEN_ETHER]; ///< Destination LAN address\r | |
284 | UINT8 src_addr[PXE_HWADDR_LEN_ETHER]; ///< Source LAN address\r | |
285 | UINT16 type; ///< Protocol or length\r | |
286 | } ETHERNET_HEADER;\r | |
287 | #pragma pack()\r | |
288 | \r | |
289 | /**\r | |
290 | Receive and Transmit packet structure\r | |
291 | **/\r | |
292 | #pragma pack(1)\r | |
293 | typedef struct _RX_TX_PACKET {\r | |
294 | struct _RX_TX_PACKET * pNext; ///< Next receive packet\r | |
295 | UINT16 Length; ///< Packet length\r | |
296 | UINT16 LengthBar; ///< Complement of the length\r | |
297 | UINT8 Data[ AX88772_MAX_PKT_SIZE ]; ///< Received packet data\r | |
298 | } RX_TX_PACKET;\r | |
299 | #pragma pack()\r | |
300 | \r | |
301 | /**\r | |
302 | AX88772 control structure\r | |
303 | \r | |
304 | The driver uses this structure to manage the Asix AX88772 10/100\r | |
305 | Ethernet controller.\r | |
306 | **/\r | |
307 | typedef struct {\r | |
308 | UINTN Signature; ///< Structure identification\r | |
309 | \r | |
310 | //\r | |
311 | // USB data\r | |
312 | //\r | |
313 | EFI_HANDLE Controller; ///< Controller handle\r | |
314 | EFI_USB_IO_PROTOCOL * pUsbIo; ///< USB driver interface\r | |
315 | \r | |
316 | //\r | |
317 | // Simple network protocol data\r | |
318 | //\r | |
319 | EFI_SIMPLE_NETWORK_PROTOCOL SimpleNetwork; ///< Driver's network stack interface\r | |
320 | EFI_SIMPLE_NETWORK_MODE SimpleNetworkData; ///< Data for simple network\r | |
321 | \r | |
322 | //\r | |
323 | // Ethernet controller data\r | |
324 | //\r | |
325 | BOOLEAN bInitialized; ///< Controller initialized\r | |
326 | VOID * pTxBuffer; ///< Last transmit buffer\r | |
327 | UINT16 PhyId; ///< PHY ID\r | |
328 | \r | |
329 | //\r | |
330 | // Link state\r | |
331 | //\r | |
332 | BOOLEAN b100Mbps; ///< Current link speed, FALSE = 10 Mbps\r | |
333 | BOOLEAN bComplete; ///< Current state of auto-negotiation\r | |
334 | BOOLEAN bFullDuplex; ///< Current duplex\r | |
335 | BOOLEAN bLinkUp; ///< Current link state\r | |
336 | BOOLEAN bLinkIdle; ///< TRUE = No received traffic\r | |
337 | EFI_EVENT Timer; ///< Timer to monitor link state and receive packets\r | |
338 | UINTN PollCount; ///< Number of times the autonegotiation status was polled\r | |
339 | \r | |
340 | //\r | |
341 | // Receive buffer list\r | |
342 | //\r | |
343 | RX_TX_PACKET * pRxHead; ///< Head of receive packet list\r | |
344 | RX_TX_PACKET * pRxTail; ///< Tail of receive packet list\r | |
345 | RX_TX_PACKET * pRxFree; ///< Free packet list\r | |
346 | INT32 MulticastHash[2]; ///< Hash table for multicast destination addresses\r | |
4986bbaf | 347 | UINT8 * pBulkInBuff; ///< Buffer for Usb Bulk\r |
8dde1f6e | 348 | } NIC_DEVICE;\r |
349 | \r | |
350 | #define DEV_FROM_SIMPLE_NETWORK(a) CR (a, NIC_DEVICE, SimpleNetwork, DEV_SIGNATURE) ///< Locate NIC_DEVICE from Simple Network Protocol\r | |
351 | \r | |
352 | //------------------------------------------------------------------------------\r | |
353 | // Simple Network Protocol\r | |
354 | //------------------------------------------------------------------------------\r | |
355 | \r | |
356 | /**\r | |
357 | Reset the network adapter.\r | |
358 | \r | |
359 | Resets a network adapter and reinitializes it with the parameters that\r | |
360 | were provided in the previous call to Initialize (). The transmit and\r | |
361 | receive queues are cleared. Receive filters, the station address, the\r | |
362 | statistics, and the multicast-IP-to-HW MAC addresses are not reset by\r | |
363 | this call.\r | |
364 | \r | |
365 | This routine calls ::Ax88772Reset to perform the adapter specific\r | |
366 | reset operation. This routine also starts the link negotiation\r | |
367 | by calling ::Ax88772NegotiateLinkStart.\r | |
368 | \r | |
369 | @param [in] pSimpleNetwork Protocol instance pointer\r | |
370 | @param [in] bExtendedVerification Indicates that the driver may perform a more\r | |
371 | exhaustive verification operation of the device\r | |
372 | during reset.\r | |
373 | \r | |
374 | @retval EFI_SUCCESS This operation was successful.\r | |
375 | @retval EFI_NOT_STARTED The network interface was not started.\r | |
376 | @retval EFI_INVALID_PARAMETER pSimpleNetwork parameter was NULL or did not point to a valid\r | |
377 | EFI_SIMPLE_NETWORK_PROTOCOL structure.\r | |
378 | @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r | |
379 | @retval EFI_UNSUPPORTED The increased buffer size feature is not supported.\r | |
380 | \r | |
381 | **/\r | |
382 | EFI_STATUS\r | |
383 | EFIAPI\r | |
384 | SN_Reset (\r | |
385 | IN EFI_SIMPLE_NETWORK_PROTOCOL * pSimpleNetwork,\r | |
386 | IN BOOLEAN bExtendedVerification\r | |
387 | );\r | |
388 | \r | |
389 | /**\r | |
390 | Initialize the simple network protocol.\r | |
391 | \r | |
392 | This routine calls ::Ax88772MacAddressGet to obtain the\r | |
393 | MAC address.\r | |
394 | \r | |
395 | @param [in] pNicDevice NIC_DEVICE_INSTANCE pointer\r | |
396 | \r | |
397 | @retval EFI_SUCCESS Setup was successful\r | |
398 | \r | |
399 | **/\r | |
400 | EFI_STATUS\r | |
401 | SN_Setup (\r | |
402 | IN NIC_DEVICE * pNicDevice\r | |
403 | );\r | |
404 | \r | |
405 | /**\r | |
406 | This routine starts the network interface.\r | |
407 | \r | |
408 | @param [in] pSimpleNetwork Protocol instance pointer\r | |
409 | \r | |
410 | @retval EFI_SUCCESS This operation was successful.\r | |
411 | @retval EFI_ALREADY_STARTED The network interface was already started.\r | |
412 | @retval EFI_INVALID_PARAMETER pSimpleNetwork parameter was NULL or did not point to a valid\r | |
413 | EFI_SIMPLE_NETWORK_PROTOCOL structure.\r | |
414 | @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r | |
415 | @retval EFI_UNSUPPORTED The increased buffer size feature is not supported.\r | |
416 | \r | |
417 | **/\r | |
418 | EFI_STATUS\r | |
419 | EFIAPI\r | |
420 | SN_Start (\r | |
421 | IN EFI_SIMPLE_NETWORK_PROTOCOL * pSimpleNetwork\r | |
422 | );\r | |
423 | \r | |
424 | /**\r | |
425 | Set the MAC address.\r | |
426 | \r | |
427 | This function modifies or resets the current station address of a\r | |
428 | network interface. If Reset is TRUE, then the current station address\r | |
429 | is set ot the network interface's permanent address. If Reset if FALSE\r | |
430 | then the current station address is changed to the address specified by\r | |
431 | pNew.\r | |
432 | \r | |
433 | This routine calls ::Ax88772MacAddressSet to update the MAC address\r | |
434 | in the network adapter.\r | |
435 | \r | |
436 | @param [in] pSimpleNetwork Protocol instance pointer\r | |
437 | @param [in] bReset Flag used to reset the station address to the\r | |
438 | network interface's permanent address.\r | |
439 | @param [in] pNew New station address to be used for the network\r | |
440 | interface.\r | |
441 | \r | |
442 | @retval EFI_SUCCESS This operation was successful.\r | |
443 | @retval EFI_NOT_STARTED The network interface was not started.\r | |
444 | @retval EFI_INVALID_PARAMETER pSimpleNetwork parameter was NULL or did not point to a valid\r | |
445 | EFI_SIMPLE_NETWORK_PROTOCOL structure.\r | |
446 | @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r | |
447 | @retval EFI_UNSUPPORTED The increased buffer size feature is not supported.\r | |
448 | \r | |
449 | **/\r | |
450 | EFI_STATUS\r | |
451 | EFIAPI\r | |
452 | SN_StationAddress (\r | |
453 | IN EFI_SIMPLE_NETWORK_PROTOCOL * pSimpleNetwork,\r | |
454 | IN BOOLEAN bReset,\r | |
455 | IN EFI_MAC_ADDRESS * pNew\r | |
456 | );\r | |
457 | \r | |
458 | /**\r | |
459 | This function resets or collects the statistics on a network interface.\r | |
460 | If the size of the statistics table specified by StatisticsSize is not\r | |
461 | big enough for all of the statistics that are collected by the network\r | |
462 | interface, then a partial buffer of statistics is returned in\r | |
463 | StatisticsTable.\r | |
464 | \r | |
465 | @param [in] pSimpleNetwork Protocol instance pointer\r | |
466 | @param [in] bReset Set to TRUE to reset the statistics for the network interface.\r | |
467 | @param [in, out] pStatisticsSize On input the size, in bytes, of StatisticsTable. On output\r | |
468 | the size, in bytes, of the resulting table of statistics.\r | |
469 | @param [out] pStatisticsTable A pointer to the EFI_NETWORK_STATISTICS structure that\r | |
470 | conains the statistics.\r | |
471 | \r | |
472 | @retval EFI_SUCCESS This operation was successful.\r | |
473 | @retval EFI_NOT_STARTED The network interface was not started.\r | |
474 | @retval EFI_BUFFER_TOO_SMALL The pStatisticsTable is NULL or the buffer is too small.\r | |
475 | @retval EFI_INVALID_PARAMETER pSimpleNetwork parameter was NULL or did not point to a valid\r | |
476 | EFI_SIMPLE_NETWORK_PROTOCOL structure.\r | |
477 | @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r | |
478 | @retval EFI_UNSUPPORTED The increased buffer size feature is not supported.\r | |
479 | \r | |
480 | **/\r | |
481 | EFI_STATUS\r | |
482 | EFIAPI\r | |
483 | SN_Statistics (\r | |
484 | IN EFI_SIMPLE_NETWORK_PROTOCOL * pSimpleNetwork,\r | |
485 | IN BOOLEAN bReset,\r | |
486 | IN OUT UINTN * pStatisticsSize,\r | |
487 | OUT EFI_NETWORK_STATISTICS * pStatisticsTable\r | |
488 | );\r | |
489 | \r | |
490 | /**\r | |
491 | This function stops a network interface. This call is only valid\r | |
492 | if the network interface is in the started state.\r | |
493 | \r | |
494 | @param [in] pSimpleNetwork Protocol instance pointer\r | |
495 | \r | |
496 | @retval EFI_SUCCESS This operation was successful.\r | |
497 | @retval EFI_NOT_STARTED The network interface was not started.\r | |
498 | @retval EFI_INVALID_PARAMETER pSimpleNetwork parameter was NULL or did not point to a valid\r | |
499 | EFI_SIMPLE_NETWORK_PROTOCOL structure.\r | |
500 | @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r | |
501 | @retval EFI_UNSUPPORTED The increased buffer size feature is not supported.\r | |
502 | \r | |
503 | **/\r | |
504 | EFI_STATUS\r | |
505 | EFIAPI\r | |
506 | SN_Stop (\r | |
507 | IN EFI_SIMPLE_NETWORK_PROTOCOL * pSimpleNetwork\r | |
508 | );\r | |
509 | \r | |
510 | /**\r | |
511 | This function releases the memory buffers assigned in the Initialize() call.\r | |
512 | Pending transmits and receives are lost, and interrupts are cleared and disabled.\r | |
513 | After this call, only Initialize() and Stop() calls may be used.\r | |
514 | \r | |
515 | @param [in] pSimpleNetwork Protocol instance pointer\r | |
516 | \r | |
517 | @retval EFI_SUCCESS This operation was successful.\r | |
518 | @retval EFI_NOT_STARTED The network interface was not started.\r | |
519 | @retval EFI_INVALID_PARAMETER pSimpleNetwork parameter was NULL or did not point to a valid\r | |
520 | EFI_SIMPLE_NETWORK_PROTOCOL structure.\r | |
521 | @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r | |
522 | @retval EFI_UNSUPPORTED The increased buffer size feature is not supported.\r | |
523 | \r | |
524 | **/\r | |
525 | EFI_STATUS\r | |
526 | EFIAPI\r | |
527 | SN_Shutdown (\r | |
528 | IN EFI_SIMPLE_NETWORK_PROTOCOL * pSimpleNetwork\r | |
529 | );\r | |
530 | \r | |
531 | /**\r | |
532 | Send a packet over the network.\r | |
533 | \r | |
534 | This function places the packet specified by Header and Buffer on\r | |
535 | the transmit queue. This function performs a non-blocking transmit\r | |
536 | operation. When the transmit is complete, the buffer is returned\r | |
537 | via the GetStatus() call.\r | |
538 | \r | |
539 | This routine calls ::Ax88772Rx to empty the network adapter of\r | |
540 | receive packets. The routine then passes the transmit packet\r | |
541 | to the network adapter.\r | |
542 | \r | |
543 | @param [in] pSimpleNetwork Protocol instance pointer\r | |
544 | @param [in] HeaderSize The size, in bytes, of the media header to be filled in by\r | |
545 | the Transmit() function. If HeaderSize is non-zero, then\r | |
546 | it must be equal to SimpleNetwork->Mode->MediaHeaderSize\r | |
547 | and DestAddr and Protocol parameters must not be NULL.\r | |
548 | @param [in] BufferSize The size, in bytes, of the entire packet (media header and\r | |
549 | data) to be transmitted through the network interface.\r | |
550 | @param [in] pBuffer A pointer to the packet (media header followed by data) to\r | |
551 | to be transmitted. This parameter can not be NULL. If\r | |
552 | HeaderSize is zero, then the media header is Buffer must\r | |
553 | already be filled in by the caller. If HeaderSize is nonzero,\r | |
554 | then the media header will be filled in by the Transmit()\r | |
555 | function.\r | |
556 | @param [in] pSrcAddr The source HW MAC address. If HeaderSize is zero, then\r | |
557 | this parameter is ignored. If HeaderSize is nonzero and\r | |
558 | SrcAddr is NULL, then SimpleNetwork->Mode->CurrentAddress\r | |
559 | is used for the source HW MAC address.\r | |
560 | @param [in] pDestAddr The destination HW MAC address. If HeaderSize is zero, then\r | |
561 | this parameter is ignored.\r | |
562 | @param [in] pProtocol The type of header to build. If HeaderSize is zero, then\r | |
563 | this parameter is ignored.\r | |
564 | \r | |
565 | @retval EFI_SUCCESS This operation was successful.\r | |
566 | @retval EFI_NOT_STARTED The network interface was not started.\r | |
567 | @retval EFI_NOT_READY The network interface is too busy to accept this transmit request.\r | |
568 | @retval EFI_BUFFER_TOO_SMALL The BufferSize parameter is too small.\r | |
569 | @retval EFI_INVALID_PARAMETER pSimpleNetwork parameter was NULL or did not point to a valid\r | |
570 | EFI_SIMPLE_NETWORK_PROTOCOL structure.\r | |
571 | @retval EFI_DEVICE_ERROR The command could not be sent to the network interface.\r | |
572 | \r | |
573 | **/\r | |
574 | EFI_STATUS\r | |
575 | EFIAPI\r | |
576 | SN_Transmit (\r | |
577 | IN EFI_SIMPLE_NETWORK_PROTOCOL * pSimpleNetwork,\r | |
578 | IN UINTN HeaderSize,\r | |
579 | IN UINTN BufferSize,\r | |
580 | IN VOID * pBuffer,\r | |
581 | IN EFI_MAC_ADDRESS * pSrcAddr,\r | |
582 | IN EFI_MAC_ADDRESS * pDestAddr,\r | |
583 | IN UINT16 * pProtocol\r | |
584 | );\r | |
585 | \r | |
586 | //------------------------------------------------------------------------------\r | |
587 | // Support Routines\r | |
588 | //------------------------------------------------------------------------------\r | |
589 | \r | |
590 | /**\r | |
591 | Get the MAC address\r | |
592 | \r | |
593 | This routine calls ::Ax88772UsbCommand to request the MAC\r | |
594 | address from the network adapter.\r | |
595 | \r | |
596 | @param [in] pNicDevice Pointer to the NIC_DEVICE structure\r | |
597 | @param [out] pMacAddress Address of a six byte buffer to receive the MAC address.\r | |
598 | \r | |
599 | @retval EFI_SUCCESS The MAC address is available.\r | |
600 | @retval other The MAC address is not valid.\r | |
601 | \r | |
602 | **/\r | |
603 | EFI_STATUS\r | |
604 | Ax88772MacAddressGet (\r | |
605 | IN NIC_DEVICE * pNicDevice,\r | |
606 | OUT UINT8 * pMacAddress\r | |
607 | );\r | |
608 | \r | |
609 | /**\r | |
610 | Set the MAC address\r | |
611 | \r | |
612 | This routine calls ::Ax88772UsbCommand to set the MAC address\r | |
613 | in the network adapter.\r | |
614 | \r | |
615 | @param [in] pNicDevice Pointer to the NIC_DEVICE structure\r | |
616 | @param [in] pMacAddress Address of a six byte buffer to containing the new MAC address.\r | |
617 | \r | |
618 | @retval EFI_SUCCESS The MAC address was set.\r | |
619 | @retval other The MAC address was not set.\r | |
620 | \r | |
621 | **/\r | |
622 | EFI_STATUS\r | |
623 | Ax88772MacAddressSet (\r | |
624 | IN NIC_DEVICE * pNicDevice,\r | |
625 | IN UINT8 * pMacAddress\r | |
626 | );\r | |
627 | \r | |
628 | /**\r | |
629 | Clear the multicast hash table\r | |
630 | \r | |
631 | @param [in] pNicDevice Pointer to the NIC_DEVICE structure\r | |
632 | \r | |
633 | **/\r | |
634 | VOID\r | |
635 | Ax88772MulticastClear (\r | |
636 | IN NIC_DEVICE * pNicDevice\r | |
637 | );\r | |
638 | \r | |
639 | /**\r | |
640 | Enable a multicast address in the multicast hash table\r | |
641 | \r | |
642 | This routine calls ::Ax88772Crc to compute the hash bit for\r | |
643 | this MAC address.\r | |
644 | \r | |
645 | @param [in] pNicDevice Pointer to the NIC_DEVICE structure\r | |
646 | @param [in] pMacAddress Address of a six byte buffer to containing the MAC address.\r | |
647 | \r | |
648 | **/\r | |
649 | VOID\r | |
650 | Ax88772MulticastSet (\r | |
651 | IN NIC_DEVICE * pNicDevice,\r | |
652 | IN UINT8 * pMacAddress\r | |
653 | );\r | |
654 | \r | |
655 | /**\r | |
656 | Start the link negotiation\r | |
657 | \r | |
658 | This routine calls ::Ax88772PhyWrite to start the PHY's link\r | |
659 | negotiation.\r | |
660 | \r | |
661 | @param [in] pNicDevice Pointer to the NIC_DEVICE structure\r | |
662 | \r | |
663 | @retval EFI_SUCCESS The link negotiation was started.\r | |
664 | @retval other Failed to start the link negotiation.\r | |
665 | \r | |
666 | **/\r | |
667 | EFI_STATUS\r | |
668 | Ax88772NegotiateLinkStart (\r | |
669 | IN NIC_DEVICE * pNicDevice\r | |
670 | );\r | |
671 | \r | |
672 | /**\r | |
673 | Complete the negotiation of the PHY link\r | |
674 | \r | |
675 | This routine calls ::Ax88772PhyRead to determine if the\r | |
676 | link negotiation is complete.\r | |
677 | \r | |
678 | @param [in] pNicDevice Pointer to the NIC_DEVICE structure\r | |
679 | @param [in, out] pPollCount Address of number of times this routine was polled\r | |
680 | @param [out] pbComplete Address of boolean to receive complate status.\r | |
681 | @param [out] pbLinkUp Address of boolean to receive link status, TRUE=up.\r | |
682 | @param [out] pbHiSpeed Address of boolean to receive link speed, TRUE=100Mbps.\r | |
683 | @param [out] pbFullDuplex Address of boolean to receive link duplex, TRUE=full.\r | |
684 | \r | |
685 | @retval EFI_SUCCESS The MAC address is available.\r | |
686 | @retval other The MAC address is not valid.\r | |
687 | \r | |
688 | **/\r | |
689 | EFI_STATUS\r | |
690 | Ax88772NegotiateLinkComplete (\r | |
691 | IN NIC_DEVICE * pNicDevice,\r | |
692 | IN OUT UINTN * pPollCount,\r | |
693 | OUT BOOLEAN * pbComplete,\r | |
694 | OUT BOOLEAN * pbLinkUp,\r | |
695 | OUT BOOLEAN * pbHiSpeed,\r | |
696 | OUT BOOLEAN * pbFullDuplex\r | |
697 | );\r | |
698 | \r | |
699 | /**\r | |
700 | Read a register from the PHY\r | |
701 | \r | |
702 | This routine calls ::Ax88772UsbCommand to read a PHY register.\r | |
703 | \r | |
704 | @param [in] pNicDevice Pointer to the NIC_DEVICE structure\r | |
705 | @param [in] RegisterAddress Number of the register to read.\r | |
706 | @param [in, out] pPhyData Address of a buffer to receive the PHY register value\r | |
707 | \r | |
708 | @retval EFI_SUCCESS The PHY data is available.\r | |
709 | @retval other The PHY data is not valid.\r | |
710 | \r | |
711 | **/\r | |
712 | EFI_STATUS\r | |
713 | Ax88772PhyRead (\r | |
714 | IN NIC_DEVICE * pNicDevice,\r | |
715 | IN UINT8 RegisterAddress,\r | |
716 | IN OUT UINT16 * pPhyData\r | |
717 | );\r | |
718 | \r | |
719 | /**\r | |
720 | Write to a PHY register\r | |
721 | \r | |
722 | This routine calls ::Ax88772UsbCommand to write a PHY register.\r | |
723 | \r | |
724 | @param [in] pNicDevice Pointer to the NIC_DEVICE structure\r | |
725 | @param [in] RegisterAddress Number of the register to read.\r | |
726 | @param [in] PhyData Address of a buffer to receive the PHY register value\r | |
727 | \r | |
728 | @retval EFI_SUCCESS The PHY data was written.\r | |
729 | @retval other Failed to wwrite the PHY register.\r | |
730 | \r | |
731 | **/\r | |
732 | EFI_STATUS\r | |
733 | Ax88772PhyWrite (\r | |
734 | IN NIC_DEVICE * pNicDevice,\r | |
735 | IN UINT8 RegisterAddress,\r | |
736 | IN UINT16 PhyData\r | |
737 | );\r | |
738 | \r | |
739 | /**\r | |
740 | Reset the AX88772\r | |
741 | \r | |
742 | This routine uses ::Ax88772UsbCommand to reset the network\r | |
743 | adapter. This routine also uses ::Ax88772PhyWrite to reset\r | |
744 | the PHY.\r | |
745 | \r | |
746 | @param [in] pNicDevice Pointer to the NIC_DEVICE structure\r | |
747 | \r | |
748 | @retval EFI_SUCCESS The MAC address is available.\r | |
749 | @retval other The MAC address is not valid.\r | |
750 | \r | |
751 | **/\r | |
752 | EFI_STATUS\r | |
753 | Ax88772Reset (\r | |
754 | IN NIC_DEVICE * pNicDevice\r | |
755 | );\r | |
756 | \r | |
757 | /**\r | |
758 | Receive a frame from the network.\r | |
759 | \r | |
760 | This routine polls the USB receive interface for a packet. If a packet\r | |
761 | is available, this routine adds the receive packet to the list of\r | |
762 | pending receive packets.\r | |
763 | \r | |
764 | This routine calls ::Ax88772NegotiateLinkComplete to verify\r | |
765 | that the link is up. This routine also calls ::SN_Reset to\r | |
766 | reset the network adapter when necessary. Finally this\r | |
767 | routine attempts to receive one or more packets from the\r | |
768 | network adapter.\r | |
769 | \r | |
770 | @param [in] pNicDevice Pointer to the NIC_DEVICE structure\r | |
771 | @param [in] bUpdateLink TRUE = Update link status\r | |
772 | \r | |
773 | **/\r | |
774 | VOID\r | |
775 | Ax88772Rx (\r | |
776 | IN NIC_DEVICE * pNicDevice,\r | |
777 | IN BOOLEAN bUpdateLink\r | |
778 | );\r | |
779 | \r | |
780 | /**\r | |
781 | Enable or disable the receiver\r | |
782 | \r | |
783 | This routine calls ::Ax88772UsbCommand to update the\r | |
784 | receiver state. This routine also calls ::Ax88772MacAddressSet\r | |
785 | to establish the MAC address for the network adapter.\r | |
786 | \r | |
787 | @param [in] pNicDevice Pointer to the NIC_DEVICE structure\r | |
788 | @param [in] RxFilter Simple network RX filter mask value\r | |
789 | \r | |
790 | @retval EFI_SUCCESS The MAC address was set.\r | |
791 | @retval other The MAC address was not set.\r | |
792 | \r | |
793 | **/\r | |
794 | EFI_STATUS\r | |
795 | Ax88772RxControl (\r | |
796 | IN NIC_DEVICE * pNicDevice,\r | |
797 | IN UINT32 RxFilter\r | |
798 | );\r | |
799 | \r | |
800 | /**\r | |
801 | Read an SROM location\r | |
802 | \r | |
803 | This routine calls ::Ax88772UsbCommand to read data from the\r | |
804 | SROM.\r | |
805 | \r | |
806 | @param [in] pNicDevice Pointer to the NIC_DEVICE structure\r | |
807 | @param [in] Address SROM address\r | |
808 | @param [out] pData Buffer to receive the data\r | |
809 | \r | |
810 | @retval EFI_SUCCESS The read was successful\r | |
811 | @retval other The read failed\r | |
812 | \r | |
813 | **/\r | |
814 | EFI_STATUS\r | |
815 | Ax88772SromRead (\r | |
816 | IN NIC_DEVICE * pNicDevice,\r | |
817 | IN UINT32 Address,\r | |
818 | OUT UINT16 * pData\r | |
819 | );\r | |
820 | \r | |
821 | /**\r | |
822 | This routine is called at a regular interval to poll for\r | |
823 | receive packets.\r | |
824 | \r | |
825 | This routine polls the link state and gets any receive packets\r | |
826 | by calling ::Ax88772Rx.\r | |
827 | \r | |
828 | @param [in] Event Timer event\r | |
829 | @param [in] pNicDevice Pointer to the NIC_DEVICE structure\r | |
830 | \r | |
831 | **/\r | |
832 | VOID\r | |
833 | Ax88772Timer (\r | |
834 | IN EFI_EVENT Event,\r | |
835 | IN NIC_DEVICE * pNicDevice\r | |
836 | );\r | |
837 | \r | |
838 | /**\r | |
839 | Send a command to the USB device.\r | |
840 | \r | |
841 | @param [in] pNicDevice Pointer to the NIC_DEVICE structure\r | |
842 | @param [in] pRequest Pointer to the request structure\r | |
843 | @param [in, out] pBuffer Data buffer address\r | |
844 | \r | |
845 | @retval EFI_SUCCESS The USB transfer was successful\r | |
846 | @retval other The USB transfer failed\r | |
847 | \r | |
848 | **/\r | |
849 | EFI_STATUS\r | |
850 | Ax88772UsbCommand (\r | |
851 | IN NIC_DEVICE * pNicDevice,\r | |
852 | IN USB_DEVICE_REQUEST * pRequest,\r | |
853 | IN OUT VOID * pBuffer\r | |
854 | );\r | |
855 | \r | |
856 | //------------------------------------------------------------------------------\r | |
857 | // EFI Component Name Protocol Support\r | |
858 | //------------------------------------------------------------------------------\r | |
859 | \r | |
860 | extern EFI_COMPONENT_NAME_PROTOCOL gComponentName; ///< Component name protocol declaration\r | |
861 | extern EFI_COMPONENT_NAME2_PROTOCOL gComponentName2; ///< Component name 2 protocol declaration\r | |
862 | \r | |
863 | /**\r | |
864 | Retrieves a Unicode string that is the user readable name of the driver.\r | |
865 | \r | |
866 | This function retrieves the user readable name of a driver in the form of a\r | |
867 | Unicode string. If the driver specified by This has a user readable name in\r | |
868 | the language specified by Language, then a pointer to the driver name is\r | |
869 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
870 | by This does not support the language specified by Language,\r | |
871 | then EFI_UNSUPPORTED is returned.\r | |
872 | \r | |
873 | @param [in] pThis A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
874 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
875 | @param [in] pLanguage A pointer to a Null-terminated ASCII string\r | |
876 | array indicating the language. This is the\r | |
877 | language of the driver name that the caller is\r | |
878 | requesting, and it must match one of the\r | |
879 | languages specified in SupportedLanguages. The\r | |
880 | number of languages supported by a driver is up\r | |
881 | to the driver writer. Language is specified\r | |
882 | in RFC 3066 or ISO 639-2 language code format.\r | |
883 | @param [out] ppDriverName A pointer to the Unicode string to return.\r | |
884 | This Unicode string is the name of the\r | |
885 | driver specified by This in the language\r | |
886 | specified by Language.\r | |
887 | \r | |
888 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
889 | This and the language specified by Language was\r | |
890 | returned in DriverName.\r | |
891 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
892 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
893 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
894 | the language specified by Language.\r | |
895 | \r | |
896 | **/\r | |
897 | EFI_STATUS\r | |
898 | EFIAPI\r | |
899 | GetDriverName (\r | |
900 | IN EFI_COMPONENT_NAME_PROTOCOL * pThis,\r | |
901 | IN CHAR8 * pLanguage,\r | |
902 | OUT CHAR16 ** ppDriverName\r | |
903 | );\r | |
904 | \r | |
905 | \r | |
906 | /**\r | |
907 | Retrieves a Unicode string that is the user readable name of the controller\r | |
908 | that is being managed by a driver.\r | |
909 | \r | |
910 | This function retrieves the user readable name of the controller specified by\r | |
911 | ControllerHandle and ChildHandle in the form of a Unicode string. If the\r | |
912 | driver specified by This has a user readable name in the language specified by\r | |
913 | Language, then a pointer to the controller name is returned in ControllerName,\r | |
914 | and EFI_SUCCESS is returned. If the driver specified by This is not currently\r | |
915 | managing the controller specified by ControllerHandle and ChildHandle,\r | |
916 | then EFI_UNSUPPORTED is returned. If the driver specified by This does not\r | |
917 | support the language specified by Language, then EFI_UNSUPPORTED is returned.\r | |
918 | \r | |
919 | @param [in] pThis A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or\r | |
920 | EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
921 | @param [in] ControllerHandle The handle of a controller that the driver\r | |
922 | specified by This is managing. This handle\r | |
923 | specifies the controller whose name is to be\r | |
924 | returned.\r | |
925 | @param [in] ChildHandle The handle of the child controller to retrieve\r | |
926 | the name of. This is an optional parameter that\r | |
927 | may be NULL. It will be NULL for device\r | |
928 | drivers. It will also be NULL for a bus drivers\r | |
929 | that wish to retrieve the name of the bus\r | |
930 | controller. It will not be NULL for a bus\r | |
931 | driver that wishes to retrieve the name of a\r | |
932 | child controller.\r | |
933 | @param [in] pLanguage A pointer to a Null-terminated ASCII string\r | |
934 | array indicating the language. This is the\r | |
935 | language of the driver name that the caller is\r | |
936 | requesting, and it must match one of the\r | |
937 | languages specified in SupportedLanguages. The\r | |
938 | number of languages supported by a driver is up\r | |
939 | to the driver writer. Language is specified in\r | |
940 | RFC 3066 or ISO 639-2 language code format.\r | |
941 | @param [out] ppControllerName A pointer to the Unicode string to return.\r | |
942 | This Unicode string is the name of the\r | |
943 | controller specified by ControllerHandle and\r | |
944 | ChildHandle in the language specified by\r | |
945 | Language from the point of view of the driver\r | |
946 | specified by This.\r | |
947 | \r | |
948 | @retval EFI_SUCCESS The Unicode string for the user readable name in\r | |
949 | the language specified by Language for the\r | |
950 | driver specified by This was returned in\r | |
951 | DriverName.\r | |
952 | @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r | |
953 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid\r | |
954 | EFI_HANDLE.\r | |
955 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
956 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
957 | @retval EFI_UNSUPPORTED The driver specified by This is not currently\r | |
958 | managing the controller specified by\r | |
959 | ControllerHandle and ChildHandle.\r | |
960 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
961 | the language specified by Language.\r | |
962 | \r | |
963 | **/\r | |
964 | EFI_STATUS\r | |
965 | EFIAPI\r | |
966 | GetControllerName (\r | |
967 | IN EFI_COMPONENT_NAME_PROTOCOL * pThis,\r | |
968 | IN EFI_HANDLE ControllerHandle,\r | |
969 | IN OPTIONAL EFI_HANDLE ChildHandle,\r | |
970 | IN CHAR8 * pLanguage,\r | |
971 | OUT CHAR16 ** ppControllerName\r | |
972 | );\r | |
973 | \r | |
974 | //------------------------------------------------------------------------------\r | |
975 | \r | |
976 | #endif // _AX88772_H_\r |