All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: linux-wireless@vger.kernel.org
Subject: [PATCH 1/3] d80211: use const
Date: Thu, 22 Feb 2007 16:10:14 -0800	[thread overview]
Message-ID: <20070222161014.62d064a6@freekitty> (raw)


Use const to indicate constant arguments and encapsulation headers.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
---
 include/net/d80211.h     |    2 +-
 net/d80211/ieee80211.c   |   39 ++++++++++++++++++++-------------------
 net/d80211/ieee80211_i.h |    2 +-
 3 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/include/net/d80211.h b/include/net/d80211.h
index 551fe46..5f291e9 100644
--- a/include/net/d80211.h
+++ b/include/net/d80211.h
@@ -931,7 +931,7 @@ int ieee80211_set_aid_for_sta(struct iee
  * headers). If the data in the sk_buff is too short to contain a valid 802.11
  * header the function returns 0.
  */
-int ieee80211_get_hdrlen_from_skb(struct sk_buff *skb);
+int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
 
 /* Like ieee80211_get_hdrlen_from_skb() but takes a FC in CPU order. */
 int ieee80211_get_hdrlen(u16 fc);
diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c
index 273cba1..73e34a0 100644
--- a/net/d80211/ieee80211.c
+++ b/net/d80211/ieee80211.c
@@ -34,15 +34,16 @@ #include "ieee80211_led.h"
 
 /* See IEEE 802.1H for LLC/SNAP encapsulation/decapsulation */
 /* Ethernet-II snap header (RFC1042 for most EtherTypes) */
-static unsigned char rfc1042_header[] =
-{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
+static const unsigned char rfc1042_header[] =
+	{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
+
 /* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
-static unsigned char bridge_tunnel_header[] =
-{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
-/* No encapsulation header if EtherType < 0x600 (=length) */
+static const unsigned char bridge_tunnel_header[] =
+	{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
 
-static unsigned char eapol_header[] =
-{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, 0x88, 0x8e };
+/* No encapsulation header if EtherType < 0x600 (=length) */
+static const unsigned char eapol_header[] =
+	{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, 0x88, 0x8e };
 
 
 static u8 * ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len);
@@ -52,7 +53,7 @@ static int ieee80211_mgmt_start_xmit(str
 
 struct ieee80211_key_conf *
 ieee80211_key_data2conf(struct ieee80211_local *local,
-			struct ieee80211_key *data)
+			const struct ieee80211_key *data)
 {
 	struct ieee80211_key_conf *conf;
 
@@ -114,7 +115,7 @@ void ieee80211_key_release(struct kobjec
 	kfree(key);
 }
 
-static int rate_list_match(int *rate_list, int rate)
+static int rate_list_match(const int *rate_list, int rate)
 {
 	int i;
 
@@ -269,9 +270,9 @@ int ieee80211_get_hdrlen(u16 fc)
 }
 EXPORT_SYMBOL(ieee80211_get_hdrlen);
 
-int ieee80211_get_hdrlen_from_skb(struct sk_buff *skb)
+int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb)
 {
-	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
+	const struct ieee80211_hdr *hdr = (const struct ieee80211_hdr *) skb->data;
 	int hdrlen;
 
 	if (unlikely(skb->len < 10))
@@ -285,9 +286,9 @@ EXPORT_SYMBOL(ieee80211_get_hdrlen_from_
 
 #ifdef CONFIG_D80211_LOWTX_FRAME_DUMP
 static void ieee80211_dump_frame(const char *ifname, const char *title,
-				 struct sk_buff *skb)
+				 const struct sk_buff *skb)
 {
-	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
+	const struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
 	u16 fc;
 	int hdrlen;
 
@@ -322,16 +323,16 @@ static inline void ieee80211_dump_frame(
 #endif /* CONFIG_D80211_LOWTX_FRAME_DUMP */
 
 
-static int ieee80211_is_eapol(struct sk_buff *skb)
+static int ieee80211_is_eapol(const struct sk_buff *skb)
 {
-	struct ieee80211_hdr *hdr;
+	const struct ieee80211_hdr *hdr;
 	u16 fc;
 	int hdrlen;
 
 	if (unlikely(skb->len < 10))
 		return 0;
 
-	hdr = (struct ieee80211_hdr *) skb->data;
+	hdr = (const struct ieee80211_hdr *) skb->data;
 	fc = le16_to_cpu(hdr->frame_control);
 
 	if (unlikely(!WLAN_FC_DATA_PRESENT(fc)))
@@ -1118,13 +1119,13 @@ static void inline ieee80211_tx_prepare(
 	__ieee80211_tx_prepare(tx, skb, dev, control);
 }
 
-static inline int __ieee80211_queue_stopped(struct ieee80211_local *local,
+static inline int __ieee80211_queue_stopped(const struct ieee80211_local *local,
 					    int queue)
 {
 	return test_bit(IEEE80211_LINK_STATE_XOFF, &local->state[queue]);
 }
 
-static inline int __ieee80211_queue_pending(struct ieee80211_local *local,
+static inline int __ieee80211_queue_pending(const struct ieee80211_local *local,
 					    int queue)
 {
 	return test_bit(IEEE80211_LINK_STATE_PENDING, &local->state[queue]);
@@ -1429,7 +1430,7 @@ static int ieee80211_subif_start_xmit(st
 	int ret = 1, head_need;
 	u16 ethertype, hdrlen, fc;
 	struct ieee80211_hdr hdr;
-	u8 *encaps_data;
+	const u8 *encaps_data;
         int encaps_len, skip_header_bytes;
 	int nh_pos, h_pos, no_encrypt = 0;
 	struct sta_info *sta;
diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h
index 0c3b054..71eb25f 100644
--- a/net/d80211/ieee80211_i.h
+++ b/net/d80211/ieee80211_i.h
@@ -607,7 +607,7 @@ int ieee80211_if_config(struct net_devic
 int ieee80211_if_config_beacon(struct net_device *dev);
 struct ieee80211_key_conf *
 ieee80211_key_data2conf(struct ieee80211_local *local,
-			struct ieee80211_key *data);
+			const struct ieee80211_key *data);
 struct ieee80211_key *ieee80211_key_alloc(struct ieee80211_sub_if_data *sdata,
 					  int idx, size_t key_len, gfp_t flags);
 void ieee80211_key_free(struct ieee80211_key *key);
-- 
1.4.1


             reply	other threads:[~2007-02-23  0:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-23  0:10 Stephen Hemminger [this message]
2007-02-23  0:11 ` [PATCH 2/3] bcm43xx: build failure Stephen Hemminger
2007-02-23  0:31   ` Michael Wu
2007-02-23  0:12 ` [PATCH 3/3] d80211: convert to use compare_ether_addr Stephen Hemminger
2007-02-23 16:55   ` 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=20070222161014.62d064a6@freekitty \
    --to=shemminger@linux-foundation.org \
    --cc=linux-wireless@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.