PERFORCE change 65059 for review

Sam Leffler sam at FreeBSD.org
Sat Nov 13 15:39:03 PST 2004


http://perforce.freebsd.org/chv.cgi?CH=65059

Change 65059 by sam at sam_ebb on 2004/11/13 23:38:54

	move ieee80211_set11gbasicrates to the rest of the 11g code
	and make it public

Affected files ...

.. //depot/projects/wifi/sys/net80211/ieee80211.c#7 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_proto.c#7 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_proto.h#5 edit

Differences ...

==== //depot/projects/wifi/sys/net80211/ieee80211.c#7 (text+ko) ====

@@ -51,9 +51,6 @@
 
 #include <net/bpf.h>
 
-static void ieee80211_set11gbasicrates(struct ieee80211_rateset *,
-		enum ieee80211_phymode);
-
 static const char *ieee80211_phymode_name[] = {
 	"auto",		/* IEEE80211_MODE_AUTO */
 	"11a",		/* IEEE80211_MODE_11A */
@@ -676,37 +673,6 @@
 }
 
 /*
- * Mark the basic rates for the 11g rate table based on the
- * operating mode.  For real 11g we mark all the 11b rates
- * and 6, 12, and 24 OFDM.  For 11b compatibility we mark only
- * 11b rates.  There's also a pseudo 11a-mode used to mark only
- * the basic OFDM rates.
- */
-static void
-ieee80211_set11gbasicrates(struct ieee80211_rateset *rs, enum ieee80211_phymode mode)
-{
-	static const struct ieee80211_rateset basic[] = {
-	    { 0 },			/* IEEE80211_MODE_AUTO */
-	    { 3, { 12, 24, 48 } },	/* IEEE80211_MODE_11A */
-	    { 2, { 2, 4 } },		/* IEEE80211_MODE_11B */
-	    { 4, { 2, 4, 11, 22 } },	/* IEEE80211_MODE_11G (mixed b/g) */
-	    { 0 },			/* IEEE80211_MODE_FH */
-					/* IEEE80211_MODE_PUREG (not yet) */
-	    { 7, { 2, 4, 11, 22, 12, 24, 48 } },
-	};
-	int i, j;
-
-	for (i = 0; i < rs->rs_nrates; i++) {
-		rs->rs_rates[i] &= IEEE80211_RATE_VAL;
-		for (j = 0; j < basic[mode].rs_nrates; j++)
-			if (basic[mode].rs_rates[j] == rs->rs_rates[i]) {
-				rs->rs_rates[i] |= IEEE80211_RATE_BASIC;
-				break;
-			}
-	}
-}
-
-/*
  * Set the current phy mode and recalculate the active channel
  * set based on the available channels for this mode.  Also
  * select a new default/current channel if the current one is

==== //depot/projects/wifi/sys/net80211/ieee80211_proto.c#7 (text+ko) ====

@@ -480,6 +480,37 @@
 #undef N
 }
 
+/*
+ * Mark the basic rates for the 11g rate table based on the
+ * operating mode.  For real 11g we mark all the 11b rates
+ * and 6, 12, and 24 OFDM.  For 11b compatibility we mark only
+ * 11b rates.  There's also a pseudo 11a-mode used to mark only
+ * the basic OFDM rates.
+ */
+void
+ieee80211_set11gbasicrates(struct ieee80211_rateset *rs, enum ieee80211_phymode mode)
+{
+	static const struct ieee80211_rateset basic[] = {
+	    { 0 },			/* IEEE80211_MODE_AUTO */
+	    { 3, { 12, 24, 48 } },	/* IEEE80211_MODE_11A */
+	    { 2, { 2, 4 } },		/* IEEE80211_MODE_11B */
+	    { 4, { 2, 4, 11, 22 } },	/* IEEE80211_MODE_11G (mixed b/g) */
+	    { 0 },			/* IEEE80211_MODE_FH */
+					/* IEEE80211_MODE_PUREG (not yet) */
+	    { 7, { 2, 4, 11, 22, 12, 24, 48 } },
+	};
+	int i, j;
+
+	for (i = 0; i < rs->rs_nrates; i++) {
+		rs->rs_rates[i] &= IEEE80211_RATE_VAL;
+		for (j = 0; j < basic[mode].rs_nrates; j++)
+			if (basic[mode].rs_rates[j] == rs->rs_rates[i]) {
+				rs->rs_rates[i] |= IEEE80211_RATE_BASIC;
+				break;
+			}
+	}
+}
+
 static int
 ieee80211_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
 {

==== //depot/projects/wifi/sys/net80211/ieee80211_proto.h#5 (text+ko) ====

@@ -69,6 +69,10 @@
 
 extern	void ieee80211_reset_erp(struct ieee80211com *);
 extern	void ieee80211_set_shortslottime(struct ieee80211com *, int onoff);
+extern	int ieee80211_iserp_rateset(struct ieee80211com *,
+		struct ieee80211_rateset *);
+extern	void ieee80211_set11gbasicrates(struct ieee80211_rateset *,
+		enum ieee80211_phymode);
 
 /*
  * Return the size of the 802.11 header for a management or data frame.
@@ -159,8 +163,6 @@
 extern	int ieee80211_fix_rate(struct ieee80211com *,
 		struct ieee80211_node *, int);
 
-extern	int ieee80211_iserp_rateset(struct ieee80211com *,
-		struct ieee80211_rateset *);
 #define	ieee80211_new_state(_ic, _nstate, _arg) \
 	(((_ic)->ic_newstate)((_ic), (_nstate), (_arg)))
 extern	void ieee80211_print_essid(const u_int8_t *, int);


More information about the p4-projects mailing list