On 05/25/10 08:59 AM, 邓宁 wrote:
> #define PATH "/dd/spmdriver"
>
> int fd, i = 0; //file descriptor
>
>
> volatile unsigned int *myDevice; //device pointer
>
> printf("Opening device...\n");
>
> fd = open(PATH, O_RDWR);
>
> myDevice = (unsigned int *) mmap (NULL, LENGTH, PROT_READ | PROT_WRITE,
> MAP_SHARED, fd, 0);
>
Please do "file /dd/spmdriver".
Note the example code in the Device Driver Tutorial creates
a pseudo device node:
if (ddi_create_minor_node(dip, "0", S_IFCHR,
ddi_get_instance(dip), DDI_PSEUDO,0)!= DDI_SUCCESS)
For your hardware device type you should probably use DDI_NT_NET.
After a successful attach the device path should be "/dev/spm".
_______________________________________________
driver-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/driver-discuss