Lines 2643-2658
Link Here
|
2643 |
struct ieee80211_node *ni, const struct ieee80211_bpf_params *params) |
2643 |
struct ieee80211_node *ni, const struct ieee80211_bpf_params *params) |
2644 |
{ |
2644 |
{ |
2645 |
struct ieee80211vap *vap = ni->ni_vap; |
2645 |
struct ieee80211vap *vap = ni->ni_vap; |
|
|
2646 |
struct ieee80211_key *k = NULL; |
2646 |
struct ieee80211_frame *wh; |
2647 |
struct ieee80211_frame *wh; |
2647 |
struct wpi_buf tx_data; |
2648 |
struct wpi_buf tx_data; |
2648 |
struct wpi_cmd_data *tx = (struct wpi_cmd_data *)&tx_data.data; |
2649 |
struct wpi_cmd_data *tx = (struct wpi_cmd_data *)&tx_data.data; |
2649 |
uint32_t flags; |
2650 |
uint32_t flags; |
2650 |
uint8_t type; |
2651 |
uint8_t type; |
2651 |
int ac, rate, totlen; |
2652 |
int ac, rate, swcrypt, totlen; |
2652 |
|
2653 |
|
2653 |
wh = mtod(m, struct ieee80211_frame *); |
2654 |
wh = mtod(m, struct ieee80211_frame *); |
2654 |
type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; |
2655 |
type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; |
2655 |
totlen = m->m_pkthdr.len; |
|
|
2656 |
|
2656 |
|
2657 |
ac = params->ibp_pri & 3; |
2657 |
ac = params->ibp_pri & 3; |
2658 |
|
2658 |
|
Lines 2669-2679
Link Here
|
2669 |
if (flags & (WPI_TX_NEED_RTS | WPI_TX_NEED_CTS)) |
2669 |
if (flags & (WPI_TX_NEED_RTS | WPI_TX_NEED_CTS)) |
2670 |
flags |= WPI_TX_FULL_TXOP; |
2670 |
flags |= WPI_TX_FULL_TXOP; |
2671 |
|
2671 |
|
|
|
2672 |
/* Encrypt the frame if need be. */ |
2673 |
if (params->ibp_flags & IEEE80211_BPF_CRYPTO) { |
2674 |
/* Retrieve key for TX. */ |
2675 |
k = ieee80211_crypto_encap(ni, m); |
2676 |
if (k == NULL) { |
2677 |
m_freem(m); |
2678 |
return ENOBUFS; |
2679 |
} |
2680 |
swcrypt = k->wk_flags & IEEE80211_KEY_SWCRYPT; |
2681 |
|
2682 |
/* 802.11 header may have moved. */ |
2683 |
wh = mtod(m, struct ieee80211_frame *); |
2684 |
} |
2685 |
totlen = m->m_pkthdr.len; |
2686 |
|
2672 |
if (ieee80211_radiotap_active_vap(vap)) { |
2687 |
if (ieee80211_radiotap_active_vap(vap)) { |
2673 |
struct wpi_tx_radiotap_header *tap = &sc->sc_txtap; |
2688 |
struct wpi_tx_radiotap_header *tap = &sc->sc_txtap; |
2674 |
|
2689 |
|
2675 |
tap->wt_flags = 0; |
2690 |
tap->wt_flags = 0; |
2676 |
tap->wt_rate = rate; |
2691 |
tap->wt_rate = rate; |
|
|
2692 |
if (params->ibp_flags & IEEE80211_BPF_CRYPTO) |
2693 |
tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; |
2677 |
|
2694 |
|
2678 |
ieee80211_radiotap_tx(vap, m); |
2695 |
ieee80211_radiotap_tx(vap, m); |
2679 |
} |
2696 |
} |
Lines 2692-2697
Link Here
|
2692 |
tx->timeout = htole16(2); |
2709 |
tx->timeout = htole16(2); |
2693 |
} |
2710 |
} |
2694 |
|
2711 |
|
|
|
2712 |
if (k != NULL && !swcrypt) { |
2713 |
switch (k->wk_cipher->ic_cipher) { |
2714 |
case IEEE80211_CIPHER_AES_CCM: |
2715 |
tx->security = WPI_CIPHER_CCMP; |
2716 |
break; |
2717 |
|
2718 |
default: |
2719 |
break; |
2720 |
} |
2721 |
|
2722 |
memcpy(tx->key, k->wk_key, k->wk_keylen); |
2723 |
} |
2724 |
|
2695 |
tx->len = htole16(totlen); |
2725 |
tx->len = htole16(totlen); |
2696 |
tx->flags = htole32(flags); |
2726 |
tx->flags = htole32(flags); |
2697 |
tx->plcp = rate2plcp(rate); |
2727 |
tx->plcp = rate2plcp(rate); |