Пример #1
0
u_int32_t
htt_pkt_dl_len_get(htt_pdev_handle htt_pdev)
{
    enum wlan_frm_fmt frm_type;
    u_int32_t pkt_dl_len = 0;
    struct htt_pdev_t *pdev = htt_pdev;

    /* account for the 802.3 or 802.11 header */
    frm_type = ol_cfg_frame_type(pdev->ctrl_pdev);
    if (frm_type == wlan_frm_fmt_native_wifi) {
        pkt_dl_len = HTT_TX_HDR_SIZE_NATIVE_WIFI;
    } else if (frm_type == wlan_frm_fmt_802_3) {
        pkt_dl_len = HTT_TX_HDR_SIZE_ETHERNET;
    } else {
        adf_os_print("Unexpected frame type spec: %d\n", frm_type);
        HTT_ASSERT0(0);
    }
    /*
     * Account for the optional L2 / ethernet header fields:
     * 802.1Q, LLC/SNAP
     */
    pkt_dl_len += 
        HTT_TX_HDR_SIZE_802_1Q + HTT_TX_HDR_SIZE_LLC_SNAP;

    /*
     * Account for the portion of the L3 (IP) payload that the
     * target needs for its tx classification.
     */
    pkt_dl_len += ol_cfg_tx_download_size(pdev->ctrl_pdev);

    return pkt_dl_len;
}
Пример #2
0
int
htt_tx_send_nonstd(htt_pdev_handle pdev,
		   cdf_nbuf_t msdu,
		   uint16_t msdu_id, enum htt_pkt_type pkt_type)
{
	int download_len;

	/*
	 * The pkt_type could be checked to see what L2 header type is present,
	 * and then the L2 header could be examined to determine its length.
	 * But for simplicity, just use the maximum possible header size,
	 * rather than computing the actual header size.
	 */
	download_len = sizeof(struct htt_host_tx_desc_t)
		+ HTT_TX_HDR_SIZE_OUTER_HDR_MAX      /* worst case */
		+ HTT_TX_HDR_SIZE_802_1Q
		+ HTT_TX_HDR_SIZE_LLC_SNAP
		+ ol_cfg_tx_download_size(pdev->ctrl_pdev);
	return htt_tx_send_base(pdev, msdu, msdu_id, download_len, 0);
}