コード例 #1
0
ファイル: cmd.c プロジェクト: 383530895/linux
struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl,
					      struct wl12xx_vif *wlvif,
					      struct sk_buff *skb)
{
	struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif);
	int ret;
	u32 rate;

	if (!skb)
		skb = ieee80211_ap_probereq_get(wl->hw, vif);
	if (!skb)
		goto out;

	wl1271_debug(DEBUG_SCAN, "set ap probe request template");

	rate = wl1271_tx_min_rate_get(wl, wlvif->bitrate_masks[wlvif->band]);
	if (wlvif->band == IEEE80211_BAND_2GHZ)
		ret = wl1271_cmd_template_set(wl, wlvif->role_id,
					      CMD_TEMPL_CFG_PROBE_REQ_2_4,
					      skb->data, skb->len, 0, rate);
	else
		ret = wl1271_cmd_template_set(wl, wlvif->role_id,
					      CMD_TEMPL_CFG_PROBE_REQ_5,
					      skb->data, skb->len, 0, rate);

	if (ret < 0)
		wl1271_error("Unable to set ap probe request template.");

out:
	return skb;
}
コード例 #2
0
struct sk_buff *wl1271_cmd_build_ap_probe_req(struct wl1271 *wl,
        struct sk_buff *skb)
{
    int ret;

    if (!skb)
        skb = ieee80211_ap_probereq_get(wl->hw, wl->vif);
    if (!skb)
        goto out;

    wl1271_dump(DEBUG_SCAN, "AP PROBE REQ: ", skb->data, skb->len);

    if (wl->band == IEEE80211_BAND_2GHZ)
        ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4,
                                      skb->data, skb->len, 0,
                                      wl->conf.tx.basic_rate);
    else
        ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5,
                                      skb->data, skb->len, 0,
                                      wl->conf.tx.basic_rate_5);

    if (ret < 0)
        wl1271_error("Unable to set ap probe request template.");

out:
    return skb;
}