PERFORCE change 119745 for review
Sepherosa Ziehau
sephe at FreeBSD.org
Sun May 13 04:05:17 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=119745
Change 119745 by sephe at sephe_zealot:sam_wifi on 2007/05/13 04:04:14
u_intX_t -> uintX_t
Approved by: sam
Affected files ...
.. //depot/projects/wifi/sys/net80211/ieee80211_crypto.c#22 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_crypto.h#15 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_crypto_ccmp.c#12 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_crypto_none.c#9 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_crypto_tkip.c#15 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_crypto_wep.c#12 edit
Differences ...
==== //depot/projects/wifi/sys/net80211/ieee80211_crypto.c#22 (text+ko) ====
@@ -90,7 +90,7 @@
}
static int
null_key_set(struct ieee80211com *ic, const struct ieee80211_key *k,
- const u_int8_t mac[IEEE80211_ADDR_LEN])
+ const uint8_t mac[IEEE80211_ADDR_LEN])
{
return 1;
}
@@ -131,7 +131,7 @@
static __inline int
dev_key_set(struct ieee80211com *ic, const struct ieee80211_key *key,
- const u_int8_t mac[IEEE80211_ADDR_LEN])
+ const uint8_t mac[IEEE80211_ADDR_LEN])
{
return ic->ic_crypto.cs_key_set(ic, key, mac);
}
@@ -467,7 +467,7 @@
*/
int
ieee80211_crypto_setkey(struct ieee80211com *ic, struct ieee80211_key *key,
- const u_int8_t macaddr[IEEE80211_ADDR_LEN])
+ const uint8_t macaddr[IEEE80211_ADDR_LEN])
{
const struct ieee80211_cipher *cip = key->wk_cipher;
@@ -511,7 +511,7 @@
struct ieee80211_key *k;
struct ieee80211_frame *wh;
const struct ieee80211_cipher *cip;
- u_int8_t keyid;
+ uint8_t keyid;
/*
* Multicast traffic always uses the multicast key.
@@ -555,8 +555,8 @@
struct ieee80211_key *k;
struct ieee80211_frame *wh;
const struct ieee80211_cipher *cip;
- const u_int8_t *ivp;
- u_int8_t keyid;
+ const uint8_t *ivp;
+ uint8_t keyid;
/* NB: this minimum size data frame could be bigger */
if (m->m_pkthdr.len < IEEE80211_WEP_MINLEN) {
@@ -574,7 +574,7 @@
* the key id in the header is meaningless (typically 0).
*/
wh = mtod(m, struct ieee80211_frame *);
- ivp = mtod(m, const u_int8_t *) + hdrlen; /* XXX contig */
+ ivp = mtod(m, const uint8_t *) + hdrlen; /* XXX contig */
keyid = ivp[IEEE80211_WEP_IVLEN];
if (IEEE80211_IS_MULTICAST(wh->i_addr1) ||
IEEE80211_KEY_UNDEFINED(&ni->ni_ucastkey))
==== //depot/projects/wifi/sys/net80211/ieee80211_crypto.h#15 (text+ko) ====
@@ -45,7 +45,7 @@
*/
struct ieee80211_wepkey {
u_int wk_len; /* key length in bytes */
- u_int8_t wk_key[IEEE80211_KEYBUF_SIZE];
+ uint8_t wk_key[IEEE80211_KEYBUF_SIZE];
};
struct ieee80211_cipher;
@@ -66,12 +66,12 @@
* Ciphers such as TKIP may also support mixed hardware/software
* encrypt/decrypt and MIC processing.
*/
-typedef u_int16_t ieee80211_keyix; /* h/w key index */
+typedef uint16_t ieee80211_keyix; /* h/w key index */
struct ieee80211_key {
- u_int8_t wk_keylen; /* key length in bytes */
- u_int8_t wk_pad;
- u_int16_t wk_flags;
+ uint8_t wk_keylen; /* key length in bytes */
+ uint8_t wk_pad;
+ uint16_t wk_flags;
#define IEEE80211_KEY_XMIT 0x01 /* key used for xmit */
#define IEEE80211_KEY_RECV 0x02 /* key used for recv */
#define IEEE80211_KEY_GROUP 0x04 /* key used for WPA group operation */
@@ -79,11 +79,11 @@
#define IEEE80211_KEY_SWMIC 0x20 /* host-based enmic/demic */
ieee80211_keyix wk_keyix; /* h/w key index */
ieee80211_keyix wk_rxkeyix; /* optional h/w rx key index */
- u_int8_t wk_key[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
+ uint8_t wk_key[IEEE80211_KEYBUF_SIZE+IEEE80211_MICBUF_SIZE];
#define wk_txmic wk_key+IEEE80211_KEYBUF_SIZE+0 /* XXX can't () right */
#define wk_rxmic wk_key+IEEE80211_KEYBUF_SIZE+8 /* XXX can't () right */
- u_int64_t wk_keyrsc; /* key receive sequence counter */
- u_int64_t wk_keytsc; /* key transmit sequence counter */
+ uint64_t wk_keyrsc; /* key receive sequence counter */
+ uint64_t wk_keytsc; /* key transmit sequence counter */
const struct ieee80211_cipher *wk_cipher;
void *wk_private; /* private cipher state */
};
@@ -122,7 +122,7 @@
struct ieee80211_crypto_state {
struct ieee80211_key cs_nw_keys[IEEE80211_WEP_NKID];
ieee80211_keyix cs_def_txkey; /* default/group tx key index */
- u_int16_t cs_max_keyix; /* max h/w key index */
+ uint16_t cs_max_keyix; /* max h/w key index */
int (*cs_key_alloc)(struct ieee80211com *,
const struct ieee80211_key *,
@@ -131,7 +131,7 @@
const struct ieee80211_key *);
int (*cs_key_set)(struct ieee80211com *,
const struct ieee80211_key *,
- const u_int8_t mac[IEEE80211_ADDR_LEN]);
+ const uint8_t mac[IEEE80211_ADDR_LEN]);
void (*cs_key_update_begin)(struct ieee80211com *);
void (*cs_key_update_end)(struct ieee80211com *);
};
@@ -143,7 +143,7 @@
int ieee80211_crypto_delkey(struct ieee80211com *,
struct ieee80211_key *);
int ieee80211_crypto_setkey(struct ieee80211com *,
- struct ieee80211_key *, const u_int8_t macaddr[IEEE80211_ADDR_LEN]);
+ struct ieee80211_key *, const uint8_t macaddr[IEEE80211_ADDR_LEN]);
void ieee80211_crypto_delglobalkeys(struct ieee80211com *);
/*
@@ -162,7 +162,7 @@
void (*ic_detach)(struct ieee80211_key *);
int (*ic_setkey)(struct ieee80211_key *);
int (*ic_encap)(struct ieee80211_key *, struct mbuf *,
- u_int8_t keyid);
+ uint8_t keyid);
int (*ic_decap)(struct ieee80211_key *, struct mbuf *, int);
int (*ic_enmic)(struct ieee80211_key *, struct mbuf *, int);
int (*ic_demic)(struct ieee80211_key *, struct mbuf *, int);
==== //depot/projects/wifi/sys/net80211/ieee80211_crypto_ccmp.c#12 (text+ko) ====
@@ -66,7 +66,7 @@
static void *ccmp_attach(struct ieee80211com *, struct ieee80211_key *);
static void ccmp_detach(struct ieee80211_key *);
static int ccmp_setkey(struct ieee80211_key *);
-static int ccmp_encap(struct ieee80211_key *k, struct mbuf *, u_int8_t keyid);
+static int ccmp_encap(struct ieee80211_key *k, struct mbuf *, uint8_t keyid);
static int ccmp_decap(struct ieee80211_key *, struct mbuf *, int);
static int ccmp_enmic(struct ieee80211_key *, struct mbuf *, int);
static int ccmp_demic(struct ieee80211_key *, struct mbuf *, int);
@@ -140,11 +140,11 @@
* Add privacy headers appropriate for the specified key.
*/
static int
-ccmp_encap(struct ieee80211_key *k, struct mbuf *m, u_int8_t keyid)
+ccmp_encap(struct ieee80211_key *k, struct mbuf *m, uint8_t keyid)
{
struct ccmp_ctx *ctx = k->wk_private;
struct ieee80211com *ic = ctx->cc_ic;
- u_int8_t *ivp;
+ uint8_t *ivp;
int hdrlen;
hdrlen = ieee80211_hdrspace(ic, mtod(m, void *));
@@ -155,7 +155,7 @@
M_PREPEND(m, ccmp.ic_header, M_NOWAIT);
if (m == NULL)
return 0;
- ivp = mtod(m, u_int8_t *);
+ ivp = mtod(m, uint8_t *);
ovbcopy(ivp + ccmp.ic_header, ivp, hdrlen);
ivp += hdrlen;
@@ -250,7 +250,7 @@
/*
* Copy up 802.11 header and strip crypto bits.
*/
- ovbcopy(mtod(m, void *), mtod(m, u_int8_t *) + ccmp.ic_header, hdrlen);
+ ovbcopy(mtod(m, void *), mtod(m, uint8_t *) + ccmp.ic_header, hdrlen);
m_adj(m, ccmp.ic_header);
m_adj(m, -ccmp.ic_trailer);
@@ -356,7 +356,7 @@
b0[1] = aad[30];
aad[1] = 22 + IEEE80211_ADDR_LEN + 2;
} else {
- *(u_int16_t *)&aad[30] = 0;
+ *(uint16_t *)&aad[30] = 0;
b0[1] = 0;
aad[1] = 22 + IEEE80211_ADDR_LEN;
}
@@ -369,12 +369,12 @@
b0[1] = aad[24];
aad[1] = 22 + 2;
} else {
- *(u_int16_t *)&aad[24] = 0;
+ *(uint16_t *)&aad[24] = 0;
b0[1] = 0;
aad[1] = 22;
}
- *(u_int16_t *)&aad[26] = 0;
- *(u_int32_t *)&aad[28] = 0;
+ *(uint16_t *)&aad[26] = 0;
+ *(uint32_t *)&aad[28] = 0;
}
/* Start with the first block and AAD */
==== //depot/projects/wifi/sys/net80211/ieee80211_crypto_none.c#9 (text+ko) ====
@@ -51,7 +51,7 @@
static void *none_attach(struct ieee80211com *, struct ieee80211_key *);
static void none_detach(struct ieee80211_key *);
static int none_setkey(struct ieee80211_key *);
-static int none_encap(struct ieee80211_key *, struct mbuf *, u_int8_t);
+static int none_encap(struct ieee80211_key *, struct mbuf *, uint8_t);
static int none_decap(struct ieee80211_key *, struct mbuf *, int);
static int none_enmic(struct ieee80211_key *, struct mbuf *, int);
static int none_demic(struct ieee80211_key *, struct mbuf *, int);
@@ -91,7 +91,7 @@
}
static int
-none_encap(struct ieee80211_key *k, struct mbuf *m, u_int8_t keyid)
+none_encap(struct ieee80211_key *k, struct mbuf *m, uint8_t keyid)
{
struct ieee80211com *ic = k->wk_private;
#ifdef IEEE80211_DEBUG
@@ -115,7 +115,7 @@
struct ieee80211com *ic = k->wk_private;
#ifdef IEEE80211_DEBUG
struct ieee80211_frame *wh = mtod(m, struct ieee80211_frame *);
- const u_int8_t *ivp = (const u_int8_t *)&wh[1];
+ const uint8_t *ivp = (const uint8_t *)&wh[1];
#endif
/*
==== //depot/projects/wifi/sys/net80211/ieee80211_crypto_tkip.c#15 (text+ko) ====
@@ -58,7 +58,7 @@
static void *tkip_attach(struct ieee80211com *, struct ieee80211_key *);
static void tkip_detach(struct ieee80211_key *);
static int tkip_setkey(struct ieee80211_key *);
-static int tkip_encap(struct ieee80211_key *, struct mbuf *m, u_int8_t keyid);
+static int tkip_encap(struct ieee80211_key *, struct mbuf *m, uint8_t keyid);
static int tkip_enmic(struct ieee80211_key *, struct mbuf *, int);
static int tkip_decap(struct ieee80211_key *, struct mbuf *, int);
static int tkip_demic(struct ieee80211_key *, struct mbuf *, int);
@@ -156,11 +156,11 @@
* Add privacy headers and do any s/w encryption required.
*/
static int
-tkip_encap(struct ieee80211_key *k, struct mbuf *m, u_int8_t keyid)
+tkip_encap(struct ieee80211_key *k, struct mbuf *m, uint8_t keyid)
{
struct tkip_ctx *ctx = k->wk_private;
struct ieee80211com *ic = ctx->tc_ic;
- u_int8_t *ivp;
+ uint8_t *ivp;
int hdrlen;
/*
@@ -185,7 +185,7 @@
M_PREPEND(m, tkip.ic_header, M_NOWAIT);
if (m == NULL)
return 0;
- ivp = mtod(m, u_int8_t *);
+ ivp = mtod(m, uint8_t *);
memmove(ivp, ivp + tkip.ic_header, hdrlen);
ivp += hdrlen;
==== //depot/projects/wifi/sys/net80211/ieee80211_crypto_wep.c#12 (text+ko) ====
@@ -54,7 +54,7 @@
static void *wep_attach(struct ieee80211com *, struct ieee80211_key *);
static void wep_detach(struct ieee80211_key *);
static int wep_setkey(struct ieee80211_key *);
-static int wep_encap(struct ieee80211_key *, struct mbuf *, u_int8_t keyid);
+static int wep_encap(struct ieee80211_key *, struct mbuf *, uint8_t keyid);
static int wep_decap(struct ieee80211_key *, struct mbuf *, int hdrlen);
static int wep_enmic(struct ieee80211_key *, struct mbuf *, int);
static int wep_demic(struct ieee80211_key *, struct mbuf *, int);
@@ -79,7 +79,7 @@
struct wep_ctx {
struct ieee80211com *wc_ic; /* for diagnostics */
- u_int32_t wc_iv; /* initial vector for crypto */
+ uint32_t wc_iv; /* initial vector for crypto */
};
/* number of references from net80211 layer */
@@ -123,12 +123,12 @@
* Add privacy headers appropriate for the specified key.
*/
static int
-wep_encap(struct ieee80211_key *k, struct mbuf *m, u_int8_t keyid)
+wep_encap(struct ieee80211_key *k, struct mbuf *m, uint8_t keyid)
{
struct wep_ctx *ctx = k->wk_private;
struct ieee80211com *ic = ctx->wc_ic;
- u_int32_t iv;
- u_int8_t *ivp;
+ uint32_t iv;
+ uint8_t *ivp;
int hdrlen;
hdrlen = ieee80211_hdrspace(ic, mtod(m, void *));
@@ -139,7 +139,7 @@
M_PREPEND(m, wep.ic_header, M_NOWAIT);
if (m == NULL)
return 0;
- ivp = mtod(m, u_int8_t *);
+ ivp = mtod(m, uint8_t *);
ovbcopy(ivp + wep.ic_header, ivp, hdrlen);
ivp += hdrlen;
@@ -235,7 +235,7 @@
/*
* Copy up 802.11 header and strip crypto bits.
*/
- ovbcopy(mtod(m, void *), mtod(m, u_int8_t *) + wep.ic_header, hdrlen);
+ ovbcopy(mtod(m, void *), mtod(m, uint8_t *) + wep.ic_header, hdrlen);
m_adj(m, wep.ic_header);
m_adj(m, -wep.ic_trailer);
@@ -312,7 +312,7 @@
#define S_SWAP(a,b) do { uint8_t t = S[a]; S[a] = S[b]; S[b] = t; } while(0)
struct wep_ctx *ctx = key->wk_private;
struct mbuf *m = m0;
- u_int8_t rc4key[IEEE80211_WEP_IVLEN + IEEE80211_KEYBUF_SIZE];
+ uint8_t rc4key[IEEE80211_WEP_IVLEN + IEEE80211_KEYBUF_SIZE];
uint8_t icv[IEEE80211_WEP_CRCLEN];
uint32_t i, j, k, crc;
size_t buflen, data_len;
@@ -323,7 +323,7 @@
ctx->wc_ic->ic_stats.is_crypto_wep++;
/* NB: this assumes the header was pulled up */
- memcpy(rc4key, mtod(m, u_int8_t *) + hdrlen, IEEE80211_WEP_IVLEN);
+ memcpy(rc4key, mtod(m, uint8_t *) + hdrlen, IEEE80211_WEP_IVLEN);
memcpy(rc4key + IEEE80211_WEP_IVLEN, key->wk_key, key->wk_keylen);
/* Setup RC4 state */
@@ -394,7 +394,7 @@
#define S_SWAP(a,b) do { uint8_t t = S[a]; S[a] = S[b]; S[b] = t; } while(0)
struct wep_ctx *ctx = key->wk_private;
struct mbuf *m = m0;
- u_int8_t rc4key[IEEE80211_WEP_IVLEN + IEEE80211_KEYBUF_SIZE];
+ uint8_t rc4key[IEEE80211_WEP_IVLEN + IEEE80211_KEYBUF_SIZE];
uint8_t icv[IEEE80211_WEP_CRCLEN];
uint32_t i, j, k, crc;
size_t buflen, data_len;
@@ -405,7 +405,7 @@
ctx->wc_ic->ic_stats.is_crypto_wep++;
/* NB: this assumes the header was pulled up */
- memcpy(rc4key, mtod(m, u_int8_t *) + hdrlen, IEEE80211_WEP_IVLEN);
+ memcpy(rc4key, mtod(m, uint8_t *) + hdrlen, IEEE80211_WEP_IVLEN);
memcpy(rc4key + IEEE80211_WEP_IVLEN, key->wk_key, key->wk_keylen);
/* Setup RC4 state */
More information about the p4-projects
mailing list