Project

General

Profile

Bug #5552 ยป test.c

Josef Sipek, 2015-01-21 02:59 PM

 
1
#include <smhbaapi.h>
2
#include <stdio.h>
3

    
4
int main(void)
5
{
6
	SMHBA_LIBRARYATTRIBUTES libattrs;
7
	HBA_STATUS status;
8
	HBA_UINT32 num, i;
9
	char name[256];
10

    
11
	HBA_LoadLibrary();
12
	num = HBA_GetNumberOfAdapters();
13
	printf("Adapter nums :%d\n", num);
14

    
15
	for (i = 0; i < num; ++i) {
16
		status = SMHBA_GetVendorLibraryAttributes(i, &libattrs);
17
		if (status != 1)
18
			continue;
19

    
20
		status = HBA_GetAdapterName(i, name);
21
		if (status != HBA_STATUS_OK || name[0] == 0)
22
			continue;
23

    
24
		printf("HBA name %s: status: %d\n", name, status);
25
	}
26

    
27
	return 0;
28
}
    (1-1/1)