From: Michael Buesch <mb@bu3sch.de>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Jiri Benc <jbenc@suse.cz>,
"John W. Linville" <linville@tuxdriver.com>,
netdev <netdev@vger.kernel.org>
Subject: Re: [RFC] make d80211 use nl80211
Date: Thu, 24 Aug 2006 19:09:34 +0200 [thread overview]
Message-ID: <200608241909.35065.mb@bu3sch.de> (raw)
In-Reply-To: <1156435657.10283.10.camel@ux156>
On Thursday 24 August 2006 18:07, Johannes Berg wrote:
> new version of this one too...
> --
> Subject: d80211: use nl80211
>
> This patch makes d80211 partially configurable using the
> infrastructure that nl80211 provides. So far, it allows
> packet injection and adding/removing virtual interfaces.
>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
>
> +static int ieee80211_inject(void *priv, void *frame, int framelen, u32 flags,
> + int queue)
> +{
> + struct ieee80211_local *local = priv;
> + struct ieee80211_tx_packet_data *pkt_data;
> + struct sk_buff *pkt;
> + void *pktdata;
> +
> + pkt = alloc_skb(framelen, GFP_KERNEL);
if (!pkt)
return -ENOMEM;
> + pktdata = skb_put(pkt, framelen);
> + memcpy(pktdata, frame, framelen);
having two variables with almost the same name seems
confusing to me. What about removing void *pktdata; and
doing the following instead of the two lines above?
memcpy(skb_put(pkt, framelen), frame, framelen);
That is also how it's done in lots of other networking code.
> + pkt_data = (struct ieee80211_tx_packet_data *) pkt->cb;
> + pkt_data->ifindex = local->mdev->ifindex;
> + pkt_data->internal_flags = TX_FLAG_INJECTED;
> + pkt_data->flags = flags;
> + /* FIXME: never used, I think? Or could be invalid? */
> + pkt_data->queue = queue;
> +
> + /* FIXME */
> + pkt->priority = 20; /* use hardcoded priority for mgmt TX queue */
> +
> + pkt->dev = local->mdev;
> + dev_queue_xmit(pkt);
> +
> + return 0;
> +}
The other code looks fine to me (the add nl80211 patch, too).
--
Greetings Michael.
next prev parent reply other threads:[~2006-08-24 17:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-22 13:53 [RFC] make d80211 use nl80211 Johannes Berg
2006-08-24 14:05 ` Jiri Benc
2006-08-24 16:07 ` Johannes Berg
2006-08-24 17:09 ` Michael Buesch [this message]
2006-08-24 17:36 ` Thomas Graf
2006-08-25 11:02 ` [RFC take3] " Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200608241909.35065.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=jbenc@suse.cz \
--cc=johannes@sipsolutions.net \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.