[svn-upgrade] new version madwifi (0.9.4+r4133.20100922)
[debian/madwifi.git] / ath / if_ath.c
index a3c5b05c6f6ea3ffee7f065b08d8865413529543..db6cfbb7cf0dcc06714b81999d9b24a507a66f0e 100644 (file)
@@ -33,7 +33,7 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: if_ath.c 4103 2010-01-09 08:47:02Z proski $
+ * $Id: if_ath.c 4133 2010-06-20 12:13:10Z proski $
  */
 
 /*
@@ -3496,7 +3496,7 @@ ath_merge_mcast(struct ath_softc *sc, u_int32_t mfilt[2])
 {
        struct ieee80211com *ic = &sc->sc_ic;
        struct ieee80211vap *vap;
-       struct dev_mc_list *mc;
+       struct ath_netdev_hw_addr *ha;
        u_int32_t val;
        u_int8_t pos;
 
@@ -3504,11 +3504,11 @@ ath_merge_mcast(struct ath_softc *sc, u_int32_t mfilt[2])
        /* XXX locking */
        TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
                struct net_device *dev = vap->iv_dev;
-               for (mc = dev->mc_list; mc; mc = mc->next) {
+               netdev_for_each_mc_addr (ha, dev) {
                        /* calculate XOR of eight 6-bit values */
-                       val = LE_READ_4(mc->dmi_addr + 0);
+                       val = LE_READ_4(ath_ha_addr(ha) + 0);
                        pos = (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
-                       val = LE_READ_4(mc->dmi_addr + 3);
+                       val = LE_READ_4(ath_ha_addr(ha) + 3);
                        pos ^= (val >> 18) ^ (val >> 12) ^ (val >> 6) ^ val;
                        pos &= 0x3f;
                        mfilt[pos / 32] |= (1 << (pos % 32));
@@ -4190,15 +4190,19 @@ ath_beacon_generate(struct ath_softc *sc, struct ieee80211vap *vap, int *needmar
                ATH_TXQ_LOCK(&avp->av_mcastq);
                ATH_TXQ_LOCK(cabq);
                bfmcast = STAILQ_FIRST(&avp->av_mcastq.axq_q);
-               /* link the descriptors */
-               if (cabq->axq_link == NULL)
-                       ath_hal_puttxbuf(ah, cabq->axq_qnum, bfmcast->bf_daddr);
-               else {
+               if (bfmcast != NULL) {
+                       /* link the descriptors */
+                       if (cabq->axq_link == NULL)
+                               ath_hal_puttxbuf(ah, cabq->axq_qnum,
+                                                bfmcast->bf_daddr);
+                       else {
 #ifdef AH_NEED_DESC_SWAP
-                       *cabq->axq_link = cpu_to_le32(bfmcast->bf_daddr);
+                               *cabq->axq_link =
+                                       cpu_to_le32(bfmcast->bf_daddr);
 #else
-                       *cabq->axq_link = bfmcast->bf_daddr;
+                               *cabq->axq_link = bfmcast->bf_daddr;
 #endif
+                       }
                }
 
                /* Set the MORE_DATA bit for each packet except the last one */