Author: jhb
Date: Thu Jan  5 18:32:37 2012
New Revision: 229613
URL: http://svn.freebsd.org/changeset/base/229613

Log:
  Update recently added drivers to use the if_*addr_r*lock() wrapper
  functions instead of using the IF_ADDR_LOCK directly.  The wrapper
  functions are the supported interface for device drivers.
  
  Reviewed by:  bz, philip
  MFC after:    1 week

Modified:
  head/sys/dev/bxe/if_bxe.c
  head/sys/dev/qlxgb/qla_os.c
  head/sys/dev/sfxge/sfxge_port.c

Modified: head/sys/dev/bxe/if_bxe.c
==============================================================================
--- head/sys/dev/bxe/if_bxe.c   Thu Jan  5 18:31:08 2012        (r229612)
+++ head/sys/dev/bxe/if_bxe.c   Thu Jan  5 18:32:37 2012        (r229613)
@@ -14115,7 +14115,7 @@ bxe_set_rx_mode(struct bxe_softc *sc)
                        i = 0;
                        config = BXE_SP(sc, mcast_config);
 
-                       IF_ADDR_LOCK(ifp);
+                       if_maddr_rlock(ifp);
 
                        TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
                                if (ifma->ifma_addr->sa_family != AF_LINK)
@@ -14144,7 +14144,7 @@ bxe_set_rx_mode(struct bxe_softc *sc)
                                    config_table->cam_entry.lsb_mac_addr);
                        }
 
-                       IF_ADDR_UNLOCK(ifp);
+                       if_maddr_runlock(ifp);
 
                        old = config->hdr.length;
 
@@ -14172,7 +14172,7 @@ bxe_set_rx_mode(struct bxe_softc *sc)
                        /* Accept one or more multicasts */
                        memset(mc_filter, 0, 4 * MC_HASH_SIZE);
 
-                       IF_ADDR_LOCK(ifp);
+                       if_maddr_rlock(ifp);
 
                        TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
                                if (ifma->ifma_addr->sa_family != AF_LINK)
@@ -14184,7 +14184,7 @@ bxe_set_rx_mode(struct bxe_softc *sc)
                                bit &= 0x1f;
                                mc_filter[regidx] |= (1 << bit);
                        }
-                       IF_ADDR_UNLOCK(ifp);
+                       if_maddr_runlock(ifp);
 
                        for (i = 0; i < MC_HASH_SIZE; i++)
                                REG_WR(sc, MC_HASH_OFFSET(sc, i), mc_filter[i]);

Modified: head/sys/dev/qlxgb/qla_os.c
==============================================================================
--- head/sys/dev/qlxgb/qla_os.c Thu Jan  5 18:31:08 2012        (r229612)
+++ head/sys/dev/qlxgb/qla_os.c Thu Jan  5 18:32:37 2012        (r229613)
@@ -760,7 +760,7 @@ qla_set_multi(qla_host_t *ha, uint32_t a
        int mcnt = 0;
        struct ifnet *ifp = ha->ifp;
 
-       IF_ADDR_LOCK(ifp);
+       if_maddr_rlock(ifp);
 
        TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
 
@@ -776,7 +776,7 @@ qla_set_multi(qla_host_t *ha, uint32_t a
                mcnt++;
        }
 
-       IF_ADDR_UNLOCK(ifp);
+       if_maddr_runlock(ifp);
 
        qla_hw_set_multi(ha, mta, mcnt, add_multi);
 

Modified: head/sys/dev/sfxge/sfxge_port.c
==============================================================================
--- head/sys/dev/sfxge/sfxge_port.c     Thu Jan  5 18:31:08 2012        
(r229612)
+++ head/sys/dev/sfxge/sfxge_port.c     Thu Jan  5 18:32:37 2012        
(r229613)
@@ -301,7 +301,7 @@ sfxge_mac_filter_set_locked(struct sfxge
                 * 0xff. */
                bucket[0xff] = 1;
 
-               IF_ADDR_LOCK(ifp);
+               if_maddr_rlock(ifp);
                TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
                        if (ifma->ifma_addr->sa_family == AF_LINK) {
                                sa = (struct sockaddr_dl *)ifma->ifma_addr;
@@ -309,7 +309,7 @@ sfxge_mac_filter_set_locked(struct sfxge
                                bucket[index] = 1;
                        }
                }
-               IF_ADDR_UNLOCK(ifp);
+               if_maddr_runlock(ifp);
        }
        return efx_mac_hash_set(enp, bucket);
 }
@@ -391,10 +391,10 @@ sfxge_port_start(struct sfxge_softc *sc)
                goto fail2;
 
        /* Set the unicast address */
-       IF_ADDR_LOCK(ifp);
+       if_addr_rlock(ifp);
        bcopy(LLADDR((struct sockaddr_dl *)ifp->if_addr->ifa_addr),
              mac_addr, sizeof(mac_addr));
-       IF_ADDR_UNLOCK(ifp);
+       if_addr_runlock(ifp);
        if ((rc = efx_mac_addr_set(enp, mac_addr)) != 0)
                goto fail;
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to