From: Jiri Benc <jbenc@suse.cz>
To: netdev@vger.kernel.org
Subject: [PATCH 2/9] d80211: host_gen_beacon_template flag
Date: Tue, 18 Jul 2006 17:45:22 +0200 (CEST) [thread overview]
Message-ID: <20060718154522.DBB9D483BB@silver.suse.cz> (raw)
In-Reply-To: <20060718174442.485760904.midnight@suse.cz>
This is a partial support for devices requiring beacon template. Please note
that there is no support for PS mode for such cards yet.
Signed-off-by: Jiri Benc <jbenc@suse.cz>
---
include/net/d80211.h | 6 ++++++
net/d80211/ieee80211.c | 22 +++++++++++++++++++++-
net/d80211/ieee80211_i.h | 1 +
net/d80211/ieee80211_ioctl.c | 2 +-
4 files changed, 29 insertions(+), 2 deletions(-)
00f22bc8c0745572f3aebd5b6fd7a721199b3a4a
diff --git a/include/net/d80211.h b/include/net/d80211.h
index 6ae4325..fdb082c 100644
--- a/include/net/d80211.h
+++ b/include/net/d80211.h
@@ -349,6 +349,9 @@ struct ieee80211_if_init_conf {
* only during config_interface() callback (so copy the value somewhere
* if you need it).
* @generic_elem_len: length of the generic element.
+ * @beacon: beacon template. Valid only if @host_gen_beacon_template in
+ * &struct ieee80211_hw is set. The driver is responsible of freeing
+ * the sk_buff.
*
* This structure is passed to config_interface() callback of
* &struct ieee80211_hw.
@@ -360,6 +363,7 @@ struct ieee80211_if_conf {
size_t ssid_len;
u8 *generic_elem;
size_t generic_elem_len;
+ struct sk_buff *beacon;
};
typedef enum { ALG_NONE, ALG_WEP, ALG_TKIP, ALG_CCMP, ALG_NULL }
@@ -439,6 +443,8 @@ struct ieee80211_hw {
* beacon frame. */
int host_gen_beacon:1;
+ /* The device needs to be supplied with a beacon template only. */
+ int host_gen_beacon_template:1;
/* Some devices handle decryption internally and do not
* indicate whether the frame was encrypted (unencrypted frames
diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c
index 18d910d..549c8a4 100644
--- a/net/d80211/ieee80211.c
+++ b/net/d80211/ieee80211.c
@@ -1900,7 +1900,8 @@ ieee80211_get_buffered_bc(struct net_dev
return skb;
}
-int ieee80211_if_config(struct net_device *dev)
+static int __ieee80211_if_config(struct net_device *dev,
+ struct sk_buff *beacon)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = dev->ieee80211_ptr;
@@ -1923,10 +1924,29 @@ int ieee80211_if_config(struct net_devic
conf.ssid_len = sdata->u.ap.ssid_len;
conf.generic_elem = sdata->u.ap.generic_elem;
conf.generic_elem_len = sdata->u.ap.generic_elem_len;
+ conf.beacon = beacon;
}
return local->hw->config_interface(local->mdev, dev->ifindex, &conf);
}
+int ieee80211_if_config(struct net_device *dev)
+{
+ return __ieee80211_if_config(dev, NULL);
+}
+
+int ieee80211_if_config_beacon(struct net_device *dev)
+{
+ struct ieee80211_local *local = dev->ieee80211_ptr;
+ struct sk_buff *skb;
+
+ if (!local->hw->host_gen_beacon_template)
+ return 0;
+ skb = ieee80211_beacon_get(local->mdev, dev->ifindex, NULL);
+ if (!skb)
+ return -ENOMEM;
+ return __ieee80211_if_config(dev, skb);
+}
+
int ieee80211_hw_config(struct net_device *dev)
{
struct ieee80211_local *local = dev->ieee80211_ptr;
diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h
index 9e1fff2..7ffeae2 100644
--- a/net/d80211/ieee80211_i.h
+++ b/net/d80211/ieee80211_i.h
@@ -546,6 +546,7 @@ struct sta_attribute {
void ieee80211_release_hw(struct ieee80211_local *local);
int ieee80211_hw_config(struct net_device *dev);
int ieee80211_if_config(struct net_device *dev);
+int ieee80211_if_config_beacon(struct net_device *dev);
struct ieee80211_key_conf *
ieee80211_key_data2conf(struct ieee80211_local *local,
struct ieee80211_key *data);
diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c
index 7c2a847..d73693e 100644
--- a/net/d80211/ieee80211_ioctl.c
+++ b/net/d80211/ieee80211_ioctl.c
@@ -110,7 +110,7 @@ static int ieee80211_ioctl_set_beacon(st
}
}
- return 0;
+ return ieee80211_if_config_beacon(dev);
}
--
1.3.0
next prev parent reply other threads:[~2006-07-18 15:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-18 15:45 [PATCH 0/9] d80211: pull request Jiri Benc
2006-07-18 15:45 ` [PATCH 1/9] d80211: do not receive through master interface when not scanning Jiri Benc
2006-07-18 15:45 ` Jiri Benc [this message]
2006-07-18 15:45 ` [PATCH 3/9] d80211: better deallocation of mdev Jiri Benc
2006-07-19 3:07 ` Simon Barber
2006-07-19 10:15 ` Jiri Benc
2006-07-18 15:45 ` [PATCH 4/9] d80211: fix receiving through virtual interfaces Jiri Benc
2006-07-18 15:45 ` [PATCH 5/9] d80211: fix defragmentation Jiri Benc
2006-07-18 15:45 ` [PATCH 6/9] d80211: optimize defragmentation Jiri Benc
2006-07-18 15:45 ` [PATCH 7/9] d80211: SET_NETDEV_DEV for non-master devices Jiri Benc
2006-07-18 15:45 ` [PATCH 8/9] d80211: Replace rc4 code with crypto api arc4 Jiri Benc
2006-07-18 15:45 ` [PATCH 9/9] d80211: Add sparse bitwise annotations Jiri Benc
2006-07-18 15:46 ` [PATCH 0/9] d80211: pull request Jiri Benc
2006-07-28 14:25 ` Jiri Benc
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=20060718154522.DBB9D483BB@silver.suse.cz \
--to=jbenc@suse.cz \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).