Re: iwm: support more than one frame per interrupt

2019-11-09 Thread Stuart Henderson
On 2019/11/09 15:28, Claudio Jeker wrote:
> On Sat, Nov 09, 2019 at 03:20:10PM +0100, Florian Obser wrote:
> > My 7260 doesn't like it. Same problem as last time.
> > These counters go through the roof and network stalls.
> > Also when packets are flowing throughput varies a lot.
> > 30131 input block ack window slides
> > 30171 input frames above block ack window end
> > 827766 expected input block ack frames never arrived
> 
> I have similar issues with a 8265:
> 65731 input frames above block ack window end
> 65711 input block ack window slides
> 150884 expected input block ack frames never arrived
> 
> It works but feels slower than before.

Now I know what to look for, I see that on 8260 too. And I do see some
minor stalls with some things (switching windows in tmux for example).



Re: iwm: support more than one frame per interrupt

2019-11-09 Thread Claudio Jeker
On Sat, Nov 09, 2019 at 03:20:10PM +0100, Florian Obser wrote:
> My 7260 doesn't like it. Same problem as last time.
> These counters go through the roof and network stalls.
> Also when packets are flowing throughput varies a lot.
> 30131 input block ack window slides
> 30171 input frames above block ack window end
> 827766 expected input block ack frames never arrived

I have similar issues with a 8265:
65731 input frames above block ack window end
65711 input block ack window slides
150884 expected input block ack frames never arrived

It works but feels slower than before.
 
> On Fri, Nov 08, 2019 at 07:23:36PM +0200, Stefan Sperling wrote:
> > On Fri, Nov 08, 2019 at 07:15:18PM +0200, Stefan Sperling wrote:
> > > On Fri, Nov 08, 2019 at 07:13:17PM +0200, Stefan Sperling wrote:
> > > > Previous versions of this diff included monitor mode support. I have 
> > > > stripped
> > > > this out for now and I am looking for stability tests in client mode 
> > > > only.
> > > > If this diff passes through testing this time around, adding monitor 
> > > > mode
> > > > on top will be easy.
> > > 
> > > Sorry, I made a mistake when splitting the diff. The diff I sent doesn't 
> > > build.
> > > I will post a new one shortly.
> > 
> > Fixed diff.
> > 
> > diff aa91687117b06dc9f357920a56ef1a22c0de6a7e 
> > 16cec9db4484c7e9e6fa4838707a4c0c7ba2f314
> > blob - f7449f560623517dfa1b3fbe6d55b10a5494e26c
> > blob + 0d5f766801f75e839476ebc2393568ed31494e62
> > --- sys/dev/pci/if_iwm.c
> > +++ sys/dev/pci/if_iwm.c
> > @@ -366,8 +366,10 @@ intiwm_get_signal_strength(struct iwm_softc *, 
> > struct
> >  void   iwm_rx_rx_phy_cmd(struct iwm_softc *, struct iwm_rx_packet *,
> > struct iwm_rx_data *);
> >  intiwm_get_noise(const struct iwm_statistics_rx_non_phy *);
> > -void   iwm_rx_rx_mpdu(struct iwm_softc *, struct iwm_rx_packet *,
> > -   struct iwm_rx_data *, struct mbuf_list *);
> > +intiwm_rx_frame(struct iwm_softc *, struct mbuf *, uint32_t,
> > +   struct mbuf_list *);
> > +intiwm_ccmp_decap(struct iwm_softc *, struct mbuf *,
> > +   struct ieee80211_node *);
> >  void   iwm_enable_ht_cck_fallback(struct iwm_softc *, struct iwm_node 
> > *);
> >  void   iwm_rx_tx_cmd_single(struct iwm_softc *, struct iwm_rx_packet *,
> > struct iwm_node *);
> > @@ -472,6 +474,11 @@ const char *iwm_desc_lookup(uint32_t);
> >  void   iwm_nic_error(struct iwm_softc *);
> >  void   iwm_nic_umac_error(struct iwm_softc *);
> >  #endif
> > +void   iwm_rx_mpdu(struct iwm_softc *, struct mbuf *, size_t,
> > +   struct mbuf_list *);
> > +intiwm_rx_pkt_valid(struct iwm_rx_packet *);
> > +void   iwm_rx_pkt(struct iwm_softc *, struct iwm_rx_data *,
> > +   struct mbuf_list *);
> >  void   iwm_notif_intr(struct iwm_softc *);
> >  intiwm_intr(void *);
> >  intiwm_match(struct device *, void *, void *);
> > @@ -1807,7 +1814,6 @@ iwm_nic_rx_init(struct iwm_softc *sc)
> > IWM_FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL|
> > IWM_FH_RCSR_CHNL0_RX_IGNORE_RXF_EMPTY   |  /* HW bug */
> > IWM_FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL   |
> > -   IWM_FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK|
> > (IWM_RX_RB_TIMEOUT << IWM_FH_RCSR_RX_CONFIG_REG_IRQ_RBTH_POS) |
> > IWM_FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K|
> > IWM_RX_QUEUE_SIZE_LOG << IWM_FH_RCSR_RX_CONFIG_RBDCB_SIZE_POS);
> > @@ -3539,56 +3545,24 @@ iwm_get_noise(const struct 
> > iwm_statistics_rx_non_phy *
> > return (nbant == 0) ? -127 : (total / nbant) - 107;
> >  }
> >  
> > -void
> > -iwm_rx_rx_mpdu(struct iwm_softc *sc, struct iwm_rx_packet *pkt,
> > -struct iwm_rx_data *data, struct mbuf_list *ml)
> > +int
> > +iwm_rx_frame(struct iwm_softc *sc, struct mbuf *m, uint32_t rx_pkt_status,
> > +struct mbuf_list *ml)
> >  {
> > struct ieee80211com *ic = >sc_ic;
> > struct ieee80211_frame *wh;
> > struct ieee80211_node *ni;
> > struct ieee80211_rxinfo rxi;
> > struct ieee80211_channel *bss_chan;
> > -   struct mbuf *m;
> > struct iwm_rx_phy_info *phy_info;
> > -   struct iwm_rx_mpdu_res_start *rx_res;
> > int device_timestamp;
> > -   uint32_t len;
> > -   uint32_t rx_pkt_status;
> > int rssi, chanidx;
> > uint8_t saved_bssid[IEEE80211_ADDR_LEN] = { 0 };
> >  
> > -   bus_dmamap_sync(sc->sc_dmat, data->map, 0, IWM_RBUF_SIZE,
> > -   BUS_DMASYNC_POSTREAD);
> > -
> > phy_info = >sc_last_phy_info;
> > -   rx_res = (struct iwm_rx_mpdu_res_start *)pkt->data;
> > -   wh = (struct ieee80211_frame *)(pkt->data + sizeof(*rx_res));
> > -   len = le16toh(rx_res->byte_count);
> > -   if (len < IEEE80211_MIN_LEN) {
> > -   ic->ic_stats.is_rx_tooshort++;
> > -   IC2IFP(ic)->if_ierrors++;
> > -   return;
> > -   }
> > -   if (len > IWM_RBUF_SIZE - sizeof(*rx_res)) {
> > -   

Re: iwm: support more than one frame per interrupt

2019-11-09 Thread Florian Obser
My 7260 doesn't like it. Same problem as last time.
These counters go through the roof and network stalls.
Also when packets are flowing throughput varies a lot.
30131 input block ack window slides
30171 input frames above block ack window end
827766 expected input block ack frames never arrived

On Fri, Nov 08, 2019 at 07:23:36PM +0200, Stefan Sperling wrote:
> On Fri, Nov 08, 2019 at 07:15:18PM +0200, Stefan Sperling wrote:
> > On Fri, Nov 08, 2019 at 07:13:17PM +0200, Stefan Sperling wrote:
> > > Previous versions of this diff included monitor mode support. I have 
> > > stripped
> > > this out for now and I am looking for stability tests in client mode only.
> > > If this diff passes through testing this time around, adding monitor mode
> > > on top will be easy.
> > 
> > Sorry, I made a mistake when splitting the diff. The diff I sent doesn't 
> > build.
> > I will post a new one shortly.
> 
> Fixed diff.
> 
> diff aa91687117b06dc9f357920a56ef1a22c0de6a7e 
> 16cec9db4484c7e9e6fa4838707a4c0c7ba2f314
> blob - f7449f560623517dfa1b3fbe6d55b10a5494e26c
> blob + 0d5f766801f75e839476ebc2393568ed31494e62
> --- sys/dev/pci/if_iwm.c
> +++ sys/dev/pci/if_iwm.c
> @@ -366,8 +366,10 @@ int  iwm_get_signal_strength(struct iwm_softc *, 
> struct
>  void iwm_rx_rx_phy_cmd(struct iwm_softc *, struct iwm_rx_packet *,
>   struct iwm_rx_data *);
>  int  iwm_get_noise(const struct iwm_statistics_rx_non_phy *);
> -void iwm_rx_rx_mpdu(struct iwm_softc *, struct iwm_rx_packet *,
> - struct iwm_rx_data *, struct mbuf_list *);
> +int  iwm_rx_frame(struct iwm_softc *, struct mbuf *, uint32_t,
> + struct mbuf_list *);
> +int  iwm_ccmp_decap(struct iwm_softc *, struct mbuf *,
> + struct ieee80211_node *);
>  void iwm_enable_ht_cck_fallback(struct iwm_softc *, struct iwm_node *);
>  void iwm_rx_tx_cmd_single(struct iwm_softc *, struct iwm_rx_packet *,
>   struct iwm_node *);
> @@ -472,6 +474,11 @@ const char *iwm_desc_lookup(uint32_t);
>  void iwm_nic_error(struct iwm_softc *);
>  void iwm_nic_umac_error(struct iwm_softc *);
>  #endif
> +void iwm_rx_mpdu(struct iwm_softc *, struct mbuf *, size_t,
> + struct mbuf_list *);
> +int  iwm_rx_pkt_valid(struct iwm_rx_packet *);
> +void iwm_rx_pkt(struct iwm_softc *, struct iwm_rx_data *,
> + struct mbuf_list *);
>  void iwm_notif_intr(struct iwm_softc *);
>  int  iwm_intr(void *);
>  int  iwm_match(struct device *, void *, void *);
> @@ -1807,7 +1814,6 @@ iwm_nic_rx_init(struct iwm_softc *sc)
>   IWM_FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL|
>   IWM_FH_RCSR_CHNL0_RX_IGNORE_RXF_EMPTY   |  /* HW bug */
>   IWM_FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL   |
> - IWM_FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK|
>   (IWM_RX_RB_TIMEOUT << IWM_FH_RCSR_RX_CONFIG_REG_IRQ_RBTH_POS) |
>   IWM_FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K|
>   IWM_RX_QUEUE_SIZE_LOG << IWM_FH_RCSR_RX_CONFIG_RBDCB_SIZE_POS);
> @@ -3539,56 +3545,24 @@ iwm_get_noise(const struct iwm_statistics_rx_non_phy *
>   return (nbant == 0) ? -127 : (total / nbant) - 107;
>  }
>  
> -void
> -iwm_rx_rx_mpdu(struct iwm_softc *sc, struct iwm_rx_packet *pkt,
> -struct iwm_rx_data *data, struct mbuf_list *ml)
> +int
> +iwm_rx_frame(struct iwm_softc *sc, struct mbuf *m, uint32_t rx_pkt_status,
> +struct mbuf_list *ml)
>  {
>   struct ieee80211com *ic = >sc_ic;
>   struct ieee80211_frame *wh;
>   struct ieee80211_node *ni;
>   struct ieee80211_rxinfo rxi;
>   struct ieee80211_channel *bss_chan;
> - struct mbuf *m;
>   struct iwm_rx_phy_info *phy_info;
> - struct iwm_rx_mpdu_res_start *rx_res;
>   int device_timestamp;
> - uint32_t len;
> - uint32_t rx_pkt_status;
>   int rssi, chanidx;
>   uint8_t saved_bssid[IEEE80211_ADDR_LEN] = { 0 };
>  
> - bus_dmamap_sync(sc->sc_dmat, data->map, 0, IWM_RBUF_SIZE,
> - BUS_DMASYNC_POSTREAD);
> -
>   phy_info = >sc_last_phy_info;
> - rx_res = (struct iwm_rx_mpdu_res_start *)pkt->data;
> - wh = (struct ieee80211_frame *)(pkt->data + sizeof(*rx_res));
> - len = le16toh(rx_res->byte_count);
> - if (len < IEEE80211_MIN_LEN) {
> - ic->ic_stats.is_rx_tooshort++;
> - IC2IFP(ic)->if_ierrors++;
> - return;
> - }
> - if (len > IWM_RBUF_SIZE - sizeof(*rx_res)) {
> - IC2IFP(ic)->if_ierrors++;
> - return;
> - }
> - rx_pkt_status = le32toh(*(uint32_t *)(pkt->data +
> - sizeof(*rx_res) + len));
> -
>   if (__predict_false(phy_info->cfg_phy_cnt > 20))
> - return;
> + return EINVAL;
>  
> - if (!(rx_pkt_status & IWM_RX_MPDU_RES_STATUS_CRC_OK) ||
> - !(rx_pkt_status & IWM_RX_MPDU_RES_STATUS_OVERRUN_OK))
> - return; /* drop */
> -
> - m = data->m;
> - if (iwm_rx_addbuf(sc, IWM_RBUF_SIZE, sc->rxq.cur) != 0)
> -  

Re: iwm: support more than one frame per interrupt

2019-11-08 Thread Stefan Sperling
On Fri, Nov 08, 2019 at 07:15:18PM +0200, Stefan Sperling wrote:
> On Fri, Nov 08, 2019 at 07:13:17PM +0200, Stefan Sperling wrote:
> > Previous versions of this diff included monitor mode support. I have 
> > stripped
> > this out for now and I am looking for stability tests in client mode only.
> > If this diff passes through testing this time around, adding monitor mode
> > on top will be easy.
> 
> Sorry, I made a mistake when splitting the diff. The diff I sent doesn't 
> build.
> I will post a new one shortly.

Fixed diff.

diff aa91687117b06dc9f357920a56ef1a22c0de6a7e 
16cec9db4484c7e9e6fa4838707a4c0c7ba2f314
blob - f7449f560623517dfa1b3fbe6d55b10a5494e26c
blob + 0d5f766801f75e839476ebc2393568ed31494e62
--- sys/dev/pci/if_iwm.c
+++ sys/dev/pci/if_iwm.c
@@ -366,8 +366,10 @@ intiwm_get_signal_strength(struct iwm_softc *, 
struct
 void   iwm_rx_rx_phy_cmd(struct iwm_softc *, struct iwm_rx_packet *,
struct iwm_rx_data *);
 intiwm_get_noise(const struct iwm_statistics_rx_non_phy *);
-void   iwm_rx_rx_mpdu(struct iwm_softc *, struct iwm_rx_packet *,
-   struct iwm_rx_data *, struct mbuf_list *);
+intiwm_rx_frame(struct iwm_softc *, struct mbuf *, uint32_t,
+   struct mbuf_list *);
+intiwm_ccmp_decap(struct iwm_softc *, struct mbuf *,
+   struct ieee80211_node *);
 void   iwm_enable_ht_cck_fallback(struct iwm_softc *, struct iwm_node *);
 void   iwm_rx_tx_cmd_single(struct iwm_softc *, struct iwm_rx_packet *,
struct iwm_node *);
@@ -472,6 +474,11 @@ const char *iwm_desc_lookup(uint32_t);
 void   iwm_nic_error(struct iwm_softc *);
 void   iwm_nic_umac_error(struct iwm_softc *);
 #endif
+void   iwm_rx_mpdu(struct iwm_softc *, struct mbuf *, size_t,
+   struct mbuf_list *);
+intiwm_rx_pkt_valid(struct iwm_rx_packet *);
+void   iwm_rx_pkt(struct iwm_softc *, struct iwm_rx_data *,
+   struct mbuf_list *);
 void   iwm_notif_intr(struct iwm_softc *);
 intiwm_intr(void *);
 intiwm_match(struct device *, void *, void *);
@@ -1807,7 +1814,6 @@ iwm_nic_rx_init(struct iwm_softc *sc)
IWM_FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL|
IWM_FH_RCSR_CHNL0_RX_IGNORE_RXF_EMPTY   |  /* HW bug */
IWM_FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL   |
-   IWM_FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK|
(IWM_RX_RB_TIMEOUT << IWM_FH_RCSR_RX_CONFIG_REG_IRQ_RBTH_POS) |
IWM_FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K|
IWM_RX_QUEUE_SIZE_LOG << IWM_FH_RCSR_RX_CONFIG_RBDCB_SIZE_POS);
@@ -3539,56 +3545,24 @@ iwm_get_noise(const struct iwm_statistics_rx_non_phy *
return (nbant == 0) ? -127 : (total / nbant) - 107;
 }
 
-void
-iwm_rx_rx_mpdu(struct iwm_softc *sc, struct iwm_rx_packet *pkt,
-struct iwm_rx_data *data, struct mbuf_list *ml)
+int
+iwm_rx_frame(struct iwm_softc *sc, struct mbuf *m, uint32_t rx_pkt_status,
+struct mbuf_list *ml)
 {
struct ieee80211com *ic = >sc_ic;
struct ieee80211_frame *wh;
struct ieee80211_node *ni;
struct ieee80211_rxinfo rxi;
struct ieee80211_channel *bss_chan;
-   struct mbuf *m;
struct iwm_rx_phy_info *phy_info;
-   struct iwm_rx_mpdu_res_start *rx_res;
int device_timestamp;
-   uint32_t len;
-   uint32_t rx_pkt_status;
int rssi, chanidx;
uint8_t saved_bssid[IEEE80211_ADDR_LEN] = { 0 };
 
-   bus_dmamap_sync(sc->sc_dmat, data->map, 0, IWM_RBUF_SIZE,
-   BUS_DMASYNC_POSTREAD);
-
phy_info = >sc_last_phy_info;
-   rx_res = (struct iwm_rx_mpdu_res_start *)pkt->data;
-   wh = (struct ieee80211_frame *)(pkt->data + sizeof(*rx_res));
-   len = le16toh(rx_res->byte_count);
-   if (len < IEEE80211_MIN_LEN) {
-   ic->ic_stats.is_rx_tooshort++;
-   IC2IFP(ic)->if_ierrors++;
-   return;
-   }
-   if (len > IWM_RBUF_SIZE - sizeof(*rx_res)) {
-   IC2IFP(ic)->if_ierrors++;
-   return;
-   }
-   rx_pkt_status = le32toh(*(uint32_t *)(pkt->data +
-   sizeof(*rx_res) + len));
-
if (__predict_false(phy_info->cfg_phy_cnt > 20))
-   return;
+   return EINVAL;
 
-   if (!(rx_pkt_status & IWM_RX_MPDU_RES_STATUS_CRC_OK) ||
-   !(rx_pkt_status & IWM_RX_MPDU_RES_STATUS_OVERRUN_OK))
-   return; /* drop */
-
-   m = data->m;
-   if (iwm_rx_addbuf(sc, IWM_RBUF_SIZE, sc->rxq.cur) != 0)
-   return;
-   m->m_data = pkt->data + sizeof(*rx_res);
-   m->m_pkthdr.len = m->m_len = len;
-
device_timestamp = le32toh(phy_info->system_timestamp);
 
rssi = iwm_get_signal_strength(sc, phy_info);
@@ -3599,6 +3573,7 @@ iwm_rx_rx_mpdu(struct iwm_softc *sc, struct iwm_rx_pac
if (chanidx < 0 || chanidx >= nitems(ic->ic_channels))  
chanidx = ieee80211_chan2ieee(ic, ic->ic_ibss_chan);
 
+   wh = mtod(m, struct 

Re: iwm: support more than one frame per interrupt

2019-11-08 Thread Stefan Sperling
On Fri, Nov 08, 2019 at 07:13:17PM +0200, Stefan Sperling wrote:
> Previous versions of this diff included monitor mode support. I have stripped
> this out for now and I am looking for stability tests in client mode only.
> If this diff passes through testing this time around, adding monitor mode
> on top will be easy.

Sorry, I made a mistake when splitting the diff. The diff I sent doesn't build.
I will post a new one shortly.



iwm: support more than one frame per interrupt

2019-11-08 Thread Stefan Sperling
This adds support for receiving more than one frame per interrupt to iwm(4).
There have been several past attempts at this already, all of which failed
due to stability issues found during testing.

Previous versions of this diff included monitor mode support. I have stripped
this out for now and I am looking for stability tests in client mode only.
If this diff passes through testing this time around, adding monitor mode
on top will be easy.

Please update your tree before applying this and make sure your iwm device
is using either -17 or -34 firmware.
 
diff aa91687117b06dc9f357920a56ef1a22c0de6a7e 
662ed8a1ce51441cd90dfc355f27a6814968d0b9
blob - f7449f560623517dfa1b3fbe6d55b10a5494e26c
blob + 3fef13e8baf3c1564493717b3cf7750447faba4e
--- sys/dev/pci/if_iwm.c
+++ sys/dev/pci/if_iwm.c
@@ -366,8 +366,10 @@ intiwm_get_signal_strength(struct iwm_softc *, 
struct
 void   iwm_rx_rx_phy_cmd(struct iwm_softc *, struct iwm_rx_packet *,
struct iwm_rx_data *);
 intiwm_get_noise(const struct iwm_statistics_rx_non_phy *);
-void   iwm_rx_rx_mpdu(struct iwm_softc *, struct iwm_rx_packet *,
-   struct iwm_rx_data *, struct mbuf_list *);
+intiwm_rx_frame(struct iwm_softc *, struct mbuf *, uint32_t,
+   struct mbuf_list *);
+intiwm_ccmp_decap(struct iwm_softc *, struct mbuf *,
+   struct ieee80211_node *);
 void   iwm_enable_ht_cck_fallback(struct iwm_softc *, struct iwm_node *);
 void   iwm_rx_tx_cmd_single(struct iwm_softc *, struct iwm_rx_packet *,
struct iwm_node *);
@@ -428,7 +430,7 @@ uint8_t iwm_ridx2rate(struct ieee80211_rateset *, int)
 intiwm_rval2ridx(int);
 void   iwm_ack_rates(struct iwm_softc *, struct iwm_node *, int *, int *);
 void   iwm_mac_ctxt_cmd_common(struct iwm_softc *, struct iwm_node *,
-   struct iwm_mac_ctx_cmd *, uint32_t, int);
+   struct iwm_mac_ctx_cmd *, uint32_t);
 void   iwm_mac_ctxt_cmd_fill_sta(struct iwm_softc *, struct iwm_node *,
struct iwm_mac_data_sta *, int);
 intiwm_mac_ctxt_cmd(struct iwm_softc *, struct iwm_node *, uint32_t, int);
@@ -472,6 +474,11 @@ const char *iwm_desc_lookup(uint32_t);
 void   iwm_nic_error(struct iwm_softc *);
 void   iwm_nic_umac_error(struct iwm_softc *);
 #endif
+void   iwm_rx_mpdu(struct iwm_softc *, struct mbuf *, size_t,
+   struct mbuf_list *);
+intiwm_rx_pkt_valid(struct iwm_rx_packet *);
+void   iwm_rx_pkt(struct iwm_softc *, struct iwm_rx_data *,
+   struct mbuf_list *);
 void   iwm_notif_intr(struct iwm_softc *);
 intiwm_intr(void *);
 intiwm_match(struct device *, void *, void *);
@@ -1807,7 +1814,6 @@ iwm_nic_rx_init(struct iwm_softc *sc)
IWM_FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL|
IWM_FH_RCSR_CHNL0_RX_IGNORE_RXF_EMPTY   |  /* HW bug */
IWM_FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL   |
-   IWM_FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK|
(IWM_RX_RB_TIMEOUT << IWM_FH_RCSR_RX_CONFIG_REG_IRQ_RBTH_POS) |
IWM_FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K|
IWM_RX_QUEUE_SIZE_LOG << IWM_FH_RCSR_RX_CONFIG_RBDCB_SIZE_POS);
@@ -3539,56 +3545,24 @@ iwm_get_noise(const struct iwm_statistics_rx_non_phy *
return (nbant == 0) ? -127 : (total / nbant) - 107;
 }
 
-void
-iwm_rx_rx_mpdu(struct iwm_softc *sc, struct iwm_rx_packet *pkt,
-struct iwm_rx_data *data, struct mbuf_list *ml)
+int
+iwm_rx_frame(struct iwm_softc *sc, struct mbuf *m, uint32_t rx_pkt_status,
+struct mbuf_list *ml)
 {
struct ieee80211com *ic = >sc_ic;
struct ieee80211_frame *wh;
struct ieee80211_node *ni;
struct ieee80211_rxinfo rxi;
struct ieee80211_channel *bss_chan;
-   struct mbuf *m;
struct iwm_rx_phy_info *phy_info;
-   struct iwm_rx_mpdu_res_start *rx_res;
int device_timestamp;
-   uint32_t len;
-   uint32_t rx_pkt_status;
int rssi, chanidx;
uint8_t saved_bssid[IEEE80211_ADDR_LEN] = { 0 };
 
-   bus_dmamap_sync(sc->sc_dmat, data->map, 0, IWM_RBUF_SIZE,
-   BUS_DMASYNC_POSTREAD);
-
phy_info = >sc_last_phy_info;
-   rx_res = (struct iwm_rx_mpdu_res_start *)pkt->data;
-   wh = (struct ieee80211_frame *)(pkt->data + sizeof(*rx_res));
-   len = le16toh(rx_res->byte_count);
-   if (len < IEEE80211_MIN_LEN) {
-   ic->ic_stats.is_rx_tooshort++;
-   IC2IFP(ic)->if_ierrors++;
-   return;
-   }
-   if (len > IWM_RBUF_SIZE - sizeof(*rx_res)) {
-   IC2IFP(ic)->if_ierrors++;
-   return;
-   }
-   rx_pkt_status = le32toh(*(uint32_t *)(pkt->data +
-   sizeof(*rx_res) + len));
-
if (__predict_false(phy_info->cfg_phy_cnt > 20))
-   return;
+   return EINVAL;
 
-   if (!(rx_pkt_status & IWM_RX_MPDU_RES_STATUS_CRC_OK) ||
-   !(rx_pkt_status & IWM_RX_MPDU_RES_STATUS_OVERRUN_OK))
-