diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-09-22 20:10:23 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-09-22 20:10:23 -0400 |
commit | 28eb177dfa5982d132edceed891cb3885df258bb (patch) | |
tree | 5f8fdc37ad1d8d0793e9c47da7d908b97c814ffb /drivers/net | |
parent | fd8ae94eea9bb4269d6dff1b47b9dc741bd70d0b (diff) | |
parent | db392219c5f572610645696e3672f6ea38783a65 (diff) |
Merge branch 'master' into upstream
Conflicts:
net/ieee80211/ieee80211_crypt_tkip.c
net/ieee80211/ieee80211_crypt_wep.c
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bmac.c | 13 | ||||
-rw-r--r-- | drivers/net/ibmveth.c | 3 | ||||
-rw-r--r-- | drivers/net/ibmveth.h | 27 | ||||
-rw-r--r-- | drivers/net/mace.c | 2 | ||||
-rw-r--r-- | drivers/net/ppp_mppe.c | 68 | ||||
-rw-r--r-- | drivers/net/spider_net.c | 12 | ||||
-rw-r--r-- | drivers/net/sungem.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/airo.c | 22 |
8 files changed, 87 insertions, 62 deletions
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c index b0c19292b60d..4adfe7b77031 100644 --- a/drivers/net/bmac.c +++ b/drivers/net/bmac.c | |||
@@ -1264,7 +1264,8 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i | |||
1264 | { | 1264 | { |
1265 | int j, rev, ret; | 1265 | int j, rev, ret; |
1266 | struct bmac_data *bp; | 1266 | struct bmac_data *bp; |
1267 | unsigned char *addr; | 1267 | const unsigned char *prop_addr; |
1268 | unsigned char addr[6]; | ||
1268 | struct net_device *dev; | 1269 | struct net_device *dev; |
1269 | int is_bmac_plus = ((int)match->data) != 0; | 1270 | int is_bmac_plus = ((int)match->data) != 0; |
1270 | 1271 | ||
@@ -1272,14 +1273,16 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i | |||
1272 | printk(KERN_ERR "BMAC: can't use, need 3 addrs and 3 intrs\n"); | 1273 | printk(KERN_ERR "BMAC: can't use, need 3 addrs and 3 intrs\n"); |
1273 | return -ENODEV; | 1274 | return -ENODEV; |
1274 | } | 1275 | } |
1275 | addr = get_property(macio_get_of_node(mdev), "mac-address", NULL); | 1276 | prop_addr = get_property(macio_get_of_node(mdev), "mac-address", NULL); |
1276 | if (addr == NULL) { | 1277 | if (prop_addr == NULL) { |
1277 | addr = get_property(macio_get_of_node(mdev), "local-mac-address", NULL); | 1278 | prop_addr = get_property(macio_get_of_node(mdev), |
1278 | if (addr == NULL) { | 1279 | "local-mac-address", NULL); |
1280 | if (prop_addr == NULL) { | ||
1279 | printk(KERN_ERR "BMAC: Can't get mac-address\n"); | 1281 | printk(KERN_ERR "BMAC: Can't get mac-address\n"); |
1280 | return -ENODEV; | 1282 | return -ENODEV; |
1281 | } | 1283 | } |
1282 | } | 1284 | } |
1285 | memcpy(addr, prop_addr, sizeof(addr)); | ||
1283 | 1286 | ||
1284 | dev = alloc_etherdev(PRIV_BYTES); | 1287 | dev = alloc_etherdev(PRIV_BYTES); |
1285 | if (!dev) { | 1288 | if (!dev) { |
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c index 48e68f5d1651..767203d35bc2 100644 --- a/drivers/net/ibmveth.c +++ b/drivers/net/ibmveth.c | |||
@@ -702,7 +702,8 @@ static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
702 | desc[3].desc, | 702 | desc[3].desc, |
703 | desc[4].desc, | 703 | desc[4].desc, |
704 | desc[5].desc, | 704 | desc[5].desc, |
705 | correlator); | 705 | correlator, |
706 | &correlator); | ||
706 | } while ((lpar_rc == H_BUSY) && (retry_count--)); | 707 | } while ((lpar_rc == H_BUSY) && (retry_count--)); |
707 | 708 | ||
708 | if(lpar_rc != H_SUCCESS && lpar_rc != H_DROPPED) { | 709 | if(lpar_rc != H_SUCCESS && lpar_rc != H_DROPPED) { |
diff --git a/drivers/net/ibmveth.h b/drivers/net/ibmveth.h index 8385bf836507..f5b25bff1540 100644 --- a/drivers/net/ibmveth.h +++ b/drivers/net/ibmveth.h | |||
@@ -41,16 +41,6 @@ | |||
41 | #define IbmVethMcastRemoveFilter 0x2UL | 41 | #define IbmVethMcastRemoveFilter 0x2UL |
42 | #define IbmVethMcastClearFilterTable 0x3UL | 42 | #define IbmVethMcastClearFilterTable 0x3UL |
43 | 43 | ||
44 | /* hcall numbers */ | ||
45 | #define H_VIO_SIGNAL 0x104 | ||
46 | #define H_REGISTER_LOGICAL_LAN 0x114 | ||
47 | #define H_FREE_LOGICAL_LAN 0x118 | ||
48 | #define H_ADD_LOGICAL_LAN_BUFFER 0x11C | ||
49 | #define H_SEND_LOGICAL_LAN 0x120 | ||
50 | #define H_MULTICAST_CTRL 0x130 | ||
51 | #define H_CHANGE_LOGICAL_LAN_MAC 0x14C | ||
52 | #define H_FREE_LOGICAL_LAN_BUFFER 0x1D4 | ||
53 | |||
54 | /* hcall macros */ | 44 | /* hcall macros */ |
55 | #define h_register_logical_lan(ua, buflst, rxq, fltlst, mac) \ | 45 | #define h_register_logical_lan(ua, buflst, rxq, fltlst, mac) \ |
56 | plpar_hcall_norets(H_REGISTER_LOGICAL_LAN, ua, buflst, rxq, fltlst, mac) | 46 | plpar_hcall_norets(H_REGISTER_LOGICAL_LAN, ua, buflst, rxq, fltlst, mac) |
@@ -61,8 +51,21 @@ | |||
61 | #define h_add_logical_lan_buffer(ua, buf) \ | 51 | #define h_add_logical_lan_buffer(ua, buf) \ |
62 | plpar_hcall_norets(H_ADD_LOGICAL_LAN_BUFFER, ua, buf) | 52 | plpar_hcall_norets(H_ADD_LOGICAL_LAN_BUFFER, ua, buf) |
63 | 53 | ||
64 | #define h_send_logical_lan(ua, buf1, buf2, buf3, buf4, buf5, buf6, correlator) \ | 54 | static inline long h_send_logical_lan(unsigned long unit_address, |
65 | plpar_hcall_8arg_2ret(H_SEND_LOGICAL_LAN, ua, buf1, buf2, buf3, buf4, buf5, buf6, correlator, &correlator) | 55 | unsigned long desc1, unsigned long desc2, unsigned long desc3, |
56 | unsigned long desc4, unsigned long desc5, unsigned long desc6, | ||
57 | unsigned long corellator_in, unsigned long *corellator_out) | ||
58 | { | ||
59 | long rc; | ||
60 | unsigned long retbuf[PLPAR_HCALL9_BUFSIZE]; | ||
61 | |||
62 | rc = plpar_hcall9(H_SEND_LOGICAL_LAN, retbuf, unit_address, desc1, | ||
63 | desc2, desc3, desc4, desc5, desc6, corellator_in); | ||
64 | |||
65 | *corellator_out = retbuf[0]; | ||
66 | |||
67 | return rc; | ||
68 | } | ||
66 | 69 | ||
67 | #define h_multicast_ctrl(ua, cmd, mac) \ | 70 | #define h_multicast_ctrl(ua, cmd, mac) \ |
68 | plpar_hcall_norets(H_MULTICAST_CTRL, ua, cmd, mac) | 71 | plpar_hcall_norets(H_MULTICAST_CTRL, ua, cmd, mac) |
diff --git a/drivers/net/mace.c b/drivers/net/mace.c index 47d7850da47b..27c24eaa2414 100644 --- a/drivers/net/mace.c +++ b/drivers/net/mace.c | |||
@@ -113,7 +113,7 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i | |||
113 | struct device_node *mace = macio_get_of_node(mdev); | 113 | struct device_node *mace = macio_get_of_node(mdev); |
114 | struct net_device *dev; | 114 | struct net_device *dev; |
115 | struct mace_data *mp; | 115 | struct mace_data *mp; |
116 | unsigned char *addr; | 116 | const unsigned char *addr; |
117 | int j, rev, rc = -EBUSY; | 117 | int j, rev, rc = -EBUSY; |
118 | 118 | ||
119 | if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) { | 119 | if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) { |
diff --git a/drivers/net/ppp_mppe.c b/drivers/net/ppp_mppe.c index 51ff9a9d1bb5..f3655fd772f5 100644 --- a/drivers/net/ppp_mppe.c +++ b/drivers/net/ppp_mppe.c | |||
@@ -43,6 +43,7 @@ | |||
43 | * deprecated in 2.6 | 43 | * deprecated in 2.6 |
44 | */ | 44 | */ |
45 | 45 | ||
46 | #include <linux/err.h> | ||
46 | #include <linux/module.h> | 47 | #include <linux/module.h> |
47 | #include <linux/kernel.h> | 48 | #include <linux/kernel.h> |
48 | #include <linux/version.h> | 49 | #include <linux/version.h> |
@@ -64,12 +65,13 @@ MODULE_LICENSE("Dual BSD/GPL"); | |||
64 | MODULE_ALIAS("ppp-compress-" __stringify(CI_MPPE)); | 65 | MODULE_ALIAS("ppp-compress-" __stringify(CI_MPPE)); |
65 | MODULE_VERSION("1.0.2"); | 66 | MODULE_VERSION("1.0.2"); |
66 | 67 | ||
67 | static void | 68 | static unsigned int |
68 | setup_sg(struct scatterlist *sg, const void *address, unsigned int length) | 69 | setup_sg(struct scatterlist *sg, const void *address, unsigned int length) |
69 | { | 70 | { |
70 | sg[0].page = virt_to_page(address); | 71 | sg[0].page = virt_to_page(address); |
71 | sg[0].offset = offset_in_page(address); | 72 | sg[0].offset = offset_in_page(address); |
72 | sg[0].length = length; | 73 | sg[0].length = length; |
74 | return length; | ||
73 | } | 75 | } |
74 | 76 | ||
75 | #define SHA1_PAD_SIZE 40 | 77 | #define SHA1_PAD_SIZE 40 |
@@ -95,8 +97,8 @@ static inline void sha_pad_init(struct sha_pad *shapad) | |||
95 | * State for an MPPE (de)compressor. | 97 | * State for an MPPE (de)compressor. |
96 | */ | 98 | */ |
97 | struct ppp_mppe_state { | 99 | struct ppp_mppe_state { |
98 | struct crypto_tfm *arc4; | 100 | struct crypto_blkcipher *arc4; |
99 | struct crypto_tfm *sha1; | 101 | struct crypto_hash *sha1; |
100 | unsigned char *sha1_digest; | 102 | unsigned char *sha1_digest; |
101 | unsigned char master_key[MPPE_MAX_KEY_LEN]; | 103 | unsigned char master_key[MPPE_MAX_KEY_LEN]; |
102 | unsigned char session_key[MPPE_MAX_KEY_LEN]; | 104 | unsigned char session_key[MPPE_MAX_KEY_LEN]; |
@@ -136,14 +138,21 @@ struct ppp_mppe_state { | |||
136 | */ | 138 | */ |
137 | static void get_new_key_from_sha(struct ppp_mppe_state * state, unsigned char *InterimKey) | 139 | static void get_new_key_from_sha(struct ppp_mppe_state * state, unsigned char *InterimKey) |
138 | { | 140 | { |
141 | struct hash_desc desc; | ||
139 | struct scatterlist sg[4]; | 142 | struct scatterlist sg[4]; |
143 | unsigned int nbytes; | ||
140 | 144 | ||
141 | setup_sg(&sg[0], state->master_key, state->keylen); | 145 | nbytes = setup_sg(&sg[0], state->master_key, state->keylen); |
142 | setup_sg(&sg[1], sha_pad->sha_pad1, sizeof(sha_pad->sha_pad1)); | 146 | nbytes += setup_sg(&sg[1], sha_pad->sha_pad1, |
143 | setup_sg(&sg[2], state->session_key, state->keylen); | 147 | sizeof(sha_pad->sha_pad1)); |
144 | setup_sg(&sg[3], sha_pad->sha_pad2, sizeof(sha_pad->sha_pad2)); | 148 | nbytes += setup_sg(&sg[2], state->session_key, state->keylen); |
149 | nbytes += setup_sg(&sg[3], sha_pad->sha_pad2, | ||
150 | sizeof(sha_pad->sha_pad2)); | ||
145 | 151 | ||
146 | crypto_digest_digest (state->sha1, sg, 4, state->sha1_digest); | 152 | desc.tfm = state->sha1; |
153 | desc.flags = 0; | ||
154 | |||
155 | crypto_hash_digest(&desc, sg, nbytes, state->sha1_digest); | ||
147 | 156 | ||
148 | memcpy(InterimKey, state->sha1_digest, state->keylen); | 157 | memcpy(InterimKey, state->sha1_digest, state->keylen); |
149 | } | 158 | } |
@@ -156,14 +165,15 @@ static void mppe_rekey(struct ppp_mppe_state * state, int initial_key) | |||
156 | { | 165 | { |
157 | unsigned char InterimKey[MPPE_MAX_KEY_LEN]; | 166 | unsigned char InterimKey[MPPE_MAX_KEY_LEN]; |
158 | struct scatterlist sg_in[1], sg_out[1]; | 167 | struct scatterlist sg_in[1], sg_out[1]; |
168 | struct blkcipher_desc desc = { .tfm = state->arc4 }; | ||
159 | 169 | ||
160 | get_new_key_from_sha(state, InterimKey); | 170 | get_new_key_from_sha(state, InterimKey); |
161 | if (!initial_key) { | 171 | if (!initial_key) { |
162 | crypto_cipher_setkey(state->arc4, InterimKey, state->keylen); | 172 | crypto_blkcipher_setkey(state->arc4, InterimKey, state->keylen); |
163 | setup_sg(sg_in, InterimKey, state->keylen); | 173 | setup_sg(sg_in, InterimKey, state->keylen); |
164 | setup_sg(sg_out, state->session_key, state->keylen); | 174 | setup_sg(sg_out, state->session_key, state->keylen); |
165 | if (crypto_cipher_encrypt(state->arc4, sg_out, sg_in, | 175 | if (crypto_blkcipher_encrypt(&desc, sg_out, sg_in, |
166 | state->keylen) != 0) { | 176 | state->keylen) != 0) { |
167 | printk(KERN_WARNING "mppe_rekey: cipher_encrypt failed\n"); | 177 | printk(KERN_WARNING "mppe_rekey: cipher_encrypt failed\n"); |
168 | } | 178 | } |
169 | } else { | 179 | } else { |
@@ -175,7 +185,7 @@ static void mppe_rekey(struct ppp_mppe_state * state, int initial_key) | |||
175 | state->session_key[1] = 0x26; | 185 | state->session_key[1] = 0x26; |
176 | state->session_key[2] = 0x9e; | 186 | state->session_key[2] = 0x9e; |
177 | } | 187 | } |
178 | crypto_cipher_setkey(state->arc4, state->session_key, state->keylen); | 188 | crypto_blkcipher_setkey(state->arc4, state->session_key, state->keylen); |
179 | } | 189 | } |
180 | 190 | ||
181 | /* | 191 | /* |
@@ -196,15 +206,19 @@ static void *mppe_alloc(unsigned char *options, int optlen) | |||
196 | 206 | ||
197 | memset(state, 0, sizeof(*state)); | 207 | memset(state, 0, sizeof(*state)); |
198 | 208 | ||
199 | state->arc4 = crypto_alloc_tfm("arc4", 0); | 209 | state->arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC); |
200 | if (!state->arc4) | 210 | if (IS_ERR(state->arc4)) { |
211 | state->arc4 = NULL; | ||
201 | goto out_free; | 212 | goto out_free; |
213 | } | ||
202 | 214 | ||
203 | state->sha1 = crypto_alloc_tfm("sha1", 0); | 215 | state->sha1 = crypto_alloc_hash("sha1", 0, CRYPTO_ALG_ASYNC); |
204 | if (!state->sha1) | 216 | if (IS_ERR(state->sha1)) { |
217 | state->sha1 = NULL; | ||
205 | goto out_free; | 218 | goto out_free; |
219 | } | ||
206 | 220 | ||
207 | digestsize = crypto_tfm_alg_digestsize(state->sha1); | 221 | digestsize = crypto_hash_digestsize(state->sha1); |
208 | if (digestsize < MPPE_MAX_KEY_LEN) | 222 | if (digestsize < MPPE_MAX_KEY_LEN) |
209 | goto out_free; | 223 | goto out_free; |
210 | 224 | ||
@@ -229,9 +243,9 @@ static void *mppe_alloc(unsigned char *options, int optlen) | |||
229 | if (state->sha1_digest) | 243 | if (state->sha1_digest) |
230 | kfree(state->sha1_digest); | 244 | kfree(state->sha1_digest); |
231 | if (state->sha1) | 245 | if (state->sha1) |
232 | crypto_free_tfm(state->sha1); | 246 | crypto_free_hash(state->sha1); |
233 | if (state->arc4) | 247 | if (state->arc4) |
234 | crypto_free_tfm(state->arc4); | 248 | crypto_free_blkcipher(state->arc4); |
235 | kfree(state); | 249 | kfree(state); |
236 | out: | 250 | out: |
237 | return NULL; | 251 | return NULL; |
@@ -247,9 +261,9 @@ static void mppe_free(void *arg) | |||
247 | if (state->sha1_digest) | 261 | if (state->sha1_digest) |
248 | kfree(state->sha1_digest); | 262 | kfree(state->sha1_digest); |
249 | if (state->sha1) | 263 | if (state->sha1) |
250 | crypto_free_tfm(state->sha1); | 264 | crypto_free_hash(state->sha1); |
251 | if (state->arc4) | 265 | if (state->arc4) |
252 | crypto_free_tfm(state->arc4); | 266 | crypto_free_blkcipher(state->arc4); |
253 | kfree(state); | 267 | kfree(state); |
254 | } | 268 | } |
255 | } | 269 | } |
@@ -356,6 +370,7 @@ mppe_compress(void *arg, unsigned char *ibuf, unsigned char *obuf, | |||
356 | int isize, int osize) | 370 | int isize, int osize) |
357 | { | 371 | { |
358 | struct ppp_mppe_state *state = (struct ppp_mppe_state *) arg; | 372 | struct ppp_mppe_state *state = (struct ppp_mppe_state *) arg; |
373 | struct blkcipher_desc desc = { .tfm = state->arc4 }; | ||
359 | int proto; | 374 | int proto; |
360 | struct scatterlist sg_in[1], sg_out[1]; | 375 | struct scatterlist sg_in[1], sg_out[1]; |
361 | 376 | ||
@@ -413,7 +428,7 @@ mppe_compress(void *arg, unsigned char *ibuf, unsigned char *obuf, | |||
413 | /* Encrypt packet */ | 428 | /* Encrypt packet */ |
414 | setup_sg(sg_in, ibuf, isize); | 429 | setup_sg(sg_in, ibuf, isize); |
415 | setup_sg(sg_out, obuf, osize); | 430 | setup_sg(sg_out, obuf, osize); |
416 | if (crypto_cipher_encrypt(state->arc4, sg_out, sg_in, isize) != 0) { | 431 | if (crypto_blkcipher_encrypt(&desc, sg_out, sg_in, isize) != 0) { |
417 | printk(KERN_DEBUG "crypto_cypher_encrypt failed\n"); | 432 | printk(KERN_DEBUG "crypto_cypher_encrypt failed\n"); |
418 | return -1; | 433 | return -1; |
419 | } | 434 | } |
@@ -462,6 +477,7 @@ mppe_decompress(void *arg, unsigned char *ibuf, int isize, unsigned char *obuf, | |||
462 | int osize) | 477 | int osize) |
463 | { | 478 | { |
464 | struct ppp_mppe_state *state = (struct ppp_mppe_state *) arg; | 479 | struct ppp_mppe_state *state = (struct ppp_mppe_state *) arg; |
480 | struct blkcipher_desc desc = { .tfm = state->arc4 }; | ||
465 | unsigned ccount; | 481 | unsigned ccount; |
466 | int flushed = MPPE_BITS(ibuf) & MPPE_BIT_FLUSHED; | 482 | int flushed = MPPE_BITS(ibuf) & MPPE_BIT_FLUSHED; |
467 | int sanity = 0; | 483 | int sanity = 0; |
@@ -599,7 +615,7 @@ mppe_decompress(void *arg, unsigned char *ibuf, int isize, unsigned char *obuf, | |||
599 | */ | 615 | */ |
600 | setup_sg(sg_in, ibuf, 1); | 616 | setup_sg(sg_in, ibuf, 1); |
601 | setup_sg(sg_out, obuf, 1); | 617 | setup_sg(sg_out, obuf, 1); |
602 | if (crypto_cipher_decrypt(state->arc4, sg_out, sg_in, 1) != 0) { | 618 | if (crypto_blkcipher_decrypt(&desc, sg_out, sg_in, 1) != 0) { |
603 | printk(KERN_DEBUG "crypto_cypher_decrypt failed\n"); | 619 | printk(KERN_DEBUG "crypto_cypher_decrypt failed\n"); |
604 | return DECOMP_ERROR; | 620 | return DECOMP_ERROR; |
605 | } | 621 | } |
@@ -619,7 +635,7 @@ mppe_decompress(void *arg, unsigned char *ibuf, int isize, unsigned char *obuf, | |||
619 | /* And finally, decrypt the rest of the packet. */ | 635 | /* And finally, decrypt the rest of the packet. */ |
620 | setup_sg(sg_in, ibuf + 1, isize - 1); | 636 | setup_sg(sg_in, ibuf + 1, isize - 1); |
621 | setup_sg(sg_out, obuf + 1, osize - 1); | 637 | setup_sg(sg_out, obuf + 1, osize - 1); |
622 | if (crypto_cipher_decrypt(state->arc4, sg_out, sg_in, isize - 1) != 0) { | 638 | if (crypto_blkcipher_decrypt(&desc, sg_out, sg_in, isize - 1)) { |
623 | printk(KERN_DEBUG "crypto_cypher_decrypt failed\n"); | 639 | printk(KERN_DEBUG "crypto_cypher_decrypt failed\n"); |
624 | return DECOMP_ERROR; | 640 | return DECOMP_ERROR; |
625 | } | 641 | } |
@@ -694,8 +710,8 @@ static struct compressor ppp_mppe = { | |||
694 | static int __init ppp_mppe_init(void) | 710 | static int __init ppp_mppe_init(void) |
695 | { | 711 | { |
696 | int answer; | 712 | int answer; |
697 | if (!(crypto_alg_available("arc4", 0) && | 713 | if (!(crypto_has_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC) && |
698 | crypto_alg_available("sha1", 0))) | 714 | crypto_has_hash("sha1", 0, CRYPTO_ALG_ASYNC))) |
699 | return -ENODEV; | 715 | return -ENODEV; |
700 | 716 | ||
701 | sha_pad = kmalloc(sizeof(struct sha_pad), GFP_KERNEL); | 717 | sha_pad = kmalloc(sizeof(struct sha_pad), GFP_KERNEL); |
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index 88907218457a..d64e718afbd2 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c | |||
@@ -1697,10 +1697,10 @@ spider_net_setup_phy(struct spider_net_card *card) | |||
1697 | */ | 1697 | */ |
1698 | static int | 1698 | static int |
1699 | spider_net_download_firmware(struct spider_net_card *card, | 1699 | spider_net_download_firmware(struct spider_net_card *card, |
1700 | u8 *firmware_ptr) | 1700 | const void *firmware_ptr) |
1701 | { | 1701 | { |
1702 | int sequencer, i; | 1702 | int sequencer, i; |
1703 | u32 *fw_ptr = (u32 *)firmware_ptr; | 1703 | const u32 *fw_ptr = firmware_ptr; |
1704 | 1704 | ||
1705 | /* stop sequencers */ | 1705 | /* stop sequencers */ |
1706 | spider_net_write_reg(card, SPIDER_NET_GSINIT, | 1706 | spider_net_write_reg(card, SPIDER_NET_GSINIT, |
@@ -1757,7 +1757,7 @@ spider_net_init_firmware(struct spider_net_card *card) | |||
1757 | { | 1757 | { |
1758 | struct firmware *firmware = NULL; | 1758 | struct firmware *firmware = NULL; |
1759 | struct device_node *dn; | 1759 | struct device_node *dn; |
1760 | u8 *fw_prop = NULL; | 1760 | const u8 *fw_prop = NULL; |
1761 | int err = -ENOENT; | 1761 | int err = -ENOENT; |
1762 | int fw_size; | 1762 | int fw_size; |
1763 | 1763 | ||
@@ -1783,7 +1783,7 @@ try_host_fw: | |||
1783 | if (!dn) | 1783 | if (!dn) |
1784 | goto out_err; | 1784 | goto out_err; |
1785 | 1785 | ||
1786 | fw_prop = (u8 *)get_property(dn, "firmware", &fw_size); | 1786 | fw_prop = get_property(dn, "firmware", &fw_size); |
1787 | if (!fw_prop) | 1787 | if (!fw_prop) |
1788 | goto out_err; | 1788 | goto out_err; |
1789 | 1789 | ||
@@ -1986,7 +1986,7 @@ spider_net_setup_netdev(struct spider_net_card *card) | |||
1986 | struct net_device *netdev = card->netdev; | 1986 | struct net_device *netdev = card->netdev; |
1987 | struct device_node *dn; | 1987 | struct device_node *dn; |
1988 | struct sockaddr addr; | 1988 | struct sockaddr addr; |
1989 | u8 *mac; | 1989 | const u8 *mac; |
1990 | 1990 | ||
1991 | SET_MODULE_OWNER(netdev); | 1991 | SET_MODULE_OWNER(netdev); |
1992 | SET_NETDEV_DEV(netdev, &card->pdev->dev); | 1992 | SET_NETDEV_DEV(netdev, &card->pdev->dev); |
@@ -2019,7 +2019,7 @@ spider_net_setup_netdev(struct spider_net_card *card) | |||
2019 | if (!dn) | 2019 | if (!dn) |
2020 | return -EIO; | 2020 | return -EIO; |
2021 | 2021 | ||
2022 | mac = (u8 *)get_property(dn, "local-mac-address", NULL); | 2022 | mac = get_property(dn, "local-mac-address", NULL); |
2023 | if (!mac) | 2023 | if (!mac) |
2024 | return -EIO; | 2024 | return -EIO; |
2025 | memcpy(addr.sa_data, mac, ETH_ALEN); | 2025 | memcpy(addr.sa_data, mac, ETH_ALEN); |
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index e567d0ae77ee..e06c59d4dd62 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c | |||
@@ -2896,7 +2896,7 @@ static int __devinit gem_get_device_address(struct gem *gp) | |||
2896 | if (use_idprom) | 2896 | if (use_idprom) |
2897 | memcpy(dev->dev_addr, idprom->id_ethaddr, 6); | 2897 | memcpy(dev->dev_addr, idprom->id_ethaddr, 6); |
2898 | #elif defined(CONFIG_PPC_PMAC) | 2898 | #elif defined(CONFIG_PPC_PMAC) |
2899 | unsigned char *addr; | 2899 | const unsigned char *addr; |
2900 | 2900 | ||
2901 | addr = get_property(gp->of_node, "local-mac-address", NULL); | 2901 | addr = get_property(gp->of_node, "local-mac-address", NULL); |
2902 | if (addr == NULL) { | 2902 | if (addr == NULL) { |
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index e088ceefb4a3..bff04cba3fed 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -19,6 +19,7 @@ | |||
19 | 19 | ||
20 | ======================================================================*/ | 20 | ======================================================================*/ |
21 | 21 | ||
22 | #include <linux/err.h> | ||
22 | #include <linux/init.h> | 23 | #include <linux/init.h> |
23 | 24 | ||
24 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
@@ -1203,7 +1204,7 @@ struct airo_info { | |||
1203 | struct iw_spy_data spy_data; | 1204 | struct iw_spy_data spy_data; |
1204 | struct iw_public_data wireless_data; | 1205 | struct iw_public_data wireless_data; |
1205 | /* MIC stuff */ | 1206 | /* MIC stuff */ |
1206 | struct crypto_tfm *tfm; | 1207 | struct crypto_cipher *tfm; |
1207 | mic_module mod[2]; | 1208 | mic_module mod[2]; |
1208 | mic_statistics micstats; | 1209 | mic_statistics micstats; |
1209 | HostRxDesc rxfids[MPI_MAX_FIDS]; // rx/tx/config MPI350 descriptors | 1210 | HostRxDesc rxfids[MPI_MAX_FIDS]; // rx/tx/config MPI350 descriptors |
@@ -1271,7 +1272,8 @@ static int flashrestart(struct airo_info *ai,struct net_device *dev); | |||
1271 | 1272 | ||
1272 | static int RxSeqValid (struct airo_info *ai,miccntx *context,int mcast,u32 micSeq); | 1273 | static int RxSeqValid (struct airo_info *ai,miccntx *context,int mcast,u32 micSeq); |
1273 | static void MoveWindow(miccntx *context, u32 micSeq); | 1274 | static void MoveWindow(miccntx *context, u32 micSeq); |
1274 | static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct crypto_tfm *); | 1275 | static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, |
1276 | struct crypto_cipher *tfm); | ||
1275 | static void emmh32_init(emmh32_context *context); | 1277 | static void emmh32_init(emmh32_context *context); |
1276 | static void emmh32_update(emmh32_context *context, u8 *pOctets, int len); | 1278 | static void emmh32_update(emmh32_context *context, u8 *pOctets, int len); |
1277 | static void emmh32_final(emmh32_context *context, u8 digest[4]); | 1279 | static void emmh32_final(emmh32_context *context, u8 digest[4]); |
@@ -1339,10 +1341,11 @@ static int micsetup(struct airo_info *ai) { | |||
1339 | int i; | 1341 | int i; |
1340 | 1342 | ||
1341 | if (ai->tfm == NULL) | 1343 | if (ai->tfm == NULL) |
1342 | ai->tfm = crypto_alloc_tfm("aes", CRYPTO_TFM_REQ_MAY_SLEEP); | 1344 | ai->tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); |
1343 | 1345 | ||
1344 | if (ai->tfm == NULL) { | 1346 | if (IS_ERR(ai->tfm)) { |
1345 | airo_print_err(ai->dev->name, "failed to load transform for AES"); | 1347 | airo_print_err(ai->dev->name, "failed to load transform for AES"); |
1348 | ai->tfm = NULL; | ||
1346 | return ERROR; | 1349 | return ERROR; |
1347 | } | 1350 | } |
1348 | 1351 | ||
@@ -1608,7 +1611,8 @@ static void MoveWindow(miccntx *context, u32 micSeq) | |||
1608 | static unsigned char aes_counter[16]; | 1611 | static unsigned char aes_counter[16]; |
1609 | 1612 | ||
1610 | /* expand the key to fill the MMH coefficient array */ | 1613 | /* expand the key to fill the MMH coefficient array */ |
1611 | static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct crypto_tfm *tfm) | 1614 | static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, |
1615 | struct crypto_cipher *tfm) | ||
1612 | { | 1616 | { |
1613 | /* take the keying material, expand if necessary, truncate at 16-bytes */ | 1617 | /* take the keying material, expand if necessary, truncate at 16-bytes */ |
1614 | /* run through AES counter mode to generate context->coeff[] */ | 1618 | /* run through AES counter mode to generate context->coeff[] */ |
@@ -1616,7 +1620,6 @@ static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct | |||
1616 | int i,j; | 1620 | int i,j; |
1617 | u32 counter; | 1621 | u32 counter; |
1618 | u8 *cipher, plain[16]; | 1622 | u8 *cipher, plain[16]; |
1619 | struct scatterlist sg[1]; | ||
1620 | 1623 | ||
1621 | crypto_cipher_setkey(tfm, pkey, 16); | 1624 | crypto_cipher_setkey(tfm, pkey, 16); |
1622 | counter = 0; | 1625 | counter = 0; |
@@ -1627,9 +1630,8 @@ static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct | |||
1627 | aes_counter[12] = (u8)(counter >> 24); | 1630 | aes_counter[12] = (u8)(counter >> 24); |
1628 | counter++; | 1631 | counter++; |
1629 | memcpy (plain, aes_counter, 16); | 1632 | memcpy (plain, aes_counter, 16); |
1630 | sg_set_buf(sg, plain, 16); | 1633 | crypto_cipher_encrypt_one(tfm, plain, plain); |
1631 | crypto_cipher_encrypt(tfm, sg, sg, 16); | 1634 | cipher = plain; |
1632 | cipher = kmap(sg->page) + sg->offset; | ||
1633 | for (j=0; (j<16) && (i< (sizeof(context->coeff)/sizeof(context->coeff[0]))); ) { | 1635 | for (j=0; (j<16) && (i< (sizeof(context->coeff)/sizeof(context->coeff[0]))); ) { |
1634 | context->coeff[i++] = ntohl(*(u32 *)&cipher[j]); | 1636 | context->coeff[i++] = ntohl(*(u32 *)&cipher[j]); |
1635 | j += 4; | 1637 | j += 4; |
@@ -2431,7 +2433,7 @@ void stop_airo_card( struct net_device *dev, int freeres ) | |||
2431 | ai->shared, ai->shared_dma); | 2433 | ai->shared, ai->shared_dma); |
2432 | } | 2434 | } |
2433 | } | 2435 | } |
2434 | crypto_free_tfm(ai->tfm); | 2436 | crypto_free_cipher(ai->tfm); |
2435 | del_airo_dev( dev ); | 2437 | del_airo_dev( dev ); |
2436 | free_netdev( dev ); | 2438 | free_netdev( dev ); |
2437 | } | 2439 | } |