aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/airo.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/airo.c')
-rw-r--r--drivers/net/wireless/airo.c57
1 files changed, 23 insertions, 34 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index cb429e783749..849ac88bcccc 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -35,6 +35,7 @@
35#include <linux/interrupt.h> 35#include <linux/interrupt.h>
36#include <linux/in.h> 36#include <linux/in.h>
37#include <linux/bitops.h> 37#include <linux/bitops.h>
38#include <linux/scatterlist.h>
38#include <asm/io.h> 39#include <asm/io.h>
39#include <asm/system.h> 40#include <asm/system.h>
40 41
@@ -1590,11 +1591,9 @@ static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct
1590 aes_counter[12] = (u8)(counter >> 24); 1591 aes_counter[12] = (u8)(counter >> 24);
1591 counter++; 1592 counter++;
1592 memcpy (plain, aes_counter, 16); 1593 memcpy (plain, aes_counter, 16);
1593 sg[0].page = virt_to_page(plain); 1594 sg_set_buf(sg, plain, 16);
1594 sg[0].offset = ((long) plain & ~PAGE_MASK);
1595 sg[0].length = 16;
1596 crypto_cipher_encrypt(tfm, sg, sg, 16); 1595 crypto_cipher_encrypt(tfm, sg, sg, 16);
1597 cipher = kmap(sg[0].page) + sg[0].offset; 1596 cipher = kmap(sg->page) + sg->offset;
1598 for (j=0; (j<16) && (i< (sizeof(context->coeff)/sizeof(context->coeff[0]))); ) { 1597 for (j=0; (j<16) && (i< (sizeof(context->coeff)/sizeof(context->coeff[0]))); ) {
1599 context->coeff[i++] = ntohl(*(u32 *)&cipher[j]); 1598 context->coeff[i++] = ntohl(*(u32 *)&cipher[j]);
1600 j += 4; 1599 j += 4;
@@ -2041,7 +2040,7 @@ static int mpi_send_packet (struct net_device *dev)
2041 return 1; 2040 return 1;
2042} 2041}
2043 2042
2044static void get_tx_error(struct airo_info *ai, u32 fid) 2043static void get_tx_error(struct airo_info *ai, s32 fid)
2045{ 2044{
2046 u16 status; 2045 u16 status;
2047 2046
@@ -2381,14 +2380,10 @@ void stop_airo_card( struct net_device *dev, int freeres )
2381 dev_kfree_skb(skb); 2380 dev_kfree_skb(skb);
2382 } 2381 }
2383 2382
2384 if (ai->flash) 2383 kfree(ai->flash);
2385 kfree(ai->flash); 2384 kfree(ai->rssi);
2386 if (ai->rssi) 2385 kfree(ai->APList);
2387 kfree(ai->rssi); 2386 kfree(ai->SSID);
2388 if (ai->APList)
2389 kfree(ai->APList);
2390 if (ai->SSID)
2391 kfree(ai->SSID);
2392 if (freeres) { 2387 if (freeres) {
2393 /* PCMCIA frees this stuff, so only for PCI and ISA */ 2388 /* PCMCIA frees this stuff, so only for PCI and ISA */
2394 release_region( dev->base_addr, 64 ); 2389 release_region( dev->base_addr, 64 );
@@ -3626,10 +3621,8 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)
3626 int rc; 3621 int rc;
3627 3622
3628 memset( &mySsid, 0, sizeof( mySsid ) ); 3623 memset( &mySsid, 0, sizeof( mySsid ) );
3629 if (ai->flash) { 3624 kfree (ai->flash);
3630 kfree (ai->flash); 3625 ai->flash = NULL;
3631 ai->flash = NULL;
3632 }
3633 3626
3634 /* The NOP is the first step in getting the card going */ 3627 /* The NOP is the first step in getting the card going */
3635 cmd.cmd = NOP; 3628 cmd.cmd = NOP;
@@ -3666,14 +3659,10 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)
3666 tdsRssiRid rssi_rid; 3659 tdsRssiRid rssi_rid;
3667 CapabilityRid cap_rid; 3660 CapabilityRid cap_rid;
3668 3661
3669 if (ai->APList) { 3662 kfree(ai->APList);
3670 kfree(ai->APList); 3663 ai->APList = NULL;
3671 ai->APList = NULL; 3664 kfree(ai->SSID);
3672 } 3665 ai->SSID = NULL;
3673 if (ai->SSID) {
3674 kfree(ai->SSID);
3675 ai->SSID = NULL;
3676 }
3677 // general configuration (read/modify/write) 3666 // general configuration (read/modify/write)
3678 status = readConfigRid(ai, lock); 3667 status = readConfigRid(ai, lock);
3679 if ( status != SUCCESS ) return ERROR; 3668 if ( status != SUCCESS ) return ERROR;
@@ -3687,10 +3676,8 @@ static u16 setup_card(struct airo_info *ai, u8 *mac, int lock)
3687 memcpy(ai->rssi, (u8*)&rssi_rid + 2, 512); /* Skip RID length member */ 3676 memcpy(ai->rssi, (u8*)&rssi_rid + 2, 512); /* Skip RID length member */
3688 } 3677 }
3689 else { 3678 else {
3690 if (ai->rssi) { 3679 kfree(ai->rssi);
3691 kfree(ai->rssi); 3680 ai->rssi = NULL;
3692 ai->rssi = NULL;
3693 }
3694 if (cap_rid.softCap & 8) 3681 if (cap_rid.softCap & 8)
3695 ai->config.rmode |= RXMODE_NORMALIZED_RSSI; 3682 ai->config.rmode |= RXMODE_NORMALIZED_RSSI;
3696 else 3683 else
@@ -5369,11 +5356,13 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) {
5369 5356
5370static int proc_close( struct inode *inode, struct file *file ) 5357static int proc_close( struct inode *inode, struct file *file )
5371{ 5358{
5372 struct proc_data *data = (struct proc_data *)file->private_data; 5359 struct proc_data *data = file->private_data;
5373 if ( data->on_close != NULL ) data->on_close( inode, file ); 5360
5374 if ( data->rbuffer ) kfree( data->rbuffer ); 5361 if (data->on_close != NULL)
5375 if ( data->wbuffer ) kfree( data->wbuffer ); 5362 data->on_close(inode, file);
5376 kfree( data ); 5363 kfree(data->rbuffer);
5364 kfree(data->wbuffer);
5365 kfree(data);
5377 return 0; 5366 return 0;
5378} 5367}
5379 5368