---
name: "cfg80211_testmode_alloc_reply_skb"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/cfg80211_testmode_alloc_reply_skb"
---

# cfg80211\_testmode\_alloc\_reply\_skb(9)

allocate testmode reply

## NAME

cfg80211\_testmode\_alloc\_reply\_skb - allocate testmode reply

## SYNOPSIS

**struct sk\_buff \* cfg80211\_testmode\_alloc\_reply\_skb(struct wiphy \*** *wiphy***, int** *approxlen***);**

## ARGUMENTS

*wiphy*

the wiphy

*approxlen*

an upper bound of the length of the data that will be put into the skb

## DESCRIPTION

This function allocates and pre-fills an skb for a reply to the testmode command. Since it is intended for a reply, calling it outside of the *testmode\_cmd* operation is invalid.

The returned skb is pre-filled with the wiphy index and set up in a way that any data that is put into the skb (with **skb\_put**, **nla\_put** or similar) will end up being within the **NL80211\_ATTR\_TESTDATA** attribute, so all that needs to be done with the skb is adding data for the corresponding userspace tool which can then read that data out of the testdata attribute. You must not modify the skb in any other way.

When done, call **cfg80211\_testmode\_reply** with the skb and return its error code as the result of the *testmode\_cmd* operation.

## RETURN

An allocated and pre-filled skb. **NULL** if any errors happen.

## AUTHOR

**Johannes Berg** \<johannes@sipsolutions.net\>

Author.

## COPYRIGHT
