diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-05 14:18:03 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-05 14:18:03 -0700 |
commit | e9563355ac1175dd3440dc2ea5c28b27ed51a283 (patch) | |
tree | 8546d55832714b5d19ba4c7799266918ca04882e /drivers/staging/wlags49_h2 | |
parent | cdd854bc42b5e6c79bbbc40c6600d995ffe6e747 (diff) | |
parent | b12d1995f650e92f26184afd28e6cf40bf64467a (diff) | |
download | kernel_samsung_espresso10-e9563355ac1175dd3440dc2ea5c28b27ed51a283.zip kernel_samsung_espresso10-e9563355ac1175dd3440dc2ea5c28b27ed51a283.tar.gz kernel_samsung_espresso10-e9563355ac1175dd3440dc2ea5c28b27ed51a283.tar.bz2 |
Staging: Merge staging-next into Linus's tree
Conflicts:
drivers/staging/Kconfig
drivers/staging/batman-adv/bat_sysfs.c
drivers/staging/batman-adv/device.c
drivers/staging/batman-adv/hard-interface.c
drivers/staging/cx25821/cx25821-audups11.c
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/wlags49_h2')
-rw-r--r-- | drivers/staging/wlags49_h2/hcf.c | 2 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/mdd.h | 4 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_cs.c | 499 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_cs.h | 2 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_netdev.c | 4 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_pci.c | 16 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_pci.h | 8 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_profile.c | 2 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_util.c | 37 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_util.h | 2 |
10 files changed, 266 insertions, 310 deletions
diff --git a/drivers/staging/wlags49_h2/hcf.c b/drivers/staging/wlags49_h2/hcf.c index 390628c..c4fe0ec 100644 --- a/drivers/staging/wlags49_h2/hcf.c +++ b/drivers/staging/wlags49_h2/hcf.c @@ -502,7 +502,7 @@ HCF_STATIC hcf_16* BASED xxxx[ ] = { #endif // MSF_COMPONENT_ID NULL //endsentinel }; -#define xxxx_PRI_IDENTITY_OFFSET (sizeof(xxxx)/sizeof(xxxx[0]) - 3) +#define xxxx_PRI_IDENTITY_OFFSET (ARRAY_SIZE(xxxx) - 3) #endif // MSF_COMPONENT_ID / HCF_EXT_MB diff --git a/drivers/staging/wlags49_h2/mdd.h b/drivers/staging/wlags49_h2/mdd.h index b45c7dd..b50b7b0 100644 --- a/drivers/staging/wlags49_h2/mdd.h +++ b/drivers/staging/wlags49_h2/mdd.h @@ -727,10 +727,10 @@ XX1( CFG_SCAN, SCAN_RS_STRCT, scan_result[32] ) /*Scan results * #define CFG_FCBE 0xFCBE //FW codes ahead of available documentation, so ??????? #define CFG_FCBF 0xFCBF //FW codes ahead of available documentation, so ??????? -#define CFG_HANDOVER_ADDR 0xFCC0 //[AP] Station MAC Adrress re-associated with other AP +#define CFG_HANDOVER_ADDR 0xFCC0 //[AP] Station MAC Address re-associated with other AP #define CFG_SCAN_CHANNEL 0xFCC2 //Channel set for host requested scan //;?#define CFG_SCAN_CHANNEL_MASK 0xFCC2 // contains -#define CFG_DISASSOCIATE_ADDR 0xFCC4 //[AP] Station MAC Adrress to be disassociated +#define CFG_DISASSOCIATE_ADDR 0xFCC4 //[AP] Station MAC Address to be disassociated #define CFG_PROBE_DATA_RATE 0xFCC5 //WARP connection control #define CFG_FRAME_BURST_LIMIT 0xFCC6 // #define CFG_COEXISTENSE_BEHAVIOUR 0xFCC7 //[AP] diff --git a/drivers/staging/wlags49_h2/wl_cs.c b/drivers/staging/wlags49_h2/wl_cs.c index 10abd40..464b067 100644 --- a/drivers/staging/wlags49_h2/wl_cs.c +++ b/drivers/staging/wlags49_h2/wl_cs.c @@ -23,7 +23,7 @@ * software indicates your acceptance of these terms and conditions. If you do * not agree with these terms and conditions, do not use the software. * - * Copyright © 2003 Agere Systems Inc. + * Copyright (c) 2003 Agere Systems Inc. * All rights reserved. * * Redistribution and use in source or binary forms, with or without @@ -44,7 +44,7 @@ * * Disclaimer * - * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN @@ -133,36 +133,36 @@ extern dbg_info_t *DbgInfo; ******************************************************************************/ static int wl_adapter_attach(struct pcmcia_device *link) { - struct net_device *dev; - struct wl_private *lp; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_adapter_attach" ); - DBG_ENTER( DbgInfo ); - - dev = wl_device_alloc(); - if(dev == NULL) { - DBG_ERROR( DbgInfo, "wl_device_alloc returned NULL\n"); - return -ENOMEM; - } - - link->io.NumPorts1 = HCF_NUM_IO_PORTS; - link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; - link->io.IOAddrLines = 6; - link->conf.Attributes = CONF_ENABLE_IRQ; - link->conf.IntType = INT_MEMORY_AND_IO; - link->conf.ConfigIndex = 5; - link->conf.Present = PRESENT_OPTION; - - link->priv = dev; - lp = wl_priv(dev); - lp->link = link; - - wl_adapter_insert(link); - - DBG_LEAVE( DbgInfo ); - return 0; -} // wl_adapter_attach + struct net_device *dev; + struct wl_private *lp; + /*--------------------------------------------------------------------*/ + + DBG_FUNC("wl_adapter_attach"); + DBG_ENTER(DbgInfo); + + dev = wl_device_alloc(); + if (dev == NULL) { + DBG_ERROR(DbgInfo, "wl_device_alloc returned NULL\n"); + return -ENOMEM; + } + + link->io.NumPorts1 = HCF_NUM_IO_PORTS; + link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; + link->io.IOAddrLines = 6; + link->conf.Attributes = CONF_ENABLE_IRQ; + link->conf.IntType = INT_MEMORY_AND_IO; + link->conf.ConfigIndex = 5; + link->conf.Present = PRESENT_OPTION; + + link->priv = dev; + lp = wl_priv(dev); + lp->link = link; + + wl_adapter_insert(link); + + DBG_LEAVE(DbgInfo); + return 0; +} /* wl_adapter_attach */ /*============================================================================*/ @@ -190,25 +190,24 @@ static int wl_adapter_attach(struct pcmcia_device *link) ******************************************************************************/ static void wl_adapter_detach(struct pcmcia_device *link) { - struct net_device *dev = link->priv; - /*------------------------------------------------------------------------*/ - + struct net_device *dev = link->priv; + /*--------------------------------------------------------------------*/ - DBG_FUNC( "wl_adapter_detach" ); - DBG_ENTER( DbgInfo ); - DBG_PARAM( DbgInfo, "link", "0x%p", link ); + DBG_FUNC("wl_adapter_detach"); + DBG_ENTER(DbgInfo); + DBG_PARAM(DbgInfo, "link", "0x%p", link); - wl_adapter_release(link); + wl_adapter_release(link); - if (dev) { - unregister_wlags_sysfs(dev); - unregister_netdev(dev); - } + if (dev) { + unregister_wlags_sysfs(dev); + unregister_netdev(dev); + } - wl_device_dealloc(dev); + wl_device_dealloc(dev); - DBG_LEAVE( DbgInfo ); -} // wl_adapter_detach + DBG_LEAVE(DbgInfo); +} /* wl_adapter_detach */ /*============================================================================*/ @@ -232,33 +231,33 @@ static void wl_adapter_detach(struct pcmcia_device *link) * N/A * ******************************************************************************/ -void wl_adapter_release( struct pcmcia_device *link ) +void wl_adapter_release(struct pcmcia_device *link) { - DBG_FUNC( "wl_adapter_release" ); - DBG_ENTER( DbgInfo ); - DBG_PARAM( DbgInfo, "link", "0x%p", link); + DBG_FUNC("wl_adapter_release"); + DBG_ENTER(DbgInfo); + DBG_PARAM(DbgInfo, "link", "0x%p", link); - /* Stop hardware */ - wl_remove(link->priv); + /* Stop hardware */ + wl_remove(link->priv); - pcmcia_disable_device(link); + pcmcia_disable_device(link); - DBG_LEAVE( DbgInfo ); -} // wl_adapter_release + DBG_LEAVE(DbgInfo); +} /* wl_adapter_release */ /*============================================================================*/ static int wl_adapter_suspend(struct pcmcia_device *link) { - struct net_device *dev = link->priv; + struct net_device *dev = link->priv; - //if (link->open) { + /* if (link->open) { */ netif_device_detach(dev); wl_suspend(dev); -//// CHECK! pcmcia_release_configuration(link->handle); - //} + /* CHECK! pcmcia_release_configuration(link->handle); */ + /* } */ - return 0; -} // wl_adapter_suspend + return 0; +} /* wl_adapter_suspend */ static int wl_adapter_resume(struct pcmcia_device *link) { @@ -266,10 +265,10 @@ static int wl_adapter_resume(struct pcmcia_device *link) wl_resume(dev); - netif_device_attach( dev ); + netif_device_attach(dev); return 0; -} // wl_adapter_resume +} /* wl_adapter_resume */ /******************************************************************************* * wl_adapter_insert() @@ -291,60 +290,59 @@ static int wl_adapter_resume(struct pcmcia_device *link) * N/A * ******************************************************************************/ -void wl_adapter_insert( struct pcmcia_device *link ) +void wl_adapter_insert(struct pcmcia_device *link) { - struct net_device *dev; - int i; - int ret; - /*------------------------------------------------------------------------*/ + struct net_device *dev; + int i; + int ret; + /*--------------------------------------------------------------------*/ - DBG_FUNC( "wl_adapter_insert" ); - DBG_ENTER( DbgInfo ); - DBG_PARAM( DbgInfo, "link", "0x%p", link ); + DBG_FUNC("wl_adapter_insert"); + DBG_ENTER(DbgInfo); + DBG_PARAM(DbgInfo, "link", "0x%p", link); - dev = link->priv; + dev = link->priv; - /* Do we need to allocate an interrupt? */ - link->conf.Attributes |= CONF_ENABLE_IRQ; + /* Do we need to allocate an interrupt? */ + link->conf.Attributes |= CONF_ENABLE_IRQ; - ret = pcmcia_request_io(link, &link->io); - if (ret != 0) - goto failed; + ret = pcmcia_request_io(link, &link->io); + if (ret != 0) + goto failed; - ret = pcmcia_request_irq(link, (void *) wl_isr); - if (ret != 0) - goto failed; + ret = pcmcia_request_irq(link, (void *) wl_isr); + if (ret != 0) + goto failed; - ret = pcmcia_request_configuration(link, &link->conf); - if (ret != 0) - goto failed; + ret = pcmcia_request_configuration(link, &link->conf); + if (ret != 0) + goto failed; - dev->irq = link->irq; - dev->base_addr = link->io.BasePort1; + dev->irq = link->irq; + dev->base_addr = link->io.BasePort1; - SET_NETDEV_DEV(dev, &link->dev); - if (register_netdev(dev) != 0) { - printk("%s: register_netdev() failed\n", MODULE_NAME); - goto failed; - } + SET_NETDEV_DEV(dev, &link->dev); + if (register_netdev(dev) != 0) { + printk("%s: register_netdev() failed\n", MODULE_NAME); + goto failed; + } - register_wlags_sysfs(dev); + register_wlags_sysfs(dev); - printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, ""mac_address ", - dev->name, dev->base_addr, dev->irq); - for( i = 0; i < ETH_ALEN; i++ ) { - printk("%02X%c", dev->dev_addr[i], ((i < (ETH_ALEN-1)) ? ':' : '\n')); - } + printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, ""mac_address ", + dev->name, dev->base_addr, dev->irq); + for (i = 0; i < ETH_ALEN; i++) + printk("%02X%c", dev->dev_addr[i], ((i < (ETH_ALEN-1)) ? ':' : '\n')); - DBG_LEAVE( DbgInfo ); - return; + DBG_LEAVE(DbgInfo); + return; failed: - wl_adapter_release( link ); + wl_adapter_release(link); - DBG_LEAVE(DbgInfo); - return; -} // wl_adapter_insert + DBG_LEAVE(DbgInfo); + return; +} /* wl_adapter_insert */ /*============================================================================*/ @@ -367,38 +365,36 @@ failed: * errno value otherwise * ******************************************************************************/ -int wl_adapter_open( struct net_device *dev ) +int wl_adapter_open(struct net_device *dev) { - struct wl_private *lp = wl_priv(dev); - struct pcmcia_device *link = lp->link; - int result = 0; - int hcf_status = HCF_SUCCESS; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wl_adapter_open" ); - DBG_ENTER( DbgInfo ); - DBG_PRINT( "%s\n", VERSION_INFO ); - DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev ); - - if(!pcmcia_dev_present(link)) - { - DBG_LEAVE( DbgInfo ); - return -ENODEV; - } - - link->open++; - - hcf_status = wl_open( dev ); - - if( hcf_status != HCF_SUCCESS ) { - link->open--; - result = -ENODEV; - } - - DBG_LEAVE( DbgInfo ); - return result; -} // wl_adapter_open + struct wl_private *lp = wl_priv(dev); + struct pcmcia_device *link = lp->link; + int result = 0; + int hcf_status = HCF_SUCCESS; + /*--------------------------------------------------------------------*/ + + DBG_FUNC("wl_adapter_open"); + DBG_ENTER(DbgInfo); + DBG_PRINT("%s\n", VERSION_INFO); + DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev); + + if (!pcmcia_dev_present(link)) { + DBG_LEAVE(DbgInfo); + return -ENODEV; + } + + link->open++; + + hcf_status = wl_open(dev); + + if (hcf_status != HCF_SUCCESS) { + link->open--; + result = -ENODEV; + } + + DBG_LEAVE(DbgInfo); + return result; +} /* wl_adapter_open */ /*============================================================================*/ @@ -421,56 +417,55 @@ int wl_adapter_open( struct net_device *dev ) * errno value otherwise * ******************************************************************************/ -int wl_adapter_close( struct net_device *dev ) +int wl_adapter_close(struct net_device *dev) { - struct wl_private *lp = wl_priv(dev); - struct pcmcia_device *link = lp->link; - /*------------------------------------------------------------------------*/ - + struct wl_private *lp = wl_priv(dev); + struct pcmcia_device *link = lp->link; + /*--------------------------------------------------------------------*/ - DBG_FUNC( "wl_adapter_close" ); - DBG_ENTER( DbgInfo ); - DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev ); + DBG_FUNC("wl_adapter_close"); + DBG_ENTER(DbgInfo); + DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev); - if( link == NULL ) { - DBG_LEAVE( DbgInfo ); - return -ENODEV; - } + if (link == NULL) { + DBG_LEAVE(DbgInfo); + return -ENODEV; + } - DBG_TRACE( DbgInfo, "%s: Shutting down adapter.\n", dev->name ); - wl_close( dev ); + DBG_TRACE(DbgInfo, "%s: Shutting down adapter.\n", dev->name); + wl_close(dev); - link->open--; + link->open--; - DBG_LEAVE( DbgInfo ); - return 0; -} // wl_adapter_close + DBG_LEAVE(DbgInfo); + return 0; +} /* wl_adapter_close */ /*============================================================================*/ static struct pcmcia_device_id wl_adapter_ids[] = { -#if ! ((HCF_TYPE) & HCF_TYPE_HII5) +#if !((HCF_TYPE) & HCF_TYPE_HII5) PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0003), PCMCIA_DEVICE_PROD_ID12("Agere Systems", "Wireless PC Card Model 0110", - 0x33103a9b, 0xe175b0dd), + 0x33103a9b, 0xe175b0dd), #else PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0004), PCMCIA_DEVICE_PROD_ID12("Linksys", "WCF54G_Wireless-G_CompactFlash_Card", - 0x0733cc81, 0x98a599e1), -#endif // (HCF_TYPE) & HCF_TYPE_HII5 + 0x0733cc81, 0x98a599e1), +#endif /* (HCF_TYPE) & HCF_TYPE_HII5 */ PCMCIA_DEVICE_NULL, - }; +}; MODULE_DEVICE_TABLE(pcmcia, wl_adapter_ids); static struct pcmcia_driver wlags49_driver = { - .owner = THIS_MODULE, - .drv = { - .name = DRIVER_NAME, - }, - .probe = wl_adapter_attach, - .remove = wl_adapter_detach, - .id_table = wl_adapter_ids, - .suspend = wl_adapter_suspend, - .resume = wl_adapter_resume, + .owner = THIS_MODULE, + .drv = { + .name = DRIVER_NAME, + }, + .probe = wl_adapter_attach, + .remove = wl_adapter_detach, + .id_table = wl_adapter_ids, + .suspend = wl_adapter_suspend, + .resume = wl_adapter_resume, }; @@ -493,21 +488,20 @@ static struct pcmcia_driver wlags49_driver = { * -1 on error * ******************************************************************************/ -int wl_adapter_init_module( void ) +int wl_adapter_init_module(void) { - int ret; - /*------------------------------------------------------------------------*/ + int ret; + /*--------------------------------------------------------------------*/ + DBG_FUNC("wl_adapter_init_module"); + DBG_ENTER(DbgInfo); + DBG_TRACE(DbgInfo, "wl_adapter_init_module() -- PCMCIA\n"); - DBG_FUNC( "wl_adapter_init_module" ); - DBG_ENTER( DbgInfo ); - DBG_TRACE( DbgInfo, "wl_adapter_init_module() -- PCMCIA\n" ); + ret = pcmcia_register_driver(&wlags49_driver); - ret = pcmcia_register_driver(&wlags49_driver); - - DBG_LEAVE( DbgInfo ); - return ret; -} // wl_adapter_init_module + DBG_LEAVE(DbgInfo); + return ret; +} /* wl_adapter_init_module */ /*============================================================================*/ @@ -528,18 +522,18 @@ int wl_adapter_init_module( void ) * N/A * ******************************************************************************/ -void wl_adapter_cleanup_module( void ) +void wl_adapter_cleanup_module(void) { - DBG_FUNC( "wl_adapter_cleanup_module" ); - DBG_ENTER( DbgInfo ); - DBG_TRACE( DbgInfo, "wl_adapter_cleanup_module() -- PCMCIA\n" ); + DBG_FUNC("wl_adapter_cleanup_module"); + DBG_ENTER(DbgInfo); + DBG_TRACE(DbgInfo, "wl_adapter_cleanup_module() -- PCMCIA\n"); - pcmcia_unregister_driver(&wlags49_driver); + pcmcia_unregister_driver(&wlags49_driver); - DBG_LEAVE( DbgInfo ); - return; -} // wl_adapter_cleanup_module + DBG_LEAVE(DbgInfo); + return; +} /* wl_adapter_cleanup_module */ /*============================================================================*/ @@ -562,17 +556,16 @@ void wl_adapter_cleanup_module( void ) * 0 otherwise * ******************************************************************************/ -int wl_adapter_is_open( struct net_device *dev ) +int wl_adapter_is_open(struct net_device *dev) { - struct wl_private *lp = wl_priv(dev); - struct pcmcia_device *link = lp->link; + struct wl_private *lp = wl_priv(dev); + struct pcmcia_device *link = lp->link; - if(!pcmcia_dev_present(link)) { - return 0; - } + if (!pcmcia_dev_present(link)) + return 0; - return( link->open ); -} // wl_adapter_is_open + return link->open; +} /* wl_adapter_is_open */ /*============================================================================*/ @@ -596,97 +589,95 @@ int wl_adapter_is_open( struct net_device *dev ) * a pointer to a string describing the error(s) * ******************************************************************************/ -const char* DbgEvent( int mask ) +const char *DbgEvent(int mask) { - static char DbgBuffer[256]; - char *pBuf; - /*------------------------------------------------------------------------*/ - + static char DbgBuffer[256]; + char *pBuf; + /*--------------------------------------------------------------------*/ - pBuf = DbgBuffer; - *pBuf = '\0'; + pBuf = DbgBuffer; + *pBuf = '\0'; - if( mask & CS_EVENT_WRITE_PROTECT ) - strcat( pBuf, "WRITE_PROTECT " ); + if (mask & CS_EVENT_WRITE_PROTECT) + strcat(pBuf, "WRITE_PROTECT "); - if(mask & CS_EVENT_CARD_LOCK) - strcat( pBuf, "CARD_LOCK " ); + if (mask & CS_EVENT_CARD_LOCK) + strcat(pBuf, "CARD_LOCK "); - if(mask & CS_EVENT_CARD_INSERTION) - strcat( pBuf, "CARD_INSERTION " ); + if (mask & CS_EVENT_CARD_INSERTION) + strcat(pBuf, "CARD_INSERTION "); - if(mask & CS_EVENT_CARD_REMOVAL) - strcat( pBuf, "CARD_REMOVAL " ); + if (mask & CS_EVENT_CARD_REMOVAL) + strcat(pBuf, "CARD_REMOVAL "); - if(mask & CS_EVENT_BATTERY_DEAD) - strcat( pBuf, "BATTERY_DEAD " ); + if (mask & CS_EVENT_BATTERY_DEAD) + strcat(pBuf, "BATTERY_DEAD "); - if(mask & CS_EVENT_BATTERY_LOW) - strcat( pBuf, "BATTERY_LOW " ); + if (mask & CS_EVENT_BATTERY_LOW) + strcat(pBuf, "BATTERY_LOW "); - if(mask & CS_EVENT_READY_CHANGE) - strcat( pBuf, "READY_CHANGE " ); + if (mask & CS_EVENT_READY_CHANGE) + strcat(pBuf, "READY_CHANGE "); - if(mask & CS_EVENT_CARD_DETECT) - strcat( pBuf, "CARD_DETECT " ); + if (mask & CS_EVENT_CARD_DETECT) + strcat(pBuf, "CARD_DETECT "); - if(mask & CS_EVENT_RESET_REQUEST) - strcat( pBuf, "RESET_REQUEST " ); + if (mask & CS_EVENT_RESET_REQUEST) + strcat(pBuf, "RESET_REQUEST "); - if(mask & CS_EVENT_RESET_PHYSICAL) - strcat( pBuf, "RESET_PHYSICAL " ); + if (mask & CS_EVENT_RESET_PHYSICAL) + strcat(pBuf, "RESET_PHYSICAL "); - if(mask & CS_EVENT_CARD_RESET) - strcat( pBuf, "CARD_RESET " ); + if (mask & CS_EVENT_CARD_RESET) + strcat(pBuf, "CARD_RESET "); - if(mask & CS_EVENT_REGISTRATION_COMPLETE) - strcat( pBuf, "REGISTRATION_COMPLETE " ); + if (mask & CS_EVENT_REGISTRATION_COMPLETE) + strcat(pBuf, "REGISTRATION_COMPLETE "); - // if(mask & CS_EVENT_RESET_COMPLETE) - // strcat( pBuf, "RESET_COMPLETE " ); + /* if (mask & CS_EVENT_RESET_COMPLETE) + strcat(pBuf, "RESET_COMPLETE "); */ - if(mask & CS_EVENT_PM_SUSPEND) - strcat( pBuf, "PM_SUSPEND " ); + if (mask & CS_EVENT_PM_SUSPEND) + strcat(pBuf, "PM_SUSPEND "); - if(mask & CS_EVENT_PM_RESUME) - strcat( pBuf, "PM_RESUME " ); + if (mask & CS_EVENT_PM_RESUME) + strcat(pBuf, "PM_RESUME "); - if(mask & CS_EVENT_INSERTION_REQUEST) - strcat( pBuf, "INSERTION_REQUEST " ); + if (mask & CS_EVENT_INSERTION_REQUEST) + strcat(pBuf, "INSERTION_REQUEST "); - if(mask & CS_EVENT_EJECTION_REQUEST) - strcat( pBuf, "EJECTION_REQUEST " ); + if (mask & CS_EVENT_EJECTION_REQUEST) + strcat(pBuf, "EJECTION_REQUEST "); - if(mask & CS_EVENT_MTD_REQUEST) - strcat( pBuf, "MTD_REQUEST " ); + if (mask & CS_EVENT_MTD_REQUEST) + strcat(pBuf, "MTD_REQUEST "); - if(mask & CS_EVENT_ERASE_COMPLETE) - strcat( pBuf, "ERASE_COMPLETE " ); + if (mask & CS_EVENT_ERASE_COMPLETE) + strcat(pBuf, "ERASE_COMPLETE "); - if(mask & CS_EVENT_REQUEST_ATTENTION) - strcat( pBuf, "REQUEST_ATTENTION " ); + if (mask & CS_EVENT_REQUEST_ATTENTION) + strcat(pBuf, "REQUEST_ATTENTION "); - if(mask & CS_EVENT_CB_DETECT) - strcat( pBuf, "CB_DETECT " ); + if (mask & CS_EVENT_CB_DETECT) + strcat(pBuf, "CB_DETECT "); - if(mask & CS_EVENT_3VCARD) - strcat( pBuf, "3VCARD " ); + if (mask & CS_EVENT_3VCARD) + strcat(pBuf, "3VCARD "); - if(mask & CS_EVENT_XVCARD) - strcat( pBuf, "XVCARD " ); + if (mask & CS_EVENT_XVCARD) + strcat(pBuf, "XVCARD "); - if( *pBuf ) { - pBuf[strlen(pBuf) - 1] = '\0'; - } else { - if( mask != 0x0 ) { - sprintf( pBuf, "<<0x%08x>>", mask ); - } - } + if (*pBuf) { + pBuf[strlen(pBuf) - 1] = '\0'; + } else { + if (mask != 0x0) + sprintf(pBuf, "<<0x%08x>>", mask); + } - return pBuf; -} // DbgEvent + return pBuf; +} /* DbgEvent */ /*============================================================================*/ #endif /* DBG */ diff --git a/drivers/staging/wlags49_h2/wl_cs.h b/drivers/staging/wlags49_h2/wl_cs.h index a9b8828..21f17be 100644 --- a/drivers/staging/wlags49_h2/wl_cs.h +++ b/drivers/staging/wlags49_h2/wl_cs.h @@ -72,8 +72,6 @@ void wl_adapter_insert(struct pcmcia_device *link); void wl_adapter_release(struct pcmcia_device *link); -int wl_adapter_event(event_t event, int priority, event_callback_args_t *args ); - int wl_adapter_init_module( void ); void wl_adapter_cleanup_module( void ); diff --git a/drivers/staging/wlags49_h2/wl_netdev.c b/drivers/staging/wlags49_h2/wl_netdev.c index 1aa61db..e2a7ad0 100644 --- a/drivers/staging/wlags49_h2/wl_netdev.c +++ b/drivers/staging/wlags49_h2/wl_netdev.c @@ -1905,8 +1905,8 @@ int wl_rx_dma( struct net_device *dev ) DBG_FUNC("wl_rx") DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev); - if((( lp = (struct wl_private *)dev->priv ) != NULL ) && - !( lp->flags & WVLAN2_UIL_BUSY )) { + if((( lp = dev->priv ) != NULL ) && + !( lp->flags & WVLAN2_UIL_BUSY )) { #ifdef USE_RTS if( lp->useRTS == 1 ) { diff --git a/drivers/staging/wlags49_h2/wl_pci.c b/drivers/staging/wlags49_h2/wl_pci.c index 6751b4b..020b17a 100644 --- a/drivers/staging/wlags49_h2/wl_pci.c +++ b/drivers/staging/wlags49_h2/wl_pci.c @@ -117,9 +117,13 @@ enum hermes_pci_versions { }; static struct pci_device_id wl_pci_tbl[] __devinitdata = { - { WL_LKM_PCI_VENDOR_ID, WL_LKM_PCI_DEVICE_ID_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Agere_Systems_Mini_PCI_V1 }, - { WL_LKM_PCI_VENDOR_ID, WL_LKM_PCI_DEVICE_ID_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Agere_Systems_Mini_PCI_V1 }, - { WL_LKM_PCI_VENDOR_ID, WL_LKM_PCI_DEVICE_ID_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Agere_Systems_Mini_PCI_V1 }, + { PCI_VENDOR_ID_WL_LKM, PCI_DEVICE_ID_WL_LKM_0, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Agere_Systems_Mini_PCI_V1 }, + { PCI_VENDOR_ID_WL_LKM, PCI_DEVICE_ID_WL_LKM_1, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Agere_Systems_Mini_PCI_V1 }, + { PCI_VENDOR_ID_WL_LKM, PCI_DEVICE_ID_WL_LKM_2, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Agere_Systems_Mini_PCI_V1 }, + { } /* Terminating entry */ }; @@ -465,7 +469,7 @@ void __devexit wl_pci_remove(struct pci_dev *pdev) free_irq( dev->irq, dev ); #ifdef ENABLE_DMA - wl_pci_dma_free( pdev, (struct wl_private *)dev->priv ); + wl_pci_dma_free( pdev, dev->priv ); #endif wl_device_dealloc( dev ); @@ -534,7 +538,7 @@ int wl_pci_setup( struct pci_dev *pdev ) #ifdef ENABLE_DMA /* Allocate DMA Descriptors */ - if( wl_pci_dma_alloc( pdev, (struct wl_private *)dev->priv ) < 0 ) { + if( wl_pci_dma_alloc( pdev, dev->priv ) < 0 ) { DBG_ERROR( DbgInfo, "Could not allocate DMA descriptor memory!!!\n" ); DBG_LEAVE( DbgInfo ); return -ENOMEM; @@ -570,7 +574,7 @@ int wl_pci_setup( struct pci_dev *pdev ) } /* Make sure interrupts are enabled properly for CardBus */ - lp = (struct wl_private *)dev->priv; + lp = dev->priv; if( lp->hcfCtx.IFB_BusType == CFG_NIC_BUS_TYPE_CARDBUS || lp->hcfCtx.IFB_BusType == CFG_NIC_BUS_TYPE_PCI ) { diff --git a/drivers/staging/wlags49_h2/wl_pci.h b/drivers/staging/wlags49_h2/wl_pci.h index 18d7b51..cea04c4 100644 --- a/drivers/staging/wlags49_h2/wl_pci.h +++ b/drivers/staging/wlags49_h2/wl_pci.h @@ -67,10 +67,10 @@ /******************************************************************************* * constant definitions ******************************************************************************/ -#define WL_LKM_PCI_VENDOR_ID 0x11C1 // Lucent Microelectronics -#define WL_LKM_PCI_DEVICE_ID_0 0xAB30 // Mini PCI -#define WL_LKM_PCI_DEVICE_ID_1 0xAB34 // Mini PCI -#define WL_LKM_PCI_DEVICE_ID_2 0xAB11 // WARP CardBus +#define PCI_VENDOR_IDWL_LKM 0x11C1 /* Lucent Microelectronics */ +#define PCI_DEVICE_ID_WL_LKM_0 0xAB30 /* Mini PCI */ +#define PCI_DEVICE_ID_WL_LKM_1 0xAB34 /* Mini PCI */ +#define PCI_DEVICE_ID_WL_LKM_2 0xAB11 /* WARP CardBus */ diff --git a/drivers/staging/wlags49_h2/wl_profile.c b/drivers/staging/wlags49_h2/wl_profile.c index 292d579..7a1337d 100644 --- a/drivers/staging/wlags49_h2/wl_profile.c +++ b/drivers/staging/wlags49_h2/wl_profile.c @@ -169,7 +169,7 @@ void parse_config(struct net_device *dev) DBG_ENTER(DbgInfo); /* Get the wavelan specific info for this device */ - wvlan_config = (struct wl_private *)dev->priv; + wvlan_config = dev->priv; if (wvlan_config == NULL) { DBG_ERROR(DbgInfo, "Wavelan specific info struct not present?\n"); return; diff --git a/drivers/staging/wlags49_h2/wl_util.c b/drivers/staging/wlags49_h2/wl_util.c index bbdb997..ce8ed41 100644 --- a/drivers/staging/wlags49_h2/wl_util.c +++ b/drivers/staging/wlags49_h2/wl_util.c @@ -259,41 +259,6 @@ int is_valid_key_string( char *s ) /******************************************************************************* - * hexdigit2int() - ******************************************************************************* - * - * DESCRIPTION: - * - * Converts a hexadecimal digit character to an integer - * - * PARAMETERS: - * - * c - the hexadecimal digit character - * - * RETURNS: - * - * the converted integer - * - ******************************************************************************/ -int hexdigit2int( char c ) -{ - if( c >= '0' && c <= '9' ) - return c - '0'; - - if( c >= 'A' && c <= 'F' ) - return c - 'A' + 10; - - if( c >= 'a' && c <= 'f' ) - return c - 'a' + 10; - - return 0; -} // hexdigit2int -/*============================================================================*/ - - - - -/******************************************************************************* * key_string2key() ******************************************************************************* * @@ -328,7 +293,7 @@ void key_string2key( char *ks, KEY_STRCT *key ) p = (char *)key->key; for( i = 2; i < l; i+=2 ) { - *p++ = ( hexdigit2int( ks[i] ) << 4 ) + hexdigit2int (ks[i+1] ); + *p++ = (hex_to_bin(ks[i]) << 4) + hex_to_bin(ks[i+1]); n++; } diff --git a/drivers/staging/wlags49_h2/wl_util.h b/drivers/staging/wlags49_h2/wl_util.h index 561e85b..ba537a6 100644 --- a/drivers/staging/wlags49_h2/wl_util.h +++ b/drivers/staging/wlags49_h2/wl_util.h @@ -71,8 +71,6 @@ int is_valid_key_string( char *s ); void key_string2key( char *ks, KEY_STRCT *key ); -int hexdigit2int( char c ); - void wl_hcf_error( struct net_device *dev, int hcfStatus ); void wl_endian_translate_event( ltv_t *pLtv ); |