NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
PexApi.h
1 #ifndef __PEX_API_H
2 #define __PEX_API_H
3 
4 /*******************************************************************************
5  * Copyright (c) PLX Technology, Inc.
6  *
7  * PLX Technology Inc. licenses this source file under the GNU Lesser General Public
8  * License (LGPL) version 2. This source file may be modified or redistributed
9  * under the terms of the LGPL and without express permission from PLX Technology.
10  *
11  * PLX Technology, Inc. provides this software AS IS, WITHOUT ANY WARRANTY,
12  * EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF
13  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. PLX makes no guarantee
14  * or representations regarding the use of, or the results of the use of,
15  * the software and documentation in terms of correctness, accuracy,
16  * reliability, currentness, or otherwise; and you rely on the software,
17  * documentation and results solely at your own risk.
18  *
19  * IN NO EVENT SHALL PLX BE LIABLE FOR ANY LOSS OF USE, LOSS OF BUSINESS,
20  * LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES
21  * OF ANY KIND.
22  *
23  ******************************************************************************/
24 
25 /******************************************************************************
26  *
27  * File Name:
28  *
29  * PexApi.h
30  *
31  * Description:
32  *
33  * This file contains all the PLX API function prototypes
34  *
35  * Revision:
36  *
37  * 02-01-13 : PLX SDK v7.00
38  *
39  ******************************************************************************/
40 
41 
42 #include "PlxTypes.h"
43 
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 
50 /******************************************
51  * Definitions
52  ******************************************/
53 // DLL support
54 #ifndef EXPORT
55  #if defined(PLX_MSWINDOWS)
56  #define EXPORT __declspec(dllexport)
57  #else
58  #define EXPORT
59  #endif
60 #endif
61 
62 
63 
64 
65 /******************************************
66  * PLX Device Selection Functions
67  *****************************************/
68 PLX_STATUS EXPORT
69 PlxPci_DeviceOpen(
70  PLX_DEVICE_KEY *pKey,
71  PLX_DEVICE_OBJECT *pDevice
72  );
73 
74 PLX_STATUS EXPORT
75 PlxPci_DeviceClose(
76  PLX_DEVICE_OBJECT *pDevice
77  );
78 
79 PLX_STATUS EXPORT
80 PlxPci_DeviceFind(
81  PLX_DEVICE_KEY *pKey,
82  U16 DeviceNumber
83  );
84 
85 PLX_STATUS EXPORT
86 PlxPci_DeviceFindEx(
87  PLX_DEVICE_KEY *pKey,
88  U16 DeviceNumber,
89  PLX_API_MODE ApiMode,
90  PLX_MODE_PROP *pModeProp
91  );
92 
93 PLX_STATUS EXPORT
94 PlxPci_I2cGetPorts(
95  PLX_API_MODE ApiMode,
96  U32 *pI2cPorts
97  );
98 
99 
100 /******************************************
101  * Query for Information Functions
102  *****************************************/
103 PLX_STATUS EXPORT
104 PlxPci_ApiVersion(
105  U8 *pVersionMajor,
106  U8 *pVersionMinor,
107  U8 *pVersionRevision
108  );
109 
110 PLX_STATUS EXPORT
111 PlxPci_I2cVersion(
112  U16 I2cPort,
113  PLX_VERSION *pVersion
114  );
115 
116 PLX_STATUS EXPORT
117 PlxPci_DriverVersion(
118  PLX_DEVICE_OBJECT *pDevice,
119  U8 *pVersionMajor,
120  U8 *pVersionMinor,
121  U8 *pVersionRevision
122  );
123 
124 PLX_STATUS EXPORT
125 PlxPci_DriverProperties(
126  PLX_DEVICE_OBJECT *pDevice,
127  PLX_DRIVER_PROP *pDriverProp
128  );
129 
130 PLX_STATUS EXPORT
131 PlxPci_DriverScheduleRescan(
132  PLX_DEVICE_OBJECT *pDevice
133  );
134 
135 PLX_STATUS EXPORT
136 PlxPci_ChipTypeGet(
137  PLX_DEVICE_OBJECT *pDevice,
138  U16 *pChipType,
139  U8 *pRevision
140  );
141 
142 PLX_STATUS EXPORT
143 PlxPci_ChipTypeSet(
144  PLX_DEVICE_OBJECT *pDevice,
145  U16 ChipType,
146  U8 Revision
147  );
148 
149 PLX_STATUS EXPORT
150 PlxPci_ChipGetPortMask(
151  U16 PlxChip,
152  U8 PlxRevision,
153  U64 *pPortMask
154  );
155 
156 PLX_STATUS EXPORT
157 PlxPci_GetPortProperties(
158  PLX_DEVICE_OBJECT *pDevice,
159  PLX_PORT_PROP *pPortProp
160  );
161 
162 
163 /******************************************
164  * Device Control Functions
165  *****************************************/
166 PLX_STATUS EXPORT
167 PlxPci_DeviceReset(
168  PLX_DEVICE_OBJECT *pDevice
169  );
170 
171 
172 /******************************************
173  * Register Access Functions
174  *****************************************/
175 U32 EXPORT
176 PlxPci_PciRegisterRead(
177  U8 bus,
178  U8 slot,
179  U8 function,
180  U16 offset,
181  PLX_STATUS *pStatus
182  );
183 
184 PLX_STATUS EXPORT
185 PlxPci_PciRegisterWrite(
186  U8 bus,
187  U8 slot,
188  U8 function,
189  U16 offset,
190  U32 value
191  );
192 
193 U32 EXPORT
194 PlxPci_PciRegisterReadFast(
195  PLX_DEVICE_OBJECT *pDevice,
196  U16 offset,
197  PLX_STATUS *pStatus
198  );
199 
200 PLX_STATUS EXPORT
201 PlxPci_PciRegisterWriteFast(
202  PLX_DEVICE_OBJECT *pDevice,
203  U16 offset,
204  U32 value
205  );
206 
207 U32 EXPORT
208 PlxPci_PciRegisterRead_BypassOS(
209  U8 bus,
210  U8 slot,
211  U8 function,
212  U16 offset,
213  PLX_STATUS *pStatus
214  );
215 
216 PLX_STATUS EXPORT
217 PlxPci_PciRegisterWrite_BypassOS(
218  U8 bus,
219  U8 slot,
220  U8 function,
221  U16 offset,
222  U32 value
223  );
224 
225 
226 /******************************************
227  * PLX-specific Register Access Functions
228  *****************************************/
229 U32 EXPORT
230 PlxPci_PlxRegisterRead(
231  PLX_DEVICE_OBJECT *pDevice,
232  U32 offset,
233  PLX_STATUS *pStatus
234  );
235 
236 PLX_STATUS EXPORT
237 PlxPci_PlxRegisterWrite(
238  PLX_DEVICE_OBJECT *pDevice,
239  U32 offset,
240  U32 value
241  );
242 
243 U32 EXPORT
244 PlxPci_PlxMappedRegisterRead(
245  PLX_DEVICE_OBJECT *pDevice,
246  U32 offset,
247  PLX_STATUS *pStatus
248  );
249 
250 PLX_STATUS EXPORT
251 PlxPci_PlxMappedRegisterWrite(
252  PLX_DEVICE_OBJECT *pDevice,
253  U32 offset,
254  U32 value
255  );
256 
257 U32 EXPORT
258 PlxPci_PlxMailboxRead(
259  PLX_DEVICE_OBJECT *pDevice,
260  U16 mailbox,
261  PLX_STATUS *pStatus
262  );
263 
264 PLX_STATUS EXPORT
265 PlxPci_PlxMailboxWrite(
266  PLX_DEVICE_OBJECT *pDevice,
267  U16 mailbox,
268  U32 value
269  );
270 
271 
272 /******************************************
273  * PCI Mapping Functions
274  *****************************************/
275 PLX_STATUS EXPORT
276 PlxPci_PciBarProperties(
277  PLX_DEVICE_OBJECT *pDevice,
278  U8 BarIndex,
279  PLX_PCI_BAR_PROP *pBarProperties
280  );
281 
282 PLX_STATUS EXPORT
283 PlxPci_PciBarMap(
284  PLX_DEVICE_OBJECT *pDevice,
285  U8 BarIndex,
286  VOID **pVa
287  );
288 
289 PLX_STATUS EXPORT
290 PlxPci_PciBarUnmap(
291  PLX_DEVICE_OBJECT *pDevice,
292  VOID **pVa
293  );
294 
295 
296 /******************************************
297  * BAR I/O & Memory Access Functions
298  *****************************************/
299 PLX_STATUS EXPORT
300 PlxPci_IoPortRead(
301  PLX_DEVICE_OBJECT *pDevice,
302  U64 port,
303  VOID *pBuffer,
304  U32 ByteCount,
305  PLX_ACCESS_TYPE AccessType
306  );
307 
308 PLX_STATUS EXPORT
309 PlxPci_IoPortWrite(
310  PLX_DEVICE_OBJECT *pDevice,
311  U64 port,
312  VOID *pBuffer,
313  U32 ByteCount,
314  PLX_ACCESS_TYPE AccessType
315  );
316 
317 PLX_STATUS EXPORT
318 PlxPci_PciBarSpaceRead(
319  PLX_DEVICE_OBJECT *pDevice,
320  U8 BarIndex,
321  U32 offset,
322  VOID *pBuffer,
323  U32 ByteCount,
324  PLX_ACCESS_TYPE AccessType,
325  BOOLEAN bOffsetAsLocalAddr
326  );
327 
328 PLX_STATUS EXPORT
329 PlxPci_PciBarSpaceWrite(
330  PLX_DEVICE_OBJECT *pDevice,
331  U8 BarIndex,
332  U32 offset,
333  VOID *pBuffer,
334  U32 ByteCount,
335  PLX_ACCESS_TYPE AccessType,
336  BOOLEAN bOffsetAsLocalAddr
337  );
338 
339 
340 /******************************************
341  * Physical Memory Functions
342  *****************************************/
343 PLX_STATUS EXPORT
344 PlxPci_PhysicalMemoryAllocate(
345  PLX_DEVICE_OBJECT *pDevice,
346  PLX_PHYSICAL_MEM *pMemoryInfo,
347  BOOLEAN bSmallerOk
348  );
349 
350 PLX_STATUS EXPORT
351 PlxPci_PhysicalMemoryFree(
352  PLX_DEVICE_OBJECT *pDevice,
353  PLX_PHYSICAL_MEM *pMemoryInfo
354  );
355 
356 PLX_STATUS EXPORT
357 PlxPci_PhysicalMemoryMap(
358  PLX_DEVICE_OBJECT *pDevice,
359  PLX_PHYSICAL_MEM *pMemoryInfo
360  );
361 
362 PLX_STATUS EXPORT
363 PlxPci_PhysicalMemoryUnmap(
364  PLX_DEVICE_OBJECT *pDevice,
365  PLX_PHYSICAL_MEM *pMemoryInfo
366  );
367 
368 PLX_STATUS EXPORT
369 PlxPci_CommonBufferProperties(
370  PLX_DEVICE_OBJECT *pDevice,
371  PLX_PHYSICAL_MEM *pMemoryInfo
372  );
373 
374 PLX_STATUS EXPORT
375 PlxPci_CommonBufferMap(
376  PLX_DEVICE_OBJECT *pDevice,
377  VOID **pVa
378  );
379 
380 PLX_STATUS EXPORT
381 PlxPci_CommonBufferUnmap(
382  PLX_DEVICE_OBJECT *pDevice,
383  VOID **pVa
384  );
385 
386 
387 /******************************************
388  * Interrupt Support Functions
389  *****************************************/
390 PLX_STATUS EXPORT
391 PlxPci_InterruptEnable(
392  PLX_DEVICE_OBJECT *pDevice,
393  PLX_INTERRUPT *pPlxIntr
394  );
395 
396 PLX_STATUS EXPORT
397 PlxPci_InterruptDisable(
398  PLX_DEVICE_OBJECT *pDevice,
399  PLX_INTERRUPT *pPlxIntr
400  );
401 
402 PLX_STATUS EXPORT
403 PlxPci_NotificationRegisterFor(
404  PLX_DEVICE_OBJECT *pDevice,
405  PLX_INTERRUPT *pPlxIntr,
406  PLX_NOTIFY_OBJECT *pEvent
407  );
408 
409 PLX_STATUS EXPORT
410 PlxPci_NotificationWait(
411  PLX_DEVICE_OBJECT *pDevice,
412  PLX_NOTIFY_OBJECT *pEvent,
413  U64 Timeout_ms
414  );
415 
416 PLX_STATUS EXPORT
417 PlxPci_NotificationStatus(
418  PLX_DEVICE_OBJECT *pDevice,
419  PLX_NOTIFY_OBJECT *pEvent,
420  PLX_INTERRUPT *pPlxIntr
421  );
422 
423 PLX_STATUS EXPORT
424 PlxPci_NotificationCancel(
425  PLX_DEVICE_OBJECT *pDevice,
426  PLX_NOTIFY_OBJECT *pEvent
427  );
428 
429 
430 /******************************************
431  * Serial EEPROM Access Functions
432  *****************************************/
433 PLX_EEPROM_STATUS EXPORT
434 PlxPci_EepromPresent(
435  PLX_DEVICE_OBJECT *pDevice,
436  PLX_STATUS *pStatus
437  );
438 
439 BOOLEAN EXPORT
440 PlxPci_EepromProbe(
441  PLX_DEVICE_OBJECT *pDevice,
442  PLX_STATUS *pStatus
443  );
444 
445 PLX_STATUS EXPORT
446 PlxPci_EepromGetAddressWidth(
447  PLX_DEVICE_OBJECT *pDevice,
448  U8 *pWidth
449  );
450 
451 PLX_STATUS EXPORT
452 PlxPci_EepromSetAddressWidth(
453  PLX_DEVICE_OBJECT *pDevice,
454  U8 width
455  );
456 
457 PLX_STATUS EXPORT
458 PlxPci_EepromCrcUpdate(
459  PLX_DEVICE_OBJECT *pDevice,
460  U32 *pCrc,
461  BOOLEAN bUpdateEeprom
462  );
463 
464 PLX_STATUS EXPORT
465 PlxPci_EepromCrcGet(
466  PLX_DEVICE_OBJECT *pDevice,
467  U32 *pCrc,
468  U8 *pCrcStatus
469  );
470 
471 PLX_STATUS EXPORT
472 PlxPci_EepromReadByOffset(
473  PLX_DEVICE_OBJECT *pDevice,
474  U32 offset,
475  U32 *pValue
476  );
477 
478 PLX_STATUS EXPORT
479 PlxPci_EepromWriteByOffset(
480  PLX_DEVICE_OBJECT *pDevice,
481  U32 offset,
482  U32 value
483  );
484 
485 PLX_STATUS EXPORT
486 PlxPci_EepromReadByOffset_16(
487  PLX_DEVICE_OBJECT *pDevice,
488  U32 offset,
489  U16 *pValue
490  );
491 
492 PLX_STATUS EXPORT
493 PlxPci_EepromWriteByOffset_16(
494  PLX_DEVICE_OBJECT *pDevice,
495  U32 offset,
496  U16 value
497  );
498 
499 
500 /******************************************
501  * PLX VPD Functions
502  *****************************************/
503 U32 EXPORT
504 PlxPci_VpdRead(
505  PLX_DEVICE_OBJECT *pDevice,
506  U16 offset,
507  PLX_STATUS *pStatus
508  );
509 
510 PLX_STATUS EXPORT
511 PlxPci_VpdWrite(
512  PLX_DEVICE_OBJECT *pDevice,
513  U16 offset,
514  U32 value
515  );
516 
517 
518 /******************************************
519  * DMA Functions
520  *****************************************/
521 PLX_STATUS EXPORT
522 PlxPci_DmaChannelOpen(
523  PLX_DEVICE_OBJECT *pDevice,
524  U8 channel,
525  PLX_DMA_PROP *pDmaProp
526  );
527 
528 PLX_STATUS EXPORT
529 PlxPci_DmaGetProperties(
530  PLX_DEVICE_OBJECT *pDevice,
531  U8 channel,
532  PLX_DMA_PROP *pDmaProp
533  );
534 
535 PLX_STATUS EXPORT
536 PlxPci_DmaSetProperties(
537  PLX_DEVICE_OBJECT *pDevice,
538  U8 channel,
539  PLX_DMA_PROP *pDmaProp
540  );
541 
542 PLX_STATUS EXPORT
543 PlxPci_DmaControl(
544  PLX_DEVICE_OBJECT *pDevice,
545  U8 channel,
546  PLX_DMA_COMMAND command
547  );
548 
549 PLX_STATUS EXPORT
550 PlxPci_DmaStatus(
551  PLX_DEVICE_OBJECT *pDevice,
552  U8 channel
553  );
554 
555 PLX_STATUS EXPORT
556 PlxPci_DmaTransferBlock(
557  PLX_DEVICE_OBJECT *pDevice,
558  U8 channel,
559  PLX_DMA_PARAMS *pDmaParams,
560  U64 Timeout_ms
561  );
562 
563 PLX_STATUS EXPORT
564 PlxPci_DmaTransferUserBuffer(
565  PLX_DEVICE_OBJECT *pDevice,
566  U8 channel,
567  PLX_DMA_PARAMS *pDmaParams,
568  U64 Timeout_ms
569  );
570 
571 PLX_STATUS EXPORT
572 PlxPci_DmaChannelClose(
573  PLX_DEVICE_OBJECT *pDevice,
574  U8 channel
575  );
576 
577 
578 /******************************************
579  * Performance Monitoring Functions
580  *****************************************/
581 PLX_STATUS EXPORT
582 PlxPci_PerformanceInitializeProperties(
583  PLX_DEVICE_OBJECT *pDevice,
584  PLX_PERF_PROP *pPerfObject
585  );
586 
587 PLX_STATUS EXPORT
588 PlxPci_PerformanceMonitorControl(
589  PLX_DEVICE_OBJECT *pDevice,
590  PLX_PERF_CMD command
591  );
592 
593 PLX_STATUS EXPORT
594 PlxPci_PerformanceResetCounters(
595  PLX_DEVICE_OBJECT *pDevice,
596  PLX_PERF_PROP *pPerfProps,
597  U8 NumOfObjects
598  );
599 
600 PLX_STATUS EXPORT
601 PlxPci_PerformanceGetCounters(
602  PLX_DEVICE_OBJECT *pDevice,
603  PLX_PERF_PROP *pPerfProps,
604  U8 NumOfObjects
605  );
606 
607 PLX_STATUS EXPORT
608 PlxPci_PerformanceCalcStatistics(
609  PLX_PERF_PROP *pPerfProp,
610  PLX_PERF_STATS *pPerfStats,
611  U32 ElapsedTime_ms
612  );
613 
614 
615 /******************************************
616  * Multi-Host Switch Functions
617  *****************************************/
618 PLX_STATUS EXPORT
619 PlxPci_MH_GetProperties(
620  PLX_DEVICE_OBJECT *pDevice,
621  PLX_MULTI_HOST_PROP *pMHProp
622  );
623 
624 PLX_STATUS EXPORT
625 PlxPci_MH_MigratePorts(
626  PLX_DEVICE_OBJECT *pDevice,
627  U16 VS_Source,
628  U16 VS_Dest,
629  U32 DsPortMask,
630  BOOLEAN bResetSrc
631  );
632 
633 
634 /******************************************
635  * PLX Non-Transparent Port Functions
636  *****************************************/
637 PLX_STATUS EXPORT
638 PlxPci_Nt_ReqIdProbe(
639  PLX_DEVICE_OBJECT *pDevice,
640  BOOLEAN bRead,
641  U16 *pReqId
642  );
643 
644 PLX_STATUS EXPORT
645 PlxPci_Nt_LutProperties(
646  PLX_DEVICE_OBJECT *pDevice,
647  U16 LutIndex,
648  U16 *pReqId,
649  U32 *pFlags,
650  BOOLEAN *pbEnabled
651  );
652 
653 PLX_STATUS EXPORT
654 PlxPci_Nt_LutAdd(
655  PLX_DEVICE_OBJECT *pDevice,
656  U16 *pLutIndex,
657  U16 ReqId,
658  U32 flags
659  );
660 
661 PLX_STATUS EXPORT
662 PlxPci_Nt_LutDisable(
663  PLX_DEVICE_OBJECT *pDevice,
664  U16 LutIndex
665  );
666 
667 
668 
669 
670 #ifdef __cplusplus
671 }
672 #endif
673 
674 #endif
Definition: PlxTypes.h:657
Definition: PlxTypes.h:579
Definition: PlxTypes.h:817
Definition: PlxTypes.h:666
Definition: PlxTypes.h:701
Definition: PlxTypes.h:531
Definition: PlxTypes.h:765
Definition: PlxTypes.h:748
Definition: PlxTypes.h:541
Definition: PlxTypes.h:643
Definition: PlxTypes.h:489
Definition: PlxTypes.h:616
Definition: PlxTypes.h:553
Definition: PlxTypes.h:563
Definition: PlxTypes.h:509