Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Jan 2007 15:00:34 +0200
From:      "Conrad Burger" <conrad.burger@mxit.com>
To:        <freebsd-current@freebsd.org>
Subject:   Need Help:: BCE Interface -  back port SERDES support to STABLE 
Message-ID:  <45FBF1D2998C93429047415BE8091CC8283E08@HERMES.swistgroup.com>

next in thread | raw e-mail | index | archive | help
*******************************************************************
Click here to view our e-mail legal notice: 
http://www.mxit.co.za/pdfs/mxit_legal.pdf or call: +27 21 888 5000
*******************************************************************
Hi=20

Could someone please help me to create a patch to back port the SERDES =
support
that was recently added to the BCE driver in CURRENT to STABLE?

I have been waiting for SERDES support on STABLE for about 3 months and =
I'm
getting rather desperate.

I am trying to back port it myself using diffs from BCE-STABLE and =
BCE-CURRENT.=20
But with almost no C experience and even less writing drivers it's going =
to take
awhile.
Currently my kernel panics during boot when it tries to attach/probe the =
network
interface.=20

I would be much appreciated it if someone could help me.

Regards=20
Conrad=20

My latest try.

*** if_bce.c-v1.27      Wed Jan 31 15:02:26 2007
--- if_bce.c-conrad-mod Wed Jan 31 13:18:00 2007
***************
*** 452,458 ****
        struct bce_softc *sc;
        struct ifnet *ifp;
        u32 val;
!       int count, mbuf, rid, rc =3D 0;

        sc =3D device_get_softc(dev);
        sc->bce_dev =3D dev;
--- 452,459 ----
        struct bce_softc *sc;
        struct ifnet *ifp;
        u32 val;
!       //#!# int count, mbuf, rid, rc =3D 0;
!       int mbuf, rid, rc =3D 0;

        sc =3D device_get_softc(dev);
        sc->bce_dev =3D dev;
***************
*** 485,496 ****
        sc->bce_vhandle =3D (vm_offset_t) rman_get_virtual(sc->bce_res);

        /* Allocate PCI IRQ resources. */
!       count =3D pci_msi_count(dev);
        if (count =3D=3D 1 && pci_alloc_msi(dev, &count) =3D=3D 0) {
                rid =3D 1;
                sc->bce_flags |=3D BCE_USING_MSI_FLAG;
        } else
!               rid =3D 0;
        sc->bce_irq =3D bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
            RF_SHAREABLE | RF_ACTIVE);

--- 486,498 ----
        sc->bce_vhandle =3D (vm_offset_t) rman_get_virtual(sc->bce_res);

        /* Allocate PCI IRQ resources. */
! /*#!# count =3D pci_msi_count(dev);
        if (count =3D=3D 1 && pci_alloc_msi(dev, &count) =3D=3D 0) {
                rid =3D 1;
                sc->bce_flags |=3D BCE_USING_MSI_FLAG;
        } else
! */            rid =3D 0;
!
        sc->bce_irq =3D bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
            RF_SHAREABLE | RF_ACTIVE);

***************
*** 2525,2535 ****
        if (sc->bce_irq !=3D NULL)
                bus_release_resource(dev,
                        SYS_RES_IRQ,
!                       sc->bce_flags & BCE_USING_MSI_FLAG ? 1 : 0,
                        sc->bce_irq);

!       if (sc->bce_flags & BCE_USING_MSI_FLAG)
                pci_release_msi(dev);

        if (sc->bce_res !=3D NULL)
                bus_release_resource(dev,
--- 2527,2539 ----
        if (sc->bce_irq !=3D NULL)
                bus_release_resource(dev,
                        SYS_RES_IRQ,
!                       //sc->bce_flags & BCE_USING_MSI_FLAG ? 1 : 0,
!                       0,
                        sc->bce_irq);

!       /* #!#if (sc->bce_flags & BCE_USING_MSI_FLAG)
                pci_release_msi(dev);
+       */

        if (sc->bce_res !=3D NULL)
                bus_release_resource(dev,
***************
*** 4129,4136 ****
  #if __FreeBSD_version < 700000
                                VLAN_INPUT_TAG(ifp, m, =
l2fhdr->l2_fhdr_vlan_tag,
continue);
  #else
!                               m->m_pkthdr.ether_vtag =3D
l2fhdr->l2_fhdr_vlan_tag;
!                               m->m_flags |=3D M_VLANTAG;
  #endif
                        }

--- 4133,4144 ----
  #if __FreeBSD_version < 700000
                                VLAN_INPUT_TAG(ifp, m, =
l2fhdr->l2_fhdr_vlan_tag,
continue);
  #else
! // #!#                                m->m_pkthdr.ether_vtag =3D
l2fhdr->l2_fhdr_vlan_tag;
! // #!#                                m->m_flags |=3D M_VLANTAG;
!                               VLAN_INPUT_TAG(ifp, m,
l2fhdr->l2_fhdr_vlan_tag);
!                               if (m =3D=3D NULL)
!                                       continue;
!
  #endif
                        }

***************
*** 4515,4520 ****
--- 4523,4530 ----
        bus_dma_segment_t segs[BCE_MAX_SEGMENTS];
        bus_dmamap_t map;
        struct tx_bd *txbd =3D NULL;
+       //#!#
+       struct m_tag *mtag;
        struct mbuf *m0;
        u16 vlan_tag =3D 0, flags =3D 0;
        u16 chain_prod, prod;
***************
*** 4535,4544 ****
        }

        /* Transfer any VLAN tags to the bd. */
!       if (m0->m_flags & M_VLANTAG) {
                flags |=3D TX_BD_FLAGS_VLAN_TAG;
                vlan_tag =3D m0->m_pkthdr.ether_vtag;
        }

        /* Map the mbuf into DMAable memory. */
        prod =3D sc->tx_prod;
--- 4545,4560 ----
        }

        /* Transfer any VLAN tags to the bd. */
! /* #!#        if (m0->m_flags & M_VLANTAG) {
                flags |=3D TX_BD_FLAGS_VLAN_TAG;
                vlan_tag =3D m0->m_pkthdr.ether_vtag;
                }
+ */
+       mtag =3D VLAN_OUTPUT_TAG(sc->bce_ifp, m0);
+       if (mtag !=3D NULL) {
+               flags |=3D TX_BD_FLAGS_VLAN_TAG;
+               vlan_tag =3D VLAN_TAG_VALUE(mtag);
+       }

        /* Map the mbuf into DMAable memory. */
        prod =3D sc->tx_prod;







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45FBF1D2998C93429047415BE8091CC8283E08>