Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/bwn/if_bwn.c
| Show First 20 Lines • Show All 994 Lines • ▼ Show 20 Lines | while ((m = mbufq_dequeue(&sc->sc_snd)) != NULL) { | ||||
| ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; | ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; | ||||
| if (ni == NULL) { | if (ni == NULL) { | ||||
| device_printf(sc->sc_dev, "unexpected NULL ni\n"); | device_printf(sc->sc_dev, "unexpected NULL ni\n"); | ||||
| m_freem(m); | m_freem(m); | ||||
| counter_u64_add(sc->sc_ic.ic_oerrors, 1); | counter_u64_add(sc->sc_ic.ic_oerrors, 1); | ||||
| continue; | continue; | ||||
| } | } | ||||
| wh = mtod(m, struct ieee80211_frame *); | wh = mtod(m, struct ieee80211_frame *); | ||||
| ieee80211_output_seqno_assign(ni, -1, m); | |||||
| if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { | if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { | ||||
| k = ieee80211_crypto_encap(ni, m); | k = ieee80211_crypto_encap(ni, m); | ||||
| if (k == NULL) { | if (k == NULL) { | ||||
| if_inc_counter(ni->ni_vap->iv_ifp, | if_inc_counter(ni->ni_vap->iv_ifp, | ||||
| IFCOUNTER_OERRORS, 1); | IFCOUNTER_OERRORS, 1); | ||||
| ieee80211_free_node(ni); | ieee80211_free_node(ni); | ||||
| m_freem(m); | m_freem(m); | ||||
| continue; | continue; | ||||
| Show All 36 Lines | if (tq->tq_free == 0 || pktlen > tq->tq_size || | ||||
| goto full; | goto full; | ||||
| } | } | ||||
| return (0); | return (0); | ||||
| full: | full: | ||||
| mbufq_prepend(&sc->sc_snd, m); | mbufq_prepend(&sc->sc_snd, m); | ||||
| return (1); | return (1); | ||||
| } | } | ||||
| /* | |||||
| * @brief Queue the give frame for transmit. | |||||
| * | |||||
| * This must be called in the same lock/path as the crypto encap call | |||||
| * to avoid reordering issues. | |||||
| */ | |||||
| static int | static int | ||||
| bwn_tx_start(struct bwn_softc *sc, struct ieee80211_node *ni, struct mbuf *m) | bwn_tx_start(struct bwn_softc *sc, struct ieee80211_node *ni, struct mbuf *m) | ||||
| { | { | ||||
| struct bwn_mac *mac = sc->sc_curmac; | struct bwn_mac *mac = sc->sc_curmac; | ||||
| int error; | int error; | ||||
| BWN_ASSERT_LOCKED(sc); | BWN_ASSERT_LOCKED(sc); | ||||
| if (m->m_pkthdr.len < IEEE80211_MIN_LEN || mac == NULL) { | if (m->m_pkthdr.len < IEEE80211_MIN_LEN || mac == NULL) { | ||||
| m_freem(m); | m_freem(m); | ||||
| return (ENXIO); | return (ENXIO); | ||||
| } | } | ||||
| ieee80211_output_seqno_assign(ni, -1, m); | |||||
| error = (mac->mac_flags & BWN_MAC_FLAG_DMA) ? | error = (mac->mac_flags & BWN_MAC_FLAG_DMA) ? | ||||
| bwn_dma_tx_start(mac, ni, &m) : bwn_pio_tx_start(mac, ni, &m); | bwn_dma_tx_start(mac, ni, &m) : bwn_pio_tx_start(mac, ni, &m); | ||||
| if (error) { | if (error) { | ||||
| m_freem(m); | m_freem(m); | ||||
| return (error); | return (error); | ||||
| } | } | ||||
| return (0); | return (0); | ||||
| ▲ Show 20 Lines • Show All 6,662 Lines • Show Last 20 Lines | |||||