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.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index df20adcd0730..dbcb5a8a2194 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -1040,7 +1040,7 @@ typedef struct {
1040 u16 status; 1040 u16 status;
1041} WifiCtlHdr; 1041} WifiCtlHdr;
1042 1042
1043WifiCtlHdr wifictlhdr8023 = { 1043static WifiCtlHdr wifictlhdr8023 = {
1044 .ctlhdr = { 1044 .ctlhdr = {
1045 .ctl = HOST_DONT_RLSE, 1045 .ctl = HOST_DONT_RLSE,
1046 } 1046 }
@@ -1111,13 +1111,13 @@ static int airo_thread(void *data);
1111static void timer_func( struct net_device *dev ); 1111static void timer_func( struct net_device *dev );
1112static int airo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 1112static int airo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
1113#ifdef WIRELESS_EXT 1113#ifdef WIRELESS_EXT
1114struct iw_statistics *airo_get_wireless_stats (struct net_device *dev); 1114static struct iw_statistics *airo_get_wireless_stats (struct net_device *dev);
1115static void airo_read_wireless_stats (struct airo_info *local); 1115static void airo_read_wireless_stats (struct airo_info *local);
1116#endif /* WIRELESS_EXT */ 1116#endif /* WIRELESS_EXT */
1117#ifdef CISCO_EXT 1117#ifdef CISCO_EXT
1118static int readrids(struct net_device *dev, aironet_ioctl *comp); 1118static int readrids(struct net_device *dev, aironet_ioctl *comp);
1119static int writerids(struct net_device *dev, aironet_ioctl *comp); 1119static int writerids(struct net_device *dev, aironet_ioctl *comp);
1120int flashcard(struct net_device *dev, aironet_ioctl *comp); 1120static int flashcard(struct net_device *dev, aironet_ioctl *comp);
1121#endif /* CISCO_EXT */ 1121#endif /* CISCO_EXT */
1122#ifdef MICSUPPORT 1122#ifdef MICSUPPORT
1123static void micinit(struct airo_info *ai); 1123static void micinit(struct airo_info *ai);
@@ -1226,6 +1226,12 @@ static int setup_proc_entry( struct net_device *dev,
1226static int takedown_proc_entry( struct net_device *dev, 1226static int takedown_proc_entry( struct net_device *dev,
1227 struct airo_info *apriv ); 1227 struct airo_info *apriv );
1228 1228
1229static int cmdreset(struct airo_info *ai);
1230static int setflashmode (struct airo_info *ai);
1231static int flashgchar(struct airo_info *ai,int matchbyte,int dwelltime);
1232static int flashputbuf(struct airo_info *ai);
1233static int flashrestart(struct airo_info *ai,struct net_device *dev);
1234
1229#ifdef MICSUPPORT 1235#ifdef MICSUPPORT
1230/*********************************************************************** 1236/***********************************************************************
1231 * MIC ROUTINES * 1237 * MIC ROUTINES *
@@ -1234,10 +1240,11 @@ static int takedown_proc_entry( struct net_device *dev,
1234 1240
1235static int RxSeqValid (struct airo_info *ai,miccntx *context,int mcast,u32 micSeq); 1241static int RxSeqValid (struct airo_info *ai,miccntx *context,int mcast,u32 micSeq);
1236static void MoveWindow(miccntx *context, u32 micSeq); 1242static void MoveWindow(miccntx *context, u32 micSeq);
1237void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct crypto_tfm *); 1243static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct crypto_tfm *);
1238void emmh32_init(emmh32_context *context); 1244static void emmh32_init(emmh32_context *context);
1239void emmh32_update(emmh32_context *context, u8 *pOctets, int len); 1245static void emmh32_update(emmh32_context *context, u8 *pOctets, int len);
1240void emmh32_final(emmh32_context *context, u8 digest[4]); 1246static void emmh32_final(emmh32_context *context, u8 digest[4]);
1247static int flashpchar(struct airo_info *ai,int byte,int dwelltime);
1241 1248
1242/* micinit - Initialize mic seed */ 1249/* micinit - Initialize mic seed */
1243 1250
@@ -1301,7 +1308,7 @@ static int micsetup(struct airo_info *ai) {
1301 int i; 1308 int i;
1302 1309
1303 if (ai->tfm == NULL) 1310 if (ai->tfm == NULL)
1304 ai->tfm = crypto_alloc_tfm("aes", 0); 1311 ai->tfm = crypto_alloc_tfm("aes", CRYPTO_TFM_REQ_MAY_SLEEP);
1305 1312
1306 if (ai->tfm == NULL) { 1313 if (ai->tfm == NULL) {
1307 printk(KERN_ERR "airo: failed to load transform for AES\n"); 1314 printk(KERN_ERR "airo: failed to load transform for AES\n");
@@ -1315,7 +1322,7 @@ static int micsetup(struct airo_info *ai) {
1315 return SUCCESS; 1322 return SUCCESS;
1316} 1323}
1317 1324
1318char micsnap[]= {0xAA,0xAA,0x03,0x00,0x40,0x96,0x00,0x02}; 1325static char micsnap[] = {0xAA,0xAA,0x03,0x00,0x40,0x96,0x00,0x02};
1319 1326
1320/*=========================================================================== 1327/*===========================================================================
1321 * Description: Mic a packet 1328 * Description: Mic a packet
@@ -1570,7 +1577,7 @@ static void MoveWindow(miccntx *context, u32 micSeq)
1570static unsigned char aes_counter[16]; 1577static unsigned char aes_counter[16];
1571 1578
1572/* expand the key to fill the MMH coefficient array */ 1579/* expand the key to fill the MMH coefficient array */
1573void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct crypto_tfm *tfm) 1580static void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct crypto_tfm *tfm)
1574{ 1581{
1575 /* take the keying material, expand if necessary, truncate at 16-bytes */ 1582 /* take the keying material, expand if necessary, truncate at 16-bytes */
1576 /* run through AES counter mode to generate context->coeff[] */ 1583 /* run through AES counter mode to generate context->coeff[] */
@@ -1602,7 +1609,7 @@ void emmh32_setseed(emmh32_context *context, u8 *pkey, int keylen, struct crypto
1602} 1609}
1603 1610
1604/* prepare for calculation of a new mic */ 1611/* prepare for calculation of a new mic */
1605void emmh32_init(emmh32_context *context) 1612static void emmh32_init(emmh32_context *context)
1606{ 1613{
1607 /* prepare for new mic calculation */ 1614 /* prepare for new mic calculation */
1608 context->accum = 0; 1615 context->accum = 0;
@@ -1610,7 +1617,7 @@ void emmh32_init(emmh32_context *context)
1610} 1617}
1611 1618
1612/* add some bytes to the mic calculation */ 1619/* add some bytes to the mic calculation */
1613void emmh32_update(emmh32_context *context, u8 *pOctets, int len) 1620static void emmh32_update(emmh32_context *context, u8 *pOctets, int len)
1614{ 1621{
1615 int coeff_position, byte_position; 1622 int coeff_position, byte_position;
1616 1623
@@ -1652,7 +1659,7 @@ void emmh32_update(emmh32_context *context, u8 *pOctets, int len)
1652static u32 mask32[4] = { 0x00000000L, 0xFF000000L, 0xFFFF0000L, 0xFFFFFF00L }; 1659static u32 mask32[4] = { 0x00000000L, 0xFF000000L, 0xFFFF0000L, 0xFFFFFF00L };
1653 1660
1654/* calculate the mic */ 1661/* calculate the mic */
1655void emmh32_final(emmh32_context *context, u8 digest[4]) 1662static void emmh32_final(emmh32_context *context, u8 digest[4])
1656{ 1663{
1657 int coeff_position, byte_position; 1664 int coeff_position, byte_position;
1658 u32 val; 1665 u32 val;
@@ -2232,7 +2239,7 @@ static void airo_read_stats(struct airo_info *ai) {
2232 u32 *vals = stats_rid.vals; 2239 u32 *vals = stats_rid.vals;
2233 2240
2234 clear_bit(JOB_STATS, &ai->flags); 2241 clear_bit(JOB_STATS, &ai->flags);
2235 if (ai->power) { 2242 if (ai->power.event) {
2236 up(&ai->sem); 2243 up(&ai->sem);
2237 return; 2244 return;
2238 } 2245 }
@@ -2255,7 +2262,7 @@ static void airo_read_stats(struct airo_info *ai) {
2255 ai->stats.rx_fifo_errors = vals[0]; 2262 ai->stats.rx_fifo_errors = vals[0];
2256} 2263}
2257 2264
2258struct net_device_stats *airo_get_stats(struct net_device *dev) 2265static struct net_device_stats *airo_get_stats(struct net_device *dev)
2259{ 2266{
2260 struct airo_info *local = dev->priv; 2267 struct airo_info *local = dev->priv;
2261 2268
@@ -2403,8 +2410,7 @@ void stop_airo_card( struct net_device *dev, int freeres )
2403 } 2410 }
2404 } 2411 }
2405#ifdef MICSUPPORT 2412#ifdef MICSUPPORT
2406 if (ai->tfm) 2413 crypto_free_tfm(ai->tfm);
2407 crypto_free_tfm(ai->tfm);
2408#endif 2414#endif
2409 del_airo_dev( dev ); 2415 del_airo_dev( dev );
2410 free_netdev( dev ); 2416 free_netdev( dev );
@@ -2414,7 +2420,7 @@ EXPORT_SYMBOL(stop_airo_card);
2414 2420
2415static int add_airo_dev( struct net_device *dev ); 2421static int add_airo_dev( struct net_device *dev );
2416 2422
2417int wll_header_parse(struct sk_buff *skb, unsigned char *haddr) 2423static int wll_header_parse(struct sk_buff *skb, unsigned char *haddr)
2418{ 2424{
2419 memcpy(haddr, skb->mac.raw + 10, ETH_ALEN); 2425 memcpy(haddr, skb->mac.raw + 10, ETH_ALEN);
2420 return ETH_ALEN; 2426 return ETH_ALEN;
@@ -2681,7 +2687,7 @@ static struct net_device *init_wifidev(struct airo_info *ai,
2681 return dev; 2687 return dev;
2682} 2688}
2683 2689
2684int reset_card( struct net_device *dev , int lock) { 2690static int reset_card( struct net_device *dev , int lock) {
2685 struct airo_info *ai = dev->priv; 2691 struct airo_info *ai = dev->priv;
2686 2692
2687 if (lock && down_interruptible(&ai->sem)) 2693 if (lock && down_interruptible(&ai->sem))
@@ -2696,9 +2702,9 @@ int reset_card( struct net_device *dev , int lock) {
2696 return 0; 2702 return 0;
2697} 2703}
2698 2704
2699struct net_device *_init_airo_card( unsigned short irq, int port, 2705static struct net_device *_init_airo_card( unsigned short irq, int port,
2700 int is_pcmcia, struct pci_dev *pci, 2706 int is_pcmcia, struct pci_dev *pci,
2701 struct device *dmdev ) 2707 struct device *dmdev )
2702{ 2708{
2703 struct net_device *dev; 2709 struct net_device *dev;
2704 struct airo_info *ai; 2710 struct airo_info *ai;
@@ -2962,7 +2968,7 @@ static int airo_thread(void *data) {
2962 break; 2968 break;
2963 } 2969 }
2964 2970
2965 if (ai->power || test_bit(FLAG_FLASHING, &ai->flags)) { 2971 if (ai->power.event || test_bit(FLAG_FLASHING, &ai->flags)) {
2966 up(&ai->sem); 2972 up(&ai->sem);
2967 continue; 2973 continue;
2968 } 2974 }
@@ -5514,7 +5520,7 @@ static int airo_pci_resume(struct pci_dev *pdev)
5514 pci_restore_state(pdev); 5520 pci_restore_state(pdev);
5515 pci_enable_wake(pdev, pci_choose_state(pdev, ai->power), 0); 5521 pci_enable_wake(pdev, pci_choose_state(pdev, ai->power), 0);
5516 5522
5517 if (ai->power > 1) { 5523 if (ai->power.event > 1) {
5518 reset_card(dev, 0); 5524 reset_card(dev, 0);
5519 mpi_init_descriptors(ai); 5525 mpi_init_descriptors(ai);
5520 setup_card(ai, dev->dev_addr, 0); 5526 setup_card(ai, dev->dev_addr, 0);
@@ -7116,7 +7122,7 @@ static int airo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
7116 int rc = 0; 7122 int rc = 0;
7117 struct airo_info *ai = (struct airo_info *)dev->priv; 7123 struct airo_info *ai = (struct airo_info *)dev->priv;
7118 7124
7119 if (ai->power) 7125 if (ai->power.event)
7120 return 0; 7126 return 0;
7121 7127
7122 switch (cmd) { 7128 switch (cmd) {
@@ -7195,7 +7201,7 @@ static void airo_read_wireless_stats(struct airo_info *local)
7195 7201
7196 /* Get stats out of the card */ 7202 /* Get stats out of the card */
7197 clear_bit(JOB_WSTATS, &local->flags); 7203 clear_bit(JOB_WSTATS, &local->flags);
7198 if (local->power) { 7204 if (local->power.event) {
7199 up(&local->sem); 7205 up(&local->sem);
7200 return; 7206 return;
7201 } 7207 }
@@ -7235,7 +7241,7 @@ static void airo_read_wireless_stats(struct airo_info *local)
7235 local->wstats.miss.beacon = vals[34]; 7241 local->wstats.miss.beacon = vals[34];
7236} 7242}
7237 7243
7238struct iw_statistics *airo_get_wireless_stats(struct net_device *dev) 7244static struct iw_statistics *airo_get_wireless_stats(struct net_device *dev)
7239{ 7245{
7240 struct airo_info *local = dev->priv; 7246 struct airo_info *local = dev->priv;
7241 7247
@@ -7450,14 +7456,8 @@ static int writerids(struct net_device *dev, aironet_ioctl *comp) {
7450 * Flash command switch table 7456 * Flash command switch table
7451 */ 7457 */
7452 7458
7453int flashcard(struct net_device *dev, aironet_ioctl *comp) { 7459static int flashcard(struct net_device *dev, aironet_ioctl *comp) {
7454 int z; 7460 int z;
7455 int cmdreset(struct airo_info *);
7456 int setflashmode(struct airo_info *);
7457 int flashgchar(struct airo_info *,int,int);
7458 int flashpchar(struct airo_info *,int,int);
7459 int flashputbuf(struct airo_info *);
7460 int flashrestart(struct airo_info *,struct net_device *);
7461 7461
7462 /* Only super-user can modify flash */ 7462 /* Only super-user can modify flash */
7463 if (!capable(CAP_NET_ADMIN)) 7463 if (!capable(CAP_NET_ADMIN))
@@ -7515,7 +7515,7 @@ int flashcard(struct net_device *dev, aironet_ioctl *comp) {
7515 * card. 7515 * card.
7516 */ 7516 */
7517 7517
7518int cmdreset(struct airo_info *ai) { 7518static int cmdreset(struct airo_info *ai) {
7519 disable_MAC(ai, 1); 7519 disable_MAC(ai, 1);
7520 7520
7521 if(!waitbusy (ai)){ 7521 if(!waitbusy (ai)){
@@ -7539,7 +7539,7 @@ int cmdreset(struct airo_info *ai) {
7539 * mode 7539 * mode
7540 */ 7540 */
7541 7541
7542int setflashmode (struct airo_info *ai) { 7542static int setflashmode (struct airo_info *ai) {
7543 set_bit (FLAG_FLASHING, &ai->flags); 7543 set_bit (FLAG_FLASHING, &ai->flags);
7544 7544
7545 OUT4500(ai, SWS0, FLASH_COMMAND); 7545 OUT4500(ai, SWS0, FLASH_COMMAND);
@@ -7566,7 +7566,7 @@ int setflashmode (struct airo_info *ai) {
7566 * x 50us for echo . 7566 * x 50us for echo .
7567 */ 7567 */
7568 7568
7569int flashpchar(struct airo_info *ai,int byte,int dwelltime) { 7569static int flashpchar(struct airo_info *ai,int byte,int dwelltime) {
7570 int echo; 7570 int echo;
7571 int waittime; 7571 int waittime;
7572 7572
@@ -7606,7 +7606,7 @@ int flashpchar(struct airo_info *ai,int byte,int dwelltime) {
7606 * Get a character from the card matching matchbyte 7606 * Get a character from the card matching matchbyte
7607 * Step 3) 7607 * Step 3)
7608 */ 7608 */
7609int flashgchar(struct airo_info *ai,int matchbyte,int dwelltime){ 7609static int flashgchar(struct airo_info *ai,int matchbyte,int dwelltime){
7610 int rchar; 7610 int rchar;
7611 unsigned char rbyte=0; 7611 unsigned char rbyte=0;
7612 7612
@@ -7637,7 +7637,7 @@ int flashgchar(struct airo_info *ai,int matchbyte,int dwelltime){
7637 * send to the card 7637 * send to the card
7638 */ 7638 */
7639 7639
7640int flashputbuf(struct airo_info *ai){ 7640static int flashputbuf(struct airo_info *ai){
7641 int nwords; 7641 int nwords;
7642 7642
7643 /* Write stuff */ 7643 /* Write stuff */
@@ -7659,7 +7659,7 @@ int flashputbuf(struct airo_info *ai){
7659/* 7659/*
7660 * 7660 *
7661 */ 7661 */
7662int flashrestart(struct airo_info *ai,struct net_device *dev){ 7662static int flashrestart(struct airo_info *ai,struct net_device *dev){
7663 int i,status; 7663 int i,status;
7664 7664
7665 ssleep(1); /* Added 12/7/00 */ 7665 ssleep(1); /* Added 12/7/00 */