Changeset bb9e843 in rtems


Ignore:
Timestamp:
03/14/05 21:45:03 (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
e9105d4
Parents:
fb77bc8
Message:

2005-03-14 Joel Sherrill <joel@…>

  • libchip/network/dec21140.c, libchip/network/elnk.c, libchip/network/if_fxp.c: Continue PCI API unification. All use pci_find_device(). Network drivers manufacture a signature since all calls have not been converted yet.
Location:
c/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/ChangeLog

    rfb77bc8 rbb9e843  
     12005-03-14      Joel Sherrill <joel@OARcorp.com>
     2
     3        * libchip/network/dec21140.c, libchip/network/elnk.c,
     4        libchip/network/if_fxp.c: Continue PCI API unification. All use
     5        pci_find_device(). Network drivers manufacture a signature since all
     6        calls have not been converted yet.
     7
    182005-03-04      Joel Sherrill <joel@OARcorp.com>
    29
  • c/src/libchip/network/dec21140.c

    rfb77bc8 rbb9e843  
    589589    */
    590590   setup_frm = (volatile unsigned char *)(bus_to_phys(rmd->buf1));
    591    eaddrs = (char *)(sc->arpcom.ac_enaddr);
     591   eaddrs = (unsigned char *)(sc->arpcom.ac_enaddr);
    592592   /* Fill the buffer with our physical address. */
    593593   for (i = 1; i < 16; i++) {
     
    10131013#if defined(__i386__)
    10141014   int          signature;
    1015    int          value;
    1016    char         interrupt;
    1017    int          diag;
    1018    unsigned int deviceId;
    1019 #endif
     1015   unsigned int value;
     1016   unsigned char interrupt;
     1017#endif
     1018   int          pbus, pdev, pfun;
    10201019#if defined(__PPC__)
    1021    int          pbus, pdev, pfun;
    10221020   int          tmp;
    10231021   unsigned int lvalue;
     
    10401038
    10411039   if (pci_initialize() != PCIB_ERR_SUCCESS)
    1042       rtems_panic("Unable to initialize PCI");
    1043 
    1044 
     1040      rtems_panic("dec2114x: Unable to initialize PCI");
     1041
     1042   /*
     1043    * Find the board
     1044    */
     1045   if ( pci_find_device(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21140,
     1046                          unitNumber-1, &pbus, &pdev, &pfun) == -1 ) {
     1047      if ( pci_find_device(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21143,
     1048                             unitNumber-1, &pbus, &pdev, &pfun) != -1 ) {
     1049
     1050        /* the 21143 chip must be enabled before it can be accessed */
    10451051#if defined(__i386__)
    1046    /*
    1047     * First, find a DEC board
    1048     */
    1049 
    1050    /*
    1051     * Try to find the network card on the PCI bus. Probe for a DEC 21140
    1052     * card first. If not found probe the bus for a DEC/Intel 21143 card.
    1053     */
    1054    deviceId = PCI_DEVICE_ID_DEC_21140;
    1055    diag = pcib_find_by_devid( PCI_VENDOR_ID_DEC, deviceId, unitNumber-1, &signature);
    1056 
    1057    if ( diag == PCIB_ERR_SUCCESS)
    1058       printk( "DEC 21140 PCI network card found\n" );
    1059    else
    1060    {
    1061       deviceId = PCI_DEVICE_ID_DEC_21143;
    1062       diag = pcib_find_by_devid( PCI_VENDOR_ID_DEC, deviceId, unitNumber-1, &signature);
    1063       if ( diag == PCIB_ERR_SUCCESS)
    1064          printk( "DEC/Intel 21143 PCI network card found\n" );
    1065       else
    1066       {
    1067          printk("No DEC/Intel 21140/3 PCI network card found !!\n");
    1068          return 0;
    1069       }
    1070    }
    1071 #endif
    1072 #if defined(__PPC__)
    1073    /*
    1074     * Find the board
    1075     */
    1076    if( BSP_pciFindDevice( PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21140,
    1077                           unitNumber-1, &pbus, &pdev, &pfun) == -1 )
    1078    {
    1079       if( BSP_pciFindDevice( PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21143,
    1080                              unitNumber-1, &pbus, &pdev, &pfun) != -1 )
    1081       {
    1082 
    1083          pci_write_config_dword(pbus,
    1084                                 pdev,
    1085                                 pfun,
    1086                                 0x40,
    1087                                 PCI_DEVICE_ID_DEC_21143 );
    1088 
    1089       }
    1090       else
    1091       {
     1052        signature =  PCIB_DEVSIG_MAKE( pbus, pdev, pfun );
     1053        pcib_conf_write32( signature, 0x40, 0 );
     1054#else
     1055        pci_write_config_dword(pbus, pdev, pfun, 0x40, PCI_DEVICE_ID_DEC_21143);
     1056#endif
     1057
     1058      } else {
    10921059         printk("dec2114x : device '%s' not found on PCI bus\n", config->name );
    10931060         return 0;
     
    10961063
    10971064#ifdef DEC_DEBUG
    1098    else
    1099    {
     1065   else {
    11001066      printk("dec21140 : found device '%s', bus 0x%02x, dev 0x%02x, func 0x%02x\n",
    11011067             config->name, pbus, pdev, pfun);
     
    11031069#endif
    11041070
    1105 #endif
    1106 
     1071#if defined(__i386__)
     1072   signature =  PCIB_DEVSIG_MAKE( pbus, pdev, pfun );
     1073#endif
    11071074
    11081075
     
    11391106    */
    11401107#if defined(__i386__)
    1141 
    1142    /* the 21143 chip must be enabled before it can be accessed */
    1143    if ( deviceId == PCI_DEVICE_ID_DEC_21143 )
    1144       pcib_conf_write32( signature, 0x40, 0 );
    11451108
    11461109   pcib_conf_read32(signature, 16, &value);
  • c/src/libchip/network/elnk.c

    rfb77bc8 rbb9e843  
    31403140#if defined(__i386__)
    31413141   int          signature;
    3142    int          value;
    3143    char         interrupt;
     3142   unsigned int   value;
     3143   unsigned char  interrupt;
    31443144#endif
    31453145#if defined(__PPC__)
     
    31803180      for( i=0; !done && xl_devs[i].xl_vid; i++)
    31813181      {
    3182          for(unum= 1; !done && BSP_pciFindDevice( xl_devs[i].xl_vid, xl_devs[i].xl_did, unum-1,
     3182         for(unum= 1; !done &&
     3183                pci_find_device( xl_devs[i].xl_vid, xl_devs[i].xl_did, unum-1,
    31833184                                         &sysboards[numFound].pbus,
    31843185                                         &sysboards[numFound].pdev,
  • c/src/libchip/network/if_fxp.c

    rfb77bc8 rbb9e843  
    460460         * find device on pci bus
    461461         */
    462     { int j;
     462    { int j; int pbus, pdev, pfun;
    463463
    464464      for (j=0; fxp_ident_table[j].devid; j++ ) {
    465                 i = pcib_find_by_devid( 0x8086,
    466                         fxp_ident_table[j].devid,
    467                         unitNumber-1,
    468                         &(sc->pci_signature));
     465                i = pci_find_device( 0x8086, fxp_ident_table[j].devid,
     466                        unitNumber-1, &pbus, &pdev, &pfun );
     467                sc->pci_signature =  PCIB_DEVSIG_MAKE( pbus, pdev, pfun );
    469468                DBGLVL_PRINTK(2,"fxp_attach: find_devid returned %d "
    470469                      "and pci signature 0x%x\n",
Note: See TracChangeset for help on using the changeset viewer.