This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

am387x dual ethernet

I have board with two ethernet interfaces(MII).
In WEC7 me need two interface CPSW3G1 and CPSW3G2, with different IP on each port.

If i use standart driver as switch (defines BSP_ETH_CPSW3G_DRIVER) work both Port but with one IP(CPSW3G1) on each port. it says about the operability both port.

If I use single mac port(BSP_ETH_CPGMAC_DRIVER), WEC7 detect bough interface CPSW3G1, CPSW3G2, but work only CPSW3G1.
Problem with CPSW3G2 following, after insert cable in Port2 occurs interrupt and driver call Cpsw3g_MiniportHandleInterrupt and MiniportAdapterContext contains information about first Port. I understand that for NDIS driver need inform the interrupt source(may be in ISR) to switch structure? or am I wrong? and how do it if i right?

  • Hi guys!
    After learning documentation on NDIS , i am implemented Installable ISR driver.

    After call LoadIntChainHandler my driver added new instance, and set necessary value after call KernelLibIoControl, but not occur call ISRHandler after generated interrupt from emac. Anyone have a similar problem?

    my cpsw3g_intr.c
    //////////////////////////////////////

    NDIS_STATUS Cpsw3g_MiniportRegisterOneInterrupt(
    PCPSW3G_ADAPTER pAdapter, PNDIS_MINIPORT_INTERRUPT InterruptInfo, UINT Interrupt)
    {
        NDIS_STATUS Status;

        UINT32 SysIntr;

        /* Register the interrupt */
       Status = NdisMRegisterInterrupt(
          InterruptInfo,
          pAdapter->AdapterHandle,
          Interrupt,
          0, //ignored
          TRUE, // RequestISR
          TRUE, // SharedInterrupt
          0); //ignored


      if (Status != NDIS_STATUS_SUCCESS)
       {
             return Status;
       }

       pAdapter->hISR = LoadIntChainHandler(
             TEXT("emacisr.dll"),
             TEXT("ISRHandler"),
             (BYTE)pAdapter->Cfg.InterruptVector);

       if (pAdapter->hISR == NULL)
       {
          return NDIS_STATUS_FAILURE;
       }

      pAdapter->IsrInfo.RxIntPortAddr = (UINT32)&(pAdapter->pCpsw3gRegsBase->Rx_IntStat_Masked);
       ...
       pAdapter->IsrInfo.SysIntr = InterruptInfo->InterruptObject->InterruptId;


       if (!KernelLibIoControl(
          pAdapter->hISR,
          0,//IOCntrolCode
          &(pAdapter->IsrInfo),
          sizeof(CPGMAC_ISR_INFO),
          NULL,
          0x00,
          NULL))
       {
          return NDIS_STATUS_FAILURE;
       }

       RETAILMSG(1, (L" CPGMAC:LoadISR - KernelLibIoControl Succeeded\r\n"));
       return NDIS_STATUS_SUCCESS;

    }

    Thank you all, figured out :)
    needed to add NKCallIntChain for correspond IRQ in OEMInterruptHandler.

    Regards,
    Krasutski

  • i have the same program problem.

    wait for answer.