Re: Stop abusing rcvif pointer to pass wireless nodes

2014-03-18 Thread Claudio Jeker
On Mon, Mar 17, 2014 at 11:41:38AM -0600, Theo de Raadt wrote:
  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).
 
 That is basically the only thought I had.  I mean you could also start
 passing it as a mbuf tag, but probably don't want the allocate/free
 overhead.

It would only make sense to use mbuf tags if the allocate/lookup/free
path of mbuf tags can be made very small. Did somebody profile them after
the switch to a pool backend? 

-- 
:wq Claudio



Re: Stop abusing rcvif pointer to pass wireless nodes

2014-03-18 Thread Mike Belopuhov
On 18 March 2014 07:20, Claudio Jeker cje...@diehard.n-r-g.com wrote:
 On Mon, Mar 17, 2014 at 11:41:38AM -0600, Theo de Raadt wrote:
  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).

 That is basically the only thought I had.  I mean you could also start
 passing it as a mbuf tag, but probably don't want the allocate/free
 overhead.

 It would only make sense to use mbuf tags if the allocate/lookup/free
 path of mbuf tags can be made very small.

meh.  i'd say the cookie pointer is fine here.

 Did somebody profile them after the switch to a pool backend?


that i did, yes.



Re: Stop abusing rcvif pointer to pass wireless nodes

2014-03-18 Thread Martin Pieuchot
On 18/03/14(Tue) 11:26, Mike Belopuhov wrote:
 On 18 March 2014 07:20, Claudio Jeker cje...@diehard.n-r-g.com wrote:
  On Mon, Mar 17, 2014 at 11:41:38AM -0600, Theo de Raadt wrote:
   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).
 
  That is basically the only thought I had.  I mean you could also start
  passing it as a mbuf tag, but probably don't want the allocate/free
  overhead.
 
  It would only make sense to use mbuf tags if the allocate/lookup/free
  path of mbuf tags can be made very small.
 
 meh.  i'd say the cookie pointer is fine here.
 
  Did somebody profile them after the switch to a pool backend?
 
 
 that i did, yes.

So here's a diff with a more generic name for the pointer and an update
of the structure in the manpage, ok?

diff --git share/man/man9/mbuf.9 share/man/man9/mbuf.9
index e3db548..ed0a511 100644
--- share/man/man9/mbuf.9
+++ share/man/man9/mbuf.9
@@ -119,6 +119,7 @@ struct pkthdr {
u_int16_t csum_flags;
u_int16_t ether_vtag;
u_int   rdomain;
+   void*ph_cookie;
struct  pkthdr_pf pf;
 };
 
diff --git sys/dev/ic/acx.c sys/dev/ic/acx.c
index 39910bc..07c04e6 100644
--- sys/dev/ic/acx.c
+++ sys/dev/ic/acx.c
@@ -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.ph_cookie;
 
/*
 * 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.ph_cookie;
goto encapped;
} else {
IFQ_DEQUEUE(ifp-if_snd, m);
diff --git sys/dev/ic/ath.c sys/dev/ic/ath.c
index 83cd233..6c1bdca 100644
--- sys/dev/ic/ath.c
+++ sys/dev/ic/ath.c
@@ -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.ph_cookie;
 
wh = mtod(m, struct ieee80211_frame *);
if ((wh-i_fc[0]  IEEE80211_FC0_SUBTYPE_MASK) ==
diff --git sys/dev/ic/athn.c sys/dev/ic/athn.c
index 3aa4f0b..dafd00a 100644
--- sys/dev/ic/athn.c
+++ sys/dev/ic/athn.c
@@ -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.ph_cookie;
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.ph_cookie;
goto sendit;
}
if (ic-ic_state != IEEE80211_S_RUN)
diff --git sys/dev/ic/atw.c sys/dev/ic/atw.c
index 443c1c0..8a0fd64 100644
--- sys/dev/ic/atw.c
+++ sys/dev/ic/atw.c
@@ -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.ph_cookie;
} else {
/* send no data packets until we are associated */
if (ic-ic_state != IEEE80211_S_RUN)
diff --git sys/dev/ic/bwi.c sys/dev/ic/bwi.c

Re: Stop abusing rcvif pointer to pass wireless nodes

2014-03-18 Thread Claudio Jeker
On Tue, Mar 18, 2014 at 12:28:41PM +0100, Martin Pieuchot wrote:
 On 18/03/14(Tue) 11:26, Mike Belopuhov wrote:
  On 18 March 2014 07:20, Claudio Jeker cje...@diehard.n-r-g.com wrote:
   On Mon, Mar 17, 2014 at 11:41:38AM -0600, Theo de Raadt wrote:
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).
  
   That is basically the only thought I had.  I mean you could also start
   passing it as a mbuf tag, but probably don't want the allocate/free
   overhead.
  
   It would only make sense to use mbuf tags if the allocate/lookup/free
   path of mbuf tags can be made very small.
  
  meh.  i'd say the cookie pointer is fine here.
  
   Did somebody profile them after the switch to a pool backend?
  
  
  that i did, yes.
 
 So here's a diff with a more generic name for the pointer and an update
 of the structure in the manpage, ok?

Yeah, lets go with this. OK claudio@
 
 diff --git share/man/man9/mbuf.9 share/man/man9/mbuf.9
 index e3db548..ed0a511 100644
 --- share/man/man9/mbuf.9
 +++ share/man/man9/mbuf.9
 @@ -119,6 +119,7 @@ struct pkthdr {
   u_int16_t csum_flags;
   u_int16_t ether_vtag;
   u_int   rdomain;
 + void*ph_cookie;
   struct  pkthdr_pf pf;
  };
  
 diff --git sys/dev/ic/acx.c sys/dev/ic/acx.c
 index 39910bc..07c04e6 100644
 --- sys/dev/ic/acx.c
 +++ sys/dev/ic/acx.c
 @@ -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.ph_cookie;
  
   /*
* 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.ph_cookie;
   goto encapped;
   } else {
   IFQ_DEQUEUE(ifp-if_snd, m);
 diff --git sys/dev/ic/ath.c sys/dev/ic/ath.c
 index 83cd233..6c1bdca 100644
 --- sys/dev/ic/ath.c
 +++ sys/dev/ic/ath.c
 @@ -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.ph_cookie;
  
   wh = mtod(m, struct ieee80211_frame *);
   if ((wh-i_fc[0]  IEEE80211_FC0_SUBTYPE_MASK) ==
 diff --git sys/dev/ic/athn.c sys/dev/ic/athn.c
 index 3aa4f0b..dafd00a 100644
 --- sys/dev/ic/athn.c
 +++ sys/dev/ic/athn.c
 @@ -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.ph_cookie;
   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.ph_cookie;
   goto sendit;
   }
   if (ic-ic_state != IEEE80211_S_RUN)
 diff --git sys/dev/ic/atw.c sys/dev/ic/atw.c
 index 443c1c0..8a0fd64 100644
 --- sys/dev/ic/atw.c
 +++ sys/dev/ic/atw.c
 @@ -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.ph_cookie;
   } else {
   /* send no data packets until we are associated */
 

Re: Stop abusing rcvif pointer to pass wireless nodes

2014-03-17 Thread Martin Pieuchot
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
  - 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 -   1.18
+++ dev/usb/if_athn_usb.c   17 Mar 2014 10:10:27 -
@@ -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.c7 Mar 2014 18:39:02 -   1.105
+++ dev/usb/if_atu.c17 Mar 2014 10:10:27 -
@@ -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 -   1.38
+++ dev/usb/if_otus.c   17 Mar 2014 10:10:27 -
@@ -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.c7 Mar 2014 18:39:02 -   1.125
+++ dev/usb/if_ral.c17 Mar 2014 10:10:27 -
@@ -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.c7 Mar 2014 18:39:02 -   1.102
+++ dev/usb/if_rum.c17 Mar 2014 10:10:27 -
@@ -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

Re: Stop abusing rcvif pointer to pass wireless nodes

2014-03-17 Thread Claudio Jeker
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 -   1.18
 +++ dev/usb/if_athn_usb.c 17 Mar 2014 10:10:27 -
 @@ -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 -   1.105
 +++ dev/usb/if_atu.c  17 Mar 2014 10:10:27 -
 @@ -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 -   1.38
 +++ dev/usb/if_otus.c 17 Mar 2014 10:10:27 -
 @@ -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 -   1.125
 +++ dev/usb/if_ral.c  17 Mar 2014 10:10:27 -
 @@ -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 -   1.102
 +++ dev/usb/if_rum.c  17 Mar 2014 10:10:27 -
 @@ -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;
 +  

Re: Stop abusing rcvif pointer to pass wireless nodes

2014-03-17 Thread Theo de Raadt
 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).

That is basically the only thought I had.  I mean you could also start
passing it as a mbuf tag, but probably don't want the allocate/free
overhead.



Stop abusing rcvif pointer to pass wireless nodes

2014-03-14 Thread Martin Pieuchot
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 :)

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 -   1.18
+++ dev/usb/if_athn_usb.c   14 Mar 2014 11:49:43 -
@@ -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 = (struct ieee80211_node *)m-m_pkthdr.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.c7 Mar 2014 18:39:02 -   1.105
+++ dev/usb/if_atu.c14 Mar 2014 11:49:43 -
@@ -2015,15 +2015,14 @@ atu_start(struct ifnet *ifp)
 
/*
 * Hack!  The referenced node pointer is in the
-* rcvif field of the packet header.  This is
+* `ni' 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 = (struct ieee80211_node *)m-m_pkthdr.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 -   1.38
+++ dev/usb/if_otus.c   14 Mar 2014 11:49:43 -
@@ -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 = (struct ieee80211_node *)m-m_pkthdr.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.c7 Mar 2014 18:39:02 -   1.125
+++ dev/usb/if_ral.c14 Mar 2014 11:49:43 -
@@ -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 = (struct ieee80211_node *)m0-m_pkthdr.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.c7 Mar 2014 18:39:02 -   1.102
+++ dev/usb/if_rum.c14 Mar 2014 11:49:43 -
@@ -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 = (struct ieee80211_node *)m0-m_pkthdr.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.c7 Mar 2014 18:39:02 -   1.96
+++ dev/usb/if_run.c14 Mar 2014 11:49:43