From owner-freebsd-current@FreeBSD.ORG Wed Jan 31 16:25:08 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 06F6B16A4D2 for ; Wed, 31 Jan 2007 16:25:07 +0000 (UTC) (envelope-from conrad.burger@mxit.com) Received: from smtp.swistgroup.com (smtp.swisttech.com [196.211.145.42]) by mx1.freebsd.org (Postfix) with ESMTP id CEA9313C467 for ; Wed, 31 Jan 2007 16:25:05 +0000 (UTC) (envelope-from conrad.burger@mxit.com) Received: from localhost (localhost [127.0.0.1]) by smtp.swistgroup.com (Postfix) with ESMTP id 7CF15BCFFD for ; Wed, 31 Jan 2007 14:52:06 +0200 (SAST) Received: from smtp.swistgroup.com ([127.0.0.1]) by localhost (fw-swist [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 01858-07 for ; Wed, 31 Jan 2007 14:52:06 +0200 (SAST) Received: from timon.swistgroup.com (unknown [172.16.1.30]) by smtp.swistgroup.com (Postfix) with ESMTP id F2913B5B94 for ; Wed, 31 Jan 2007 14:52:05 +0200 (SAST) Received: from mailnull by timon.swistgroup.com with local (Exim 4.52 (FreeBSD)) id 1HCF9i-0005EG-6g for freebsd-current@freebsd.org; Wed, 31 Jan 2007 15:05:42 +0200 Received: from hermes.swistgroup.com ([172.16.1.6]) by timon.swistgroup.com with esmtp (Exim 4.52 (FreeBSD)) id 1HCF9i-0005E4-4t for freebsd-current@freebsd.org; Wed, 31 Jan 2007 15:05:42 +0200 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Wed, 31 Jan 2007 15:00:34 +0200 Message-ID: <45FBF1D2998C93429047415BE8091CC8283E08@HERMES.swistgroup.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Need Help:: BCE Interface - back port SERDES support to STABLE Thread-Index: AcdFOOQCi5PRsn4PSMS8k++QGMUYvw== From: "Conrad Burger" To: X-disclaimer: Legalsentry X-Virus-Scanned: by amavisd-new at example.com Subject: Need Help:: BCE Interface - back port SERDES support to STABLE X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jan 2007 16:25:08 -0000 ******************************************************************* 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;