On Mon, Mar 17, 2014 at 11:14:24AM +0100, Martin Pieuchot wrote:
> On 14/03/14(Fri) 15:46, Martin Pieuchot wrote:
> > Diff below adds a new pointer to "struct pkthdr" to explicitly pass
> > some wireless nodes to the pointer without abusing the interface
> > pointer that I'd like to kill.
> > 
> > I kept and updated the comments saying that this way of passing the
> > corresponding node is a hack since using a dedicated pointer does
> > not change the design.  Somebody will certainly dig into this at
> > some point :)
> 
> Here's a new diff addressing some comments I received:
> 
>   - Use a longer/more explicit name

What about using a more generic name which is not bound to 80211 since the
field is a generic pointer. This may allow us to use something similar in
other drivers like mpe(4), gif(4), gre(4).

>   - Remove useless cast
>   - Remove comments talking about a hack since we're no longer
>     abusing the rcvif pointer.
> 
> ok?
> 
> Index: dev/usb/if_athn_usb.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/usb/if_athn_usb.c,v
> retrieving revision 1.18
> diff -u -p -r1.18 if_athn_usb.c
> --- dev/usb/if_athn_usb.c     7 Aug 2013 01:06:41 -0000       1.18
> +++ dev/usb/if_athn_usb.c     17 Mar 2014 10:10:27 -0000
> @@ -2009,7 +2009,7 @@ athn_usb_start(struct ifnet *ifp)
>               /* Send pending management frames first. */
>               IF_DEQUEUE(&ic->ic_mgtq, m);
>               if (m != NULL) {
> -                     ni = (void *)m->m_pkthdr.rcvif;
> +                     ni = m->m_pkthdr.ieee80211_ni;
>                       goto sendit;
>               }
>               if (ic->ic_state != IEEE80211_S_RUN)
> Index: dev/usb/if_atu.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/usb/if_atu.c,v
> retrieving revision 1.105
> diff -u -p -r1.105 if_atu.c
> --- dev/usb/if_atu.c  7 Mar 2014 18:39:02 -0000       1.105
> +++ dev/usb/if_atu.c  17 Mar 2014 10:10:27 -0000
> @@ -2013,17 +2013,7 @@ atu_start(struct ifnet *ifp)
>                       DPRINTFN(25, ("%s: atu_start: mgmt packet\n",
>                           sc->atu_dev.dv_xname));
>  
> -                     /*
> -                      * Hack!  The referenced node pointer is in the
> -                      * rcvif field of the packet header.  This is
> -                      * placed there by ieee80211_mgmt_output because
> -                      * we need to hold the reference with the frame
> -                      * and there's no other way (other than packet
> -                      * tags which we consider too expensive to use)
> -                      * to pass it along.
> -                      */
> -                     ni = (struct ieee80211_node *)m->m_pkthdr.rcvif;
> -                     m->m_pkthdr.rcvif = NULL;
> +                     ni = m->m_pkthdr.ieee80211_ni;
>  
>                       wh = mtod(m, struct ieee80211_frame *);
>                       /* sc->sc_stats.ast_tx_mgmt++; */
> Index: dev/usb/if_otus.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/usb/if_otus.c,v
> retrieving revision 1.38
> diff -u -p -r1.38 if_otus.c
> --- dev/usb/if_otus.c 7 Mar 2014 18:39:02 -0000       1.38
> +++ dev/usb/if_otus.c 17 Mar 2014 10:10:27 -0000
> @@ -1438,7 +1438,7 @@ otus_start(struct ifnet *ifp)
>               /* Send pending management frames first. */
>               IF_DEQUEUE(&ic->ic_mgtq, m);
>               if (m != NULL) {
> -                     ni = (void *)m->m_pkthdr.rcvif;
> +                     ni = m->m_pkthdr.ieee80211_ni;
>                       goto sendit;
>               }
>               if (ic->ic_state != IEEE80211_S_RUN)
> Index: dev/usb/if_ral.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/usb/if_ral.c,v
> retrieving revision 1.125
> diff -u -p -r1.125 if_ral.c
> --- dev/usb/if_ral.c  7 Mar 2014 18:39:02 -0000       1.125
> +++ dev/usb/if_ral.c  17 Mar 2014 10:10:27 -0000
> @@ -1255,8 +1255,7 @@ ural_start(struct ifnet *ifp)
>                       }
>                       IF_DEQUEUE(&ic->ic_mgtq, m0);
>  
> -                     ni = (struct ieee80211_node *)m0->m_pkthdr.rcvif;
> -                     m0->m_pkthdr.rcvif = NULL;
> +                     ni = m0->m_pkthdr.ieee80211_ni;
>  #if NBPFILTER > 0
>                       if (ic->ic_rawbpf != NULL)
>                               bpf_mtap(ic->ic_rawbpf, m0, BPF_DIRECTION_OUT);
> Index: dev/usb/if_rum.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/usb/if_rum.c,v
> retrieving revision 1.102
> diff -u -p -r1.102 if_rum.c
> --- dev/usb/if_rum.c  7 Mar 2014 18:39:02 -0000       1.102
> +++ dev/usb/if_rum.c  17 Mar 2014 10:10:27 -0000
> @@ -1274,8 +1274,7 @@ rum_start(struct ifnet *ifp)
>                       }
>                       IF_DEQUEUE(&ic->ic_mgtq, m0);
>  
> -                     ni = (struct ieee80211_node *)m0->m_pkthdr.rcvif;
> -                     m0->m_pkthdr.rcvif = NULL;
> +                     ni = m0->m_pkthdr.ieee80211_ni;
>  #if NBPFILTER > 0
>                       if (ic->ic_rawbpf != NULL)
>                               bpf_mtap(ic->ic_rawbpf, m0, BPF_DIRECTION_OUT);
> Index: dev/usb/if_run.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/usb/if_run.c,v
> retrieving revision 1.96
> diff -u -p -r1.96 if_run.c
> --- dev/usb/if_run.c  7 Mar 2014 18:39:02 -0000       1.96
> +++ dev/usb/if_run.c  17 Mar 2014 10:10:27 -0000
> @@ -2273,7 +2273,7 @@ run_start(struct ifnet *ifp)
>               /* send pending management frames first */
>               IF_DEQUEUE(&ic->ic_mgtq, m);
>               if (m != NULL) {
> -                     ni = (void *)m->m_pkthdr.rcvif;
> +                     ni = m->m_pkthdr.ieee80211_ni;
>                       goto sendit;
>               }
>               if (ic->ic_state != IEEE80211_S_RUN)
> Index: dev/usb/if_uath.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/usb/if_uath.c,v
> retrieving revision 1.57
> diff -u -p -r1.57 if_uath.c
> --- dev/usb/if_uath.c 7 Mar 2014 18:39:02 -0000       1.57
> +++ dev/usb/if_uath.c 17 Mar 2014 10:10:27 -0000
> @@ -1492,8 +1492,7 @@ uath_start(struct ifnet *ifp)
>                       }
>                       IF_DEQUEUE(&ic->ic_mgtq, m0);
>  
> -                     ni = (struct ieee80211_node *)m0->m_pkthdr.rcvif;
> -                     m0->m_pkthdr.rcvif = NULL;
> +                     ni = m0->m_pkthdr.ieee80211_ni;
>  #if NBPFILTER > 0
>                       if (ic->ic_rawbpf != NULL)
>                               bpf_mtap(ic->ic_rawbpf, m0, BPF_DIRECTION_OUT);
> Index: dev/usb/if_upgt.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/usb/if_upgt.c,v
> retrieving revision 1.60
> diff -u -p -r1.60 if_upgt.c
> --- dev/usb/if_upgt.c 21 Aug 2013 05:21:45 -0000      1.60
> +++ dev/usb/if_upgt.c 17 Mar 2014 10:10:27 -0000
> @@ -1410,8 +1410,7 @@ upgt_start(struct ifnet *ifp)
>                       /* management frame */
>                       IF_DEQUEUE(&ic->ic_mgtq, m);
>  
> -                     ni = (struct ieee80211_node *)m->m_pkthdr.rcvif;
> -                     m->m_pkthdr.rcvif = NULL;
> +                     ni = m->m_pkthdr.ieee80211_ni;
>  #if NBPFILTER > 0
>                       if (ic->ic_rawbpf != NULL)
>                               bpf_mtap(ic->ic_rawbpf, m, BPF_DIRECTION_OUT);
> Index: dev/usb/if_urtw.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/usb/if_urtw.c,v
> retrieving revision 1.44
> diff -u -p -r1.44 if_urtw.c
> --- dev/usb/if_urtw.c 7 Mar 2014 18:39:02 -0000       1.44
> +++ dev/usb/if_urtw.c 17 Mar 2014 10:10:27 -0000
> @@ -2496,8 +2496,7 @@ urtw_start(struct ifnet *ifp)
>                               break;
>                       }
>                       IF_DEQUEUE(&ic->ic_mgtq, m0);
> -                     ni = (struct ieee80211_node *)m0->m_pkthdr.rcvif;
> -                     m0->m_pkthdr.rcvif = NULL;
> +                     ni = m0->m_pkthdr.ieee80211_ni;
>  #if NBPFILTER > 0
>                       if (ic->ic_rawbpf != NULL)
>                               bpf_mtap(ic->ic_rawbpf, m0, BPF_DIRECTION_OUT);
> Index: dev/usb/if_urtwn.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/usb/if_urtwn.c,v
> retrieving revision 1.34
> diff -u -p -r1.34 if_urtwn.c
> --- dev/usb/if_urtwn.c        14 Mar 2014 15:00:47 -0000      1.34
> +++ dev/usb/if_urtwn.c        17 Mar 2014 10:10:27 -0000
> @@ -1919,7 +1919,7 @@ urtwn_start(struct ifnet *ifp)
>               /* Send pending management frames first. */
>               IF_DEQUEUE(&ic->ic_mgtq, m);
>               if (m != NULL) {
> -                     ni = (void *)m->m_pkthdr.rcvif;
> +                     ni = m->m_pkthdr.ieee80211_ni;
>                       goto sendit;
>               }
>               if (ic->ic_state != IEEE80211_S_RUN)
> Index: dev/usb/if_zyd.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/usb/if_zyd.c,v
> retrieving revision 1.96
> diff -u -p -r1.96 if_zyd.c
> --- dev/usb/if_zyd.c  7 Mar 2014 18:39:02 -0000       1.96
> +++ dev/usb/if_zyd.c  17 Mar 2014 10:10:27 -0000
> @@ -2230,7 +2230,7 @@ zyd_start(struct ifnet *ifp)
>               /* send pending management frames first */
>               IF_DEQUEUE(&ic->ic_mgtq, m);
>               if (m != NULL) {
> -                     ni = (void *)m->m_pkthdr.rcvif;
> +                     ni = m->m_pkthdr.ieee80211_ni;
>                       goto sendit;
>               }
>               if (ic->ic_state != IEEE80211_S_RUN)
> Index: sys/mbuf.h
> ===================================================================
> RCS file: /home/ncvs/src/sys/sys/mbuf.h,v
> retrieving revision 1.172
> diff -u -p -r1.172 mbuf.h
> --- sys/mbuf.h        19 Jan 2014 03:04:54 -0000      1.172
> +++ sys/mbuf.h        17 Mar 2014 10:10:27 -0000
> @@ -111,13 +111,14 @@ struct pkthdr_pf {
>  /* record/packet header in first mbuf of chain; valid if M_PKTHDR set */
>  struct       pkthdr {
>       struct ifnet            *rcvif;         /* rcv interface */
> -     SLIST_HEAD(packet_tags, m_tag) tags; /* list of packet tags */
> +     SLIST_HEAD(packet_tags, m_tag) tags;    /* list of packet tags */
>       int                      len;           /* total packet length */
>       u_int16_t                tagsset;       /* mtags attached */
>       u_int16_t                pad;
>       u_int16_t                csum_flags;    /* checksum flags */
>       u_int16_t                ether_vtag;    /* Ethernet 802.1p+Q vlan tag */
>       u_int                    rdomain;       /* routing domain id */
> +     void                    *ieee80211_ni;  /* ieee80211 node */
>       struct pkthdr_pf         pf;
>  };
>  
> Index: net80211/ieee80211_output.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/net80211/ieee80211_output.c,v
> retrieving revision 1.89
> diff -u -p -r1.89 ieee80211_output.c
> --- net80211/ieee80211_output.c       7 Dec 2013 01:55:06 -0000       1.89
> +++ net80211/ieee80211_output.c       17 Mar 2014 10:10:27 -0000
> @@ -202,17 +202,16 @@ ieee80211_mgmt_output(struct ifnet *ifp,
>       ni->ni_inact = 0;
>  
>       /*
> -      * Yech, hack alert!  We want to pass the node down to the
> -      * driver's start routine.  We could stick this in an m_tag
> -      * and tack that on to the mbuf.  However that's rather
> -      * expensive to do for every frame so instead we stuff it in
> -      * the rcvif field since outbound frames do not (presently)
> -      * use this.
> +      * We want to pass the node down to the driver's start
> +      * routine.  We could stick this in an m_tag and tack that
> +      * on to the mbuf.  However that's rather expensive to do
> +      * for every frame so instead we stuff it in a special pkthdr
> +      * field.
>        */
>       M_PREPEND(m, sizeof(struct ieee80211_frame), M_DONTWAIT);
>       if (m == NULL)
>               return ENOMEM;
> -     m->m_pkthdr.rcvif = (void *)ni;
> +     m->m_pkthdr.ieee80211_ni = ni;
>  
>       wh = mtod(m, struct ieee80211_frame *);
>       wh->i_fc[0] = IEEE80211_FC0_VERSION_0 | IEEE80211_FC0_TYPE_MGT | type;
> @@ -1864,7 +1863,7 @@ ieee80211_beacon_alloc(struct ieee80211c
>  #endif
>  
>       m->m_pkthdr.len = m->m_len = frm - mtod(m, u_int8_t *);
> -     m->m_pkthdr.rcvif = (void *)ni;
> +     m->m_pkthdr.ieee80211_ni = ni;
>  
>       return m;
>  }
> @@ -1914,10 +1913,10 @@ ieee80211_pwrsave(struct ieee80211com *i
>       } else {
>               IF_ENQUEUE(&ni->ni_savedq, m);
>               /*
> -              * Similar to ieee80211_mgmt_output, store the node in the
> -              * rcvif field.
> +              * Similar to ieee80211_mgmt_output, store the node in a
> +              * special pkthdr field.
>                */
> -             m->m_pkthdr.rcvif = (void *)ni;
> +             m->m_pkthdr.ieee80211_ni = ni;
>       }
>       return 1;
>  }
> Index: dev/ic/acx.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/ic/acx.c,v
> retrieving revision 1.101
> diff -u -p -r1.101 acx.c
> --- dev/ic/acx.c      7 Aug 2013 01:06:27 -0000       1.101
> +++ dev/ic/acx.c      17 Mar 2014 10:10:27 -0000
> @@ -948,8 +948,7 @@ acx_start(struct ifnet *ifp)
>               IF_DEQUEUE(&ic->ic_mgtq, m);
>               /* first dequeue management frames */
>               if (m != NULL) {
> -                     ni = (struct ieee80211_node *)m->m_pkthdr.rcvif;
> -                     m->m_pkthdr.rcvif = NULL;
> +                     ni = m->m_pkthdr.ieee80211_ni;
>  
>                       /*
>                        * probe response mgmt frames are handled by the
> @@ -976,8 +975,7 @@ acx_start(struct ifnet *ifp)
>                       /* then dequeue packets on the powersave queue */
>                       IF_DEQUEUE(&ic->ic_pwrsaveq, m);
>                       if (m != NULL) {
> -                             ni = (struct ieee80211_node *)m->m_pkthdr.rcvif;
> -                             m->m_pkthdr.rcvif = NULL;
> +                             ni = m->m_pkthdr.ieee80211_ni;
>                               goto encapped;
>                       } else {
>                               IFQ_DEQUEUE(&ifp->if_snd, m);
> Index: dev/ic/ath.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/ic/ath.c,v
> retrieving revision 1.98
> diff -u -p -r1.98 ath.c
> --- dev/ic/ath.c      26 Nov 2013 09:50:32 -0000      1.98
> +++ dev/ic/ath.c      17 Mar 2014 10:10:27 -0000
> @@ -897,17 +897,7 @@ ath_start(struct ifnet *ifp)
>                       }
>                       wh = mtod(m, struct ieee80211_frame *);
>               } else {
> -                     /*
> -                      * Hack!  The referenced node pointer is in the
> -                      * rcvif field of the packet header.  This is
> -                      * placed there by ieee80211_mgmt_output because
> -                      * we need to hold the reference with the frame
> -                      * and there's no other way (other than packet
> -                      * tags which we consider too expensive to use)
> -                      * to pass it along.
> -                      */
> -                     ni = (struct ieee80211_node *) m->m_pkthdr.rcvif;
> -                     m->m_pkthdr.rcvif = NULL;
> +                     ni = m->m_pkthdr.ieee80211_ni;
>  
>                       wh = mtod(m, struct ieee80211_frame *);
>                       if ((wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) ==
> Index: dev/ic/athn.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/ic/athn.c,v
> retrieving revision 1.80
> diff -u -p -r1.80 athn.c
> --- dev/ic/athn.c     6 Dec 2013 21:03:02 -0000       1.80
> +++ dev/ic/athn.c     17 Mar 2014 10:10:27 -0000
> @@ -2554,7 +2554,7 @@ athn_start(struct ifnet *ifp)
>               /* Send pending management frames first. */
>               IF_DEQUEUE(&ic->ic_mgtq, m);
>               if (m != NULL) {
> -                     ni = (void *)m->m_pkthdr.rcvif;
> +                     ni = m->m_pkthdr.ieee80211_ni;
>                       goto sendit;
>               }
>               if (ic->ic_state != IEEE80211_S_RUN)
> @@ -2562,7 +2562,7 @@ athn_start(struct ifnet *ifp)
>  
>               IF_DEQUEUE(&ic->ic_pwrsaveq, m);
>               if (m != NULL) {
> -                     ni = (void *)m->m_pkthdr.rcvif;
> +                     ni = m->m_pkthdr.ieee80211_ni;
>                       goto sendit;
>               }
>               if (ic->ic_state != IEEE80211_S_RUN)
> Index: dev/ic/atw.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/ic/atw.c,v
> retrieving revision 1.80
> diff -u -p -r1.80 atw.c
> --- dev/ic/atw.c      6 Dec 2013 21:03:02 -0000       1.80
> +++ dev/ic/atw.c      17 Mar 2014 10:10:27 -0000
> @@ -3605,8 +3605,7 @@ atw_start(struct ifnet *ifp)
>                */
>               IF_DEQUEUE(&ic->ic_mgtq, m0);
>               if (m0 != NULL) {
> -                     ni = (struct ieee80211_node *)m0->m_pkthdr.rcvif;
> -                     m0->m_pkthdr.rcvif = NULL;
> +                     ni = m0->m_pkthdr.ieee80211_ni;
>               } else {
>                       /* send no data packets until we are associated */
>                       if (ic->ic_state != IEEE80211_S_RUN)
> Index: dev/ic/bwi.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/ic/bwi.c,v
> retrieving revision 1.100
> diff -u -p -r1.100 bwi.c
> --- dev/ic/bwi.c      6 Dec 2013 21:03:02 -0000       1.100
> +++ dev/ic/bwi.c      17 Mar 2014 10:10:27 -0000
> @@ -7202,8 +7202,7 @@ bwi_start(struct ifnet *ifp)
>               if (m != NULL) {
>                       IF_DEQUEUE(&ic->ic_mgtq, m);
>  
> -                     ni = (struct ieee80211_node *)m->m_pkthdr.rcvif;
> -                     m->m_pkthdr.rcvif = NULL;
> +                     ni = m->m_pkthdr.ieee80211_ni;
>  
>                       mgt_pkt = 1;
>               } else {
> Index: dev/ic/malo.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/ic/malo.c,v
> retrieving revision 1.97
> diff -u -p -r1.97 malo.c
> --- dev/ic/malo.c     6 Dec 2013 21:03:03 -0000       1.97
> +++ dev/ic/malo.c     17 Mar 2014 10:10:27 -0000
> @@ -1026,8 +1026,7 @@ malo_start(struct ifnet *ifp)
>                       }
>                       IF_DEQUEUE(&ic->ic_mgtq, m0);
>  
> -                     ni = (struct ieee80211_node *)m0->m_pkthdr.rcvif;
> -                     m0->m_pkthdr.rcvif = NULL;
> +                     ni = m0->m_pkthdr.ieee80211_ni;
>  #if NBPFILTER > 0
>                       if (ic->ic_rawbpf != NULL)
>                               bpf_mtap(ic->ic_rawbpf, m0, BPF_DIRECTION_OUT);
> Index: dev/ic/rt2560.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/ic/rt2560.c,v
> retrieving revision 1.62
> diff -u -p -r1.62 rt2560.c
> --- dev/ic/rt2560.c   6 Dec 2013 21:03:03 -0000       1.62
> +++ dev/ic/rt2560.c   17 Mar 2014 10:10:27 -0000
> @@ -1945,8 +1945,7 @@ rt2560_start(struct ifnet *ifp)
>                       }
>                       IF_DEQUEUE(&ic->ic_mgtq, m0);
>  
> -                     ni = (struct ieee80211_node *)m0->m_pkthdr.rcvif;
> -                     m0->m_pkthdr.rcvif = NULL;
> +                     ni = m0->m_pkthdr.ieee80211_ni;
>  #if NBPFILTER > 0
>                       if (ic->ic_rawbpf != NULL)
>                               bpf_mtap(ic->ic_rawbpf, m0, BPF_DIRECTION_OUT);
> Index: dev/ic/rt2661.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/ic/rt2661.c,v
> retrieving revision 1.71
> diff -u -p -r1.71 rt2661.c
> --- dev/ic/rt2661.c   11 Mar 2014 19:45:28 -0000      1.71
> +++ dev/ic/rt2661.c   17 Mar 2014 10:10:27 -0000
> @@ -1947,8 +1947,7 @@ rt2661_start(struct ifnet *ifp)
>                       }
>                       IF_DEQUEUE(&ic->ic_mgtq, m0);
>  
> -                     ni = (struct ieee80211_node *)m0->m_pkthdr.rcvif;
> -                     m0->m_pkthdr.rcvif = NULL;
> +                     ni = m0->m_pkthdr.ieee80211_ni;
>  #if NBPFILTER > 0
>                       if (ic->ic_rawbpf != NULL)
>                               bpf_mtap(ic->ic_rawbpf, m0, BPF_DIRECTION_OUT);
> Index: dev/ic/rt2860.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/ic/rt2860.c,v
> retrieving revision 1.71
> diff -u -p -r1.71 rt2860.c
> --- dev/ic/rt2860.c   6 Dec 2013 21:03:03 -0000       1.71
> +++ dev/ic/rt2860.c   17 Mar 2014 10:10:27 -0000
> @@ -1758,7 +1758,7 @@ rt2860_start(struct ifnet *ifp)
>               /* send pending management frames first */
>               IF_DEQUEUE(&ic->ic_mgtq, m);
>               if (m != NULL) {
> -                     ni = (void *)m->m_pkthdr.rcvif;
> +                     ni = m->m_pkthdr.ieee80211_ni;
>                       goto sendit;
>               }
>               if (ic->ic_state != IEEE80211_S_RUN)
> @@ -1767,7 +1767,7 @@ rt2860_start(struct ifnet *ifp)
>               /* send buffered frames for power-save mode */
>               IF_DEQUEUE(&ic->ic_pwrsaveq, m);
>               if (m != NULL) {
> -                     ni = (void *)m->m_pkthdr.rcvif;
> +                     ni = m->m_pkthdr.ieee80211_ni;
>                       goto sendit;
>               }
>  
> Index: dev/ic/rtw.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/ic/rtw.c,v
> retrieving revision 1.83
> diff -u -p -r1.83 rtw.c
> --- dev/ic/rtw.c      26 Nov 2013 09:50:33 -0000      1.83
> +++ dev/ic/rtw.c      17 Mar 2014 10:10:27 -0000
> @@ -1504,7 +1504,7 @@ rtw_intr_beacon(struct rtw_softc *sc, u_
>                           sc->sc_dev.dv_xname);
>                       return;
>               }
> -             m->m_pkthdr.rcvif = (void *)ieee80211_ref_node(ic->ic_bss);
> +             m->m_pkthdr.ieee80211_ni = ieee80211_ref_node(ic->ic_bss);
>               IF_ENQUEUE(&sc->sc_beaconq, m);
>               rtw_start(&sc->sc_if);
>       }
> @@ -2706,8 +2706,7 @@ rtw_80211_dequeue(struct rtw_softc *sc, 
>               return NULL;
>       }
>       IF_DEQUEUE(ifq, m);
> -     *nip = (struct ieee80211_node *)m->m_pkthdr.rcvif;
> -     m->m_pkthdr.rcvif = NULL;
> +     *nip = m->m_pkthdr.ieee80211_ni;
>       return m;
>  }
>  
> Index: dev/pci/if_iwn.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/pci/if_iwn.c,v
> retrieving revision 1.130
> diff -u -p -r1.130 if_iwn.c
> --- dev/pci/if_iwn.c  11 Feb 2014 19:44:22 -0000      1.130
> +++ dev/pci/if_iwn.c  17 Mar 2014 10:10:27 -0000
> @@ -3064,7 +3064,7 @@ iwn_start(struct ifnet *ifp)
>               /* Send pending management frames first. */
>               IF_DEQUEUE(&ic->ic_mgtq, m);
>               if (m != NULL) {
> -                     ni = (void *)m->m_pkthdr.rcvif;
> +                     ni = m->m_pkthdr.ieee80211_ni;
>                       goto sendit;
>               }
>               if (ic->ic_state != IEEE80211_S_RUN)
> Index: dev/pci/if_wpi.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/dev/pci/if_wpi.c,v
> retrieving revision 1.117
> diff -u -p -r1.117 if_wpi.c
> --- dev/pci/if_wpi.c  6 Dec 2013 21:03:04 -0000       1.117
> +++ dev/pci/if_wpi.c  17 Mar 2014 10:10:27 -0000
> @@ -1926,7 +1926,7 @@ wpi_start(struct ifnet *ifp)
>               /* Send pending management frames first. */
>               IF_DEQUEUE(&ic->ic_mgtq, m);
>               if (m != NULL) {
> -                     ni = (void *)m->m_pkthdr.rcvif;
> +                     ni = m->m_pkthdr.ieee80211_ni;
>                       goto sendit;
>               }
>               if (ic->ic_state != IEEE80211_S_RUN)
> 

-- 
:wq Claudio

Reply via email to