PCI Programming

From: Cole (cole_at_opteqint.net)
Date: 04/28/05

  • Next message: Bruce M Simpson: "Re: PCI Programming"
    To: <freebsd-hackers@freebsd.org>
    Date: Thu, 28 Apr 2005 19:39:33 +0200
    
    

    Hey

    Im currently trying to port some linux pci driver to FreeBSD code. But im running into a problem. Its using a function that I cant
    seem to find the equivalent of for FreeBSD.

    Heres the function up to the point where im getting stuck.

    int FindDevice( void )
    {

        static struct pci_dev *pciptr;
        int pci_info_index = 0;
        U16 wDev;
        unsigned int tmp_addr;

            /*-----------------------------------------*/
    #ifdef CONFIG_PCI // find the specified device and its configuration
      if( pcibios_present() ){

        pci_for_each_dev( pciptr ){
            if ((pciptr->vendor == VENDOR_ID) && \
                (pciptr->device == DEVICE_ID) && \
                (pciptr->subsystem_vendor == SUBSYSTEM_VID) && \
                (pciptr->subsystem_device == SUBSYSTEM_DID) && \
                (PCI_FUNC(pciptr->devfn) == 0) )
            {
                        DevExtension[pci_info_index].wBus= pciptr->bus->number;
                        DevExtension[pci_info_index].wDevFunc= pciptr->devfn;
                        DevExtension[pci_info_index].wCard = pci_info_index;
                        tmp_addr = pci_resource_start( pciptr, 4 );
                        DevExtension[pci_info_index].func0_bar = (tmp_addr & ~0x03);

    now the function im getting stuck at, is the "tmp_addr = pci_resource_start(pciptr, 4). I was wondering if anyone knows of an
    equivalent under FreeBSD. Or if there is a way to obtain that value with some other method in FreeBSD. I am pretty much fine up
    until that point.

    If anyone has any sample code or anything that I could read to proceed any further, it would be greatly appreciated.

    Regards
    /Cole

    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: Bruce M Simpson: "Re: PCI Programming"

    Relevant Pages

    • Re: Is FreeBSD a Novelty Operating System?
      ... the windows system cannot be used for much of the new windows ... The upgrades to FreeBSD are far easier than any other OS I've ever ... 'ported' from other operating systems. ... FreeBSD code. ...
      (comp.unix.bsd.freebsd.misc)
    • Re: GigaByte GA-MA69VM USB+mouse problem [WAS: AMD690G/V issues with 7-current (sata, usb)]
      ... I'm thinking opposite - it definitely is FreeBSD code (in combination ... Windows 2000 can initialize the mouse without any problems (and with ...
      (freebsd-current)
    • Datafab umass device - quirks
      ... Got myself a Datafab KCCF-USBG CompactFlash based usb mass storage ... Initially the device did not work with FreeBSD. ... seems like the FreeBSD code is derived from ... Looking at the HEAD branch of FreeBSD and NetBSD, ...
      (freebsd-questions)
    • Re: Autostart files
      ... > However I cant find out how to start this, I want to add this to the ... good conscience without warning you about wu-ftpd's horrid security ... Version: GnuPG v1.4.0 (FreeBSD) ...
      (freebsd-questions)
    • Re: Where are the config files stored?
      ... > disturbing. ... > I install a soft like postfix for example and I cant find the sample ... > That's not right for freebsd and I cant find those sample for procmail ...
      (freebsd-questions)