diff options
Diffstat (limited to 'drivers/staging/wlags49_h2')
-rw-r--r-- | drivers/staging/wlags49_h2/debug.h | 56 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/sta_h25.c | 6 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_cs.c | 67 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_cs.h | 2 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_enc.c | 15 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_enc.h | 4 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_main.c | 155 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_main.h | 2 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_netdev.c | 97 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_pci.c | 1578 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_pci.h | 109 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_priv.c | 134 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_profile.c | 17 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_util.c | 59 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_version.h | 34 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_wext.c | 190 | ||||
-rw-r--r-- | drivers/staging/wlags49_h2/wl_wext.h | 2 |
17 files changed, 41 insertions, 2486 deletions
diff --git a/drivers/staging/wlags49_h2/debug.h b/drivers/staging/wlags49_h2/debug.h index 811698f1070c..40f6a3ee7408 100644 --- a/drivers/staging/wlags49_h2/debug.h +++ b/drivers/staging/wlags49_h2/debug.h @@ -83,7 +83,8 @@ the types of messages displayed */ #ifndef DBG_LVL #define DBG_LVL 5 /* yields nothing via init_module, - original value of 5 yields DBG_TRACE_ON and DBG_VERBOSE_ON */ + original value of 5 yields + DBG_TRACE_ON and DBG_VERBOSE_ON */ #endif /* DBG_LVL*/ @@ -105,46 +106,16 @@ #define DBG_LEVEL(A) ((A)->dbgLevel) -#ifndef PRINTK -# define PRINTK(S...) printk(S) -#endif /* PRINTK */ - - #ifndef DBG_PRINT -# define DBG_PRINT(S...) PRINTK(KERN_DEBUG S) +# define DBG_PRINT(S...) printk(KERN_DEBUG S) #endif /* DBG_PRINT */ #ifndef DBG_PRINTC -# define DBG_PRINTC(S...) PRINTK(S) +# define DBG_PRINTC(S...) printk(S) #endif /* DBG_PRINTC */ -#ifndef DBG_TRAP -# define DBG_TRAP {} -#endif /* DBG_TRAP */ - - -#define _ENTER_STR ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" -#define _LEAVE_STR "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" - - -#define _DBG_ENTER(A) \ - DBG_PRINT("%s:%.*s:%s\n", DBG_NAME(A), ++DBG_LEVEL(A), \ - _ENTER_STR, __func__) -#define _DBG_LEAVE(A) \ - DBG_PRINT("%s:%.*s:%s\n", DBG_NAME(A), DBG_LEVEL(A)--, \ - _LEAVE_STR, __func__) - - -#define DBG_FUNC(F) - -#define DBG_ENTER(A) {if (DBG_FLAGS(A) & DBG_TRACE_ON) \ - _DBG_ENTER(A); } - -#define DBG_LEAVE(A) {if (DBG_FLAGS(A) & DBG_TRACE_ON) \ - _DBG_LEAVE(A); } - #define DBG_PARAM(A, N, F, S...) {if (DBG_FLAGS(A) & DBG_PARAM_ON) \ DBG_PRINT(" %s -- "F"\n", N, S); } @@ -153,7 +124,6 @@ if (DBG_FLAGS(A) & DBG_ERROR_ON) { \ DBG_PRINT("%s:ERROR:%s ", DBG_NAME(A), __func__); \ DBG_PRINTC(S); \ - DBG_TRAP; \ } } while (0) @@ -193,26 +163,22 @@ if (!(C)) { \ DBG_PRINT("ASSERT(%s) -- %s#%d (%s)\n", \ #C, __FILE__, __LINE__, __func__); \ - DBG_TRAP; \ } } while (0) -typedef struct { - char *dbgName; - int dbgLevel; - unsigned long DebugFlag; -} dbg_info_t; +struct dbg_info { + char *dbgName; + int dbgLevel; + unsigned long DebugFlag; +}; + +extern struct dbg_info *DbgInfo; /****************************************************************************/ #else /* DBG */ /****************************************************************************/ -#define DBG_DEFN -#define DBG_TRAP -#define DBG_FUNC(F) #define DBG_PRINT(S...) -#define DBG_ENTER(A) -#define DBG_LEAVE(A) #define DBG_PARAM(A, N, F, S...) #define DBG_ERROR(A, S...) #define DBG_WARNING(A, S...) diff --git a/drivers/staging/wlags49_h2/sta_h25.c b/drivers/staging/wlags49_h2/sta_h25.c index 5b6f670d8ef2..eccd780ef135 100644 --- a/drivers/staging/wlags49_h2/sta_h25.c +++ b/drivers/staging/wlags49_h2/sta_h25.c @@ -5211,7 +5211,7 @@ static const CFG_PROG_STRCT fw_image_code[] = { 0000, 0x000F429B, // Start execution address }, - { 0000, 0000, 0000, 0000, 00000000, 0000, 00000000} + { 0000, 0000, 0000, 0000, 00000000, 0000, NULL} }; static const CFG_RANGE20_STRCT fw_image_infocompat[] = { @@ -5247,8 +5247,8 @@ memimage fw_image = { "FUPU7D37dhfwci\001C", //signature, <format number>, C/Bin type (CFG_PROG_STRCT *) fw_image_code, 0x000F429B, - 00000000, //(dummy) pdaplug - 00000000, //(dummy) priplug + NULL, //(dummy) pdaplug + NULL, //(dummy) priplug (CFG_RANGE20_STRCT *) fw_image_infocompat, (CFG_IDENTITY_STRCT *) fw_image_infoidentity, }; diff --git a/drivers/staging/wlags49_h2/wl_cs.c b/drivers/staging/wlags49_h2/wl_cs.c index a458705a379c..3f7cf41a0e34 100644 --- a/drivers/staging/wlags49_h2/wl_cs.c +++ b/drivers/staging/wlags49_h2/wl_cs.c @@ -100,15 +100,6 @@ #include <wl_netdev.h> #include <wl_cs.h> - -/******************************************************************************* - * global definitions - ******************************************************************************/ -#if DBG -extern dbg_info_t *DbgInfo; -#endif /* DBG */ - - /******************************************************************************* * wl_adapter_attach() ******************************************************************************* @@ -133,10 +124,6 @@ static int wl_adapter_attach(struct pcmcia_device *link) struct net_device *dev; struct wl_private *lp; int ret; - /*--------------------------------------------------------------------*/ - - DBG_FUNC("wl_adapter_attach"); - DBG_ENTER(DbgInfo); dev = wl_device_alloc(); if (dev == NULL) { @@ -158,7 +145,6 @@ static int wl_adapter_attach(struct pcmcia_device *link) if (ret != 0) wl_device_dealloc(dev); - DBG_LEAVE(DbgInfo); return ret; } /* wl_adapter_attach */ /*============================================================================*/ @@ -168,10 +154,7 @@ static int wl_adapter_attach(struct pcmcia_device *link) static void wl_adapter_detach(struct pcmcia_device *link) { struct net_device *dev = link->priv; - /*--------------------------------------------------------------------*/ - DBG_FUNC("wl_adapter_detach"); - DBG_ENTER(DbgInfo); DBG_PARAM(DbgInfo, "link", "0x%p", link); wl_adapter_release(link); @@ -180,24 +163,18 @@ static void wl_adapter_detach(struct pcmcia_device *link) unregister_netdev(dev); wl_device_dealloc(dev); } - - DBG_LEAVE(DbgInfo); } /* wl_adapter_detach */ /*============================================================================*/ void wl_adapter_release(struct pcmcia_device *link) { - DBG_FUNC("wl_adapter_release"); - DBG_ENTER(DbgInfo); DBG_PARAM(DbgInfo, "link", "0x%p", link); /* Stop hardware */ wl_remove(link->priv); pcmcia_disable_device(link); - - DBG_LEAVE(DbgInfo); } /* wl_adapter_release */ /*============================================================================*/ @@ -229,10 +206,7 @@ int wl_adapter_insert(struct pcmcia_device *link) { struct net_device *dev; int ret; - /*--------------------------------------------------------------------*/ - DBG_FUNC("wl_adapter_insert"); - DBG_ENTER(DbgInfo); DBG_PARAM(DbgInfo, "link", "0x%p", link); dev = link->priv; @@ -259,20 +233,17 @@ int wl_adapter_insert(struct pcmcia_device *link) SET_NETDEV_DEV(dev, &link->dev); ret = register_netdev(dev); if (ret != 0) { - printk("%s: register_netdev() failed\n", MODULE_NAME); + printk("%s: register_netdev() failed\n", KBUILD_MODNAME); goto failed; } printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, mac_address" " %pM\n", dev->name, dev->base_addr, dev->irq, dev->dev_addr); - DBG_LEAVE(DbgInfo); return 0; failed: wl_adapter_release(link); - - DBG_LEAVE(DbgInfo); return ret; } /* wl_adapter_insert */ /*============================================================================*/ @@ -303,17 +274,12 @@ int wl_adapter_open(struct net_device *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); + if (!pcmcia_dev_present(link)) return -ENODEV; - } link->open++; @@ -324,7 +290,6 @@ int wl_adapter_open(struct net_device *dev) result = -ENODEV; } - DBG_LEAVE(DbgInfo); return result; } /* wl_adapter_open */ /*============================================================================*/ @@ -353,23 +318,17 @@ int wl_adapter_close(struct net_device *dev) { 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); - if (link == NULL) { - DBG_LEAVE(DbgInfo); + if (link == NULL) return -ENODEV; - } DBG_TRACE(DbgInfo, "%s: Shutting down adapter.\n", dev->name); wl_close(dev); link->open--; - DBG_LEAVE(DbgInfo); return 0; } /* wl_adapter_close */ /*============================================================================*/ @@ -420,17 +379,7 @@ static struct pcmcia_driver wlags49_driver = { ******************************************************************************/ int wl_adapter_init_module(void) { - int ret; - /*--------------------------------------------------------------------*/ - - DBG_FUNC("wl_adapter_init_module"); - DBG_ENTER(DbgInfo); - DBG_TRACE(DbgInfo, "wl_adapter_init_module() -- PCMCIA\n"); - - ret = pcmcia_register_driver(&wlags49_driver); - - DBG_LEAVE(DbgInfo); - return ret; + return pcmcia_register_driver(&wlags49_driver); } /* wl_adapter_init_module */ /*============================================================================*/ @@ -454,15 +403,7 @@ int wl_adapter_init_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"); - - pcmcia_unregister_driver(&wlags49_driver); - - DBG_LEAVE(DbgInfo); - return; } /* wl_adapter_cleanup_module */ /*============================================================================*/ diff --git a/drivers/staging/wlags49_h2/wl_cs.h b/drivers/staging/wlags49_h2/wl_cs.h index 081cc6f28d1f..9a597a9f145f 100644 --- a/drivers/staging/wlags49_h2/wl_cs.h +++ b/drivers/staging/wlags49_h2/wl_cs.h @@ -86,4 +86,4 @@ const char *DbgEvent( int mask ); -#endif // __WL_CS_H__ +#endif /* __WL_CS_H__ */ diff --git a/drivers/staging/wlags49_h2/wl_enc.c b/drivers/staging/wlags49_h2/wl_enc.c index 51293d9f2be9..389c23bdc28f 100644 --- a/drivers/staging/wlags49_h2/wl_enc.c +++ b/drivers/staging/wlags49_h2/wl_enc.c @@ -70,21 +70,6 @@ #include <wl_enc.h> - - - -/******************************************************************************* - * global definitions - ******************************************************************************/ -#if DBG - -extern dbg_info_t *DbgInfo; - -#endif /* DBG */ - - - - /******************************************************************************* * wl_wep_code() ******************************************************************************* diff --git a/drivers/staging/wlags49_h2/wl_enc.h b/drivers/staging/wlags49_h2/wl_enc.h index 1804611276b8..03a52fbd3c09 100644 --- a/drivers/staging/wlags49_h2/wl_enc.h +++ b/drivers/staging/wlags49_h2/wl_enc.h @@ -69,7 +69,7 @@ ******************************************************************************/ #define CRYPT_CODE "57617665A5D6" #define ENCRYPTION_LEN 102 -#define ENCRYPTION_MAGIC 0x48576877L // HWhw +#define ENCRYPTION_MAGIC 0x48576877L /* HWhw */ #define DEF_CRYPT_STR "G?TIUEA]d5MAdZV'eUb&&6.)'&:,'VF/(FR2)6^5*'*8*W6;+GB>,7NA-'ZD-X&G.H2J/8>M0(JP0XVS1HbV29.Y3):\\3YF_4IRb56" #define DEFAULT_CRYPT_MAC "W\x01\x6B\x66\xA5\x5A" @@ -115,4 +115,4 @@ int wl_wep_decode( char *szCrypt, void *Dest, char *szData ); -#endif // __WAVELAN2_ENCRYPTION_H__ +#endif /* __WAVELAN2_ENCRYPTION_H__ */ diff --git a/drivers/staging/wlags49_h2/wl_main.c b/drivers/staging/wlags49_h2/wl_main.c index 43535610acc4..650def88e5c2 100644 --- a/drivers/staging/wlags49_h2/wl_main.c +++ b/drivers/staging/wlags49_h2/wl_main.c @@ -400,8 +400,8 @@ static p_u32 pc_debug = DBG_LVL; */ p_u32 DebugFlag = ~0; //recognizable "undefined value" rather then DBG_DEFAULTS; //MODULE_PARM(DebugFlag, "l"); -dbg_info_t wl_info = { DBG_MOD_NAME, 0, 0 }; -dbg_info_t *DbgInfo = &wl_info; +static struct dbg_info wl_info = { KBUILD_MODNAME, 0, 0 }; +struct dbg_info *DbgInfo = &wl_info; #endif /* DBG */ #ifdef USE_RTS @@ -434,9 +434,6 @@ int wl_insert( struct net_device *dev ) int i; unsigned long flags = 0; struct wl_private *lp = wl_priv(dev); - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_insert" ); - DBG_ENTER( DbgInfo ); /* Initialize the adapter hardware. */ memset( &( lp->hcfCtx ), 0, sizeof( IFB_STRCT )); @@ -926,7 +923,6 @@ int wl_insert( struct net_device *dev ) proc_mkdir("driver/wlags49", 0); #endif /* SCULL_USE_PROC */ - DBG_LEAVE( DbgInfo ); return result; hcf_failed: @@ -944,8 +940,6 @@ failed: result = -EFAULT; - - DBG_LEAVE( DbgInfo ); return result; } // wl_insert /*============================================================================*/ @@ -972,9 +966,7 @@ int wl_reset(struct net_device *dev) { struct wl_private *lp = wl_priv(dev); int hcf_status = HCF_SUCCESS; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_reset" ); - DBG_ENTER( DbgInfo ); + DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev ); DBG_PARAM( DbgInfo, "dev->base_addr", "(%#03lx)", dev->base_addr ); @@ -1021,7 +1013,6 @@ int wl_reset(struct net_device *dev) } out: - DBG_LEAVE( DbgInfo ); return hcf_status; } // wl_reset /*============================================================================*/ @@ -1049,9 +1040,6 @@ int wl_go( struct wl_private *lp ) int hcf_status = HCF_SUCCESS; char *cp = NULL; //fw_image int retries = 0; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_go" ); - DBG_ENTER( DbgInfo ); hcf_status = wl_disable( lp ); if ( hcf_status != HCF_SUCCESS ) { @@ -1148,7 +1136,6 @@ int rc; } if ( hcf_status != HCF_SUCCESS ) { DBG_ERROR( DbgInfo, "Firmware Download failed\n" ); - DBG_LEAVE( DbgInfo ); return hcf_status; } } @@ -1187,7 +1174,6 @@ int rc; hcf_status = hcf_get_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord )); if ( hcf_status != HCF_SUCCESS ) { DBG_ERROR( DbgInfo, "Could not retrieve MAC address\n" ); - DBG_LEAVE( DbgInfo ); return hcf_status; } memcpy( lp->MACAddress, &lp->ltvRecord.u.u8[0], ETH_ALEN ); @@ -1206,7 +1192,6 @@ int rc; #endif // USE_WDS hcf_status = wl_connect( lp ); } - DBG_LEAVE( DbgInfo ); return hcf_status; } // wl_go /*============================================================================*/ @@ -1234,9 +1219,7 @@ int rc; void wl_set_wep_keys( struct wl_private *lp ) { int count = 0; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_set_wep_keys" ); - DBG_ENTER( DbgInfo ); + DBG_PARAM( DbgInfo, "lp", "%s (0x%p)", lp->dev->name, lp ); if ( lp->EnableEncryption ) { /* NOTE: CFG_CNF_ENCRYPTION is set in wl_put_ltv() as it's a static @@ -1274,8 +1257,6 @@ void wl_set_wep_keys( struct wl_private *lp ) DBG_NOTICE( DbgInfo, "encrypt: %d, ID: %d\n", lp->EnableEncryption, lp->TransmitKeyID ); DBG_NOTICE( DbgInfo, "set key: %s(%d) [%d]\n", lp->DefaultKeys.key[lp->TransmitKeyID-1].key, lp->DefaultKeys.key[lp->TransmitKeyID-1].len, lp->TransmitKeyID-1 ); } - - DBG_LEAVE( DbgInfo ); } // wl_set_wep_keys /*============================================================================*/ @@ -1301,9 +1282,7 @@ void wl_set_wep_keys( struct wl_private *lp ) int wl_apply(struct wl_private *lp) { int hcf_status = HCF_SUCCESS; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_apply" ); - DBG_ENTER( DbgInfo ); + DBG_ASSERT( lp != NULL); DBG_PARAM( DbgInfo, "lp", "%s (0x%p)", lp->dev->name, lp ); @@ -1319,13 +1298,11 @@ int wl_apply(struct wl_private *lp) hcf_status = wl_disconnect( lp ); if ( hcf_status != HCF_SUCCESS ) { DBG_ERROR( DbgInfo, "Disconnect failed\n" ); - DBG_LEAVE( DbgInfo ); return -1; } hcf_status = wl_disable( lp ); if ( hcf_status != HCF_SUCCESS ) { DBG_ERROR( DbgInfo, "Disable failed\n" ); - DBG_LEAVE( DbgInfo ); return -1; } else { /* Write out configuration to the device, enable, and reconnect. @@ -1347,7 +1324,6 @@ int wl_apply(struct wl_private *lp) } } - DBG_LEAVE( DbgInfo ); return hcf_status; } // wl_apply /*============================================================================*/ @@ -1375,12 +1351,9 @@ int wl_put_ltv_init( struct wl_private *lp ) int i; int hcf_status; CFG_RID_LOG_STRCT *RidLog; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_put_ltv_init" ); - DBG_ENTER( DbgInfo ); + if ( lp == NULL ) { DBG_ERROR( DbgInfo, "lp pointer is NULL\n" ); - DBG_LEAVE( DbgInfo ); return -1; } /* DMA/IO */ @@ -1446,7 +1419,6 @@ int wl_put_ltv_init( struct wl_private *lp ) DBG_TRACE( DbgInfo, "CFG_REG_INFO_LOG\n" ); DBG_TRACE( DbgInfo, "CFG_REG_INFO_LOG result : 0x%04x\n", hcf_status ); - DBG_LEAVE( DbgInfo ); return hcf_status; } // wl_put_ltv_init /*============================================================================*/ @@ -1473,9 +1445,6 @@ int wl_put_ltv( struct wl_private *lp ) { int len; int hcf_status; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_put_ltv" ); - DBG_ENTER( DbgInfo ); if ( lp == NULL ) { DBG_ERROR( DbgInfo, "lp pointer is NULL\n" ); @@ -2013,7 +1982,6 @@ int wl_put_ltv( struct wl_private *lp ) /* Country Code */ /* countryInfo, ltvCountryInfo, CFG_CNF_COUNTRY_INFO */ - DBG_LEAVE( DbgInfo ); return hcf_status; } // wl_put_ltv /*============================================================================*/ @@ -2042,7 +2010,6 @@ static int __init wl_module_init( void ) int result; /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_module_init" ); #if DBG /* Convert "standard" PCMCIA parameter pc_debug to a reasonable DebugFlag value. @@ -2067,7 +2034,6 @@ static int __init wl_module_init( void ) } #endif /* DBG */ - DBG_ENTER( DbgInfo ); printk(KERN_INFO "%s\n", VERSION_INFO); printk(KERN_INFO "*** Modified for kernel 2.6 by Henk de Groot <pe1dnn@amsat.org>\n"); printk(KERN_INFO "*** Based on 7.18 version by Andrey Borzenkov <arvidjaar@mail.ru> $Revision: 39 $\n"); @@ -2080,7 +2046,6 @@ static int __init wl_module_init( void ) // #endif /* (HCF_TYPE) & HCF_TYPE_AP */ result = wl_adapter_init_module( ); - DBG_LEAVE( DbgInfo ); return result; } // init_module /*============================================================================*/ @@ -2105,16 +2070,10 @@ static int __init wl_module_init( void ) ******************************************************************************/ static void __exit wl_module_exit( void ) { - DBG_FUNC( "wl_module_exit" ); - DBG_ENTER(DbgInfo); - wl_adapter_cleanup_module( ); #if 0 //SCULL_USE_PROC /* don't waste space if unused */ remove_proc_entry( "wlags", NULL ); //;?why so a-symmetric compared to location of proc_create_data #endif - - DBG_LEAVE( DbgInfo ); - return; } // cleanup_module /*============================================================================*/ @@ -2322,9 +2281,6 @@ void wl_remove( struct net_device *dev ) { struct wl_private *lp = wl_priv(dev); unsigned long flags; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_remove" ); - DBG_ENTER( DbgInfo ); DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev ); @@ -2356,8 +2312,6 @@ void wl_remove( struct net_device *dev ) #ifdef USE_RTS if ( lp->useRTS == 1 ) { wl_unlock( lp, &flags ); - - DBG_LEAVE( DbgInfo ); return; } #endif /* USE_RTS */ @@ -2366,9 +2320,6 @@ void wl_remove( struct net_device *dev ) hcf_connect( &lp->hcfCtx, HCF_DISCONNECT ); wl_unlock( lp, &flags ); - - DBG_LEAVE( DbgInfo ); - return; } // wl_remove /*============================================================================*/ @@ -2394,9 +2345,6 @@ void wl_suspend( struct net_device *dev ) { struct wl_private *lp = wl_priv(dev); unsigned long flags; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_suspend" ); - DBG_ENTER( DbgInfo ); DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev ); @@ -2422,9 +2370,6 @@ void wl_suspend( struct net_device *dev ) lp->portState = WVLAN_PORT_STATE_DISABLED; wl_unlock( lp, &flags ); - - DBG_LEAVE( DbgInfo ); - return; } // wl_suspend /*============================================================================*/ @@ -2450,9 +2395,6 @@ void wl_resume(struct net_device *dev) { struct wl_private *lp = wl_priv(dev); unsigned long flags; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_resume" ); - DBG_ENTER( DbgInfo ); DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev ); @@ -2474,9 +2416,6 @@ void wl_resume(struct net_device *dev) wl_act_int_on( lp ); wl_unlock( lp, &flags ); - - DBG_LEAVE( DbgInfo ); - return; } // wl_resume /*============================================================================*/ @@ -2504,9 +2443,6 @@ void wl_resume(struct net_device *dev) void wl_release( struct net_device *dev ) { struct wl_private *lp = wl_priv(dev); - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_release" ); - DBG_ENTER( DbgInfo ); DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev ); /* If wl_remove() hasn't been called (i.e. when Card Services is shut @@ -2517,9 +2453,6 @@ void wl_release( struct net_device *dev ) lp->is_registered = FALSE; } - - DBG_LEAVE( DbgInfo ); - return; } // wl_release /*============================================================================*/ @@ -2593,9 +2526,6 @@ p_s8 * wl_get_irq_list( void ) int wl_enable( struct wl_private *lp ) { int hcf_status = HCF_SUCCESS; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_enable" ); - DBG_ENTER( DbgInfo ); if ( lp->portState == WVLAN_PORT_STATE_ENABLED ) { DBG_TRACE( DbgInfo, "No action: Card already enabled\n" ); @@ -2617,7 +2547,6 @@ int wl_enable( struct wl_private *lp ) if ( hcf_status != HCF_SUCCESS ) { //;?make this an assert DBG_TRACE( DbgInfo, "failed: 0x%x\n", hcf_status ); } - DBG_LEAVE( DbgInfo ); return hcf_status; } // wl_enable /*============================================================================*/ @@ -2643,14 +2572,9 @@ int wl_enable( struct wl_private *lp ) ******************************************************************************/ void wl_enable_wds_ports( struct wl_private * lp ) { - - DBG_FUNC( "wl_enable_wds_ports" ); - DBG_ENTER( DbgInfo ); if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ){ DBG_ERROR( DbgInfo, "!!!!;? someone misunderstood something !!!!!\n" ); } - DBG_LEAVE( DbgInfo ); - return; } // wl_enable_wds_ports #endif /* USE_WDS */ /*============================================================================*/ @@ -2676,21 +2600,15 @@ void wl_enable_wds_ports( struct wl_private * lp ) int wl_connect( struct wl_private *lp ) { int hcf_status; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_connect" ); - DBG_ENTER( DbgInfo ); if ( lp->portState != WVLAN_PORT_STATE_ENABLED ) { DBG_TRACE( DbgInfo, "No action: Not in enabled state\n" ); - DBG_LEAVE( DbgInfo ); return HCF_SUCCESS; } hcf_status = hcf_cntl( &lp->hcfCtx, HCF_CNTL_CONNECT ); if ( hcf_status == HCF_SUCCESS ) { lp->portState = WVLAN_PORT_STATE_CONNECTED; } - DBG_LEAVE( DbgInfo ); return hcf_status; } // wl_connect /*============================================================================*/ @@ -2716,21 +2634,15 @@ int wl_connect( struct wl_private *lp ) int wl_disconnect( struct wl_private *lp ) { int hcf_status; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_disconnect" ); - DBG_ENTER( DbgInfo ); if ( lp->portState != WVLAN_PORT_STATE_CONNECTED ) { DBG_TRACE( DbgInfo, "No action: Not in connected state\n" ); - DBG_LEAVE( DbgInfo ); return HCF_SUCCESS; } hcf_status = hcf_cntl( &lp->hcfCtx, HCF_CNTL_DISCONNECT ); if ( hcf_status == HCF_SUCCESS ) { lp->portState = WVLAN_PORT_STATE_ENABLED; } - DBG_LEAVE( DbgInfo ); return hcf_status; } // wl_disconnect /*============================================================================*/ @@ -2757,9 +2669,6 @@ int wl_disconnect( struct wl_private *lp ) int wl_disable( struct wl_private *lp ) { int hcf_status = HCF_SUCCESS; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_disable" ); - DBG_ENTER( DbgInfo ); if ( lp->portState == WVLAN_PORT_STATE_DISABLED ) { DBG_TRACE( DbgInfo, "No action: Port state is disabled\n" ); @@ -2779,7 +2688,6 @@ int wl_disable( struct wl_private *lp ) if ( hcf_status != HCF_SUCCESS ) { DBG_TRACE( DbgInfo, "failed: 0x%x\n", hcf_status ); } - DBG_LEAVE( DbgInfo ); return hcf_status; } // wl_disable /*============================================================================*/ @@ -2805,10 +2713,6 @@ int wl_disable( struct wl_private *lp ) ******************************************************************************/ void wl_disable_wds_ports( struct wl_private * lp ) { - - DBG_FUNC( "wl_disable_wds_ports" ); - DBG_ENTER( DbgInfo ); - if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ){ DBG_ERROR( DbgInfo, "!!!!;? someone misunderstood something !!!!!\n" ); } @@ -2820,7 +2724,6 @@ void wl_disable_wds_ports( struct wl_private * lp ) // wl_disable( lp, HCF_PORT_5 ); // wl_disable( lp, HCF_PORT_6 ); // } - DBG_LEAVE( DbgInfo ); return; } // wl_disable_wds_ports #endif // USE_WDS @@ -2848,9 +2751,7 @@ void wl_disable_wds_ports( struct wl_private * lp ) int wl_mbx( struct wl_private *lp ) { int hcf_status = HCF_SUCCESS; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_mbx" ); - DBG_ENTER( DbgInfo ); + DBG_TRACE( DbgInfo, "Mailbox Info: IFB_MBInfoLen: %d\n", lp->hcfCtx.IFB_MBInfoLen ); @@ -2862,19 +2763,15 @@ int wl_mbx( struct wl_private *lp ) if ( hcf_status != HCF_SUCCESS ) { DBG_ERROR( DbgInfo, "hcf_get_info returned 0x%x\n", hcf_status ); - - DBG_LEAVE( DbgInfo ); return hcf_status; } - if ( lp->ltvRecord.typ == CFG_MB_INFO ) { - DBG_LEAVE( DbgInfo ); + if ( lp->ltvRecord.typ == CFG_MB_INFO ) return hcf_status; - } + /* Endian translate the mailbox data, then process the message */ wl_endian_translate_mailbox( &( lp->ltvRecord )); wl_process_mailbox( lp ); - DBG_LEAVE( DbgInfo ); return hcf_status; } // wl_mbx /*============================================================================*/ @@ -2900,9 +2797,6 @@ int wl_mbx( struct wl_private *lp ) ******************************************************************************/ void wl_endian_translate_mailbox( ltv_t *ltv ) { - - DBG_FUNC( "wl_endian_translate_mailbox" ); - DBG_ENTER( DbgInfo ); switch( ltv->typ ) { case CFG_TALLIES: break; @@ -2990,9 +2884,6 @@ void wl_endian_translate_mailbox( ltv_t *ltv ) default: break; } - - DBG_LEAVE( DbgInfo ); - return; } // wl_endian_translate_mailbox /*============================================================================*/ @@ -3017,9 +2908,7 @@ void wl_process_mailbox( struct wl_private *lp ) { ltv_t *ltv; hcf_16 ltv_val = 0xFFFF; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_process_mailbox" ); - DBG_ENTER( DbgInfo ); + ltv = &( lp->ltvRecord ); switch( ltv->typ ) { @@ -3448,8 +3337,6 @@ void wl_process_mailbox( struct wl_private *lp ) DBG_TRACE( DbgInfo, "UNKNOWN MESSAGE: 0x%04x\n", ltv->typ ); break; } - DBG_LEAVE( DbgInfo ); - return; } // wl_process_mailbox /*============================================================================*/ #endif /* ifndef USE_MBOX_SYNC */ @@ -3477,9 +3364,7 @@ void wl_process_mailbox( struct wl_private *lp ) void wl_wds_netdev_register( struct wl_private *lp ) { int count; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_wds_netdev_register" ); - DBG_ENTER( DbgInfo ); + //;?why is there no USE_WDS clause like in wl_enable_wds_ports if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ) { for( count = 0; count < NUM_WDS_PORTS; count++ ) { @@ -3496,8 +3381,6 @@ void wl_wds_netdev_register( struct wl_private *lp ) } } } - DBG_LEAVE( DbgInfo ); - return; } // wl_wds_netdev_register /*============================================================================*/ @@ -3524,9 +3407,7 @@ void wl_wds_netdev_register( struct wl_private *lp ) void wl_wds_netdev_deregister( struct wl_private *lp ) { int count; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_wds_netdev_deregister" ); - DBG_ENTER( DbgInfo ); + if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ) { for( count = 0; count < NUM_WDS_PORTS; count++ ) { if ( WVLAN_VALID_MAC_ADDRESS( lp->wds_port[count].wdsAddress )) { @@ -3535,8 +3416,6 @@ void wl_wds_netdev_deregister( struct wl_private *lp ) lp->wds_port[count].is_registered = FALSE; } } - DBG_LEAVE( DbgInfo ); - return; } // wl_wds_netdev_deregister /*============================================================================*/ #endif /* USE_WDS */ @@ -3780,9 +3659,6 @@ static int write_int(struct file *file, const char *buffer, unsigned long count, static char proc_number[11]; unsigned int nr = 0; - DBG_FUNC( "write_int" ); - DBG_ENTER( DbgInfo ); - if (count > 9) { count = -EINVAL; } else if ( copy_from_user(proc_number, buffer, count) ) { @@ -3799,7 +3675,6 @@ static int write_int(struct file *file, const char *buffer, unsigned long count, } } DBG_PRINT( "value: %08X\n", nr ); - DBG_LEAVE( DbgInfo ); return count; } // write_int @@ -3839,10 +3714,6 @@ void timer_oor( u_long arg ) { struct wl_private *lp = (struct wl_private *)arg; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "timer_oor" ); - DBG_ENTER( DbgInfo ); DBG_PARAM( DbgInfo, "arg", "0x%08lx", arg ); printk(KERN_NOTICE "timer_oor: %ld 0x%04X\n", jiffies, lp->timer_oor_cnt ); //;?remove me 1 day @@ -3856,8 +3727,6 @@ void timer_oor( u_long arg ) lp->timer_oor.data = (unsigned long)lp; lp->timer_oor.expires = RUN_AT( (lp->timer_oor_cnt & ~DS_OOR) * HZ ); add_timer( &lp->timer_oor ); - - DBG_LEAVE( DbgInfo ); } // timer_oor #endif //DN554 diff --git a/drivers/staging/wlags49_h2/wl_main.h b/drivers/staging/wlags49_h2/wl_main.h index 3b5acdf4e329..3806e744d7f6 100644 --- a/drivers/staging/wlags49_h2/wl_main.h +++ b/drivers/staging/wlags49_h2/wl_main.h @@ -135,4 +135,4 @@ void wl_wds_netdev_deregister( struct wl_private *lp ); #define WL_WDS_NETDEV_DEREGISTER( ARG ) #endif /* USE_WDS */ -#endif // __WL_MAIN_H__ +#endif /* __WL_MAIN_H__ */ diff --git a/drivers/staging/wlags49_h2/wl_netdev.c b/drivers/staging/wlags49_h2/wl_netdev.c index 235cc2a7ffe6..965b1c0a4753 100644 --- a/drivers/staging/wlags49_h2/wl_netdev.c +++ b/drivers/staging/wlags49_h2/wl_netdev.c @@ -115,14 +115,6 @@ #endif /* BUS_PCI */ -/******************************************************************************* - * global variables - ******************************************************************************/ -#if DBG -extern dbg_info_t *DbgInfo; -#endif /* DBG */ - - #if HCF_ENCAP #define MTU_MAX (HCF_MAX_MSG - ETH_HLEN - 8) #else @@ -170,10 +162,6 @@ int wl_init( struct net_device *dev ) { // unsigned long flags; // struct wl_private *lp = wl_priv(dev); - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_init" ); - DBG_ENTER( DbgInfo ); DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev ); @@ -182,7 +170,6 @@ int wl_init( struct net_device *dev ) // wl_lock( lp, &flags ); // wl_unlock( lp, &flags ); - DBG_LEAVE( DbgInfo ); return 0; } // wl_init /*============================================================================*/ @@ -208,9 +195,6 @@ int wl_init( struct net_device *dev ) ******************************************************************************/ int wl_config( struct net_device *dev, struct ifmap *map ) { - DBG_FUNC( "wl_config" ); - DBG_ENTER( DbgInfo ); - DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev ); DBG_PARAM( DbgInfo, "map", "0x%p", map ); @@ -218,7 +202,6 @@ int wl_config( struct net_device *dev, struct ifmap *map ) ignore the request. */ DBG_TRACE(DbgInfo, "%s: %s called.\n", dev->name, __func__); - DBG_LEAVE( DbgInfo ); return 0; } // wl_config /*============================================================================*/ @@ -249,10 +232,7 @@ struct net_device_stats *wl_stats( struct net_device *dev ) unsigned long flags; struct net_device_stats *pStats; struct wl_private *lp = wl_priv(dev); - /*------------------------------------------------------------------------*/ - //DBG_FUNC( "wl_stats" ); - //DBG_ENTER( DbgInfo ); //DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev ); pStats = NULL; @@ -262,8 +242,6 @@ struct net_device_stats *wl_stats( struct net_device *dev ) #ifdef USE_RTS if( lp->useRTS == 1 ) { wl_unlock( lp, &flags ); - - //DBG_LEAVE( DbgInfo ); return NULL; } #endif /* USE_RTS */ @@ -286,8 +264,6 @@ struct net_device_stats *wl_stats( struct net_device *dev ) wl_unlock( lp, &flags ); - //DBG_LEAVE( DbgInfo ); - return pStats; } // wl_stats /*============================================================================*/ @@ -315,10 +291,6 @@ int wl_open(struct net_device *dev) int status = HCF_SUCCESS; struct wl_private *lp = wl_priv(dev); unsigned long flags; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_open" ); - DBG_ENTER( DbgInfo ); wl_lock( lp, &flags ); @@ -326,7 +298,6 @@ int wl_open(struct net_device *dev) if( lp->useRTS == 1 ) { DBG_TRACE( DbgInfo, "Skipping device open, in RTS mode\n" ); wl_unlock( lp, &flags ); - DBG_LEAVE( DbgInfo ); return -EIO; } #endif /* USE_RTS */ @@ -384,7 +355,6 @@ int wl_open(struct net_device *dev) wl_unlock( lp, &flags ); - DBG_LEAVE( DbgInfo ); return status; } // wl_open /*============================================================================*/ @@ -411,10 +381,7 @@ int wl_close( struct net_device *dev ) { struct wl_private *lp = wl_priv(dev); unsigned long flags; - /*------------------------------------------------------------------------*/ - DBG_FUNC("wl_close"); - DBG_ENTER(DbgInfo); DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev); /* Mark the adapter as busy */ @@ -440,7 +407,6 @@ int wl_close( struct net_device *dev ) if( lp->useRTS == 1 ) { DBG_TRACE( DbgInfo, "Skipping device close, in RTS mode\n" ); wl_unlock( lp, &flags ); - DBG_LEAVE( DbgInfo ); return -EIO; } #endif /* USE_RTS */ @@ -450,7 +416,6 @@ int wl_close( struct net_device *dev ) wl_unlock( lp, &flags ); - DBG_LEAVE( DbgInfo ); return 0; } // wl_close /*============================================================================*/ @@ -504,10 +469,7 @@ int wl_ioctl( struct net_device *dev, struct ifreq *rq, int cmd ) struct wl_private *lp = wl_priv(dev); unsigned long flags; int ret = 0; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_ioctl" ); - DBG_ENTER(DbgInfo); DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev); DBG_PARAM(DbgInfo, "rq", "0x%p", rq); DBG_PARAM(DbgInfo, "cmd", "0x%04x", cmd); @@ -563,7 +525,6 @@ out_act_int_on_unlock: wl_unlock( lp, &flags ); - DBG_LEAVE( DbgInfo ); return ret; } // wl_ioctl /*============================================================================*/ @@ -606,10 +567,6 @@ void wl_tx_timeout( struct net_device *dev ) unsigned long flags; struct wl_private *lp = wl_priv(dev); struct net_device_stats *pStats = NULL; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_tx_timeout" ); - DBG_ENTER( DbgInfo ); DBG_WARNING( DbgInfo, "%s: Transmit timeout.\n", dev->name ); @@ -619,8 +576,6 @@ void wl_tx_timeout( struct net_device *dev ) if( lp->useRTS == 1 ) { DBG_TRACE( DbgInfo, "Skipping tx_timeout handler, in RTS mode\n" ); wl_unlock( lp, &flags ); - - DBG_LEAVE( DbgInfo ); return; } #endif /* USE_RTS */ @@ -650,8 +605,6 @@ void wl_tx_timeout( struct net_device *dev ) pStats->tx_errors++; wl_unlock( lp, &flags ); - - DBG_LEAVE( DbgInfo ); } // wl_tx_timeout /*============================================================================*/ @@ -683,8 +636,6 @@ int wl_send( struct wl_private *lp ) int len; /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_send" ); - if( lp == NULL ) { DBG_ERROR( DbgInfo, "Private adapter struct is NULL\n" ); return FALSE; @@ -801,8 +752,6 @@ int wl_tx( struct sk_buff *skb, struct net_device *dev, int port ) struct list_head *element; /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_tx" ); - /* Grab the spinlock */ wl_lock( lp, &flags ); @@ -895,7 +844,6 @@ int wl_rx(struct net_device *dev) DESC_STRCT *desc; /*------------------------------------------------------------------------*/ - DBG_FUNC("wl_rx") DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev); if(!( lp->flags & WVLAN2_UIL_BUSY )) { @@ -1047,16 +995,11 @@ void wl_multicast( struct net_device *dev ) struct netdev_hw_addr *ha; struct wl_private *lp = wl_priv(dev); unsigned long flags; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_multicast" ); - DBG_ENTER( DbgInfo ); DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev ); - if( !wl_adapter_is_open( dev )) { - DBG_LEAVE( DbgInfo ); + if( !wl_adapter_is_open( dev )) return; - } #if DBG if( DBG_FLAGS( DbgInfo ) & DBG_PARAM_ON ) { @@ -1077,8 +1020,6 @@ void wl_multicast( struct net_device *dev ) #ifdef USE_RTS if( lp->useRTS == 1 ) { DBG_TRACE( DbgInfo, "Skipping multicast, in RTS mode\n" ); - - DBG_LEAVE( DbgInfo ); return; } #endif /* USE_RTS */ @@ -1146,7 +1087,6 @@ void wl_multicast( struct net_device *dev ) wl_act_int_on( lp ); wl_unlock( lp, &flags ); } - DBG_LEAVE( DbgInfo ); #endif /* HCF_STA */ } // wl_multicast /*============================================================================*/ @@ -1155,16 +1095,11 @@ void wl_multicast( struct net_device *dev ) void wl_multicast( struct net_device *dev, int num_addrs, void *addrs ) { - DBG_FUNC( "wl_multicast"); - DBG_ENTER(DbgInfo); - DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev ); DBG_PARAM( DbgInfo, "num_addrs", "%d", num_addrs ); DBG_PARAM( DbgInfo, "addrs", "0x%p", addrs ); #error Obsolete set multicast interface! - - DBG_LEAVE( DbgInfo ); } // wl_multicast /*============================================================================*/ @@ -1213,10 +1148,6 @@ struct net_device * wl_device_alloc( void ) { struct net_device *dev = NULL; struct wl_private *lp = NULL; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_device_alloc" ); - DBG_ENTER( DbgInfo ); /* Alloc a net_device struct */ dev = alloc_etherdev(sizeof(struct wl_private)); @@ -1253,7 +1184,6 @@ struct net_device * wl_device_alloc( void ) /* Allocate virtual devices for WDS support if needed */ WL_WDS_DEVICE_ALLOC( lp ); - DBG_LEAVE( DbgInfo ); return dev; } // wl_device_alloc /*============================================================================*/ @@ -1279,17 +1209,11 @@ struct net_device * wl_device_alloc( void ) void wl_device_dealloc( struct net_device *dev ) { // struct wl_private *lp = wl_priv(dev); - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_device_dealloc" ); - DBG_ENTER( DbgInfo ); /* Dealloc the WDS ports */ WL_WDS_DEVICE_DEALLOC( lp ); free_netdev( dev ); - - DBG_LEAVE( DbgInfo ); } // wl_device_dealloc /*============================================================================*/ @@ -1496,10 +1420,6 @@ int wl_tx_port6( struct sk_buff *skb, struct net_device *dev ) void wl_wds_device_alloc( struct wl_private *lp ) { int count; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_wds_device_alloc" ); - DBG_ENTER( DbgInfo ); /* WDS support requires additional net_device structs to be allocated, so that user space apps can use these virtual devices to specify the @@ -1508,10 +1428,8 @@ void wl_wds_device_alloc( struct wl_private *lp ) struct net_device *dev_wds = NULL; dev_wds = kzalloc(sizeof(struct net_device), GFP_KERNEL); - if (!dev_wds) { - DBG_LEAVE(DbgInfo); + if (!dev_wds) return; - } ether_setup( dev_wds ); @@ -1542,8 +1460,6 @@ void wl_wds_device_alloc( struct wl_private *lp ) lp->wds_port[5].dev->hard_start_xmit = &wl_tx_port6; WL_WDS_NETIF_STOP_QUEUE( lp ); - - DBG_LEAVE( DbgInfo ); } // wl_wds_device_alloc /*============================================================================*/ @@ -1567,10 +1483,6 @@ void wl_wds_device_alloc( struct wl_private *lp ) void wl_wds_device_dealloc( struct wl_private *lp ) { int count; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_wds_device_dealloc" ); - DBG_ENTER( DbgInfo ); for( count = 0; count < NUM_WDS_PORTS; count++ ) { struct net_device *dev_wds = NULL; @@ -1587,8 +1499,6 @@ void wl_wds_device_dealloc( struct wl_private *lp ) lp->wds_port[count].dev = NULL; } } - - DBG_LEAVE( DbgInfo ); } // wl_wds_device_dealloc /*============================================================================*/ @@ -1792,8 +1702,6 @@ int wl_send_dma( struct wl_private *lp, struct sk_buff *skb, int port ) DESC_STRCT *desc_next = NULL; /*------------------------------------------------------------------------*/ - DBG_FUNC( "wl_send_dma" ); - if( lp == NULL ) { DBG_ERROR( DbgInfo, "Private adapter struct is NULL\n" ); return FALSE; @@ -1882,7 +1790,6 @@ int wl_rx_dma( struct net_device *dev ) //CFG_MB_INFO_RANGE2_STRCT x; /*------------------------------------------------------------------------*/ - DBG_FUNC("wl_rx") DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev); if((( lp = dev->priv ) != NULL ) && diff --git a/drivers/staging/wlags49_h2/wl_pci.c b/drivers/staging/wlags49_h2/wl_pci.c deleted file mode 100644 index 6226e5eebf3a..000000000000 --- a/drivers/staging/wlags49_h2/wl_pci.c +++ /dev/null @@ -1,1578 +0,0 @@ -/******************************************************************************* - * Agere Systems Inc. - * Wireless device driver for Linux (wlags49). - * - * Copyright (c) 1998-2003 Agere Systems Inc. - * All rights reserved. - * http://www.agere.com - * - * Initially developed by TriplePoint, Inc. - * http://www.triplepoint.com - * - *------------------------------------------------------------------------------ - * - * This file contains processing and initialization specific to PCI/miniPCI - * devices. - * - *------------------------------------------------------------------------------ - * - * SOFTWARE LICENSE - * - * This software is provided subject to the following terms and conditions, - * which you should read carefully before using the software. Using this - * 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. - * All rights reserved. - * - * Redistribution and use in source or binary forms, with or without - * modifications, are permitted provided that the following conditions are met: - * - * . Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following Disclaimer as comments in the code as - * well as in the documentation and/or other materials provided with the - * distribution. - * - * . Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following Disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * . Neither the name of Agere Systems Inc. nor the names of the contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * Disclaimer - * - * 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 - * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - ******************************************************************************/ - -/******************************************************************************* - * include files - ******************************************************************************/ -#include <wireless/wl_version.h> - -#include <linux/module.h> -#include <linux/kernel.h> -#include <linux/errno.h> -#include <linux/pci.h> -#include <linux/init.h> -#include <linux/sched.h> -#include <linux/ptrace.h> -#include <linux/ctype.h> -#include <linux/string.h> -//#include <linux/timer.h> -#include <linux/interrupt.h> -#include <linux/in.h> -#include <linux/delay.h> -#include <asm/io.h> -#include <asm/irq.h> -#include <asm/bitops.h> -#include <asm/uaccess.h> - -#include <linux/ethtool.h> -#include <linux/netdevice.h> -#include <linux/etherdevice.h> -#include <linux/skbuff.h> -#include <linux/if_arp.h> -#include <linux/ioport.h> - -#include <hcf/debug.h> - -#include <hcf.h> -#include <dhf.h> -#include <hcfdef.h> - -#include <wireless/wl_if.h> -#include <wireless/wl_internal.h> -#include <wireless/wl_util.h> -#include <wireless/wl_main.h> -#include <wireless/wl_netdev.h> -#include <wireless/wl_pci.h> - - -/******************************************************************************* - * global variables - ******************************************************************************/ -#if DBG -extern dbg_info_t *DbgInfo; -#endif // DBG - -/* define the PCI device Table Cardname and id tables */ -static struct pci_device_id wl_pci_tbl[] = { - { PCI_DEVICE(PCI_VENDOR_ID_WL_LKM, PCI_DEVICE_ID_WL_LKM_0), }, - { PCI_DEVICE(PCI_VENDOR_ID_WL_LKM, PCI_DEVICE_ID_WL_LKM_1), }, - { PCI_DEVICE(PCI_VENDOR_ID_WL_LKM, PCI_DEVICE_ID_WL_LKM_2), }, - - { } /* Terminating entry */ -}; - -MODULE_DEVICE_TABLE(pci, wl_pci_tbl); - -/******************************************************************************* - * function prototypes - ******************************************************************************/ -int wl_pci_probe( struct pci_dev *pdev, - const struct pci_device_id *ent ); -void wl_pci_remove(struct pci_dev *pdev); -int wl_pci_setup( struct pci_dev *pdev ); -void wl_pci_enable_cardbus_interrupts( struct pci_dev *pdev ); - -#ifdef ENABLE_DMA -int wl_pci_dma_alloc( struct pci_dev *pdev, struct wl_private *lp ); -int wl_pci_dma_free( struct pci_dev *pdev, struct wl_private *lp ); -int wl_pci_dma_alloc_tx_packet( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT **desc ); -int wl_pci_dma_free_tx_packet( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT **desc ); -int wl_pci_dma_alloc_rx_packet( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT **desc ); -int wl_pci_dma_free_rx_packet( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT **desc ); -int wl_pci_dma_alloc_desc_and_buf( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT **desc, int size ); -int wl_pci_dma_free_desc_and_buf( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT **desc ); -int wl_pci_dma_alloc_desc( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT **desc ); -int wl_pci_dma_free_desc( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT **desc ); -int wl_pci_dma_alloc_buf( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT *desc, int size ); -int wl_pci_dma_free_buf( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT *desc ); - -void wl_pci_dma_hcf_reclaim_rx( struct wl_private *lp ); -#endif // ENABLE_DMA - -/******************************************************************************* - * PCI module function registration - ******************************************************************************/ -static struct pci_driver wl_driver = { - .name = MODULE_NAME, - .id_table = wl_pci_tbl, - .probe = wl_pci_probe, - .remove = wl_pci_remove, - .suspend = NULL, - .resume = NULL -}; - -/******************************************************************************* - * wl_adapter_init_module() - ******************************************************************************* - * - * DESCRIPTION: - * - * Called by init_module() to perform PCI-specific driver initialization. - * - * PARAMETERS: - * - * N/A - * - * RETURNS: - * - * 0 - * - ******************************************************************************/ -int wl_adapter_init_module( void ) -{ - int result; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_adapter_init_module()" ); - DBG_ENTER( DbgInfo ); - DBG_TRACE( DbgInfo, "wl_adapter_init_module() -- PCI\n" ); - - result = pci_register_driver( &wl_driver ); //;?replace with pci_module_init, Rubini pg 490 - //;? why not do something with the result - - DBG_LEAVE( DbgInfo ); - return 0; -} // wl_adapter_init_module -/*============================================================================*/ - -/******************************************************************************* - * wl_adapter_cleanup_module() - ******************************************************************************* - * - * DESCRIPTION: - * - * Called by cleanup_module() to perform PCI-specific driver cleanup. - * - * PARAMETERS: - * - * N/A - * - * RETURNS: - * - * N/A - * - ******************************************************************************/ -void wl_adapter_cleanup_module( void ) -{ - //;?how come wl_adapter_cleanup_module is located in a seemingly pci specific module - DBG_FUNC( "wl_adapter_cleanup_module" ); - DBG_ENTER( DbgInfo ); - - //;?DBG_TRACE below feels like nearly redundant in the light of DBG_ENTER above - DBG_TRACE( DbgInfo, "wl_adapter_cleanup_module() -- PCI\n" ); - - pci_unregister_driver( &wl_driver ); - - DBG_LEAVE( DbgInfo ); - return; -} // wl_adapter_cleanup_module -/*============================================================================*/ - -/******************************************************************************* - * wl_adapter_insert() - ******************************************************************************* - * - * DESCRIPTION: - * - * Called by wl_pci_probe() to continue the process of device insertion. - * - * PARAMETERS: - * - * dev - a pointer to the device's net_device structure - * - * RETURNS: - * - * TRUE or FALSE - * - ******************************************************************************/ -int wl_adapter_insert( struct net_device *dev ) -{ - int result = FALSE; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_adapter_insert" ); - DBG_ENTER( DbgInfo ); - - DBG_TRACE( DbgInfo, "wl_adapter_insert() -- PCI\n" ); - - if( dev == NULL ) { - DBG_ERROR( DbgInfo, "net_device pointer is NULL!!!\n" ); - } else if( dev->priv == NULL ) { - DBG_ERROR( DbgInfo, "wl_private pointer is NULL!!!\n" ); - } else if( wl_insert( dev ) ) { /* Perform remaining device initialization */ - result = TRUE; - } else { - DBG_TRACE( DbgInfo, "wl_insert() FAILED\n" ); - } - DBG_LEAVE( DbgInfo ); - return result; -} // wl_adapter_insert -/*============================================================================*/ - -/******************************************************************************* - * wl_adapter_open() - ******************************************************************************* - * - * DESCRIPTION: - * - * Open the device. - * - * PARAMETERS: - * - * dev - a pointer to the device's net_device structure - * - * RETURNS: - * - * an HCF status code - * - ******************************************************************************/ -int wl_adapter_open( struct net_device *dev ) -{ - int result = 0; - int hcf_status = HCF_SUCCESS; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_adapter_open" ); - DBG_ENTER( DbgInfo ); - - DBG_TRACE( DbgInfo, "wl_adapter_open() -- PCI\n" ); - - hcf_status = wl_open( dev ); - - if( hcf_status != HCF_SUCCESS ) { - result = -ENODEV; - } - - DBG_LEAVE( DbgInfo ); - return result; -} // wl_adapter_open -/*============================================================================*/ - -/******************************************************************************* - * wl_adapter_close() - ******************************************************************************* - * - * DESCRIPTION: - * - * Close the device - * - * PARAMETERS: - * - * dev - a pointer to the device's net_device structure - * - * RETURNS: - * - * 0 - * - ******************************************************************************/ -int wl_adapter_close( struct net_device *dev ) -{ - DBG_FUNC( "wl_adapter_close" ); - DBG_ENTER( DbgInfo ); - - DBG_TRACE( DbgInfo, "wl_adapter_close() -- PCI\n" ); - DBG_TRACE( DbgInfo, "%s: Shutting down adapter.\n", dev->name ); - - wl_close( dev ); - - DBG_LEAVE( DbgInfo ); - return 0; -} // wl_adapter_close -/*============================================================================*/ - -/******************************************************************************* - * wl_adapter_is_open() - ******************************************************************************* - * - * DESCRIPTION: - * - * Check whether this device is open. Returns - * - * PARAMETERS: - * - * dev - a pointer to the device's net_device structure - * - * RETURNS: - * - * nonzero if device is open. - * - ******************************************************************************/ -int wl_adapter_is_open( struct net_device *dev ) -{ - /* This function is used in PCMCIA to check the status of the 'open' field - in the dev_link_t structure associated with a network device. There - doesn't seem to be an analog to this for PCI, and checking the status - contained in the net_device structure doesn't have the same effect. - For now, return TRUE, but find out if this is necessary for PCI. */ - - return TRUE; -} // wl_adapter_is_open -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_probe() - ******************************************************************************* - * - * DESCRIPTION: - * - * Registered in the pci_driver structure, this function is called when the - * PCI subsystem finds a new PCI device which matches the information contained - * in the pci_device_id table. - * - * PARAMETERS: - * - * pdev - a pointer to the device's pci_dev structure - * ent - this device's entry in the pci_device_id table - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -int wl_pci_probe( struct pci_dev *pdev, - const struct pci_device_id *ent ) -{ - int result; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_pci_probe" ); - DBG_ENTER( DbgInfo ); - DBG_PRINT( "%s\n", VERSION_INFO ); - - result = wl_pci_setup( pdev ); - - DBG_LEAVE( DbgInfo ); - - return result; -} // wl_pci_probe -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_remove() - ******************************************************************************* - * - * DESCRIPTION: - * - * Registered in the pci_driver structure, this function is called when the - * PCI subsystem detects that a PCI device which matches the information - * contained in the pci_device_id table has been removed. - * - * PARAMETERS: - * - * pdev - a pointer to the device's pci_dev structure - * - * RETURNS: - * - * N/A - * - ******************************************************************************/ -void wl_pci_remove(struct pci_dev *pdev) -{ - struct net_device *dev = NULL; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_pci_remove" ); - DBG_ENTER( DbgInfo ); - - /* Make sure the pci_dev pointer passed in is valid */ - if( pdev == NULL ) { - DBG_ERROR( DbgInfo, "PCI subsys passed in an invalid pci_dev pointer\n" ); - return; - } - - dev = pci_get_drvdata( pdev ); - if( dev == NULL ) { - DBG_ERROR( DbgInfo, "Could not retrieve net_device structure\n" ); - return; - } - - /* Perform device cleanup */ - wl_remove( dev ); - free_irq( dev->irq, dev ); - -#ifdef ENABLE_DMA - wl_pci_dma_free( pdev, dev->priv ); -#endif - - wl_device_dealloc( dev ); - - DBG_LEAVE( DbgInfo ); - return; -} // wl_pci_remove -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_setup() - ******************************************************************************* - * - * DESCRIPTION: - * - * Called by wl_pci_probe() to begin a device's initialization process. - * - * PARAMETERS: - * - * pdev - a pointer to the device's pci_dev structure - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -int wl_pci_setup( struct pci_dev *pdev ) -{ - int result = 0; - struct net_device *dev = NULL; - struct wl_private *lp = NULL; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_pci_setup" ); - DBG_ENTER( DbgInfo ); - - /* Make sure the pci_dev pointer passed in is valid */ - if( pdev == NULL ) { - DBG_ERROR( DbgInfo, "PCI subsys passed in an invalid pci_dev pointer\n" ); - return -ENODEV; - } - - result = pci_enable_device( pdev ); - if( result != 0 ) { - DBG_ERROR( DbgInfo, "pci_enable_device() failed\n" ); - DBG_LEAVE( DbgInfo ); - return result; - } - - /* We found our device! Let's register it with the system */ - DBG_TRACE( DbgInfo, "Found our device, now registering\n" ); - dev = wl_device_alloc( ); - if( dev == NULL ) { - DBG_ERROR( DbgInfo, "Could not register device!!!\n" ); - DBG_LEAVE( DbgInfo ); - return -ENOMEM; - } - - /* Make sure that space was allocated for our private adapter struct */ - if( dev->priv == NULL ) { - DBG_ERROR( DbgInfo, "Private adapter struct was not allocated!!!\n" ); - wl_device_dealloc(dev); - DBG_LEAVE( DbgInfo ); - return -ENOMEM; - } - -#ifdef ENABLE_DMA - /* Allocate DMA Descriptors */ - if( wl_pci_dma_alloc( pdev, dev->priv ) < 0 ) { - DBG_ERROR( DbgInfo, "Could not allocate DMA descriptor memory!!!\n" ); - wl_device_dealloc(dev); - DBG_LEAVE( DbgInfo ); - return -ENOMEM; - } -#endif - - /* Register our private adapter structure with PCI */ - pci_set_drvdata( pdev, dev ); - - /* Fill out bus specific information in the net_device struct */ - dev->irq = pdev->irq; - SET_MODULE_OWNER( dev ); - - DBG_TRACE( DbgInfo, "Device Base Address: %#03lx\n", pdev->resource[0].start ); - dev->base_addr = pdev->resource[0].start; - - /* Initialize our device here */ - if( !wl_adapter_insert( dev )) { - DBG_ERROR( DbgInfo, "wl_adapter_insert() FAILED!!!\n" ); - wl_device_dealloc( dev ); - DBG_LEAVE( DbgInfo ); - return -EINVAL; - } - - /* Register our ISR */ - DBG_TRACE( DbgInfo, "Registering ISR...\n" ); - - result = request_irq(dev->irq, wl_isr, SA_SHIRQ, dev->name, dev); - if( result ) { - DBG_WARNING( DbgInfo, "Could not register ISR!!!\n" ); - wl_remove(dev); - wl_device_dealloc(dev); - DBG_LEAVE( DbgInfo ); - return result; - } - - /* Make sure interrupts are enabled properly for CardBus */ - lp = dev->priv; - - if( lp->hcfCtx.IFB_BusType == CFG_NIC_BUS_TYPE_CARDBUS || - lp->hcfCtx.IFB_BusType == CFG_NIC_BUS_TYPE_PCI ) { - DBG_TRACE( DbgInfo, "This is a PCI/CardBus card, enable interrupts\n" ); - wl_pci_enable_cardbus_interrupts( pdev ); - } - - /* Enable bus mastering */ - pci_set_master( pdev ); - - DBG_LEAVE( DbgInfo ); - return 0; -} // wl_pci_setup -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_enable_cardbus_interrupts() - ******************************************************************************* - * - * DESCRIPTION: - * - * Called by wl_pci_setup() to enable interrupts on a CardBus device. This - * is done by writing bit 15 to the function event mask register. This - * CardBus-specific register is located in BAR2 (counting from BAR0), in memory - * space at byte offset 1f4 (7f4 for WARP). - * - * PARAMETERS: - * - * pdev - a pointer to the device's pci_dev structure - * - * RETURNS: - * - * N/A - * - ******************************************************************************/ -void wl_pci_enable_cardbus_interrupts( struct pci_dev *pdev ) -{ - u32 bar2_reg; - u32 mem_addr_bus; - u32 func_evt_mask_reg; - void *mem_addr_kern = NULL; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_pci_enable_cardbus_interrupts" ); - DBG_ENTER( DbgInfo ); - - /* Initialize to known bad values */ - bar2_reg = 0xdeadbeef; - mem_addr_bus = 0xdeadbeef; - - /* Read the BAR2 register; this register contains the base address of the - memory region where the function event mask register lives */ - pci_read_config_dword( pdev, PCI_BASE_ADDRESS_2, &bar2_reg ); - mem_addr_bus = bar2_reg & PCI_BASE_ADDRESS_MEM_MASK; - - /* Once the base address is obtained, remap the memory region to kernel - space so we can retrieve the register */ - mem_addr_kern = ioremap( mem_addr_bus, 0x200 ); - -#ifdef HERMES25 -#define REG_OFFSET 0x07F4 -#else -#define REG_OFFSET 0x01F4 -#endif // HERMES25 - -#define BIT15 0x8000 - - /* Retrieve the functional event mask register, enable interrupts by - setting Bit 15, and write back the value */ - func_evt_mask_reg = *(u32 *)( mem_addr_kern + REG_OFFSET ); - func_evt_mask_reg |= BIT15; - *(u32 *)( mem_addr_kern + REG_OFFSET ) = func_evt_mask_reg; - - /* Once complete, unmap the region and exit */ - iounmap( mem_addr_kern ); - - DBG_LEAVE( DbgInfo ); - return; -} // wl_pci_enable_cardbus_interrupts -/*============================================================================*/ - -#ifdef ENABLE_DMA -/******************************************************************************* - * wl_pci_dma_alloc() - ******************************************************************************* - * - * DESCRIPTION: - * - * Allocates all resources needed for PCI/CardBus DMA operation - * - * PARAMETERS: - * - * pdev - a pointer to the device's pci_dev structure - * lp - the device's private adapter structure - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -int wl_pci_dma_alloc( struct pci_dev *pdev, struct wl_private *lp ) -{ - int i; - int status = 0; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_pci_dma_alloc" ); - DBG_ENTER( DbgInfo ); - -// lp->dma.tx_rsc_ind = lp->dma.rx_rsc_ind = 0; -// -// /* Alloc for the Tx chain and its reclaim descriptor */ -// for( i = 0; i < NUM_TX_DESC; i++ ) { -// status = wl_pci_dma_alloc_tx_packet( pdev, lp, &lp->dma.tx_packet[i] ); -// if( status == 0 ) { -// DBG_PRINT( "lp->dma.tx_packet[%d] : 0x%p\n", i, lp->dma.tx_packet[i] ); -// DBG_PRINT( "lp->dma.tx_packet[%d]->next_desc_addr : 0x%p\n", i, lp->dma.tx_packet[i]->next_desc_addr ); -// lp->dma.tx_rsc_ind++; -// } else { -// DBG_ERROR( DbgInfo, "Could not alloc DMA Tx Packet\n" ); -// break; -// } -// } -// if( status == 0 ) { -// status = wl_pci_dma_alloc_desc( pdev, lp, &lp->dma.tx_reclaim_desc ); -// DBG_PRINT( "lp->dma.tx_reclaim_desc: 0x%p\n", lp->dma.tx_reclaim_desc ); -// } -// /* Alloc for the Rx chain and its reclaim descriptor */ -// if( status == 0 ) { -// for( i = 0; i < NUM_RX_DESC; i++ ) { -// status = wl_pci_dma_alloc_rx_packet( pdev, lp, &lp->dma.rx_packet[i] ); -// if( status == 0 ) { -// DBG_PRINT( "lp->dma.rx_packet[%d] : 0x%p\n", i, lp->dma.rx_packet[i] ); -// DBG_PRINT( "lp->dma.rx_packet[%d]->next_desc_addr : 0x%p\n", i, lp->dma.rx_packet[i]->next_desc_addr ); -// lp->dma.rx_rsc_ind++; -// } else { -// DBG_ERROR( DbgInfo, "Could not alloc DMA Rx Packet\n" ); -// break; -// } -// } -// } -// if( status == 0 ) { -// status = wl_pci_dma_alloc_desc( pdev, lp, &lp->dma.rx_reclaim_desc ); -// DBG_PRINT( "lp->dma.rx_reclaim_desc: 0x%p\n", lp->dma.rx_reclaim_desc ); -// } -// /* Store status, as host should not call HCF functions if this fails */ -// lp->dma.status = status; //;?all useages of dma.status have been commented out -// DBG_LEAVE( DbgInfo ); - return status; -} // wl_pci_dma_alloc -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_dma_free() - ******************************************************************************* - * - * DESCRIPTION: - * - * Deallocated all resources needed for PCI/CardBus DMA operation - * - * PARAMETERS: - * - * pdev - a pointer to the device's pci_dev structure - * lp - the device's private adapter structure - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -int wl_pci_dma_free( struct pci_dev *pdev, struct wl_private *lp ) -{ - int i; - int status = 0; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_pci_dma_free" ); - DBG_ENTER( DbgInfo ); - - /* Reclaim all Rx packets that were handed over to the HCF */ - /* Do I need to do this? Before this free is called, I've already disabled - the port which will call wl_pci_dma_hcf_reclaim */ - //if( lp->dma.status == 0 ) - //{ - // wl_pci_dma_hcf_reclaim( lp ); - //} - - /* Free everything needed for DMA Rx */ - for( i = 0; i < NUM_RX_DESC; i++ ) { - if( lp->dma.rx_packet[i] ) { - status = wl_pci_dma_free_rx_packet( pdev, lp, &lp->dma.rx_packet[i] ); - if( status != 0 ) { - DBG_WARNING( DbgInfo, "Problem freeing Rx packet\n" ); - } - } - } - lp->dma.rx_rsc_ind = 0; - - if( lp->dma.rx_reclaim_desc ) { - status = wl_pci_dma_free_desc( pdev, lp, &lp->dma.rx_reclaim_desc ); - if( status != 0 ) { - DBG_WARNING( DbgInfo, "Problem freeing Rx reclaim descriptor\n" ); - } - } - - /* Free everything needed for DMA Tx */ - for( i = 0; i < NUM_TX_DESC; i++ ) { - if( lp->dma.tx_packet[i] ) { - status = wl_pci_dma_free_tx_packet( pdev, lp, &lp->dma.tx_packet[i] ); - if( status != 0 ) { - DBG_WARNING( DbgInfo, "Problem freeing Tx packet\n" ); - } - } - } - lp->dma.tx_rsc_ind = 0; - - if( lp->dma.tx_reclaim_desc ) { - status = wl_pci_dma_free_desc( pdev, lp, &lp->dma.tx_reclaim_desc ); - if( status != 0 ) { - DBG_WARNING( DbgInfo, "Problem freeing Tx reclaim descriptor\n" ); - } - } - - DBG_LEAVE( DbgInfo ); - return status; -} // wl_pci_dma_free - -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_dma_alloc_tx_packet() - ******************************************************************************* - * - * DESCRIPTION: - * - * Allocates a single Tx packet, consisting of several descriptors and - * buffers. Data to transmit is first copied into the 'payload' buffer - * before being transmitted. - * - * PARAMETERS: - * - * pdev - a pointer to the device's pci_dev structure - * lp - the device's private adapter structure - * desc - a pointer which will reference the descriptor to be alloc'd. - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -int wl_pci_dma_alloc_tx_packet( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT **desc ) -{ -// int status = 0; -// /*------------------------------------------------------------------------*/ -// -// if( desc == NULL ) { -// status = -EFAULT; -// } -// if( status == 0 ) { -// status = wl_pci_dma_alloc_desc_and_buf( pdev, lp, desc, -// HCF_DMA_TX_BUF1_SIZE ); -// -// if( status == 0 ) { -// status = wl_pci_dma_alloc_desc_and_buf( pdev, lp, -// &( (*desc)->next_desc_addr ), -// HCF_MAX_PACKET_SIZE ); -// } -// } -// if( status == 0 ) { -// (*desc)->next_desc_phys_addr = (*desc)->next_desc_addr->desc_phys_addr; -// } -// return status; -} // wl_pci_dma_alloc_tx_packet -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_dma_free_tx_packet() - ******************************************************************************* - * - * DESCRIPTION: - * - * Frees a single Tx packet, described in the corresponding alloc function. - * - * PARAMETERS: - * - * pdev - a pointer to the device's pci_dev structure - * lp - the device's private adapter structure - * desc - a pointer which will reference the descriptor to be alloc'd. - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -int wl_pci_dma_free_tx_packet( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT **desc ) -{ - int status = 0; - /*------------------------------------------------------------------------*/ - - if( *desc == NULL ) { - DBG_PRINT( "Null descriptor\n" ); - status = -EFAULT; - } - //;?the "limited" NDIS strategy, assuming a frame consists ALWAYS out of 2 - //descriptors, make this robust - if( status == 0 && (*desc)->next_desc_addr ) { - status = wl_pci_dma_free_desc_and_buf( pdev, lp, &(*desc)->next_desc_addr ); - } - if( status == 0 ) { - status = wl_pci_dma_free_desc_and_buf( pdev, lp, desc ); - } - return status; -} // wl_pci_dma_free_tx_packet -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_dma_alloc_rx_packet() - ******************************************************************************* - * - * DESCRIPTION: - * - * Allocates a single Rx packet, consisting of two descriptors and one - * contiguous buffer. The buffer starts with the hermes-specific header. - * One descriptor points at the start, the other at offset 0x3a of the - * buffer. - * - * PARAMETERS: - * - * pdev - a pointer to the device's pci_dev structure - * lp - the device's private adapter structure - * desc - a pointer which will reference the descriptor to be alloc'd. - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -int wl_pci_dma_alloc_rx_packet( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT **desc ) -{ - int status = 0; - DESC_STRCT *p; - /*------------------------------------------------------------------------*/ - -// if( desc == NULL ) { -// status = -EFAULT; -// } -// //;?the "limited" NDIS strategy, assuming a frame consists ALWAYS out of 2 -// //descriptors, make this robust -// if( status == 0 ) { -// status = wl_pci_dma_alloc_desc( pdev, lp, desc ); -// } -// if( status == 0 ) { -// status = wl_pci_dma_alloc_buf( pdev, lp, *desc, HCF_MAX_PACKET_SIZE ); -// } -// if( status == 0 ) { -// status = wl_pci_dma_alloc_desc( pdev, lp, &p ); -// } -// if( status == 0 ) { -// /* Size of 1st descriptor becomes 0x3a bytes */ -// SET_BUF_SIZE( *desc, HCF_DMA_RX_BUF1_SIZE ); -// -// /* Make 2nd descriptor point at offset 0x3a of the buffer */ -// SET_BUF_SIZE( p, ( HCF_MAX_PACKET_SIZE - HCF_DMA_RX_BUF1_SIZE )); -// p->buf_addr = (*desc)->buf_addr + HCF_DMA_RX_BUF1_SIZE; -// p->buf_phys_addr = (*desc)->buf_phys_addr + HCF_DMA_RX_BUF1_SIZE; -// p->next_desc_addr = NULL; -// -// /* Chain 2nd descriptor to 1st descriptor */ -// (*desc)->next_desc_addr = p; -// (*desc)->next_desc_phys_addr = p->desc_phys_addr; -// } - - return status; -} // wl_pci_dma_alloc_rx_packet -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_dma_free_rx_packet() - ******************************************************************************* - * - * DESCRIPTION: - * - * Frees a single Rx packet, described in the corresponding alloc function. - * - * PARAMETERS: - * - * pdev - a pointer to the device's pci_dev structure - * lp - the device's private adapter structure - * desc - a pointer which will reference the descriptor to be alloc'd. - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -int wl_pci_dma_free_rx_packet( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT **desc ) -{ - int status = 0; - DESC_STRCT *p; - /*------------------------------------------------------------------------*/ - - if( *desc == NULL ) { - status = -EFAULT; - } - if( status == 0 ) { - p = (*desc)->next_desc_addr; - - /* Free the 2nd descriptor */ - if( p != NULL ) { - p->buf_addr = NULL; - p->buf_phys_addr = 0; - - status = wl_pci_dma_free_desc( pdev, lp, &p ); - } - } - - /* Free the buffer and 1st descriptor */ - if( status == 0 ) { - SET_BUF_SIZE( *desc, HCF_MAX_PACKET_SIZE ); - status = wl_pci_dma_free_desc_and_buf( pdev, lp, desc ); - } - return status; -} // wl_pci_dma_free_rx_packet -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_dma_alloc_desc_and_buf() - ******************************************************************************* - * - * DESCRIPTION: - * - * Allocates a DMA descriptor and buffer, and associates them with one - * another. - * - * PARAMETERS: - * - * pdev - a pointer to the device's pci_dev structure - * lp - the device's private adapter structure - * desc - a pointer which will reference the descriptor to be alloc'd - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -int wl_pci_dma_alloc_desc_and_buf( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT **desc, int size ) -{ - int status = 0; - /*------------------------------------------------------------------------*/ - -// if( desc == NULL ) { -// status = -EFAULT; -// } -// if( status == 0 ) { -// status = wl_pci_dma_alloc_desc( pdev, lp, desc ); -// -// if( status == 0 ) { -// status = wl_pci_dma_alloc_buf( pdev, lp, *desc, size ); -// } -// } - return status; -} // wl_pci_dma_alloc_desc_and_buf -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_dma_free_desc_and_buf() - ******************************************************************************* - * - * DESCRIPTION: - * - * Frees a DMA descriptor and associated buffer. - * - * PARAMETERS: - * - * pdev - a pointer to the device's pci_dev structure - * lp - the device's private adapter structure - * desc - a pointer which will reference the descriptor to be alloc'd - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -int wl_pci_dma_free_desc_and_buf( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT **desc ) -{ - int status = 0; - /*------------------------------------------------------------------------*/ - - if( desc == NULL ) { - status = -EFAULT; - } - if( status == 0 && *desc == NULL ) { - status = -EFAULT; - } - if( status == 0 ) { - status = wl_pci_dma_free_buf( pdev, lp, *desc ); - - if( status == 0 ) { - status = wl_pci_dma_free_desc( pdev, lp, desc ); - } - } - return status; -} // wl_pci_dma_free_desc_and_buf -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_dma_alloc_desc() - ******************************************************************************* - * - * DESCRIPTION: - * - * Allocates one DMA descriptor in cache coherent memory. - * - * PARAMETERS: - * - * pdev - a pointer to the device's pci_dev structure - * lp - the device's private adapter structure - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -int wl_pci_dma_alloc_desc( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT **desc ) -{ -// int status = 0; -// dma_addr_t pa; -// /*------------------------------------------------------------------------*/ -// -// DBG_FUNC( "wl_pci_dma_alloc_desc" ); -// DBG_ENTER( DbgInfo ); -// -// if( desc == NULL ) { -// status = -EFAULT; -// } -// if( status == 0 ) { -// *desc = pci_alloc_consistent( pdev, sizeof( DESC_STRCT ), &pa ); -// } -// if( *desc == NULL ) { -// DBG_ERROR( DbgInfo, "pci_alloc_consistent() failed\n" ); -// status = -ENOMEM; -// } else { -// memset( *desc, 0, sizeof( DESC_STRCT )); -// (*desc)->desc_phys_addr = cpu_to_le32( pa ); -// } -// DBG_LEAVE( DbgInfo ); -// return status; -} // wl_pci_dma_alloc_desc -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_dma_free_desc() - ******************************************************************************* - * - * DESCRIPTION: - * - * Frees one DMA descriptor in cache coherent memory. - * - * PARAMETERS: - * - * pdev - a pointer to the device's pci_dev structure - * lp - the device's private adapter structure - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -int wl_pci_dma_free_desc( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT **desc ) -{ - int status = 0; - /*------------------------------------------------------------------------*/ - - if( *desc == NULL ) { - status = -EFAULT; - } - if( status == 0 ) { - pci_free_consistent( pdev, sizeof( DESC_STRCT ), *desc, - (*desc)->desc_phys_addr ); - } - *desc = NULL; - return status; -} // wl_pci_dma_free_desc -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_dma_alloc_buf() - ******************************************************************************* - * - * DESCRIPTION: - * - * Allocates one DMA buffer in cache coherent memory, and associates a DMA - * descriptor with this buffer. - * - * PARAMETERS: - * - * pdev - a pointer to the device's pci_dev structure - * lp - the device's private adapter structure - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -int wl_pci_dma_alloc_buf( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT *desc, int size ) -{ - int status = 0; - dma_addr_t pa; - /*------------------------------------------------------------------------*/ - -// DBG_FUNC( "wl_pci_dma_alloc_buf" ); -// DBG_ENTER( DbgInfo ); -// -// if( desc == NULL ) { -// status = -EFAULT; -// } -// if( status == 0 && desc->buf_addr != NULL ) { -// status = -EFAULT; -// } -// if( status == 0 ) { -// desc->buf_addr = pci_alloc_consistent( pdev, size, &pa ); -// } -// if( desc->buf_addr == NULL ) { -// DBG_ERROR( DbgInfo, "pci_alloc_consistent() failed\n" ); -// status = -ENOMEM; -// } else { -// desc->buf_phys_addr = cpu_to_le32( pa ); -// SET_BUF_SIZE( desc, size ); -// } -// DBG_LEAVE( DbgInfo ); - return status; -} // wl_pci_dma_alloc_buf -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_dma_free_buf() - ******************************************************************************* - * - * DESCRIPTION: - * - * Allocates one DMA buffer in cache coherent memory, and associates a DMA - * descriptor with this buffer. - * - * PARAMETERS: - * - * pdev - a pointer to the device's pci_dev structure - * lp - the device's private adapter structure - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -int wl_pci_dma_free_buf( struct pci_dev *pdev, struct wl_private *lp, - DESC_STRCT *desc ) -{ - int status = 0; - /*------------------------------------------------------------------------*/ - - if( desc == NULL ) { - status = -EFAULT; - } - if( status == 0 && desc->buf_addr == NULL ) { - status = -EFAULT; - } - if( status == 0 ) { - pci_free_consistent( pdev, GET_BUF_SIZE( desc ), desc->buf_addr, - desc->buf_phys_addr ); - - desc->buf_addr = 0; - desc->buf_phys_addr = 0; - SET_BUF_SIZE( desc, 0 ); - } - return status; -} // wl_pci_dma_free_buf -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_dma_hcf_supply() - ******************************************************************************* - * - * DESCRIPTION: - * - * Supply HCF with DMA-related resources. These consist of: - * - buffers and descriptors for receive purposes - * - one 'reclaim' descriptor for the transmit path, used to fulfill a - * certain H25 DMA engine requirement - * - one 'reclaim' descriptor for the receive path, used to fulfill a - * certain H25 DMA engine requirement - * - * This function is called at start-of-day or at re-initialization. - * - * PARAMETERS: - * - * lp - the device's private adapter structure - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -void wl_pci_dma_hcf_supply( struct wl_private *lp ) -{ - int i; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_pci_dma_hcf_supply" ); - DBG_ENTER( DbgInfo ); - - //if( lp->dma.status == 0 ); - //{ - /* Hand over the Rx/Tx reclaim descriptors to the HCF */ - if( lp->dma.tx_reclaim_desc ) { - DBG_PRINT( "lp->dma.tx_reclaim_desc: 0x%p\n", lp->dma.tx_reclaim_desc ); - hcf_dma_tx_put( &lp->hcfCtx, lp->dma.tx_reclaim_desc, 0 ); - lp->dma.tx_reclaim_desc = NULL; - DBG_PRINT( "lp->dma.tx_reclaim_desc: 0x%p\n", lp->dma.tx_reclaim_desc ); - } - if( lp->dma.rx_reclaim_desc ) { - DBG_PRINT( "lp->dma.rx_reclaim_desc: 0x%p\n", lp->dma.rx_reclaim_desc ); - hcf_dma_rx_put( &lp->hcfCtx, lp->dma.rx_reclaim_desc ); - lp->dma.rx_reclaim_desc = NULL; - DBG_PRINT( "lp->dma.rx_reclaim_desc: 0x%p\n", lp->dma.rx_reclaim_desc ); - } - /* Hand over the Rx descriptor chain to the HCF */ - for( i = 0; i < NUM_RX_DESC; i++ ) { - DBG_PRINT( "lp->dma.rx_packet[%d]: 0x%p\n", i, lp->dma.rx_packet[i] ); - hcf_dma_rx_put( &lp->hcfCtx, lp->dma.rx_packet[i] ); - lp->dma.rx_packet[i] = NULL; - DBG_PRINT( "lp->dma.rx_packet[%d]: 0x%p\n", i, lp->dma.rx_packet[i] ); - } - //} - - DBG_LEAVE( DbgInfo ); - return; -} // wl_pci_dma_hcf_supply -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_dma_hcf_reclaim() - ******************************************************************************* - * - * DESCRIPTION: - * - * Return DMA-related resources from the HCF. These consist of: - * - buffers and descriptors for receive purposes - * - buffers and descriptors for transmit purposes - * - one 'reclaim' descriptor for the transmit path, used to fulfill a - * certain H25 DMA engine requirement - * - one 'reclaim' descriptor for the receive path, used to fulfill a - * certain H25 DMA engine requirement - * - * This function is called at end-of-day or at re-initialization. - * - * PARAMETERS: - * - * lp - the device's private adapter structure - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -void wl_pci_dma_hcf_reclaim( struct wl_private *lp ) -{ - int i; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_pci_dma_hcf_reclaim" ); - DBG_ENTER( DbgInfo ); - - wl_pci_dma_hcf_reclaim_rx( lp ); - for( i = 0; i < NUM_RX_DESC; i++ ) { - DBG_PRINT( "rx_packet[%d] 0x%p\n", i, lp->dma.rx_packet[i] ); -// if( lp->dma.rx_packet[i] == NULL ) { -// DBG_PRINT( "wl_pci_dma_hcf_reclaim: rx_packet[%d] NULL\n", i ); -// } - } - - wl_pci_dma_hcf_reclaim_tx( lp ); - for( i = 0; i < NUM_TX_DESC; i++ ) { - DBG_PRINT( "tx_packet[%d] 0x%p\n", i, lp->dma.tx_packet[i] ); -// if( lp->dma.tx_packet[i] == NULL ) { -// DBG_PRINT( "wl_pci_dma_hcf_reclaim: tx_packet[%d] NULL\n", i ); -// } - } - - DBG_LEAVE( DbgInfo ); - return; -} // wl_pci_dma_hcf_reclaim -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_dma_hcf_reclaim_rx() - ******************************************************************************* - * - * DESCRIPTION: - * - * Reclaim Rx packets that have already been processed by the HCF. - * - * PARAMETERS: - * - * lp - the device's private adapter structure - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -void wl_pci_dma_hcf_reclaim_rx( struct wl_private *lp ) -{ - int i; - DESC_STRCT *p; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_pci_dma_hcf_reclaim_rx" ); - DBG_ENTER( DbgInfo ); - - //if( lp->dma.status == 0 ) - //{ - while ( ( p = hcf_dma_rx_get( &lp->hcfCtx ) ) != NULL ) { - if( p && p->buf_addr == NULL ) { - /* A reclaim descriptor is being given back by the HCF. Reclaim - descriptors have a NULL buf_addr */ - lp->dma.rx_reclaim_desc = p; - DBG_PRINT( "reclaim_descriptor: 0x%p\n", p ); - continue; - } - for( i = 0; i < NUM_RX_DESC; i++ ) { - if( lp->dma.rx_packet[i] == NULL ) { - break; - } - } - /* An Rx buffer descriptor is being given back by the HCF */ - lp->dma.rx_packet[i] = p; - lp->dma.rx_rsc_ind++; - DBG_PRINT( "rx_packet[%d] 0x%p\n", i, lp->dma.rx_packet[i] ); - } - //} - DBG_LEAVE( DbgInfo ); -} // wl_pci_dma_hcf_reclaim_rx -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_dma_get_tx_packet() - ******************************************************************************* - * - * DESCRIPTION: - * - * Obtains a Tx descriptor from the chain to use for Tx. - * - * PARAMETERS: - * - * lp - a pointer to the device's wl_private structure. - * - * RETURNS: - * - * A pointer to the retrieved descriptor - * - ******************************************************************************/ -DESC_STRCT * wl_pci_dma_get_tx_packet( struct wl_private *lp ) -{ - int i; - DESC_STRCT *desc = NULL; - /*------------------------------------------------------------------------*/ - - for( i = 0; i < NUM_TX_DESC; i++ ) { - if( lp->dma.tx_packet[i] ) { - break; - } - } - - if( i != NUM_TX_DESC ) { - desc = lp->dma.tx_packet[i]; - - lp->dma.tx_packet[i] = NULL; - lp->dma.tx_rsc_ind--; - - memset( desc->buf_addr, 0, HCF_DMA_TX_BUF1_SIZE ); - } - - return desc; -} // wl_pci_dma_get_tx_packet -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_dma_put_tx_packet() - ******************************************************************************* - * - * DESCRIPTION: - * - * Returns a Tx descriptor to the chain. - * - * PARAMETERS: - * - * lp - a pointer to the device's wl_private structure. - * desc - a pointer to the descriptor to return. - * - * RETURNS: - * - * N/A - * - ******************************************************************************/ -void wl_pci_dma_put_tx_packet( struct wl_private *lp, DESC_STRCT *desc ) -{ - int i; - /*------------------------------------------------------------------------*/ - - for( i = 0; i < NUM_TX_DESC; i++ ) { - if( lp->dma.tx_packet[i] == NULL ) { - break; - } - } - - if( i != NUM_TX_DESC ) { - lp->dma.tx_packet[i] = desc; - lp->dma.tx_rsc_ind++; - } -} // wl_pci_dma_put_tx_packet -/*============================================================================*/ - -/******************************************************************************* - * wl_pci_dma_hcf_reclaim_tx() - ******************************************************************************* - * - * DESCRIPTION: - * - * Reclaim Tx packets that have either been processed by the HCF due to a - * port disable or a Tx completion. - * - * PARAMETERS: - * - * lp - the device's private adapter structure - * - * RETURNS: - * - * 0 on success - * errno value otherwise - * - ******************************************************************************/ -void wl_pci_dma_hcf_reclaim_tx( struct wl_private *lp ) -{ - int i; - DESC_STRCT *p; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_pci_dma_hcf_reclaim_tx" ); - DBG_ENTER( DbgInfo ); - - //if( lp->dma.status == 0 ) - //{ - while ( ( p = hcf_dma_tx_get( &lp->hcfCtx ) ) != NULL ) { - - if( p != NULL && p->buf_addr == NULL ) { - /* A Reclaim descriptor is being given back by the HCF. Reclaim - descriptors have a NULL buf_addr */ - lp->dma.tx_reclaim_desc = p; - DBG_PRINT( "reclaim_descriptor: 0x%p\n", p ); - continue; - } - for( i = 0; i < NUM_TX_DESC; i++ ) { - if( lp->dma.tx_packet[i] == NULL ) { - break; - } - } - /* An Rx buffer descriptor is being given back by the HCF */ - lp->dma.tx_packet[i] = p; - lp->dma.tx_rsc_ind++; - DBG_PRINT( "tx_packet[%d] 0x%p\n", i, lp->dma.tx_packet[i] ); - } - //} - - if( lp->netif_queue_on == FALSE ) { - netif_wake_queue( lp->dev ); - WL_WDS_NETIF_WAKE_QUEUE( lp ); - lp->netif_queue_on = TRUE; - } - DBG_LEAVE( DbgInfo ); - return; -} // wl_pci_dma_hcf_reclaim_tx -/*============================================================================*/ -#endif // ENABLE_DMA diff --git a/drivers/staging/wlags49_h2/wl_pci.h b/drivers/staging/wlags49_h2/wl_pci.h deleted file mode 100644 index 86831f1b4de2..000000000000 --- a/drivers/staging/wlags49_h2/wl_pci.h +++ /dev/null @@ -1,109 +0,0 @@ -/******************************************************************************* - * Agere Systems Inc. - * Wireless device driver for Linux (wlags49). - * - * Copyright (c) 1998-2003 Agere Systems Inc. - * All rights reserved. - * http://www.agere.com - * - * Initially developed by TriplePoint, Inc. - * http://www.triplepoint.com - * - *------------------------------------------------------------------------------ - * - * Header describing information required for the driver to support PCI. - * - *------------------------------------------------------------------------------ - * - * SOFTWARE LICENSE - * - * This software is provided subject to the following terms and conditions, - * which you should read carefully before using the software. Using this - * 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. - * All rights reserved. - * - * Redistribution and use in source or binary forms, with or without - * modifications, are permitted provided that the following conditions are met: - * - * . Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following Disclaimer as comments in the code as - * well as in the documentation and/or other materials provided with the - * distribution. - * - * . Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following Disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * . Neither the name of Agere Systems Inc. nor the names of the contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * Disclaimer - * - * 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 - * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - ******************************************************************************/ - -#ifndef __WL_PCI_H__ -#define __WL_PCI_H__ - - - - -/******************************************************************************* - * constant definitions - ******************************************************************************/ -#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 */ - - - - -/******************************************************************************* - * function prototypes - ******************************************************************************/ -int wl_adapter_init_module( void ); - -void wl_adapter_cleanup_module( void ); - -int wl_adapter_insert( struct net_device *dev ); - -int wl_adapter_open( struct net_device *dev ); - -int wl_adapter_close( struct net_device *dev ); - -int wl_adapter_is_open( struct net_device *dev ); - - -#ifdef ENABLE_DMA - -void wl_pci_dma_hcf_supply( struct wl_private *lp ); - -void wl_pci_dma_hcf_reclaim( struct wl_private *lp ); - -DESC_STRCT * wl_pci_dma_get_tx_packet( struct wl_private *lp ); - -void wl_pci_dma_put_tx_packet( struct wl_private *lp, DESC_STRCT *desc ); - -void wl_pci_dma_hcf_reclaim_tx( struct wl_private *lp ); - -#endif // ENABLE_DMA - - -#endif // __WL_PCI_H__ diff --git a/drivers/staging/wlags49_h2/wl_priv.c b/drivers/staging/wlags49_h2/wl_priv.c index 7e10dcdc3090..41f332499d42 100644 --- a/drivers/staging/wlags49_h2/wl_priv.c +++ b/drivers/staging/wlags49_h2/wl_priv.c @@ -94,16 +94,6 @@ int cfg_driver_info(struct uilreq *urq, struct wl_private *lp); int cfg_driver_identity(struct uilreq *urq, struct wl_private *lp); -/******************************************************************************* - * global variables - ******************************************************************************/ -#if DBG -extern dbg_info_t *DbgInfo; -#endif /* DBG */ - - - - /* If USE_UIL is not defined, then none of the UIL Interface code below will be included in the build */ #ifdef USE_UIL @@ -130,10 +120,6 @@ extern dbg_info_t *DbgInfo; int wvlan_uil(struct uilreq *urq, struct wl_private *lp) { int ioctl_ret = 0; - /*------------------------------------------------------------------------*/ - - DBG_FUNC("wvlan_uil"); - DBG_ENTER(DbgInfo); switch (urq->command) { case UIL_FUN_CONNECT: @@ -165,7 +151,6 @@ int wvlan_uil(struct uilreq *urq, struct wl_private *lp) ioctl_ret = -EOPNOTSUPP; break; } - DBG_LEAVE(DbgInfo); return ioctl_ret; } /* wvlan_uil */ /*============================================================================*/ @@ -195,12 +180,6 @@ int wvlan_uil(struct uilreq *urq, struct wl_private *lp) int wvlan_uil_connect(struct uilreq *urq, struct wl_private *lp) { int result = 0; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC("wvlan_uil_connect"); - DBG_ENTER(DbgInfo); - if (!(lp->flags & WVLAN2_UIL_CONNECTED)) { lp->flags |= WVLAN2_UIL_CONNECTED; @@ -211,7 +190,6 @@ int wvlan_uil_connect(struct uilreq *urq, struct wl_private *lp) urq->result = UIL_ERR_IN_USE; } - DBG_LEAVE(DbgInfo); return result; } /* wvlan_uil_connect */ /*============================================================================*/ @@ -241,12 +219,6 @@ int wvlan_uil_connect(struct uilreq *urq, struct wl_private *lp) int wvlan_uil_disconnect(struct uilreq *urq, struct wl_private *lp) { int result = 0; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC("wvlan_uil_disconnect"); - DBG_ENTER(DbgInfo); - if (urq->hcfCtx == &(lp->hcfCtx)) { if (lp->flags & WVLAN2_UIL_CONNECTED) { @@ -266,7 +238,6 @@ int wvlan_uil_disconnect(struct uilreq *urq, struct wl_private *lp) urq->result = UIL_ERR_WRONG_IFB; } - DBG_LEAVE(DbgInfo); return result; } /* wvlan_uil_disconnect */ /*============================================================================*/ @@ -297,12 +268,6 @@ int wvlan_uil_action(struct uilreq *urq, struct wl_private *lp) { int result = 0; ltv_t *ltv; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC("wvlan_uil_action"); - DBG_ENTER(DbgInfo); - if (urq->hcfCtx == &(lp->hcfCtx)) { /* Make sure there's an LTV in the request buffer */ @@ -344,7 +309,6 @@ int wvlan_uil_action(struct uilreq *urq, struct wl_private *lp) urq->result = UIL_ERR_WRONG_IFB; } - DBG_LEAVE(DbgInfo); return result; } /* wvlan_uil_action */ /*============================================================================*/ @@ -376,11 +340,6 @@ int wvlan_uil_action(struct uilreq *urq, struct wl_private *lp) int wvlan_uil_block(struct uilreq *urq, struct wl_private *lp) { int result = 0; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC("wvlan_uil_block"); - DBG_ENTER(DbgInfo); if (urq->hcfCtx == &(lp->hcfCtx)) { if (capable(CAP_NET_ADMIN)) { @@ -398,7 +357,6 @@ int wvlan_uil_block(struct uilreq *urq, struct wl_private *lp) urq->result = UIL_ERR_WRONG_IFB; } - DBG_LEAVE(DbgInfo); return result; } /* wvlan_uil_block */ /*============================================================================*/ @@ -428,11 +386,6 @@ int wvlan_uil_block(struct uilreq *urq, struct wl_private *lp) int wvlan_uil_unblock(struct uilreq *urq, struct wl_private *lp) { int result = 0; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC("wvlan_uil_unblock"); - DBG_ENTER(DbgInfo); if (urq->hcfCtx == &(lp->hcfCtx)) { if (capable(CAP_NET_ADMIN)) { @@ -451,7 +404,6 @@ int wvlan_uil_unblock(struct uilreq *urq, struct wl_private *lp) urq->result = UIL_ERR_WRONG_IFB; } - DBG_LEAVE(DbgInfo); return result; } /* wvlan_uil_unblock */ /*============================================================================*/ @@ -482,11 +434,6 @@ int wvlan_uil_send_diag_msg(struct uilreq *urq, struct wl_private *lp) { int result = 0; DESC_STRCT Descp[1]; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC("wvlan_uil_send_diag_msg"); - DBG_ENTER(DbgInfo); if (urq->hcfCtx == &(lp->hcfCtx)) { if (capable(CAP_NET_ADMIN)) { @@ -499,7 +446,6 @@ int wvlan_uil_send_diag_msg(struct uilreq *urq, struct wl_private *lp) if (result != 0) { DBG_ERROR(DbgInfo, "verify_area failed, result: %d\n", result); urq->result = UIL_FAILURE; - DBG_LEAVE(DbgInfo); return result; } @@ -518,7 +464,6 @@ int wvlan_uil_send_diag_msg(struct uilreq *urq, struct wl_private *lp) DBG_ERROR(DbgInfo, "ENOMEM\n"); urq->result = UIL_FAILURE; result = -ENOMEM; - DBG_LEAVE(DbgInfo); return result; } @@ -539,7 +484,6 @@ int wvlan_uil_send_diag_msg(struct uilreq *urq, struct wl_private *lp) urq->result = UIL_ERR_WRONG_IFB; } - DBG_LEAVE(DbgInfo); return result; } /* wvlan_uil_send_diag_msg */ /*============================================================================*/ @@ -575,10 +519,6 @@ int wvlan_uil_put_info(struct uilreq *urq, struct wl_private *lp) #ifdef USE_WDS hcf_16 hcfPort = HCF_PORT_0; #endif /* USE_WDS */ - /*------------------------------------------------------------------------*/ - DBG_FUNC("wvlan_uil_put_info"); - DBG_ENTER(DbgInfo); - if (urq->hcfCtx == &(lp->hcfCtx)) { if (capable(CAP_NET_ADMIN)) { @@ -589,7 +529,6 @@ int wvlan_uil_put_info(struct uilreq *urq, struct wl_private *lp) urq->result = UIL_ERR_LEN; DBG_ERROR(DbgInfo, "No Length/Type in LTV!!!\n"); DBG_ERROR(DbgInfo, "UIL_ERR_LEN\n"); - DBG_LEAVE(DbgInfo); return result; } @@ -598,7 +537,6 @@ int wvlan_uil_put_info(struct uilreq *urq, struct wl_private *lp) if (result != 0) { urq->result = UIL_FAILURE; DBG_ERROR(DbgInfo, "verify_area(), VERIFY_READ FAILED\n"); - DBG_LEAVE(DbgInfo); return result; } @@ -611,7 +549,6 @@ int wvlan_uil_put_info(struct uilreq *urq, struct wl_private *lp) urq->len = sizeof(lp->ltvRecord); urq->result = UIL_ERR_LEN; DBG_ERROR(DbgInfo, "UIL_ERR_LEN\n"); - DBG_LEAVE(DbgInfo); return result; } @@ -627,7 +564,6 @@ int wvlan_uil_put_info(struct uilreq *urq, struct wl_private *lp) urq->len = sizeof(lp->ltvRecord); urq->result = UIL_ERR_LEN; result = -ENOMEM; - DBG_LEAVE(DbgInfo); return result; } } else { @@ -1161,7 +1097,6 @@ int wvlan_uil_put_info(struct uilreq *urq, struct wl_private *lp) urq->result = UIL_ERR_WRONG_IFB; } - DBG_LEAVE(DbgInfo); return result; } /* wvlan_uil_put_info */ @@ -1191,10 +1126,6 @@ int wvlan_uil_get_info(struct uilreq *urq, struct wl_private *lp) { int result = 0; int i; - /*------------------------------------------------------------------------*/ - - DBG_FUNC("wvlan_uil_get_info"); - DBG_ENTER(DbgInfo); if (urq->hcfCtx == &(lp->hcfCtx)) { if ((urq->data != NULL) && (urq->len != 0)) { @@ -1207,7 +1138,6 @@ int wvlan_uil_get_info(struct uilreq *urq, struct wl_private *lp) DBG_ERROR(DbgInfo, "No Length/Type in LTV!!!\n"); DBG_ERROR(DbgInfo, "UIL_ERR_LEN\n"); urq->result = UIL_ERR_LEN; - DBG_LEAVE(DbgInfo); return result; } @@ -1216,7 +1146,6 @@ int wvlan_uil_get_info(struct uilreq *urq, struct wl_private *lp) if (result != 0) { DBG_ERROR(DbgInfo, "verify_area(), VERIFY_READ FAILED\n"); urq->result = UIL_FAILURE; - DBG_LEAVE(DbgInfo); return result; } @@ -1229,7 +1158,6 @@ int wvlan_uil_get_info(struct uilreq *urq, struct wl_private *lp) DBG_ERROR(DbgInfo, "Incoming LTV too big\n"); urq->len = sizeof(lp->ltvRecord); urq->result = UIL_ERR_LEN; - DBG_LEAVE(DbgInfo); return result; } @@ -1513,7 +1441,6 @@ int wvlan_uil_get_info(struct uilreq *urq, struct wl_private *lp) urq->result = UIL_ERR_WRONG_IFB; } - DBG_LEAVE(DbgInfo); return result; } /* wvlan_uil_get_info */ /*============================================================================*/ @@ -1544,18 +1471,11 @@ int wvlan_uil_get_info(struct uilreq *urq, struct wl_private *lp) int cfg_driver_info(struct uilreq *urq, struct wl_private *lp) { int result = 0; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC("cfg_driver_info"); - DBG_ENTER(DbgInfo); - /* Make sure that user buffer can handle the driver information buffer */ if (urq->len < sizeof(lp->driverInfo)) { urq->len = sizeof(lp->driverInfo); urq->result = UIL_ERR_LEN; - DBG_LEAVE(DbgInfo); return result; } @@ -1563,7 +1483,6 @@ int cfg_driver_info(struct uilreq *urq, struct wl_private *lp) result = verify_area(VERIFY_WRITE, urq->data, sizeof(lp->driverInfo)); if (result != 0) { urq->result = UIL_FAILURE; - DBG_LEAVE(DbgInfo); return result; } @@ -1573,7 +1492,6 @@ int cfg_driver_info(struct uilreq *urq, struct wl_private *lp) urq->result = UIL_SUCCESS; copy_to_user(urq->data, &(lp->driverInfo), sizeof(lp->driverInfo)); - DBG_LEAVE(DbgInfo); return result; } /* cfg_driver_info */ /*============================================================================*/ @@ -1603,18 +1521,11 @@ int cfg_driver_info(struct uilreq *urq, struct wl_private *lp) int cfg_driver_identity(struct uilreq *urq, struct wl_private *lp) { int result = 0; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC("wvlan_driver_identity"); - DBG_ENTER(DbgInfo); - /* Make sure that user buffer can handle the driver identity structure. */ if (urq->len < sizeof(lp->driverIdentity)) { urq->len = sizeof(lp->driverIdentity); urq->result = UIL_ERR_LEN; - DBG_LEAVE(DbgInfo); return result; } @@ -1622,7 +1533,6 @@ int cfg_driver_identity(struct uilreq *urq, struct wl_private *lp) result = verify_area(VERIFY_WRITE, urq->data, sizeof(lp->driverIdentity)); if (result != 0) { urq->result = UIL_FAILURE; - DBG_LEAVE(DbgInfo); return result; } @@ -1630,7 +1540,6 @@ int cfg_driver_identity(struct uilreq *urq, struct wl_private *lp) urq->result = UIL_SUCCESS; copy_to_user(urq->data, &(lp->driverIdentity), sizeof(lp->driverIdentity)); - DBG_LEAVE(DbgInfo); return result; } /* cfg_driver_identity */ /*============================================================================*/ @@ -1672,11 +1581,6 @@ int wvlan_set_netname(struct net_device *dev, struct wl_private *lp = wl_priv(dev); unsigned long flags; int ret = 0; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC("wvlan_set_netname"); - DBG_ENTER(DbgInfo); wl_lock(lp, &flags); @@ -1687,7 +1591,6 @@ int wvlan_set_netname(struct net_device *dev, wl_apply(lp); wl_unlock(lp, &flags); - DBG_LEAVE(DbgInfo); return ret; } /* wvlan_set_netname */ /*============================================================================*/ @@ -1724,11 +1627,6 @@ int wvlan_get_netname(struct net_device *dev, int ret = 0; int status = -1; wvName_t *pName; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC("wvlan_get_netname"); - DBG_ENTER(DbgInfo); wl_lock(lp, &flags); @@ -1751,7 +1649,6 @@ int wvlan_get_netname(struct net_device *dev, wl_unlock(lp, &flags); - DBG_LEAVE(DbgInfo); return ret; } /* wvlan_get_netname */ /*============================================================================*/ @@ -1787,11 +1684,6 @@ int wvlan_set_station_nickname(struct net_device *dev, unsigned long flags; size_t len; int ret = 0; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC("wvlan_set_station_nickname"); - DBG_ENTER(DbgInfo); wl_lock(lp, &flags); @@ -1803,7 +1695,6 @@ int wvlan_set_station_nickname(struct net_device *dev, wl_apply(lp); wl_unlock(lp, &flags); - DBG_LEAVE(DbgInfo); return ret; } /* wvlan_set_station_nickname */ /*============================================================================*/ @@ -1840,11 +1731,6 @@ int wvlan_get_station_nickname(struct net_device *dev, int ret = 0; int status = -1; wvName_t *pName; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC("wvlan_get_station_nickname"); - DBG_ENTER(DbgInfo); wl_lock(lp, &flags); @@ -1867,7 +1753,6 @@ int wvlan_get_station_nickname(struct net_device *dev, wl_unlock(lp, &flags); /* out: */ - DBG_LEAVE(DbgInfo); return ret; } /* wvlan_get_station_nickname */ /*============================================================================*/ @@ -1903,11 +1788,6 @@ int wvlan_set_porttype(struct net_device *dev, unsigned long flags; int ret = 0; hcf_16 portType; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC("wvlan_set_porttype"); - DBG_ENTER(DbgInfo); wl_lock(lp, &flags); @@ -1928,7 +1808,6 @@ out_unlock: wl_unlock(lp, &flags); /* out: */ - DBG_LEAVE(DbgInfo); return ret; } @@ -1965,11 +1844,6 @@ int wvlan_get_porttype(struct net_device *dev, int status = -1; hcf_16 *pPortType; __u32 *pData = (__u32 *)extra; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC("wvlan_get_porttype"); - DBG_ENTER(DbgInfo); wl_lock(lp, &flags); @@ -1990,7 +1864,6 @@ int wvlan_get_porttype(struct net_device *dev, wl_unlock(lp, &flags); /* out: */ - DBG_LEAVE(DbgInfo); return ret; } /* wvlan_get_porttype */ /*============================================================================*/ @@ -2023,12 +1896,6 @@ int wvlan_get_porttype(struct net_device *dev, int wvlan_rts(struct rtsreq *rrq, __u32 io_base) { int ioctl_ret = 0; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC("wvlan_rts"); - DBG_ENTER(DbgInfo); - DBG_PRINT("io_base: 0x%08x\n", io_base); @@ -2060,7 +1927,6 @@ int wvlan_rts(struct rtsreq *rrq, __u32 io_base) break; } - DBG_LEAVE(DbgInfo); return ioctl_ret; } /* wvlan_rts */ /*============================================================================*/ diff --git a/drivers/staging/wlags49_h2/wl_profile.c b/drivers/staging/wlags49_h2/wl_profile.c index beabf5916df7..28cc5765e5c1 100644 --- a/drivers/staging/wlags49_h2/wl_profile.c +++ b/drivers/staging/wlags49_h2/wl_profile.c @@ -101,16 +101,11 @@ #include <wl_profile.h> -/******************************************************************************* - * global variables - ******************************************************************************/ - /* Definition needed to prevent unresolved external in unistd.h */ static int errno; #if DBG extern p_u32 DebugFlag; -extern dbg_info_t *DbgInfo; #endif int parse_yes_no(char *value); @@ -163,10 +158,6 @@ void parse_config(struct net_device *dev) mm_segment_t fs; struct wl_private *wvlan_config = NULL; ENCSTRCT sEncryption; - /*------------------------------------------------------------------------*/ - - DBG_FUNC("parse_config"); - DBG_ENTER(DbgInfo); /* Get the wavelan specific info for this device */ wvlan_config = dev->priv; @@ -272,7 +263,6 @@ void parse_config(struct net_device *dev) set_fs(fs); /* Return to the original context */ #endif /* BIN_DL */ - DBG_LEAVE(DbgInfo); return; } /* parse_config */ @@ -354,8 +344,6 @@ void translate_option(char *buffer, struct wl_private *lp) u_char mac_value[ETH_ALEN]; /*------------------------------------------------------------------------*/ - DBG_FUNC("translate_option"); - if (buffer == NULL || lp == NULL) { DBG_ERROR(DbgInfo, "Config file buffer and/or wavelan buffer ptr NULL\n"); return; @@ -959,10 +947,6 @@ void ParseConfigLine(char *pszLine, char **ppszLVal, char **ppszRVal) { int i; int size; - /*------------------------------------------------------------------------*/ - - DBG_FUNC("ParseConfigLine"); - DBG_ENTER(DbgInfo); /* get a snapshot of our string size */ size = strlen(pszLine); @@ -1005,7 +989,6 @@ void ParseConfigLine(char *pszLine, char **ppszLVal, char **ppszRVal) pszLine[i] = '\0'; } } - DBG_LEAVE(DbgInfo); } /* ParseConfigLine */ /*============================================================================*/ diff --git a/drivers/staging/wlags49_h2/wl_util.c b/drivers/staging/wlags49_h2/wl_util.c index 404ec7da0348..4ca6e42ecd7e 100644 --- a/drivers/staging/wlags49_h2/wl_util.c +++ b/drivers/staging/wlags49_h2/wl_util.c @@ -128,13 +128,6 @@ static const long chan_freq_list[][2] = {161,5805} }; -#if DBG -extern dbg_info_t *DbgInfo; -#endif /* DBG */ - - - - /******************************************************************************* * dbm() ******************************************************************************* @@ -481,10 +474,6 @@ void wl_hcf_error( struct net_device *dev, int hcfStatus ) ******************************************************************************/ void wl_endian_translate_event( ltv_t *pLtv ) { - DBG_FUNC( "wl_endian_translate_event" ); - DBG_ENTER( DbgInfo ); - - switch( pLtv->typ ) { case CFG_TALLIES: break; @@ -582,9 +571,6 @@ void wl_endian_translate_event( ltv_t *pLtv ) default: break; } - - DBG_LEAVE( DbgInfo ); - return; } // wl_endian_translate_event /*============================================================================*/ @@ -997,10 +983,6 @@ int wl_get_chan_from_freq( long frequency ) void wl_process_link_status( struct wl_private *lp ) { hcf_16 link_stat; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_process_link_status" ); - DBG_ENTER( DbgInfo ); if( lp != NULL ) { //link_stat = lp->hcfCtx.IFB_DSLinkStat & CFG_LINK_STAT_FW; @@ -1027,8 +1009,6 @@ void wl_process_link_status( struct wl_private *lp ) break; } } - DBG_LEAVE( DbgInfo ); - return; } // wl_process_link_status /*============================================================================*/ @@ -1058,12 +1038,6 @@ void wl_process_probe_response( struct wl_private *lp ) PROBE_RESP *probe_rsp; hcf_8 *wpa_ie = NULL; hcf_16 wpa_ie_len = 0; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wl_process_probe_response" ); - DBG_ENTER( DbgInfo ); - if( lp != NULL ) { probe_rsp = (PROBE_RESP *)&lp->ProbeResp; @@ -1235,9 +1209,6 @@ void wl_process_probe_response( struct wl_private *lp ) } } } - - DBG_LEAVE( DbgInfo ); - return; } // wl_process_probe_response /*============================================================================*/ @@ -1263,10 +1234,6 @@ void wl_process_probe_response( struct wl_private *lp ) ******************************************************************************/ void wl_process_updated_record( struct wl_private *lp ) { - DBG_FUNC( "wl_process_updated_record" ); - DBG_ENTER( DbgInfo ); - - if( lp != NULL ) { lp->updatedRecord.u.u16[0] = CNV_LITTLE_TO_INT( lp->updatedRecord.u.u16[0] ); @@ -1286,9 +1253,6 @@ void wl_process_updated_record( struct wl_private *lp ) lp->updatedRecord.u.u16[0] ); } } - - DBG_LEAVE( DbgInfo ); - return; } // wl_process_updated_record /*============================================================================*/ @@ -1315,12 +1279,6 @@ void wl_process_updated_record( struct wl_private *lp ) void wl_process_assoc_status( struct wl_private *lp ) { ASSOC_STATUS_STRCT *assoc_stat; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wl_process_assoc_status" ); - DBG_ENTER( DbgInfo ); - if( lp != NULL ) { assoc_stat = (ASSOC_STATUS_STRCT *)&lp->assoc_stat; @@ -1353,9 +1311,6 @@ void wl_process_assoc_status( struct wl_private *lp ) assoc_stat->oldApAddr); } } - - DBG_LEAVE( DbgInfo ); - return; } // wl_process_assoc_status /*============================================================================*/ @@ -1382,12 +1337,6 @@ void wl_process_assoc_status( struct wl_private *lp ) void wl_process_security_status( struct wl_private *lp ) { SECURITY_STATUS_STRCT *sec_stat; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wl_process_security_status" ); - DBG_ENTER( DbgInfo ); - if( lp != NULL ) { sec_stat = (SECURITY_STATUS_STRCT *)&lp->sec_stat; @@ -1425,9 +1374,6 @@ void wl_process_security_status( struct wl_private *lp ) DBG_TRACE(DbgInfo, "Reason : 0x%04x\n", sec_stat->reason); } - - DBG_LEAVE( DbgInfo ); - return; } // wl_process_security_status /*============================================================================*/ @@ -1438,9 +1384,6 @@ int wl_get_tallies(struct wl_private *lp, int status; CFG_HERMES_TALLIES_STRCT *pTallies; - DBG_FUNC( "wl_get_tallies" ); - DBG_ENTER(DbgInfo); - /* Get the current tallies from the adapter */ lp->ltvRecord.len = 1 + HCF_TOT_TAL_CNT * sizeof(hcf_16); lp->ltvRecord.typ = CFG_TALLIES; @@ -1456,8 +1399,6 @@ int wl_get_tallies(struct wl_private *lp, ret = -EFAULT; } - DBG_LEAVE( DbgInfo ); - return ret; } diff --git a/drivers/staging/wlags49_h2/wl_version.h b/drivers/staging/wlags49_h2/wl_version.h index 037b5266428c..bbc484a6b80f 100644 --- a/drivers/staging/wlags49_h2/wl_version.h +++ b/drivers/staging/wlags49_h2/wl_version.h @@ -115,42 +115,12 @@ err: define bus type; #define DRV_VARIANT 2 #endif // HERMES25 -#ifdef BUS_PCMCIA -#if defined HERMES25 -#define MODULE_NAME DRIVER_NAME "_h25_cs" -#else -#define MODULE_NAME DRIVER_NAME "_h2_cs" -#endif /* HERMES25 */ -#elif defined BUS_PCI -#if defined HERMES25 -#define MODULE_NAME DRIVER_NAME "_h25" -#else -#define MODULE_NAME DRIVER_NAME "_h2" -#endif /* HERMES25 */ -#endif /* BUS_XXX */ - -#ifdef DBG -#define MODULE_DATE __DATE__ " " __TIME__ -#else -#define MODULE_DATE "07/18/2004 13:30:00" -#endif // DBG - -//#define STR2(m) #m -//#define STR1(m) STR2(m) -//#define MODULE_NAME STR1( MOD_NAME ) - -#define VERSION_INFO MODULE_NAME " v" DRV_VERSION_STR \ - " for " BUS_TYPE ", " \ - MODULE_DATE " by " VENDOR_NAME +#define VERSION_INFO KBUILD_MODNAME " v" DRV_VERSION_STR \ + " for " BUS_TYPE ", by " VENDOR_NAME /* The version of wireless extensions we support */ #define WIRELESS_SUPPORT 21 -//#define DBG_MOD_NAME DRIVER_NAME ":" BUS_TYPE ":" HW_TYPE ":" FW_TYPE -#define DBG_MOD_NAME MODULE_NAME - - - /******************************************************************************* * bus architecture specific defines, includes, etc. ******************************************************************************/ diff --git a/drivers/staging/wlags49_h2/wl_wext.c b/drivers/staging/wlags49_h2/wl_wext.c index c731ff2a6aa1..187fc060de26 100644 --- a/drivers/staging/wlags49_h2/wl_wext.c +++ b/drivers/staging/wlags49_h2/wl_wext.c @@ -76,14 +76,6 @@ #include <wl_wext.h> #include <wl_priv.h> -/******************************************************************************* - * global definitions - ******************************************************************************/ -#if DBG -extern dbg_info_t *DbgInfo; -#endif // DBG - - /* Set up the LTV to program the appropriate key */ static int hermes_set_tkip_keys(ltv_t *ltv, u16 key_idx, u8 *addr, int set_tx, u8 *seq, u8 *key, size_t key_len) @@ -93,8 +85,6 @@ static int hermes_set_tkip_keys(ltv_t *ltv, u16 key_idx, u8 *addr, hcf_8 tsc[IW_ENCODE_SEQ_MAX_SIZE] = { 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00 }; - DBG_ENTER(DbgInfo); - /* * Check the key index here; if 0, load as Pairwise Key, otherwise, * load as a group key. Note that for the Hermes, the RIDs for @@ -163,7 +153,6 @@ static int hermes_set_tkip_keys(ltv_t *ltv, u16 key_idx, u8 *addr, break; } - DBG_LEAVE(DbgInfo); return ret; } @@ -327,10 +316,6 @@ static int wireless_commit(struct net_device *dev, struct wl_private *lp = wl_priv(dev); unsigned long flags; int ret = 0; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wireless_commit" ); - DBG_ENTER(DbgInfo); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -348,7 +333,6 @@ static int wireless_commit(struct net_device *dev, wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_commit /*============================================================================*/ @@ -376,16 +360,12 @@ out: ******************************************************************************/ static int wireless_get_protocol(struct net_device *dev, struct iw_request_info *info, char *name, char *extra) { - DBG_FUNC( "wireless_get_protocol" ); - DBG_ENTER( DbgInfo ); - /* Originally, the driver was placing the string "Wireless" here. However, the wireless extensions (/linux/wireless.h) indicate this string should describe the wireless protocol. */ strcpy(name, "IEEE 802.11b"); - DBG_LEAVE(DbgInfo); return 0; } // wireless_get_protocol /*============================================================================*/ @@ -418,11 +398,6 @@ static int wireless_set_frequency(struct net_device *dev, struct iw_request_info unsigned long flags; int channel = 0; int ret = 0; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wireless_set_frequency" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -431,7 +406,6 @@ static int wireless_set_frequency(struct net_device *dev, struct iw_request_info if( !capable( CAP_NET_ADMIN )) { ret = -EPERM; - DBG_LEAVE( DbgInfo ); return ret; } @@ -473,7 +447,6 @@ static int wireless_set_frequency(struct net_device *dev, struct iw_request_info wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_set_frequency /*============================================================================*/ @@ -505,11 +478,6 @@ static int wireless_get_frequency(struct net_device *dev, struct iw_request_info struct wl_private *lp = wl_priv(dev); unsigned long flags; int ret = -1; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wireless_get_frequency" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -538,7 +506,6 @@ static int wireless_get_frequency(struct net_device *dev, struct iw_request_info ret = (ret == HCF_SUCCESS ? 0 : -EFAULT); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_get_frequency /*============================================================================*/ @@ -576,11 +543,6 @@ static int wireless_get_range(struct net_device *dev, struct iw_request_info *in int count; __u16 *pTxRate; int retries = 0; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wireless_get_range" ); - DBG_ENTER( DbgInfo ); /* Set range information */ data->length = sizeof(struct iw_range); @@ -748,7 +710,6 @@ out_unlock: wl_unlock(lp, &flags); - DBG_LEAVE(DbgInfo); return ret; } // wireless_get_range /*============================================================================*/ @@ -781,11 +742,6 @@ static int wireless_get_bssid(struct net_device *dev, struct iw_request_info *in #if 1 //;? (HCF_TYPE) & HCF_TYPE_STA int status = -1; #endif /* (HCF_TYPE) & HCF_TYPE_STA */ - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wireless_get_bssid" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -828,7 +784,6 @@ static int wireless_get_bssid(struct net_device *dev, struct iw_request_info *in wl_unlock(lp, &flags); out: - DBG_LEAVE(DbgInfo); return ret; } // wireless_get_bssid /*============================================================================*/ @@ -874,10 +829,6 @@ static int wireless_get_ap_list (struct net_device *dev, struct iw_request_info #else ProbeResult *p = &lp->probe_results; #endif // WARP - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wireless_get_ap_list" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -977,7 +928,6 @@ static int wireless_get_ap_list (struct net_device *dev, struct iw_request_info } } out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_get_ap_list /*============================================================================*/ @@ -1010,11 +960,6 @@ static int wireless_set_sensitivity(struct net_device *dev, struct iw_request_in unsigned long flags; int ret = 0; int dens = sens->value; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wireless_set_sensitivity" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -1038,7 +983,6 @@ static int wireless_set_sensitivity(struct net_device *dev, struct iw_request_in wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_set_sensitivity /*============================================================================*/ @@ -1069,12 +1013,6 @@ static int wireless_get_sensitivity(struct net_device *dev, struct iw_request_in { struct wl_private *lp = wl_priv(dev); int ret = 0; - /*------------------------------------------------------------------------*/ - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wireless_get_sensitivity" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -1085,7 +1023,6 @@ static int wireless_get_sensitivity(struct net_device *dev, struct iw_request_in sens->value = lp->DistanceBetweenAPs; sens->fixed = 0; /* auto */ out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_get_sensitivity /*============================================================================*/ @@ -1119,15 +1056,12 @@ static int wireless_set_essid(struct net_device *dev, struct iw_request_info *in unsigned long flags; int ret = 0; - DBG_FUNC( "wireless_set_essid" ); - DBG_ENTER( DbgInfo ); - if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; goto out; } - if (data->flags != 0 && data->length > HCF_MAX_NAME_LEN + 1) { + if (data->flags != 0 && data->length > HCF_MAX_NAME_LEN) { ret = -EINVAL; goto out; } @@ -1165,7 +1099,6 @@ static int wireless_set_essid(struct net_device *dev, struct iw_request_info *in wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_set_essid /*============================================================================*/ @@ -1201,11 +1134,6 @@ static int wireless_get_essid(struct net_device *dev, struct iw_request_info *in int ret = 0; int status = -1; wvName_t *pName; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wireless_get_essid" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -1300,7 +1228,6 @@ out_unlock: wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_get_essid /*============================================================================*/ @@ -1335,8 +1262,6 @@ static int wireless_set_encode(struct net_device *dev, struct iw_request_info *i int ret = 0; bool enable = true; - DBG_ENTER(DbgInfo); - if (lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; goto out; @@ -1361,7 +1286,6 @@ static int wireless_set_encode(struct net_device *dev, struct iw_request_info *i wl_unlock(lp, &flags); out: - DBG_LEAVE(DbgInfo); return ret; } @@ -1391,11 +1315,7 @@ static int wireless_get_encode(struct net_device *dev, struct iw_request_info *i unsigned long flags; int ret = 0; int index; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wireless_get_encode" ); - DBG_ENTER( DbgInfo ); DBG_NOTICE(DbgInfo, "GIWENCODE: encrypt: %d, ID: %d\n", lp->EnableEncryption, lp->TransmitKeyID); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { @@ -1406,7 +1326,6 @@ static int wireless_get_encode(struct net_device *dev, struct iw_request_info *i /* Only super-user can see WEP key */ if( !capable( CAP_NET_ADMIN )) { ret = -EPERM; - DBG_LEAVE( DbgInfo ); return ret; } @@ -1450,7 +1369,6 @@ out_unlock: wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_get_encode /*============================================================================*/ @@ -1482,11 +1400,6 @@ static int wireless_set_nickname(struct net_device *dev, struct iw_request_info struct wl_private *lp = wl_priv(dev); unsigned long flags; int ret = 0; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wireless_set_nickname" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -1496,7 +1409,6 @@ static int wireless_set_nickname(struct net_device *dev, struct iw_request_info #if 0 //;? Needed, was present in original code but not in 7.18 Linux 2.6 kernel version if( !capable(CAP_NET_ADMIN )) { ret = -EPERM; - DBG_LEAVE( DbgInfo ); return ret; } #endif @@ -1523,7 +1435,6 @@ static int wireless_set_nickname(struct net_device *dev, struct iw_request_info wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_set_nickname /*============================================================================*/ @@ -1557,11 +1468,6 @@ static int wireless_get_nickname(struct net_device *dev, struct iw_request_info int ret = 0; int status = -1; wvName_t *pName; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wireless_get_nickname" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -1600,7 +1506,6 @@ static int wireless_get_nickname(struct net_device *dev, struct iw_request_info wl_unlock(lp, &flags); out: - DBG_LEAVE(DbgInfo); return ret; } // wireless_get_nickname /*============================================================================*/ @@ -1634,10 +1539,6 @@ static int wireless_set_porttype(struct net_device *dev, struct iw_request_info int ret = 0; hcf_16 portType; hcf_16 createIBSS; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wireless_set_porttype" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -1714,7 +1615,6 @@ static int wireless_set_porttype(struct net_device *dev, struct iw_request_info wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_set_porttype /*============================================================================*/ @@ -1749,11 +1649,6 @@ static int wireless_get_porttype(struct net_device *dev, struct iw_request_info int ret = 0; int status = -1; hcf_16 *pPortType; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wireless_get_porttype" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -1824,7 +1719,6 @@ static int wireless_get_porttype(struct net_device *dev, struct iw_request_info wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_get_porttype /*============================================================================*/ @@ -1856,11 +1750,6 @@ static int wireless_set_power(struct net_device *dev, struct iw_request_info *in struct wl_private *lp = wl_priv(dev); unsigned long flags; int ret = 0; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wireless_set_power" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -1872,8 +1761,6 @@ static int wireless_set_power(struct net_device *dev, struct iw_request_info *in #if 0 //;? Needed, was present in original code but not in 7.18 Linux 2.6 kernel version if( !capable( CAP_NET_ADMIN )) { ret = -EPERM; - - DBG_LEAVE( DbgInfo ); return ret; } #endif @@ -1897,7 +1784,6 @@ static int wireless_set_power(struct net_device *dev, struct iw_request_info *in wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_set_power /*============================================================================*/ @@ -1930,9 +1816,6 @@ static int wireless_get_power(struct net_device *dev, struct iw_request_info *in struct wl_private *lp = wl_priv(dev); unsigned long flags; int ret = 0; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wireless_get_power" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -1959,7 +1842,6 @@ static int wireless_get_power(struct net_device *dev, struct iw_request_info *in wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_get_power /*============================================================================*/ @@ -1991,9 +1873,6 @@ static int wireless_get_tx_power(struct net_device *dev, struct iw_request_info struct wl_private *lp = wl_priv(dev); unsigned long flags; int ret = 0; - /*------------------------------------------------------------------------*/ - DBG_FUNC( "wireless_get_tx_power" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -2019,7 +1898,6 @@ static int wireless_get_tx_power(struct net_device *dev, struct iw_request_info wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_get_tx_power /*============================================================================*/ @@ -2052,11 +1930,6 @@ static int wireless_set_rts_threshold (struct net_device *dev, struct iw_request struct wl_private *lp = wl_priv(dev); unsigned long flags; int rthr = rts->value; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wireless_set_rts_threshold" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -2090,7 +1963,6 @@ static int wireless_set_rts_threshold (struct net_device *dev, struct iw_request wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_set_rts_threshold /*============================================================================*/ @@ -2122,10 +1994,6 @@ static int wireless_get_rts_threshold (struct net_device *dev, struct iw_request int ret = 0; struct wl_private *lp = wl_priv(dev); unsigned long flags; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wireless_get_rts_threshold" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -2147,7 +2015,6 @@ static int wireless_get_rts_threshold (struct net_device *dev, struct iw_request wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_get_rts_threshold /*============================================================================*/ @@ -2184,11 +2051,6 @@ static int wireless_set_rate(struct net_device *dev, struct iw_request_info *inf int status = -1; int index = 0; #endif // WARP - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wireless_set_rate" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -2214,7 +2076,6 @@ static int wireless_set_rate(struct net_device *dev, struct iw_request_info *inf DBG_PRINT( "Index: %d\n", index ); } else { DBG_ERROR( DbgInfo, "Could not determine radio frequency\n" ); - DBG_LEAVE( DbgInfo ); ret = -EINVAL; goto out_unlock; } @@ -2375,7 +2236,6 @@ out_unlock: wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_set_rate /*============================================================================*/ @@ -2410,11 +2270,6 @@ static int wireless_get_rate(struct net_device *dev, struct iw_request_info *inf int ret = 0; int status = -1; hcf_16 txRate; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wireless_get_rate" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -2490,7 +2345,6 @@ static int wireless_get_rate(struct net_device *dev, struct iw_request_info *inf wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_get_rate /*============================================================================*/ @@ -2522,11 +2376,6 @@ out: int wireless_get_private_interface( struct iwreq *wrq, struct wl_private *lp ) { int ret = 0; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wireless_get_private_interface" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -2547,10 +2396,8 @@ int wireless_get_private_interface( struct iwreq *wrq, struct wl_private *lp ) /* Verify the user buffer */ ret = verify_area( VERIFY_WRITE, wrq->u.data.pointer, sizeof( priv )); - if( ret != 0 ) { - DBG_LEAVE( DbgInfo ); + if( ret != 0 ) return ret; - } /* Copy the data into the user's buffer */ wrq->u.data.length = NELEM( priv ); @@ -2558,7 +2405,6 @@ int wireless_get_private_interface( struct iwreq *wrq, struct wl_private *lp ) } out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_get_private_interface /*============================================================================*/ @@ -2592,13 +2438,9 @@ static int wireless_set_scan(struct net_device *dev, struct iw_request_info *inf int ret = 0; int status = -1; int retries = 0; - /*------------------------------------------------------------------------*/ //;? Note: shows results as trace, returns always 0 unless BUSY - DBG_FUNC( "wireless_set_scan" ); - DBG_ENTER( DbgInfo ); - if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; goto out; @@ -2694,7 +2536,6 @@ retry: wl_unlock(lp, &flags); out: - DBG_LEAVE(DbgInfo); return ret; } // wireless_set_scan /*============================================================================*/ @@ -2734,11 +2575,6 @@ static int wireless_get_scan(struct net_device *dev, struct iw_request_info *inf hcf_8 msg[512]; hcf_8 *wpa_ie; hcf_16 wpa_ie_len; - /*------------------------------------------------------------------------*/ - - - DBG_FUNC( "wireless_get_scan" ); - DBG_ENTER( DbgInfo ); if(lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; @@ -2888,7 +2724,6 @@ out_unlock: wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_get_scan /*============================================================================*/ @@ -2923,9 +2758,6 @@ static int wireless_set_auth(struct net_device *dev, int iwa_idx = data->flags & IW_AUTH_INDEX; int iwa_val = data->value; - DBG_FUNC( "wireless_set_auth" ); - DBG_ENTER( DbgInfo ); - if (lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; goto out; @@ -3038,7 +2870,6 @@ static int wireless_set_auth(struct net_device *dev, wl_unlock(lp, &flags); out: - DBG_LEAVE( DbgInfo ); return ret; } // wireless_set_auth /*============================================================================*/ @@ -3087,8 +2918,6 @@ static int wireless_set_encodeext(struct net_device *dev, bool enable = true; bool set_tx = false; - DBG_ENTER(DbgInfo); - if (lp->portState == WVLAN_PORT_STATE_DISABLED) { ret = -EBUSY; goto out; @@ -3114,7 +2943,6 @@ static int wireless_set_encodeext(struct net_device *dev, if (sizeof(ext->rx_seq) != 8) { DBG_TRACE(DbgInfo, "rx_seq size mismatch\n"); - DBG_LEAVE(DbgInfo); ret = -EINVAL; goto out_unlock; } @@ -3188,7 +3016,6 @@ out_unlock: wl_unlock(lp, &flags); out: - DBG_LEAVE(DbgInfo); return ret; } /*============================================================================*/ @@ -3202,13 +3029,10 @@ static int wireless_set_genie(struct net_device *dev, { int ret = 0; - DBG_ENTER(DbgInfo); - /* We can't write this to the card, but apparently this * operation needs to succeed */ ret = 0; - DBG_LEAVE(DbgInfo); return ret; } /*============================================================================*/ @@ -3237,11 +3061,7 @@ struct iw_statistics * wl_wireless_stats( struct net_device *dev ) { struct iw_statistics *pStats; struct wl_private *lp = wl_priv(dev); - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_wireless_stats" ); - DBG_ENTER(DbgInfo); DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev); pStats = NULL; @@ -3302,7 +3122,6 @@ struct iw_statistics * wl_wireless_stats( struct net_device *dev ) } } - DBG_LEAVE( DbgInfo ); return pStats; } // wl_wireless_stats /*============================================================================*/ @@ -3336,10 +3155,6 @@ struct iw_statistics * wl_get_wireless_stats( struct net_device *dev ) unsigned long flags; struct wl_private *lp = wl_priv(dev); struct iw_statistics *pStats = NULL; - /*------------------------------------------------------------------------*/ - - DBG_FUNC( "wl_get_wireless_stats" ); - DBG_ENTER(DbgInfo); wl_lock( lp, &flags ); @@ -3357,7 +3172,6 @@ struct iw_statistics * wl_get_wireless_stats( struct net_device *dev ) wl_unlock(lp, &flags); - DBG_LEAVE( DbgInfo ); return pStats; } // wl_get_wireless_stats diff --git a/drivers/staging/wlags49_h2/wl_wext.h b/drivers/staging/wlags49_h2/wl_wext.h index 029da52c4c49..4a85dc889a12 100644 --- a/drivers/staging/wlags49_h2/wl_wext.h +++ b/drivers/staging/wlags49_h2/wl_wext.h @@ -85,4 +85,4 @@ void wl_wext_event_assoc_ie( struct net_device *dev ); extern const struct iw_handler_def wl_iw_handler_def; -#endif // __WL_WEXT_H__ +#endif /* __WL_WEXT_H__ */ |