Subject: kern/20482: if_xi.c compilation fails on Sparc
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jruschme@comcast.net>
List: netbsd-bugs
Date: 02/24/2003 13:08:58
>Number:         20482
>Category:       kern
>Synopsis:       if_xi.c compilation fails on Sparc
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 24 13:09:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     John Ruschmeyer
>Release:        1.6
>Organization:
none
>Environment:
NetBSD crobin 1.6 NetBSD 1.6 (CROBIN) #1: Sun Feb 23 16:59:53 EST 2003     jruschme@crobin:/usr/src/sys/arch/sparc/compile/CROBIN sparc
>Description:
The xi (Xircom CC Ethernet) driver has several places where a bus space offset pointer is declared as bus_addr_t instead of bus_size_t. This causes the if_xi.c code to fail compilation on Sparc32 (and possibly other) platforms when warnings are treated as errors.
>How-To-Repeat:
Create kernel config file for Sparc which enables nell PCMCIA driver and the MI 'xi' driver. Config and compile.
>Fix:
*** if_xi.c.orig        Mon Feb 24 15:44:53 2003
--- if_xi.c     Mon Feb 24 15:52:09 2003
***************
*** 439,445 ****
        if (sc->sc_flags & XIFLAGS_DINGO) {
                struct pcmcia_mem_handle pcmh;
                int ccr_window;
!               bus_addr_t ccr_offset;

                /* get access to the DINGO CCR space */
                if (pcmcia_mem_alloc(psc->sc_pf, PCMCIA_CCR_SIZE_DINGO,
--- 439,445 ----
        if (sc->sc_flags & XIFLAGS_DINGO) {
                struct pcmcia_mem_handle pcmh;
                int ccr_window;
!               bus_size_t ccr_offset;

                /* get access to the DINGO CCR space */
                if (pcmcia_mem_alloc(psc->sc_pf, PCMCIA_CCR_SIZE_DINGO,
***************
*** 1034,1040 ****
  {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
!       bus_addr_t offset = sc->sc_offset;

        /* Drive MDC low... */
        bus_space_write_1(bst, bsh, offset + GP2, MDC_LOW);
--- 1034,1040 ----
  {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
!       bus_size_t offset = sc->sc_offset;

        /* Drive MDC low... */
        bus_space_write_1(bst, bsh, offset + GP2, MDC_LOW);
***************
*** 1054,1060 ****
  {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
!       bus_addr_t offset = sc->sc_offset;
        u_int8_t bit = data ? MDIO_HIGH : MDIO_LOW;

        /* First latch the data bit MDIO with clock bit MDC low...*/
--- 1054,1060 ----
  {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
!       bus_size_t offset = sc->sc_offset;
        u_int8_t bit = data ? MDIO_HIGH : MDIO_LOW;

        /* First latch the data bit MDIO with clock bit MDC low...*/
***************
*** 1284,1290 ****
        struct xi_softc *sc = ifp->if_softc;
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
!       bus_addr_t offset = sc->sc_offset;
        unsigned int s, len, pad = 0;
        struct mbuf *m0, *m;
        u_int16_t space;
--- 1284,1290 ----
        struct xi_softc *sc = ifp->if_softc;
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
!       bus_size_t offset = sc->sc_offset;
        unsigned int s, len, pad = 0;
        struct mbuf *m0, *m;
        u_int16_t space;
***************
*** 1510,1516 ****
  {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
!       bus_addr_t offset = sc->sc_offset;
        struct ethercom *ether = &sc->sc_ethercom;
  #if 0
        struct ifnet *ifp = &sc->sc_ethercom.ec_if;
--- 1510,1516 ----
  {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
!       bus_size_t offset = sc->sc_offset;
        struct ethercom *ether = &sc->sc_ethercom;
  #if 0
        struct ifnet *ifp = &sc->sc_ethercom.ec_if;
***************
*** 1589,1595 ****
  {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
!       bus_addr_t offset = sc->sc_offset;

        DPRINTF(XID_CONFIG, ("xi_cycle_power()\n"));

--- 1589,1595 ----
  {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
!       bus_size_t offset = sc->sc_offset;

        DPRINTF(XID_CONFIG, ("xi_cycle_power()\n"));

***************
*** 1611,1617 ****
  {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
!       bus_addr_t offset = sc->sc_offset;

        DPRINTF(XID_CONFIG, ("xi_full_reset()\n"));

--- 1611,1617 ----
  {
        bus_space_tag_t bst = sc->sc_bst;
        bus_space_handle_t bsh = sc->sc_bsh;
!       bus_size_t offset = sc->sc_offset;

        DPRINTF(XID_CONFIG, ("xi_full_reset()\n"));

>Release-Note:
>Audit-Trail:
>Unformatted: