Some Questions

Yong Ma mayong at mail.com
Tue Oct 18 01:27:01 PDT 2005


Hi everybody:
 

I'm new here,nice to meet you all! I'm also aFreeBSD_device_driver newbie, and now I'm enaged in writting a driverfor a cryptographic accelerator card.As a preparation I read thesections of device driver in "FreeBSD Architecture Handbook",andexercised the example driver in the book.now I have several questions(maybeeasy for you but most useful for me):

1)Some drivers declares the device_open() as int device_open(dev_t dev,...),and some declare it as int device_open(struct cdev
*dev,...),sometimes the first one couldn't be compliedsuccessfully,what's the difference?

2) if (pci_get_vendor(dev) == 0x11c1) { ...
                              ~~~~~~~~how to get this number if I don't know it?

3)Could the device on PCI slot be listed by /pciconf -l /without driver.

4)The printf() seems not work under XWindow mode in functions like deviec_prob or device_attach,how to make it work?

5)If only the pseudo-device in /dev can be destroyed with destroy_dev(sc->dev0) in detach() function in a KLD driver? I can't do that!

Thanks 
Ma

-- 
___________________________________________________
Play 100s of games for FREE! http://games.mail.com/



More information about the freebsd-drivers mailing list