1ǻHi3511V100 PCIͨЭ㣬
|-- Makefile			
|-- hios_mcc			/* MCCͨЭ */
|   |-- Makefile
|   |-- hi_mcc_usrdev.h
|   |-- hios_mcc.c
|   `-- hios_mcc_usrdev.c
|-- hios_mcc_test		/* MCCͨЭû̬Դ */
|   |-- mccu-hostsend.c
|   |-- mccu-slaveread.c
|   `-- mccu-test.c
|-- hios_pci			/* PCIͨЭ */
|   |-- Makefile
|   |-- drv			/* PCIͨЭ */
|   |   |-- data_common.c
|   |   `-- proto_common.c
|   `-- hal			/* PCIӲʼ */
|       |-- hisi_pci_hosthw.c
|       `-- hisi_pci_slavehw.c
|-- hios_pci_test		/* PCIͨЭԴ */
|   |-- Makefile
|   |-- test_multi_open.c
|   |-- test_normal.c
|   |-- test_normal_speed.c
|   |-- test_priority.c
|   `-- test_priority_speed.c
|-- include			/* ͷļĿ¼ */
|   |-- data_common.h		
|   |-- hi_mcc_usrdev.h		/* ṩͻͷļ */
|   |-- hisi_pci_hw.h
|   `-- proto.h			/* PCIͨЭṩAPIͷļ */
`-- readme.txt

2˳
host˳pci_hwhal_host.kohi_hw_adp.kopcicom.komcc_usrdev.ko
10sslave˳pci_hwhal_slave.kohi_hw_adp.kopcicom.komcc_usrdev.ko
pcicom.koȷϣȷϵȴʱĿǰΪ10s

pci_hwhal_slave.koں˲
insmod pci_hwhal_slave.ko shm_phys_addr=<ڴʼַ> shm_size=<ڴС>

hi_hw_adp.koǿָڴshm_phys_addrַƫƣĬֵ0һϱһ£ƫƺĹڴ治ܴshm_size
insmod hi_hw_adp.ko offset_size=<ƫƾ>

3hios_mcc Ŀ¼аװں̬û̬MCCͨŽӿ
û̬ʹòο˷mccu-hostsend.c Ӷ˽mccu-slaveread.c

int main()
{
        struct hi_mcc_handle_attr attr;
	int fd
	int ret;
	void buf[DATA_SIZE]
	fd_set fds;

	FD_ZERO(&fds);

	fd = open("/dev/himedia/mcc_userdev", O_RDWR);

	/* ÿһopen HI_MCC_IOC_CONNECTattrݣݷֵжǷóɹ*/
	/* 豸ϱдԶtarget_idϢڲhi_hosthw_pcicom.koʱӡ */
	/* 豸target_id ֻд0 */
        attr.target_id = 0;
	
        attr.port = 0;	// port 0~1023

	/* ͨͨpriorityΪ0ͨpriorityΪ1 */
        attr.priority = 1;

	if(ioctl(fd, HI_MCC_IOC_CONNECT, &attr)){
		printf("connect error\n");
		return -1;
	}
	FD_SET(fd, &fds);
	
	/* ͬͣ߳ɹطͳȣ-1 */
	ret = write(fd, buf, DATA_SIZE);
	if(ret < 0){
		printf("write error\n");
	 	return -1;
	}
	
	/* 첽գΪֹ */
	select(fd + 1, &fds, NULL, NULL, NULL);
	
	/* ͬգշؽճȣûݷΪ0 */
	ret = read(fd, buf, DATA_SIZE);

	return 0;
}

4ʱҪָں·޸ĸĿ¼MakefileеKERNEL_MAKE
