From 491dbc8d1ae56199ad199830d16c77c8317aa987 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Wed, 24 Mar 2010 22:17:07 -0700 Subject: Staging: wlags49_h2: Hoist assign from if Signed-off-by: Joe Perches Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/hcf.c | 15 ++++++++++----- drivers/staging/wlags49_h2/wl_main.c | 3 ++- drivers/staging/wlags49_h2/wl_netdev.c | 12 ++++++++---- drivers/staging/wlags49_h2/wl_priv.c | 9 ++++++--- drivers/staging/wlags49_h2/wl_sysfs.c | 3 ++- 5 files changed, 28 insertions(+), 14 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/hcf.c b/drivers/staging/wlags49_h2/hcf.c index 6e39f50..390628c 100644 --- a/drivers/staging/wlags49_h2/hcf.c +++ b/drivers/staging/wlags49_h2/hcf.c @@ -990,7 +990,8 @@ int rc = HCF_ERR_INCOMP_FW; ifbp->IFB_CntlOpt |= DMA_ENABLED; HCFASSERT( NT_ASSERT, NEVER_TESTED ) // make the entire rx descriptor chain DMA-owned, so the DMA engine can (re-)use it. - if ( ( p = ifbp->IFB_FirstDesc[DMA_RX] ) != NULL ) { //;? Think this over again in the light of the new chaining strategy + p = ifbp->IFB_FirstDesc[DMA_RX]; + if (p != NULL) { //;? Think this over again in the light of the new chaining strategy if ( 1 ) { //begin alternative HCFASSERT( NT_ASSERT, NEVER_TESTED ) put_frame_lst( ifbp, ifbp->IFB_FirstDesc[DMA_RX], DMA_RX ); @@ -2087,7 +2088,8 @@ wci_bufp pt; //pointer with the "right" type, just to help ease writing macr OPW( HREG_AUX_OFFSET, (hcf_16)(PLUG_DATA_OFFSET & 0x7E) ); io_port = ifbp->IFB_IOBase + HREG_AUX_DATA; //to prevent side effects of the MSF-defined macro p = ltvp->val; //destination char pointer (in LTV record) - if ( ( i = len - 1 ) > 0 ) { + i = len - 1; + if (i > 0 ) { pt = (wci_bufp)p; //just to help ease writing macros with embedded assembly IN_PORT_STRING_8_16( io_port, pt, i ); //space used by T: -1 } @@ -2674,7 +2676,8 @@ hcf_16 fid = 0; #if (HCF_EXT) & HCF_EXT_TX_CONT // Continuous transmit test if ( tx_cntl == HFS_TX_CNTL_TX_CONT ) { - if ( ( fid = get_fid( ifbp ) ) != 0 ) { + fid = get_fid(ifbp); + if (fid != 0 ) { //setup BAP to begin of TxFS (void)setup_bap( ifbp, fid, 0, IO_OUT ); //copy all the fragments in a transparent fashion @@ -2700,7 +2703,8 @@ hcf_16 fid = 0; #if (HCF_TYPE) & HCF_TYPE_WPA tx_cntl |= ifbp->IFB_MICTxCntl; #endif // HCF_TYPE_WPA - if ( (fid = ifbp->IFB_TxFID) == 0 && ( fid = get_fid( ifbp ) ) != 0 ) /* 4 */ + fid = ifbp->IFB_TxFID; + if (fid == 0 && ( fid = get_fid( ifbp ) ) != 0 ) /* 4 */ /* skip the next compound statement if: - pre-put message or - no fid available (which should never occur if the MSF adheres to the WCI) @@ -4860,7 +4864,8 @@ PROT_CNT_INI int rc; HCFTRACE( ifbp, HCF_TRACE_STRIO ); - if ( ( rc = ifbp->IFB_DefunctStat ) == HCF_SUCCESS ) { /*2*/ + rc = ifbp->IFB_DefunctStat; + if (rc == HCF_SUCCESS) { /*2*/ OPW( HREG_SELECT_1, fid ); /*4*/ OPW( HREG_OFFSET_1, offset ); if ( type == IO_IN ) { diff --git a/drivers/staging/wlags49_h2/wl_main.c b/drivers/staging/wlags49_h2/wl_main.c index cf0c384..88d0d47 100644 --- a/drivers/staging/wlags49_h2/wl_main.c +++ b/drivers/staging/wlags49_h2/wl_main.c @@ -3591,7 +3591,8 @@ int scull_read_procmem(char *buf, char **start, off_t offset, int len, int *eof, len=0; - if ( ( lp = ((struct net_device *)data)->priv ) == NULL ) { + lp = ((struct net_device *)data)->priv; + if (lp == NULL) { len += sprintf(buf+len,"No wl_private in scull_read_procmem\n" ); } else if ( lp->wlags49_type == 0 ){ ifbp = &lp->hcfCtx; diff --git a/drivers/staging/wlags49_h2/wl_netdev.c b/drivers/staging/wlags49_h2/wl_netdev.c index 1db73eb..1cfaee3 100644 --- a/drivers/staging/wlags49_h2/wl_netdev.c +++ b/drivers/staging/wlags49_h2/wl_netdev.c @@ -930,8 +930,10 @@ int wl_rx(struct net_device *dev) port = ( hfs_stat >> 8 ) & 0x0007; DBG_RX( DbgInfo, "Rx frame for port %d\n", port ); - if(( pktlen = lp->hcfCtx.IFB_RxLen ) != 0 ) { - if(( skb = ALLOC_SKB( pktlen )) != NULL ) { + pktlen = lp->hcfCtx.IFB_RxLen; + if (pktlen != 0) { + skb = ALLOC_SKB(pktlen); + if (skb != NULL) { /* Set the netdev based on the port */ switch( port ) { #ifdef USE_WDS @@ -1995,8 +1997,10 @@ int wl_rx_dma( struct net_device *dev ) port = ( hfs_stat >> 8 ) & 0x0007; DBG_RX( DbgInfo, "Rx frame for port %d\n", port ); - if(( pktlen = GET_BUF_CNT( desc_next )) != 0 ) { - if(( skb = ALLOC_SKB( pktlen )) != NULL ) { + pktlen = GET_BUF_CNT(desc_next); + if (pktlen != 0) { + skb = ALLOC_SKB(pktlen); + if (skb != NULL) { switch( port ) { #ifdef USE_WDS case 1: diff --git a/drivers/staging/wlags49_h2/wl_priv.c b/drivers/staging/wlags49_h2/wl_priv.c index 727ea8a..a67ff52 100644 --- a/drivers/staging/wlags49_h2/wl_priv.c +++ b/drivers/staging/wlags49_h2/wl_priv.c @@ -503,7 +503,8 @@ int wvlan_uil_send_diag_msg( struct uilreq *urq, struct wl_private *lp ) return result; } - if ((data = kmalloc(urq->len, GFP_KERNEL)) != NULL) { + data = kmalloc(urq->len, GFP_KERNEL); + if (data != NULL) { memset( Descp, 0, sizeof( DESC_STRCT )); memcpy( data, urq->data, urq->len ); @@ -617,7 +618,8 @@ int wvlan_uil_put_info( struct uilreq *urq, struct wl_private *lp ) LTV record, try to allocate it from the kernel stack. Otherwise, we just use our local LTV record. */ if( urq->len > sizeof( lp->ltvRecord )) { - if(( pLtv = (ltv_t *)kmalloc( urq->len, GFP_KERNEL )) != NULL ) { + pLtv = (ltv_t *)kmalloc( urq->len, GFP_KERNEL ); + if (pLtv != NULL) { ltvAllocated = TRUE; } else { DBG_ERROR( DbgInfo, "Alloc FAILED\n" ); @@ -1296,7 +1298,8 @@ int wvlan_uil_get_info( struct uilreq *urq, struct wl_private *lp ) LTV record, try to allocate it from the kernel stack. Otherwise, we just use our local LTV record. */ if( urq->len > sizeof( lp->ltvRecord )) { - if(( pLtv = (ltv_t *)kmalloc( urq->len, GFP_KERNEL )) != NULL ) { + pLtv = (ltv_t *)kmalloc( urq->len, GFP_KERNEL ); + if (pLtv != NULL) { ltvAllocated = TRUE; /* Copy the command/length information into the new buffer. */ diff --git a/drivers/staging/wlags49_h2/wl_sysfs.c b/drivers/staging/wlags49_h2/wl_sysfs.c index 864e01a..e4c8804 100644 --- a/drivers/staging/wlags49_h2/wl_sysfs.c +++ b/drivers/staging/wlags49_h2/wl_sysfs.c @@ -46,7 +46,8 @@ static ssize_t show_tallies(struct device *d, struct device_attribute *attr, if (dev_isalive(dev)) { wl_lock(lp, &flags); - if ((ret = wl_get_tallies(lp, &tallies)) == 0) { + ret = wl_get_tallies(lp, &tallies); + if (ret == 0) { wl_unlock(lp, &flags); ret = snprintf(buf, PAGE_SIZE, "TxUnicastFrames: %u\n" -- cgit v1.1 From b93634c4e38e3fbe476b53b1e68ec391ad0ecc86 Mon Sep 17 00:00:00 2001 From: Ruslan Pisarev Date: Mon, 15 Mar 2010 22:46:24 +0200 Subject: Staging: wlags49_h2: fix spaces, macros and comments coding style issue in debug.h This is a patch to the debug.h file that fixed up a TAB and spaces Errors found by the checkpatch.pl tools, like spaces required around that '&' (ctx:VxV) and ERROR: Invalid UTF-8, patch and commit message should be encoded in UTF-8 and do not use C99 // comments and Macros with complex values should be enclosed in parenthesis Signed-off-by: Ruslan Pisarev Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/debug.h | 104 +++++++++++++++++++++---------------- 1 file changed, 59 insertions(+), 45 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/debug.h b/drivers/staging/wlags49_h2/debug.h index 0b52e17..2c3dd14 100644 --- a/drivers/staging/wlags49_h2/debug.h +++ b/drivers/staging/wlags49_h2/debug.h @@ -22,7 +22,7 @@ * software indicates your acceptance of these terms and conditions. If you do * not agree with these terms and conditions, do not use the software. * - * Copyright © 2003 Agere Systems Inc. + * Copyright (c) 2003 Agere Systems Inc. * All rights reserved. * * Redistribution and use in source or binary forms, with or without @@ -70,7 +70,7 @@ #else #undef DBG #define DBG 1 -#endif //DBG +#endif /* DBG */ @@ -84,7 +84,7 @@ #ifndef DBG_LVL #define DBG_LVL 5 /* yields nothing via init_module, original value of 5 yields DBG_TRACE_ON and DBG_VERBOSE_ON */ -#endif // DBG_LVL +#endif /* DBG_LVL*/ #define DBG_ERROR_ON 0x00000001L @@ -100,80 +100,94 @@ #define DBG_DEFAULTS (DBG_ERROR_ON | DBG_WARNING_ON | DBG_BREAK_ON) -#define DBG_FLAGS(A) (A)->DebugFlag -#define DBG_NAME(A) (A)->dbgName -#define DBG_LEVEL(A) (A)->dbgLevel +#define DBG_FLAGS(A) ((A)->DebugFlag) +#define DBG_NAME(A) ((A)->dbgName) +#define DBG_LEVEL(A) ((A)->dbgLevel) #ifndef PRINTK # define PRINTK(S...) printk(S) -#endif // PRINTK +#endif /* PRINTK */ #ifndef DBG_PRINT # define DBG_PRINT(S...) PRINTK(KERN_DEBUG S) -#endif // DBG_PRINT +#endif /* DBG_PRINT */ #ifndef DBG_PRINTC # define DBG_PRINTC(S...) PRINTK(S) -#endif // DBG_PRINTC +#endif /* DBG_PRINTC */ #ifndef DBG_TRAP # define DBG_TRAP {} -#endif // 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_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) static const char *__FUNC__ = F; -#define DBG_ENTER(A) {if (DBG_FLAGS(A) & DBG_TRACE_ON) _DBG_ENTER(A);} +#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_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);} +#define DBG_PARAM(A, N, F, S...) {if (DBG_FLAGS(A) & DBG_PARAM_ON) \ + DBG_PRINT(" %s -- "F"\n", N, S); } -#define DBG_ERROR(A,S...) {if (DBG_FLAGS(A) & DBG_ERROR_ON) \ - {DBG_PRINT("%s:ERROR:%s ",DBG_NAME(A),__FUNC__);DBG_PRINTC(S);DBG_TRAP;}} +#define DBG_ERROR(A, S...) {if (DBG_FLAGS(A) & DBG_ERROR_ON) {\ + DBG_PRINT("%s:ERROR:%s ", DBG_NAME(A), __FUNC__);\ + DBG_PRINTC(S); \ + DBG_TRAP; \ + } \ + } -#define DBG_WARNING(A,S...) {if (DBG_FLAGS(A) & DBG_WARNING_ON) \ - {DBG_PRINT("%s:WARNING:%s ",DBG_NAME(A),__FUNC__);DBG_PRINTC(S);}} +#define DBG_WARNING(A, S...) {if (DBG_FLAGS(A) & DBG_WARNING_ON) {\ + DBG_PRINT("%s:WARNING:%s ", DBG_NAME(A), __FUNC__);\ + DBG_PRINTC(S); } } -#define DBG_NOTICE(A,S...) {if (DBG_FLAGS(A) & DBG_NOTICE_ON) \ - {DBG_PRINT("%s:NOTICE:%s ",DBG_NAME(A),__FUNC__);DBG_PRINTC(S);}} +#define DBG_NOTICE(A, S...) {if (DBG_FLAGS(A) & DBG_NOTICE_ON) {\ + DBG_PRINT("%s:NOTICE:%s ", DBG_NAME(A), __FUNC__);\ + DBG_PRINTC(S); \ + } \ + } -#define DBG_TRACE(A,S...) do {if (DBG_FLAGS(A) & DBG_TRACE_ON) \ - {DBG_PRINT("%s:%s ",DBG_NAME(A),__FUNC__);DBG_PRINTC(S);}} while (0) +#define DBG_TRACE(A, S...) do {if (DBG_FLAGS(A) & DBG_TRACE_ON) {\ + DBG_PRINT("%s:%s ", DBG_NAME(A), __FUNC__);\ + DBG_PRINTC(S); } } while (0) -#define DBG_RX(A,S...) {if (DBG_FLAGS(A) & DBG_RX_ON) \ - {DBG_PRINT(S);}} +#define DBG_RX(A, S...) {if (DBG_FLAGS(A) & DBG_RX_ON) {\ + DBG_PRINT(S); } } -#define DBG_TX(A,S...) {if (DBG_FLAGS(A) & DBG_TX_ON) \ - {DBG_PRINT(S);}} +#define DBG_TX(A, S...) {if (DBG_FLAGS(A) & DBG_TX_ON) {\ + DBG_PRINT(S); } } -#define DBG_DS(A,S...) {if (DBG_FLAGS(A) & DBG_DS_ON) \ - {DBG_PRINT(S);}} +#define DBG_DS(A, S...) {if (DBG_FLAGS(A) & DBG_DS_ON) {\ + DBG_PRINT(S); } } -#define DBG_ASSERT(C) {if (!(C)) \ - {DBG_PRINT("ASSERT(%s) -- %s#%d (%s)\n", \ - #C,__FILE__,__LINE__,__FUNC__); \ - DBG_TRAP;}} +#define DBG_ASSERT(C) { \ + if (!(C)) {\ + DBG_PRINT("ASSERT(%s) -- %s#%d (%s)\n", \ + #C, __FILE__, __LINE__, __FUNC__); \ + DBG_TRAP; \ + } \ + } typedef struct { char *dbgName; @@ -183,7 +197,7 @@ typedef struct { /****************************************************************************/ -#else // DBG +#else /* DBG */ /****************************************************************************/ #define DBG_DEFN @@ -192,21 +206,21 @@ typedef struct { #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...) -#define DBG_NOTICE(A,S...) -#define DBG_TRACE(A,S...) -#define DBG_RX(A,S...) -#define DBG_TX(A,S...) -#define DBG_DS(A,S...) +#define DBG_PARAM(A, N, F, S...) +#define DBG_ERROR(A, S...) +#define DBG_WARNING(A, S...) +#define DBG_NOTICE(A, S...) +#define DBG_TRACE(A, S...) +#define DBG_RX(A, S...) +#define DBG_TX(A, S...) +#define DBG_DS(A, S...) #define DBG_ASSERT(C) -#endif // DBG +#endif /* DBG */ /****************************************************************************/ -#endif // _DEBUG_H +#endif /* _DEBUG_H */ -- cgit v1.1 From 0a13dfdffcef1e72cd4edf9bb9b03d8a3f5fea70 Mon Sep 17 00:00:00 2001 From: Ruslan Pisarev Date: Mon, 15 Mar 2010 23:29:02 +0200 Subject: Staging: wlags49_h2: fix comments coding style issue in ap_h2.c This is a patch to the ap_h2.c file that fixed up a TAB and spaces Errors found by the checkpatch.pl tools, like do not use C99 // comments Signed-off-by: Ruslan Pisarev Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/ap_h2.c | 70 +++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/ap_h2.c b/drivers/staging/wlags49_h2/ap_h2.c index f5123d2..e311498 100644 --- a/drivers/staging/wlags49_h2/ap_h2.c +++ b/drivers/staging/wlags49_h2/ap_h2.c @@ -25,10 +25,10 @@ */ -#include "hcfcfg.h" // to get hcf_16 etc defined as well as - // possible settings which inluence mdd.h or dhf.h -#include "mdd.h" //to get COMP_ID_STA etc defined -#include "dhf.h" //used to be "fhfmem.h", to get memblock,plugrecord, +#include "hcfcfg.h" /* to get hcf_16 etc defined as well as */ + /* possible settings which inluence mdd.h or dhf.h */ +#include "mdd.h" /* to get COMP_ID_STA etc defined */ +#include "dhf.h" /* used to be "fhfmem.h", to get memblock,plugrecord, */ static const hcf_8 fw_image_1_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -3241,56 +3241,56 @@ static const CFG_IDENTITY_STRCT fw_image_infoidentity[] = { sizeof( CFG_IDENTITY_STRCT ) / sizeof(hcf_16) - 1, CFG_FW_IDENTITY, COMP_ID_FW_AP, - 2, //Variant - 2, //Major - 36 //Minor + 2, /* Variant / + 2, /* Major */ + 36 /* Minor */ }, - { 0000, 0000, 0000, 0000, 0000, 0000 } //endsentinel + { 0000, 0000, 0000, 0000, 0000, 0000 } /* endsentinel */ }; static const CFG_PROG_STRCT fw_image_code[] = { { 8, CFG_PROG, - CFG_PROG_VOLATILE, // mode - 0x0146, // sizeof(fw_image_1_data), - 0x00000060, // Target address in NIC Memory - 0x0000, // CRC: yes/no TYPE: primary/station/tertiary + CFG_PROG_VOLATILE, /* mode */ + 0x0146, /* sizeof(fw_image_1_data), */ + 0x00000060, /* Target address in NIC Memory */ + 0x0000, /* CRC: yes/no TYPE: primary/station/tertiary */ (hcf_8 FAR *) fw_image_1_data }, { 8, CFG_PROG, - CFG_PROG_VOLATILE, // mode - 0x1918, // sizeof(fw_image_2_data), - 0x00000C16, // Target address in NIC Memory - 0x0000, // CRC: yes/no TYPE: primary/station/tertiary + CFG_PROG_VOLATILE, /* mode */ + 0x1918, /* sizeof(fw_image_2_data), */ + 0x00000C16, /* Target address in NIC Memory */ + 0x0000, /* CRC: yes/no TYPE: primary/station/tertiary */ (hcf_8 FAR *) fw_image_2_data }, { 8, CFG_PROG, - CFG_PROG_VOLATILE, // mode - 0x01bc, // sizeof(fw_image_3_data), - 0x001E252E, // Target address in NIC Memory - 0x0000, // CRC: yes/no TYPE: primary/station/tertiary + CFG_PROG_VOLATILE, /* mode */ + 0x01bc, /* sizeof(fw_image_3_data), */ + 0x001E252E, /* Target address in NIC Memory */ + 0x0000, /* CRC: yes/no TYPE: primary/station/tertiary */ (hcf_8 FAR *) fw_image_3_data }, { 8, CFG_PROG, - CFG_PROG_VOLATILE, // mode - 0xab28, // sizeof(fw_image_4_data), - 0x001F4000, // Target address in NIC Memory - 0x0000, // CRC: yes/no TYPE: primary/station/tertiary + CFG_PROG_VOLATILE, /* mode */ + 0xab28, /* sizeof(fw_image_4_data), */ + 0x001F4000, /* Target address in NIC Memory */ + 0x0000, /* CRC: yes/no TYPE: primary/station/tertiary */ (hcf_8 FAR *) fw_image_4_data }, { 5, CFG_PROG, - CFG_PROG_STOP, // mode + CFG_PROG_STOP, /* mode*/ 0000, - 0x000F1297, // Start execution address + 0x000F1297, /* Start execution address */ }, { 0000, 0000, 0000, 0000, 00000000, 0000, 00000000} }; @@ -3301,7 +3301,7 @@ static const CFG_RANGE20_STRCT fw_image_infocompat[] = { COMP_ROLE_SUPL, COMP_ID_APF, { - { 2, 2, 4 } //variant, bottom, top + { 2, 2, 4 } /* variant, bottom, top */ } }, { 3 + ((20 * sizeof(CFG_RANGE_SPEC_STRCT)) / sizeof(hcf_16)), @@ -3309,9 +3309,9 @@ static const CFG_RANGE20_STRCT fw_image_infocompat[] = { COMP_ROLE_ACT, COMP_ID_MFI, { - { 4, 6, 7 }, //variant, bottom, top - { 5, 6, 7 }, //variant, bottom, top - { 6, 6, 7 } //variant, bottom, top + { 4, 6, 7 }, /* variant, bottom, top */ + { 5, 6, 7 }, /* variant, bottom, top */ + { 6, 6, 7 } /* variant, bottom, top */ } }, { 3 + ((20 * sizeof(CFG_RANGE_SPEC_STRCT)) / sizeof(hcf_16)), @@ -3319,18 +3319,18 @@ static const CFG_RANGE20_STRCT fw_image_infocompat[] = { COMP_ROLE_ACT, COMP_ID_CFI, { - { 2, 1, 2 } //variant, bottom, top + { 2, 1, 2 } /* variant, bottom, top */ } }, - { 0000, 0000, 0000, 0000, { { 0000, 0000, 0000 } } } //endsentinel + { 0000, 0000, 0000, 0000, { { 0000, 0000, 0000 } } } /* endsentinel */ }; memimage fw_image = { - "FUPU7D37dhfwci\001C", //signature, , C/Bin type + "FUPU7D37dhfwci\001C", /* signature, , C/Bin type */ (CFG_PROG_STRCT *) fw_image_code, 0x000F1297, - 00000000, //(dummy) pdaplug - 00000000, //(dummy) priplug + 00000000, /* (dummy) pdaplug */ + 00000000, /* (dummy) priplug */ (CFG_RANGE20_STRCT *) fw_image_infocompat, (CFG_IDENTITY_STRCT *) fw_image_infoidentity, }; -- cgit v1.1 From 01ce33545f2ef939ef73a93974b89c92a27e5522 Mon Sep 17 00:00:00 2001 From: Ruslan Pisarev Date: Tue, 16 Mar 2010 00:05:34 +0200 Subject: Staging: wlags49_h2: fix TAB and space coding style issue in ap_h2.c This is a patch to the p80211conv.c file that fixed up a TAB and spaces Errors found by the checkpatch.pl tools Signed-off-by: Ruslan Pisarev Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/ap_h2.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/ap_h2.c b/drivers/staging/wlags49_h2/ap_h2.c index e311498..eb8244c 100644 --- a/drivers/staging/wlags49_h2/ap_h2.c +++ b/drivers/staging/wlags49_h2/ap_h2.c @@ -26,7 +26,7 @@ #include "hcfcfg.h" /* to get hcf_16 etc defined as well as */ - /* possible settings which inluence mdd.h or dhf.h */ + /* possible settings which inluence mdd.h or dhf.h */ #include "mdd.h" /* to get COMP_ID_STA etc defined */ #include "dhf.h" /* used to be "fhfmem.h", to get memblock,plugrecord, */ @@ -3238,7 +3238,7 @@ static const hcf_8 fw_image_4_data[] = { static const CFG_IDENTITY_STRCT fw_image_infoidentity[] = { { - sizeof( CFG_IDENTITY_STRCT ) / sizeof(hcf_16) - 1, + sizeof(CFG_IDENTITY_STRCT) / sizeof(hcf_16) - 1, CFG_FW_IDENTITY, COMP_ID_FW_AP, 2, /* Variant / @@ -3256,7 +3256,7 @@ static const CFG_PROG_STRCT fw_image_code[] = { 0x0146, /* sizeof(fw_image_1_data), */ 0x00000060, /* Target address in NIC Memory */ 0x0000, /* CRC: yes/no TYPE: primary/station/tertiary */ - (hcf_8 FAR *) fw_image_1_data + (hcf_8 FAR *) fw_image_1_data }, { 8, @@ -3265,7 +3265,7 @@ static const CFG_PROG_STRCT fw_image_code[] = { 0x1918, /* sizeof(fw_image_2_data), */ 0x00000C16, /* Target address in NIC Memory */ 0x0000, /* CRC: yes/no TYPE: primary/station/tertiary */ - (hcf_8 FAR *) fw_image_2_data + (hcf_8 FAR *) fw_image_2_data }, { 8, @@ -3274,7 +3274,7 @@ static const CFG_PROG_STRCT fw_image_code[] = { 0x01bc, /* sizeof(fw_image_3_data), */ 0x001E252E, /* Target address in NIC Memory */ 0x0000, /* CRC: yes/no TYPE: primary/station/tertiary */ - (hcf_8 FAR *) fw_image_3_data + (hcf_8 FAR *) fw_image_3_data }, { 8, @@ -3283,14 +3283,14 @@ static const CFG_PROG_STRCT fw_image_code[] = { 0xab28, /* sizeof(fw_image_4_data), */ 0x001F4000, /* Target address in NIC Memory */ 0x0000, /* CRC: yes/no TYPE: primary/station/tertiary */ - (hcf_8 FAR *) fw_image_4_data + (hcf_8 FAR *) fw_image_4_data }, { 5, CFG_PROG, CFG_PROG_STOP, /* mode*/ 0000, - 0x000F1297, /* Start execution address */ + 0x000F1297, /* Start execution address */ }, { 0000, 0000, 0000, 0000, 00000000, 0000, 00000000} }; -- cgit v1.1 From fd547f1fead33e55190a1c670575fea467ee24ee Mon Sep 17 00:00:00 2001 From: Ruslan Pisarev Date: Tue, 16 Mar 2010 21:48:11 +0200 Subject: Staging: wlags49_h2: fix comments coding style issue in dhf.c This is a patch to the dhf.c file that fixed up a TAB and spaces Errors found by the checkpatch.pl tools, like do not use C99 // comments Signed-off-by: Ruslan Pisarev Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/dhf.c | 74 ++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/dhf.c b/drivers/staging/wlags49_h2/dhf.c index b6f5834..8997980 100644 --- a/drivers/staging/wlags49_h2/dhf.c +++ b/drivers/staging/wlags49_h2/dhf.c @@ -1,5 +1,5 @@ -// vim:tw=110:ts=4: +/* vim:tw=110:ts=4: */ /************************************************************************************************************** * * FILE : DHF.C @@ -97,7 +97,7 @@ #include "dhf.h" #include "mmd.h" -//to distinguish MMD from HCF asserts by means of line number +/* to distinguish MMD from HCF asserts by means of line number */ #undef FILE_NAME_OFFSET #define FILE_NAME_OFFSET MMD_FILE_NAME_OFFSET /*----------------------------------------------------------------------------- @@ -106,18 +106,18 @@ * *---------------------------------------------------------------------------*/ -// 12345678901234 +/* 12345678901234 */ char signature[14] = "FUPU7D37dhfwci"; -//The binary download function "relocates" the image using constructions like: -// fw->identity = (CFG_IDENTITY_STRCT FAR *)((char FAR *)fw->identity + (hcf_32)fw ); -//under some of the memory models under MSVC 1.52 these constructions degrade to 16-bits pointer arithmetic. -//fw->identity is limited, such that adding it to fw, does not need to carry over from offset to segment. -//However the segment is not set at all. -//As a workaround the PSEUDO_CHARP macro is introduced which is a char pointer except for MSVC 1.52, in -//which case we know that a 32-bit quantity is adequate as a pointer. -//Note that other platforms may experience comparable problems when using the binary download feature. -#if defined(_MSC_VER) && _MSC_VER == 800 // Visual C++ 1.5 +/* The binary download function "relocates" the image using constructions like: + fw->identity = (CFG_IDENTITY_STRCT FAR *)((char FAR *)fw->identity + (hcf_32)fw ); + under some of the memory models under MSVC 1.52 these constructions degrade to 16-bits pointer arithmetic. + fw->identity is limited, such that adding it to fw, does not need to carry over from offset to segment. + However the segment is not set at all. + As a workaround the PSEUDO_CHARP macro is introduced which is a char pointer except for MSVC 1.52, in + which case we know that a 32-bit quantity is adequate as a pointer. + Note that other platforms may experience comparable problems when using the binary download feature. */ +#if defined(_MSC_VER) && _MSC_VER == 800 /* Visual C++ 1.5 */ #define PSEUDO_CHARP hcf_32 #else #define PSEUDO_CHARP hcf_8* @@ -132,12 +132,12 @@ char signature[14] = "FUPU7D37dhfwci"; * *---------------------------------------------------------------------------*/ -// for USB/H1 we needed a smaller value than the CFG_DL_BUF_STRCT reported 8192 -// for the time being it seems simpler to always use 2000 for USB/H1 as well as all other cases rather than -// using the "fixed anyway" CFG_DL_BUF_STRCT. +/* for USB/H1 we needed a smaller value than the CFG_DL_BUF_STRCT reported 8192 + for the time being it seems simpler to always use 2000 for USB/H1 as well as all other cases rather than + using the "fixed anyway" CFG_DL_BUF_STRCT. */ #define DL_SIZE 2000 -//CFG_IDENTITY_STRCT pri_identity = { LOF(CFG_IDENTITY_STRCT), CFG_PRI_IDENTITY }; +/* CFG_IDENTITY_STRCT pri_identity = { LOF(CFG_IDENTITY_STRCT), CFG_PRI_IDENTITY }; */ CFG_SUP_RANGE_STRCT mfi_sup = { LOF(CFG_SUP_RANGE_STRCT), CFG_NIC_MFI_SUP_RANGE }; CFG_SUP_RANGE_STRCT cfi_sup = { LOF(CFG_SUP_RANGE_STRCT), CFG_NIC_CFI_SUP_RANGE }; /* Note: could be used rather than the above explained and defined DL_SIZE if need arises @@ -192,41 +192,41 @@ int rc = HCF_SUCCESS; CFG_RANGE_SPEC_STRCT* i; switch( fw->identity->typ ) { - case CFG_FW_IDENTITY: //Station F/W - case COMP_ID_FW_AP_FAKE: //;?is this useful (used to be: CFG_AP_IDENTITY) + case CFG_FW_IDENTITY: /* Station F/W */ + case COMP_ID_FW_AP_FAKE: /* ;?is this useful (used to be: CFG_AP_IDENTITY) */ break; default: - MMDASSERT( DO_ASSERT, fw->identity->typ ) //unknown/unsupported firmware_type: + MMDASSERT( DO_ASSERT, fw->identity->typ ) /* unknown/unsupported firmware_type: */ rc = DHF_ERR_INCOMP_FW; - return rc; /* ;? how useful is this anyway, + return rc; /* ;? how useful is this anyway, * till that is sorted out might as well violate my own single exit principle */ } p = fw->compat; i = NULL; - while( p->len && i == NULL ) { // check the MFI ranges + while( p->len && i == NULL ) { /* check the MFI ranges */ if ( p->typ == CFG_MFI_ACT_RANGES_STA ) { i = mmd_check_comp( (void*)p, &mfi_sup ); } p++; } - MMDASSERT( i, 0 ) //MFI: NIC Supplier not compatible with F/W image Actor + MMDASSERT( i, 0 ) /* MFI: NIC Supplier not compatible with F/W image Actor */ if ( i ) { p = fw->compat; i = NULL; - while ( p->len && i == NULL ) { // check the CFI ranges + while ( p->len && i == NULL ) { /* check the CFI ranges */ if ( p->typ == CFG_CFI_ACT_RANGES_STA ) { i = mmd_check_comp( (void*)p, &cfi_sup ); } p++; } - MMDASSERT( i, 0 ) //CFI: NIC Supplier not compatible with F/W image Actor + MMDASSERT( i, 0 ) /* CFI: NIC Supplier not compatible with F/W image Actor */ } if ( i == NULL ) { rc = DHF_ERR_INCOMP_FW; } return rc; -} // check_comp_fw +} /* check_comp_fw */ @@ -277,13 +277,13 @@ int rc = HCF_SUCCESS; CFG_PROG_STRCT *p; int i; - //validate the image - for ( i = 0; i < sizeof(signature) && fw->signature[i] == signature[i]; i++ ) /*NOP*/; + /* validate the image */ + for ( i = 0; i < sizeof(signature) && fw->signature[i] == signature[i]; i++ ) /* NOP */; if ( i != sizeof(signature) || fw->signature[i] != 0x01 || - //test for Little/Big Endian Binary flag - fw->signature[i+1] != ( /*HCF_BIG_ENDIAN ? 'B' : */ 'L' ) ) rc = DHF_ERR_INCOMP_FW; - else { //Little Endian Binary format + /* test for Little/Big Endian Binary flag */ + fw->signature[i+1] != ( /* HCF_BIG_ENDIAN ? 'B' : */ 'L' ) ) rc = DHF_ERR_INCOMP_FW; + else { /* Little Endian Binary format */ fw->codep = (CFG_PROG_STRCT FAR *)((PSEUDO_CHARP)fw->codep + (hcf_32)fw ); fw->identity = (CFG_IDENTITY_STRCT FAR *)((PSEUDO_CHARP)fw->identity + (hcf_32)fw ); fw->compat = (CFG_RANGE20_STRCT FAR *)((PSEUDO_CHARP)fw->compat + (hcf_32)fw ); @@ -295,7 +295,7 @@ int i; } } return rc; -} // dhf_download_binary +} /* dhf_download_binary */ /************************************************************************************************************* @@ -360,17 +360,17 @@ LTVP ltvp; int i; MMDASSERT( fw != NULL, 0 ) - //validate the image - for ( i = 0; i < sizeof(signature) && fw->signature[i] == signature[i]; i++ ) /*NOP*/; + /* validate the image */ + for ( i = 0; i < sizeof(signature) && fw->signature[i] == signature[i]; i++ ) /* NOP */; if ( i != sizeof(signature) || fw->signature[i] != 0x01 || - //check for binary image + /* check for binary image */ ( fw->signature[i+1] != 'C' && fw->signature[i+1] != ( /*HCF_BIG_ENDIAN ? 'B' : */ 'L' ) ) ) rc = DHF_ERR_INCOMP_FW; -// Retrieve all information needed for download from the NIC +/* Retrieve all information needed for download from the NIC */ while ( ( rc == HCF_SUCCESS ) && ( ( ltvp = pp->ltvp) != NULL ) ) { - ltvp->len = pp++->len; // Set len to original len. This len is changed to real len by GET_INFO() + ltvp->len = pp++->len; /* Set len to original len. This len is changed to real len by GET_INFO() */ rc = GET_INFO( ltvp ); MMDASSERT( rc == HCF_SUCCESS, rc ) MMDASSERT( rc == HCF_SUCCESS, ltvp->typ ) @@ -385,6 +385,6 @@ int i; } MMDASSERT( rc == HCF_SUCCESS, rc ) return rc; -} // dhf_download_fw +} /* dhf_download_fw */ -- cgit v1.1 From ccc75a583d993c4d51e2b62ae340cebb23ae886f Mon Sep 17 00:00:00 2001 From: Ruslan Pisarev Date: Tue, 16 Mar 2010 21:59:22 +0200 Subject: Staging: wlags49_h2: fix copyright style issue in dhf.c This is a patch to the dhf.c file that fixed up a copyright style Errors found by the checkpatch.pl tools Signed-off-by: Ruslan Pisarev Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/dhf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/dhf.c b/drivers/staging/wlags49_h2/dhf.c index 8997980..3690364 100644 --- a/drivers/staging/wlags49_h2/dhf.c +++ b/drivers/staging/wlags49_h2/dhf.c @@ -54,8 +54,8 @@ * 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 © 1999 - 2000 by Lucent Technologies. All Rights Reserved -* COPYRIGHT © 2001 - 2004 by Agere Systems Inc. All Rights Reserved +* COPYRIGHT (C) 1999 - 2000 by Lucent Technologies. All Rights Reserved +* COPYRIGHT (C) 2001 - 2004 by Agere Systems Inc. All Rights Reserved * All rights reserved. * * Redistribution and use in source or binary forms, with or without -- cgit v1.1 From 068b561c3c96e7a52a4974da457fb8591064d40b Mon Sep 17 00:00:00 2001 From: Ruslan Pisarev Date: Wed, 17 Mar 2010 10:14:34 +0200 Subject: Staging: wlags49_h2: fix TAB and space coding style issue dhf.c This is a patch to the dhf.c file that fixed up a TAB and spaces Errors found by the checkpatch.pl tools Signed-off-by: Ruslan Pisarev Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/dhf.c | 88 ++++++++++++++++++++-------------------- 1 file changed, 44 insertions(+), 44 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/dhf.c b/drivers/staging/wlags49_h2/dhf.c index 3690364..3af4398 100644 --- a/drivers/staging/wlags49_h2/dhf.c +++ b/drivers/staging/wlags49_h2/dhf.c @@ -120,7 +120,7 @@ char signature[14] = "FUPU7D37dhfwci"; #if defined(_MSC_VER) && _MSC_VER == 800 /* Visual C++ 1.5 */ #define PSEUDO_CHARP hcf_32 #else -#define PSEUDO_CHARP hcf_8* +#define PSEUDO_CHARP (hcf_8 *) #endif /*----------------------------------------------------------------------------- @@ -164,7 +164,7 @@ LTV_INFO_STRUCT ltv_info[] = { /***********************************************************************************************************/ /*************************************** PROTOTYPES ******************************************************/ /***********************************************************************************************************/ -static int check_comp_fw( memimage *fw ); +static int check_comp_fw(memimage *fw); /************************************************************************************************************ @@ -185,44 +185,44 @@ static int check_comp_fw( memimage *fw ); *.ENDDOC END DOCUMENTATION *************************************************************************************************************/ int -check_comp_fw( memimage *fw ) +check_comp_fw(memimage *fw) { CFG_RANGE20_STRCT *p; int rc = HCF_SUCCESS; -CFG_RANGE_SPEC_STRCT* i; +CFG_RANGE_SPEC_STRCT *i; - switch( fw->identity->typ ) { - case CFG_FW_IDENTITY: /* Station F/W */ - case COMP_ID_FW_AP_FAKE: /* ;?is this useful (used to be: CFG_AP_IDENTITY) */ + switch (fw->identity->typ) { + case CFG_FW_IDENTITY: /* Station F/W */ + case COMP_ID_FW_AP_FAKE: /* ;?is this useful (used to be: CFG_AP_IDENTITY) */ break; - default: - MMDASSERT( DO_ASSERT, fw->identity->typ ) /* unknown/unsupported firmware_type: */ + default: + MMDASSERT(DO_ASSERT, fw->identity->typ) /* unknown/unsupported firmware_type: */ rc = DHF_ERR_INCOMP_FW; - return rc; /* ;? how useful is this anyway, + return rc; /* ;? how useful is this anyway, * till that is sorted out might as well violate my own single exit principle */ } p = fw->compat; i = NULL; - while( p->len && i == NULL ) { /* check the MFI ranges */ - if ( p->typ == CFG_MFI_ACT_RANGES_STA ) { - i = mmd_check_comp( (void*)p, &mfi_sup ); + while (p->len && i == NULL) { /* check the MFI ranges */ + if (p->typ == CFG_MFI_ACT_RANGES_STA) { + i = mmd_check_comp((void *)p, &mfi_sup); } p++; } - MMDASSERT( i, 0 ) /* MFI: NIC Supplier not compatible with F/W image Actor */ - if ( i ) { + MMDASSERT(i, 0) /* MFI: NIC Supplier not compatible with F/W image Actor */ + if (i) { p = fw->compat; i = NULL; - while ( p->len && i == NULL ) { /* check the CFI ranges */ - if ( p->typ == CFG_CFI_ACT_RANGES_STA ) { - i = mmd_check_comp( (void*)p, &cfi_sup ); + while (p->len && i == NULL) { /* check the CFI ranges */ + if (p->typ == CFG_CFI_ACT_RANGES_STA) { + i = mmd_check_comp((void *)p, &cfi_sup); } p++; } - MMDASSERT( i, 0 ) /* CFI: NIC Supplier not compatible with F/W image Actor */ + MMDASSERT(i, 0) /* CFI: NIC Supplier not compatible with F/W image Actor */ } - if ( i == NULL ) { + if (i == NULL) { rc = DHF_ERR_INCOMP_FW; } return rc; @@ -271,25 +271,25 @@ CFG_RANGE_SPEC_STRCT* i; *.ENDDOC END DOCUMENTATION *************************************************************************************************************/ int -dhf_download_binary( memimage *fw ) +dhf_download_binary(memimage *fw) { int rc = HCF_SUCCESS; CFG_PROG_STRCT *p; int i; /* validate the image */ - for ( i = 0; i < sizeof(signature) && fw->signature[i] == signature[i]; i++ ) /* NOP */; - if ( i != sizeof(signature) || + for (i = 0; i < sizeof(signature) && fw->signature[i] == signature[i]; i++); /* NOP */ + if (i != sizeof(signature) || fw->signature[i] != 0x01 || /* test for Little/Big Endian Binary flag */ - fw->signature[i+1] != ( /* HCF_BIG_ENDIAN ? 'B' : */ 'L' ) ) rc = DHF_ERR_INCOMP_FW; + fw->signature[i+1] != (/* HCF_BIG_ENDIAN ? 'B' : */ 'L')) rc = DHF_ERR_INCOMP_FW; else { /* Little Endian Binary format */ - fw->codep = (CFG_PROG_STRCT FAR *)((PSEUDO_CHARP)fw->codep + (hcf_32)fw ); - fw->identity = (CFG_IDENTITY_STRCT FAR *)((PSEUDO_CHARP)fw->identity + (hcf_32)fw ); - fw->compat = (CFG_RANGE20_STRCT FAR *)((PSEUDO_CHARP)fw->compat + (hcf_32)fw ); - for ( i = 0; fw->p[i]; i++ ) fw->p[i] = ((PSEUDO_CHARP)fw->p[i] + (hcf_32)fw ); + fw->codep = (CFG_PROG_STRCT FAR*)((PSEUDO_CHARP)fw->codep + (hcf_32)fw); + fw->identity = (CFG_IDENTITY_STRCT FAR*)((PSEUDO_CHARP)fw->identity + (hcf_32)fw); + fw->compat = (CFG_RANGE20_STRCT FAR*)((PSEUDO_CHARP)fw->compat + (hcf_32)fw); + for (i = 0; fw->p[i]; i++) fw->p[i] = ((PSEUDO_CHARP)fw->p[i] + (hcf_32)fw); p = fw->codep; - while ( p->len ) { + while (p->len) { p->host_addr = (PSEUDO_CHARP)p->host_addr + (hcf_32)fw; p++; } @@ -351,7 +351,7 @@ int i; *.ENDDOC END DOCUMENTATION *************************************************************************************************************/ int -dhf_download_fw( void *ifbp, memimage *fw ) +dhf_download_fw(void *ifbp, memimage *fw) { int rc = HCF_SUCCESS; LTV_INFO_STRUCT_PTR pp = ltv_info; @@ -359,31 +359,31 @@ CFG_PROG_STRCT *p = fw->codep; LTVP ltvp; int i; - MMDASSERT( fw != NULL, 0 ) + MMDASSERT(fw != NULL, 0) /* validate the image */ - for ( i = 0; i < sizeof(signature) && fw->signature[i] == signature[i]; i++ ) /* NOP */; - if ( i != sizeof(signature) || + for (i = 0; i < sizeof(signature) && fw->signature[i] == signature[i]; i++) /* NOP */; + if (i != sizeof(signature) || fw->signature[i] != 0x01 || /* check for binary image */ - ( fw->signature[i+1] != 'C' && fw->signature[i+1] != ( /*HCF_BIG_ENDIAN ? 'B' : */ 'L' ) ) ) + (fw->signature[i+1] != 'C' && fw->signature[i+1] != (/*HCF_BIG_ENDIAN ? 'B' : */ 'L'))) rc = DHF_ERR_INCOMP_FW; /* Retrieve all information needed for download from the NIC */ - while ( ( rc == HCF_SUCCESS ) && ( ( ltvp = pp->ltvp) != NULL ) ) { + while ((rc == HCF_SUCCESS) && ((ltvp = pp->ltvp) != NULL)) { ltvp->len = pp++->len; /* Set len to original len. This len is changed to real len by GET_INFO() */ - rc = GET_INFO( ltvp ); - MMDASSERT( rc == HCF_SUCCESS, rc ) - MMDASSERT( rc == HCF_SUCCESS, ltvp->typ ) - MMDASSERT( rc == HCF_SUCCESS, ltvp->len ) + rc = GET_INFO(ltvp); + MMDASSERT(rc == HCF_SUCCESS, rc) + MMDASSERT(rc == HCF_SUCCESS, ltvp->typ) + MMDASSERT(rc == HCF_SUCCESS, ltvp->len) } - if ( rc == HCF_SUCCESS ) rc = check_comp_fw( fw ); - if ( rc == HCF_SUCCESS ) { - while ( rc == HCF_SUCCESS && p->len ) { - rc = PUT_INFO( p ); + if (rc == HCF_SUCCESS) rc = check_comp_fw(fw); + if (rc == HCF_SUCCESS) { + while (rc == HCF_SUCCESS && p->len) { + rc = PUT_INFO(p); p++; } } - MMDASSERT( rc == HCF_SUCCESS, rc ) + MMDASSERT(rc == HCF_SUCCESS, rc) return rc; } /* dhf_download_fw */ -- cgit v1.1 From 437de951eca9c831dc69a47b58603b1d8d9cbf82 Mon Sep 17 00:00:00 2001 From: Ruslan Pisarev Date: Wed, 17 Mar 2010 11:02:49 +0200 Subject: Staging: wlags49_h2: fix trailing statements coding style issue in dhf.c This is a patch to the dhf.c file that fixed up a trailing statements Errors found by the checkpatch.pl tools, like trailing statements should be on next line Signed-off-by: Ruslan Pisarev Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/dhf.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/dhf.c b/drivers/staging/wlags49_h2/dhf.c index 3af4398..d5fb1a9 100644 --- a/drivers/staging/wlags49_h2/dhf.c +++ b/drivers/staging/wlags49_h2/dhf.c @@ -278,16 +278,19 @@ CFG_PROG_STRCT *p; int i; /* validate the image */ - for (i = 0; i < sizeof(signature) && fw->signature[i] == signature[i]; i++); /* NOP */ + for (i = 0; i < sizeof(signature) && fw->signature[i] == signature[i]; i++) + ; /* NOP */ if (i != sizeof(signature) || fw->signature[i] != 0x01 || /* test for Little/Big Endian Binary flag */ - fw->signature[i+1] != (/* HCF_BIG_ENDIAN ? 'B' : */ 'L')) rc = DHF_ERR_INCOMP_FW; + fw->signature[i+1] != (/* HCF_BIG_ENDIAN ? 'B' : */ 'L')) + rc = DHF_ERR_INCOMP_FW; else { /* Little Endian Binary format */ fw->codep = (CFG_PROG_STRCT FAR*)((PSEUDO_CHARP)fw->codep + (hcf_32)fw); fw->identity = (CFG_IDENTITY_STRCT FAR*)((PSEUDO_CHARP)fw->identity + (hcf_32)fw); fw->compat = (CFG_RANGE20_STRCT FAR*)((PSEUDO_CHARP)fw->compat + (hcf_32)fw); - for (i = 0; fw->p[i]; i++) fw->p[i] = ((PSEUDO_CHARP)fw->p[i] + (hcf_32)fw); + for (i = 0; fw->p[i]; i++) + fw->p[i] = ((PSEUDO_CHARP)fw->p[i] + (hcf_32)fw); p = fw->codep; while (p->len) { p->host_addr = (PSEUDO_CHARP)p->host_addr + (hcf_32)fw; @@ -361,7 +364,8 @@ int i; MMDASSERT(fw != NULL, 0) /* validate the image */ - for (i = 0; i < sizeof(signature) && fw->signature[i] == signature[i]; i++) /* NOP */; + for (i = 0; i < sizeof(signature) && fw->signature[i] == signature[i]; i++) + ; /* NOP */ if (i != sizeof(signature) || fw->signature[i] != 0x01 || /* check for binary image */ @@ -376,7 +380,8 @@ int i; MMDASSERT(rc == HCF_SUCCESS, ltvp->typ) MMDASSERT(rc == HCF_SUCCESS, ltvp->len) } - if (rc == HCF_SUCCESS) rc = check_comp_fw(fw); + if (rc == HCF_SUCCESS) + rc = check_comp_fw(fw); if (rc == HCF_SUCCESS) { while (rc == HCF_SUCCESS && p->len) { rc = PUT_INFO(p); -- cgit v1.1 From 7adea182f1fcaac3c0f37007a15d27f80ef56b85 Mon Sep 17 00:00:00 2001 From: Ruslan Pisarev Date: Sat, 20 Mar 2010 09:24:44 +0200 Subject: Staging: wlags49_h2: fix copyright and space style issue in dhf.h This is a patch to the dhf.h file that fixed up a copyright anf space style Errors found by the checkpatch.pl tools Signed-off-by: Ruslan Pisarev Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/dhf.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/dhf.h b/drivers/staging/wlags49_h2/dhf.h index c071f34..13abcdd 100644 --- a/drivers/staging/wlags49_h2/dhf.h +++ b/drivers/staging/wlags49_h2/dhf.h @@ -38,9 +38,9 @@ * 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 © 1994 - 1995 by AT&T. All Rights Reserved -* COPYRIGHT © 1999 - 2000 by Lucent Technologies. All Rights Reserved -* COPYRIGHT © 2001 - 2004 by Agere Systems Inc. All Rights Reserved +* COPYRIGHT (C) 1994 - 1995 by AT&T. All Rights Reserved +* COPYRIGHT (C) 1999 - 2000 by Lucent Technologies. All Rights Reserved +* COPYRIGHT (C) 2001 - 2004 by Agere Systems Inc. All Rights Reserved * All rights reserved. * * Redistribution and use in source or binary forms, with or without @@ -85,11 +85,11 @@ #include "hcf.h" // includes HCFCFG.H too #ifdef DHF_UIL -#define GET_INFO( pp ) uil_get_info( (LTVP)pp ) -#define PUT_INFO( pp ) uil_put_info( (LTVP)pp ) +#define GET_INFO(pp) uil_get_info((LTVP)pp) +#define PUT_INFO(pp) uil_put_info((LTVP)pp) #else -#define GET_INFO( pp ) hcf_get_info( ifbp, (LTVP)pp ) -#define PUT_INFO( pp ) hcf_put_info( ifbp, (LTVP)pp ) +#define GET_INFO(pp) hcf_get_info(ifbp, (LTVP)pp) +#define PUT_INFO(pp) hcf_put_info(ifbp, (LTVP)pp) #endif @@ -189,9 +189,9 @@ typedef struct { */ typedef struct { char signature[14+1+1]; // signature (see DHF.C) + C/LE-Bin/BE-Bin-flag + format version - CFG_PROG_STRCT FAR *codep; // + CFG_PROG_STRCT FAR * codep; // hcf_32 execution; // Execution address of the firmware - void FAR *place_holder_1; + void FAR * place_holder_1; void FAR *place_holder_2; CFG_RANGE20_STRCT FAR *compat; // Pointer to the compatibility info records CFG_IDENTITY_STRCT FAR *identity; // Pointer to the identity info records @@ -209,8 +209,8 @@ typedef struct { * *---------------------------------------------------------------------------*/ -EXTERN_C int dhf_download_fw( void *ifbp, memimage *fw ); // ifbp, ignored when using the UIL -EXTERN_C int dhf_download_binary( memimage *fw ); +EXTERN_C int dhf_download_fw(void *ifbp, memimage *fw); // ifbp, ignored when using the UIL +EXTERN_C int dhf_download_binary(memimage *fw); /*----------------------------------------------------------------------------- @@ -220,7 +220,7 @@ EXTERN_C int dhf_download_binary( memimage *fw ); *---------------------------------------------------------------------------*/ // defined in DHF.C; see there for comments -EXTERN_C hcf_16 *find_record_in_pda( hcf_16 *pdap, hcf_16 code ); +EXTERN_C hcf_16 *find_record_in_pda(hcf_16 *pdap, hcf_16 code); #endif // DHF_H -- cgit v1.1 From 1ef61183ceaf2ebb59df817834c0cc755d99c634 Mon Sep 17 00:00:00 2001 From: Ruslan Pisarev Date: Sat, 20 Mar 2010 09:24:57 +0200 Subject: Staging: wlags49_h2: fix space and comments style issue in dhf.h This is a patch to the dhf.c file that fixed up a space and comments style Errors found by the checkpatch.pl tools Signed-off-by: Ruslan Pisarev Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/dhf.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/dhf.h b/drivers/staging/wlags49_h2/dhf.h index 13abcdd..dbe0611 100644 --- a/drivers/staging/wlags49_h2/dhf.h +++ b/drivers/staging/wlags49_h2/dhf.h @@ -1,5 +1,5 @@ -// vim:tw=110:ts=4: +/* vim:tw=110:ts=4: */ #ifndef DHF_H #define DHF_H @@ -82,7 +82,7 @@ #include #endif -#include "hcf.h" // includes HCFCFG.H too +#include "hcf.h" /* includes HCFCFG.H too */ #ifdef DHF_UIL #define GET_INFO(pp) uil_get_info((LTVP)pp) @@ -94,15 +94,15 @@ /*---- Defines --------------------------------------------------------------*/ -#define CODEMASK 0x0000FFFFL // Codemask for plug records +#define CODEMASK 0x0000FFFFL /* Codemask for plug records */ /*---- Error numbers --------------------------------------------------------*/ -#define DHF_ERR_INCOMP_FW 0x40 //Image not compatible with NIC +#define DHF_ERR_INCOMP_FW 0x40 /* Image not compatible with NIC */ /*---- Type definitions -----------------------------------------------------*/ -//* needed by dhf_wrap.c -// +/* needed by dhf_wrap.c */ + typedef struct { LTVP ltvp; hcf_16 len; @@ -119,9 +119,9 @@ typedef struct { */ typedef struct { - hcf_32 code; // Code to plug - hcf_32 addr; // Address within the memory image to plug it in - hcf_32 len; // The # of bytes which are available to store it + hcf_32 code; /* Code to plug */ + hcf_32 addr; /* Address within the memory image to plug it in */ + hcf_32 len; /* The # of bytes which are available to store it */ } plugrecord; /* @@ -159,7 +159,7 @@ typedef struct { char str[MAX_DEBUGEXPORT_LEN]; } exportrecord; -// Offsets in memimage array p[] +/* Offsets in memimage array p[] */ #define FWSTRINGS_FUNCTION 0 #define FWEXPORTS_FUNCTION 1 @@ -188,13 +188,13 @@ typedef struct { * The end of the array is indicated by a plug record of which all fields are zero. */ typedef struct { - char signature[14+1+1]; // signature (see DHF.C) + C/LE-Bin/BE-Bin-flag + format version - CFG_PROG_STRCT FAR * codep; // - hcf_32 execution; // Execution address of the firmware - void FAR * place_holder_1; + char signature[14+1+1]; /* signature (see DHF.C) + C/LE-Bin/BE-Bin-flag + format version */ + CFG_PROG_STRCT FAR *codep; /* */ + hcf_32 execution; /* Execution address of the firmware */ + void FAR *place_holder_1; void FAR *place_holder_2; - CFG_RANGE20_STRCT FAR *compat; // Pointer to the compatibility info records - CFG_IDENTITY_STRCT FAR *identity; // Pointer to the identity info records + CFG_RANGE20_STRCT FAR *compat; /* Pointer to the compatibility info records */ + CFG_IDENTITY_STRCT FAR *identity; /* Pointer to the identity info records */ void FAR *p[2]; /* (Up to 9) pointers for (future) expansion * currently in use: * - F/W printf information @@ -209,7 +209,7 @@ typedef struct { * *---------------------------------------------------------------------------*/ -EXTERN_C int dhf_download_fw(void *ifbp, memimage *fw); // ifbp, ignored when using the UIL +EXTERN_C int dhf_download_fw(void *ifbp, memimage *fw); /* ifbp, ignored when using the UIL */ EXTERN_C int dhf_download_binary(memimage *fw); @@ -219,8 +219,8 @@ EXTERN_C int dhf_download_binary(memimage *fw); * *---------------------------------------------------------------------------*/ -// defined in DHF.C; see there for comments +/* defined in DHF.C; see there for comments */ EXTERN_C hcf_16 *find_record_in_pda(hcf_16 *pdap, hcf_16 code); -#endif // DHF_H +#endif /* DHF_H */ -- cgit v1.1 From fa51929f66ce7953714df1193b13750c39871065 Mon Sep 17 00:00:00 2001 From: Ruslan Pisarev Date: Sat, 20 Mar 2010 09:36:15 +0200 Subject: Staging: wlags49_h2: fix copyright and comments style issue in dhfcfg.h This is a patch to the dhfcfg.h file that fixed up a copyright and commets style Errors found by the checkpatch.pl tools Signed-off-by: Ruslan Pisarev Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/dhfcfg.h | 118 ++++++++++++++++++------------------ 1 file changed, 59 insertions(+), 59 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/dhfcfg.h b/drivers/staging/wlags49_h2/dhfcfg.h index a0c26c6..75c279f 100644 --- a/drivers/staging/wlags49_h2/dhfcfg.h +++ b/drivers/staging/wlags49_h2/dhfcfg.h @@ -22,7 +22,7 @@ * software indicates your acceptance of these terms and conditions. If you do * not agree with these terms and conditions, do not use the software. * - * Copyright © 2003 Agere Systems Inc. + * Copyright (c) 2003 Agere Systems Inc. * All rights reserved. * * Redistribution and use in source or binary forms, with or without @@ -77,82 +77,82 @@ *---------------------------------------------------------------------------*/ -// Define DHF_WCI if you want to use the WCI to access the ORiNOCO card. -// Define DHF_UIL if you want to use the UIL to access the ORiNOCO card. -// You must define either DHF_WCI or DHF_UIL. If neither of the two is defined -// or both a compile error is generated. +/* Define DHF_WCI if you want to use the WCI to access the ORiNOCO card. + Define DHF_UIL if you want to use the UIL to access the ORiNOCO card. + You must define either DHF_WCI or DHF_UIL. If neither of the two is defined + or both a compile error is generated. */ #define DHF_WCI -//!!!#define DHF_UIL +/* !!!#define DHF_UIL */ -// Define DHF_BIG_ENDIAN if you are working on a big endian platform. -// Define DHF_LITTLE_ENDIAN if you are working on a little endian platform. -// You must define either DHF_BIG_ENDIAN or DHF_LITTLE_ENDIAN. If neither of -// the two is defined or both a compile error is generated. +/* Define DHF_BIG_ENDIAN if you are working on a big endian platform. + Define DHF_LITTLE_ENDIAN if you are working on a little endian platform. + You must define either DHF_BIG_ENDIAN or DHF_LITTLE_ENDIAN. If neither of + the two is defined or both a compile error is generated. */ #ifdef USE_BIG_ENDIAN #define DHF_BIG_ENDIAN #else #define DHF_LITTLE_ENDIAN #endif /* USE_BIG_ENDIAN */ -// Define DHF_WIN if you are working on Windows platform. -// Define DHF_DOS if you are working on DOS. -// You must define either DHF_WIN or DHF_DOS. If neither of -// the two is defined or both a compile error is generated. -//!!!#define DHF_WIN -//!!!#define DHF_DOS +/* Define DHF_WIN if you are working on Windows platform. + Define DHF_DOS if you are working on DOS. + You must define either DHF_WIN or DHF_DOS. If neither of + the two is defined or both a compile error is generated. + !!!#define DHF_WIN + !!!#define DHF_DOS */ -// Define if you want the DHF to users. Not defining DHF_GET_RES_MSG -// leads to a decrease in code size as message strings are not included. -//!!!#define DHF_GET_RES_MSG +/* Define if you want the DHF to users. Not defining DHF_GET_RES_MSG + leads to a decrease in code size as message strings are not included. + !!!#define DHF_GET_RES_MSG */ -// Linux driver specific -// Prevent inclusion of stdlib.h and string.h +/* Linux driver specific + Prevent inclusion of stdlib.h and string.h */ #define _INC_STDLIB #define _INC_STRING -//----------------------------------------------------------------------------- -// Define one or more of the following DSF #defines if you want to implement -// the related DSF-function. Function dsf_callback must allways be implemented. -// See file DHF.H for prototypes of the functions. - -// Define DSF_ALLOC if you want to manage memory allocation and de-allocation -// for the DHF. If DSF_ALLOC is defined you must implement dsf_alloc and dsf_free. -//!!!#define DSF_ALLOC - -// Define DSF_CONFIRM if you want the DHF to ask the user for confirmation in a -// number of situations. If DSF_CONFIRM is defined you must implement dsf_confirm. -// Not defining DSF_CONFIRM leads to a decrease in code size as confirmation -// strings are not included. -//!!!#define DSF_CONFIRM - -// Define DSF_DEBUG_MESSAGE if you want debug messages added to your output. -// If you define DSF_DEBUG_MESSAGE then you must implement function -// dsf_debug_message. -//#define DSF_DEBUG_MESSAGE - -// Define DSF_ASSERT if you want asserts to be activated. -// If you define DSF_ASSERT then you must implement function dsf_assert. -//#define DBG 1 -//#define DSF_ASSERT - -// Define DSF_DBWIN if you want asserts and debug messages to be send to a debug -// window like SOFTICE or DebugView from SysInternals. -//!!!#define DSF_DBWIN -//!!! Not implemented yet! - -// Define DSF_VOLATILE_ONLY if you only wants to use valatile functions -// This is a typical setting for a AP and a driver. +/*----------------------------------------------------------------------------- + Define one or more of the following DSF #defines if you want to implement + the related DSF-function. Function dsf_callback must allways be implemented. + See file DHF.H for prototypes of the functions. */ + +/* Define DSF_ALLOC if you want to manage memory allocation and de-allocation + for the DHF. If DSF_ALLOC is defined you must implement dsf_alloc and dsf_free. + !!!#define DSF_ALLOC */ + +/* Define DSF_CONFIRM if you want the DHF to ask the user for confirmation in a + number of situations. If DSF_CONFIRM is defined you must implement dsf_confirm. + Not defining DSF_CONFIRM leads to a decrease in code size as confirmation + strings are not included. + !!!#define DSF_CONFIRM */ + +/* Define DSF_DEBUG_MESSAGE if you want debug messages added to your output. + If you define DSF_DEBUG_MESSAGE then you must implement function + dsf_debug_message. + #define DSF_DEBUG_MESSAGE */ + +/* Define DSF_ASSERT if you want asserts to be activated. + If you define DSF_ASSERT then you must implement function dsf_assert. + #define DBG 1 + #define DSF_ASSERT */ + +/* Define DSF_DBWIN if you want asserts and debug messages to be send to a debug + window like SOFTICE or DebugView from SysInternals. + !!!#define DSF_DBWIN + !!! Not implemented yet! */ + +/* Define DSF_VOLATILE_ONLY if you only wants to use valatile functions + This is a typical setting for a AP and a driver. */ #define DSF_VOLATILE_ONLY -// Define DSF_HERMESII if you want to use the DHF for the Hermes-II +/* Define DSF_HERMESII if you want to use the DHF for the Hermes-II */ #ifdef HERMES2 #define DSF_HERMESII #else #undef DSF_HERMESII -#endif // HERMES2 +#endif /* HERMES2 */ -// Define DSF_BINARY_FILE if you want to use the DHF in combination with -// reading the Firmware from a separate binary file. -//!!!#define DSF_BINARY_FILE +/* Define DSF_BINARY_FILE if you want to use the DHF in combination with + reading the Firmware from a separate binary file. + !!!#define DSF_BINARY_FILE */ -#endif // DHFCFG_H +#endif /* DHFCFG_H */ -- cgit v1.1 From d101b958cb334c757edd4998fa0f2454755d7c3e Mon Sep 17 00:00:00 2001 From: "Prashant P. Shah" Date: Sun, 9 May 2010 22:41:16 +0530 Subject: Staging: wlags49_h2: fixed whitespace issues in wl_profile.c This is a patch to the wl_profile.c file that fixes whitespace issues found by the checkpatch.pl tool. Signed-off-by: Prashant P. Shah Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/wl_profile.c | 759 +++++++++++++++----------------- 1 file changed, 354 insertions(+), 405 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/wl_profile.c b/drivers/staging/wlags49_h2/wl_profile.c index 1e0c75f..e4e78a4 100644 --- a/drivers/staging/wlags49_h2/wl_profile.c +++ b/drivers/staging/wlags49_h2/wl_profile.c @@ -113,17 +113,19 @@ extern p_u32 DebugFlag; extern dbg_info_t *DbgInfo; #endif -int parse_yes_no( char* value ); +int parse_yes_no(char *value); -int parse_yes_no( char* value ) { +int parse_yes_no(char *value) +{ int rc = 0; //default to NO for invalid parameters - if ( strlen( value ) == 1 ) { - if ( ( value[0] | ('Y'^'y') ) == 'y' ) rc = 1; + if (strlen(value) == 1) { + if ((value[0] | ('Y'^'y')) == 'y') + rc = 1; // } else { // this should not be debug time info, it is an enduser data entry error ;? -// DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MICROWAVE_ROBUSTNESS ); +// DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MICROWAVE_ROBUSTNESS); } return rc; } // parse_yes_no @@ -149,11 +151,11 @@ int rc = 0; //default to NO for invalid parameters * N/A * ******************************************************************************/ -void parse_config( struct net_device *dev ) +void parse_config(struct net_device *dev) { int file_desc; #if 0 // BIN_DL - int rc; + int rc; char *cp = NULL; #endif // BIN_DL char buffer[MAX_LINE_SIZE]; @@ -163,48 +165,48 @@ void parse_config( struct net_device *dev ) ENCSTRCT sEncryption; /*------------------------------------------------------------------------*/ - DBG_FUNC( "parse_config" ); - DBG_ENTER( DbgInfo ); + DBG_FUNC("parse_config"); + DBG_ENTER(DbgInfo); /* Get the wavelan specific info for this device */ wvlan_config = (struct wl_private *)dev->priv; - if ( wvlan_config == NULL ) { - DBG_ERROR( DbgInfo, "Wavelan specific info struct not present?\n" ); + if (wvlan_config == NULL) { + DBG_ERROR(DbgInfo, "Wavelan specific info struct not present?\n"); return; } /* setup the default encryption string */ - strcpy( wvlan_config->szEncryption, DEF_CRYPT_STR ); + strcpy(wvlan_config->szEncryption, DEF_CRYPT_STR); /* Obtain a user-space process context, storing the original context */ - fs = get_fs( ); - set_fs( get_ds( )); + fs = get_fs(); + set_fs(get_ds()); /* Determine the filename for this device and attempt to open it */ - sprintf( filename, "%s%s", ROOT_CONFIG_FILENAME, dev->name ); - file_desc = open( filename, O_RDONLY, 0 ); - if ( file_desc != -1 ) { - DBG_TRACE( DbgInfo, "Wireless config file found. Parsing options...\n" ); + sprintf(filename, "%s%s", ROOT_CONFIG_FILENAME, dev->name); + file_desc = open(filename, O_RDONLY, 0); + if (file_desc != -1) { + DBG_TRACE(DbgInfo, "Wireless config file found. Parsing options...\n"); /* Read out the options */ - while( readline( file_desc, buffer )) { - translate_option( buffer, wvlan_config ); + while (readline(file_desc, buffer)) { + translate_option(buffer, wvlan_config); } /* Close the file */ - close( file_desc ); //;?even if file_desc == -1 ??? + close(file_desc); //;?even if file_desc == -1 ??? } else { - DBG_TRACE( DbgInfo, "No iwconfig file found for this device; " - "config.opts or wireless.opts will be used\n" ); + DBG_TRACE(DbgInfo, "No iwconfig file found for this device; " + "config.opts or wireless.opts will be used\n"); } /* Return to the original context */ - set_fs( fs ); + set_fs(fs); /* convert the WEP keys, if read in as key1, key2, type of data */ - if ( wvlan_config->EnableEncryption ) { - memset( &sEncryption, 0, sizeof( sEncryption )); + if (wvlan_config->EnableEncryption) { + memset(&sEncryption, 0, sizeof(sEncryption)); - wl_wep_decode( CRYPT_CODE, &sEncryption, - wvlan_config->szEncryption ); + wl_wep_decode(CRYPT_CODE, &sEncryption, + wvlan_config->szEncryption); /* the Linux driver likes to use 1-4 for the key IDs, and then convert to 0-3 when sending to the card. The Windows code @@ -216,63 +218,63 @@ void parse_config( struct net_device *dev ) sEncryption.wEnabled = wvlan_config->EnableEncryption; sEncryption.wTxKeyID = wvlan_config->TransmitKeyID - 1; - memcpy( &sEncryption.EncStr, &wvlan_config->DefaultKeys, - sizeof( CFG_DEFAULT_KEYS_STRCT )); + memcpy(&sEncryption.EncStr, &wvlan_config->DefaultKeys, + sizeof(CFG_DEFAULT_KEYS_STRCT)); - memset( wvlan_config->szEncryption, 0, sizeof( wvlan_config->szEncryption )); + memset(wvlan_config->szEncryption, 0, sizeof(wvlan_config->szEncryption)); - wl_wep_code( CRYPT_CODE, wvlan_config->szEncryption, &sEncryption, - sizeof( sEncryption )); + wl_wep_code(CRYPT_CODE, wvlan_config->szEncryption, &sEncryption, + sizeof(sEncryption)); } /* decode the encryption string for the call to wl_commit() */ - wl_wep_decode( CRYPT_CODE, &sEncryption, wvlan_config->szEncryption ); + wl_wep_decode(CRYPT_CODE, &sEncryption, wvlan_config->szEncryption); wvlan_config->TransmitKeyID = sEncryption.wTxKeyID + 1; wvlan_config->EnableEncryption = sEncryption.wEnabled; - memcpy( &wvlan_config->DefaultKeys, &sEncryption.EncStr, - sizeof( CFG_DEFAULT_KEYS_STRCT )); + memcpy(&wvlan_config->DefaultKeys, &sEncryption.EncStr, + sizeof(CFG_DEFAULT_KEYS_STRCT)); #if 0 //BIN_DL /* Obtain a user-space process context, storing the original context */ - fs = get_fs( ); - set_fs( get_ds( )); + fs = get_fs(); + set_fs(get_ds()); //;?just to fake something - strcpy(/*wvlan_config->fw_image_*/filename, "/etc/agere/fw.bin" ); - file_desc = open( /*wvlan_config->fw_image_*/filename, 0, 0 ); - if ( file_desc == -1 ) { - DBG_ERROR( DbgInfo, "No image file found\n" ); + strcpy(/*wvlan_config->fw_image_*/filename, "/etc/agere/fw.bin"); + file_desc = open(/*wvlan_config->fw_image_*/filename, 0, 0); + if (file_desc == -1) { + DBG_ERROR(DbgInfo, "No image file found\n"); } else { - DBG_TRACE( DbgInfo, "F/W image file found\n" ); + DBG_TRACE(DbgInfo, "F/W image file found\n"); #define DHF_ALLOC_SIZE 96000 //just below 96K, let's hope it suffices for now and for the future - cp = (char*)vmalloc( DHF_ALLOC_SIZE ); - if ( cp == NULL ) { - DBG_ERROR( DbgInfo, "error in vmalloc\n" ); + cp = (char *)vmalloc(DHF_ALLOC_SIZE); + if (cp == NULL) { + DBG_ERROR(DbgInfo, "error in vmalloc\n"); } else { - rc = read( file_desc, cp, DHF_ALLOC_SIZE ); - if ( rc == DHF_ALLOC_SIZE ) { - DBG_ERROR( DbgInfo, "buffer too small, %d\n", DHF_ALLOC_SIZE ); - } else if ( rc > 0 ) { - DBG_TRACE( DbgInfo, "read O.K.: %d bytes %.12s\n", rc, cp ); - rc = read( file_desc, &cp[rc], 1 ); - if ( rc == 0 ) { - DBG_TRACE( DbgInfo, "no more to read\n" ); + rc = read(file_desc, cp, DHF_ALLOC_SIZE); + if (rc == DHF_ALLOC_SIZE) { + DBG_ERROR(DbgInfo, "buffer too small, %d\n", DHF_ALLOC_SIZE); + } else if (rc > 0) { + DBG_TRACE(DbgInfo, "read O.K.: %d bytes %.12s\n", rc, cp); + rc = read(file_desc, &cp[rc], 1); + if (rc == 0) { + DBG_TRACE(DbgInfo, "no more to read\n"); } } - if ( rc != 0 ) { - DBG_ERROR( DbgInfo, "file not read in one swoop or other error"\ - ", give up, too complicated, rc = %0X\n", rc ); + if (rc != 0) { + DBG_ERROR(DbgInfo, "file not read in one swoop or other error"\ + ", give up, too complicated, rc = %0X\n", rc); } - vfree( cp ); + vfree(cp); } - close( file_desc ); + close(file_desc); } - set_fs( fs ); /* Return to the original context */ + set_fs(fs); /* Return to the original context */ #endif // BIN_DL - DBG_LEAVE( DbgInfo ); + DBG_LEAVE(DbgInfo); return; } // parse_config @@ -298,17 +300,17 @@ void parse_config( struct net_device *dev ) * -1 on error * ******************************************************************************/ -int readline( int filedesc, char *buffer ) +int readline(int filedesc, char *buffer) { int result = -1; int bytes_read = 0; /*------------------------------------------------------------------------*/ /* Make sure the file descriptor is good */ - if ( filedesc != -1 ) { + if (filedesc != -1) { /* Read in from the file byte by byte until a newline is reached */ - while(( result = read( filedesc, &buffer[bytes_read], 1 )) == 1 ) { - if ( buffer[bytes_read] == '\n' ) { + while ((result = read(filedesc, &buffer[bytes_read], 1)) == 1) { + if (buffer[bytes_read] == '\n') { buffer[bytes_read] = '\0'; bytes_read++; break; @@ -318,7 +320,7 @@ int readline( int filedesc, char *buffer ) } /* Return the number of bytes read */ - if ( result == -1 ) { + if (result == -1) { return result; } else { return bytes_read; @@ -346,7 +348,7 @@ int readline( int filedesc, char *buffer ) * N/A * ******************************************************************************/ -void translate_option( char *buffer, struct wl_private *lp ) +void translate_option(char *buffer, struct wl_private *lp) { unsigned int value_convert = 0; int string_length = 0; @@ -355,16 +357,16 @@ void translate_option( char *buffer, struct wl_private *lp ) u_char mac_value[ETH_ALEN]; /*------------------------------------------------------------------------*/ - DBG_FUNC( "translate_option" ); + DBG_FUNC("translate_option"); - if ( buffer == NULL || lp == NULL ) { - DBG_ERROR( DbgInfo, "Config file buffer and/or wavelan buffer ptr NULL\n" ); + if (buffer == NULL || lp == NULL) { + DBG_ERROR(DbgInfo, "Config file buffer and/or wavelan buffer ptr NULL\n"); return; } - ParseConfigLine( buffer, &key, &value ); + ParseConfigLine(buffer, &key, &value); - if ( key == NULL || value == NULL ) { + if (key == NULL || value == NULL) { return; } @@ -375,9 +377,9 @@ void translate_option( char *buffer, struct wl_private *lp ) /* handle DebugFlag as early as possible so it starts its influence as early * as possible */ - if ( strcmp( key, PARM_NAME_DEBUG_FLAG ) == 0 ) { - if ( DebugFlag == ~0 ) { //if DebugFlag is not specified on the command line - if ( DbgInfo->DebugFlag == 0 ) { /* if pc_debug did not set DebugFlag (i.e.pc_debug is + if (strcmp(key, PARM_NAME_DEBUG_FLAG) == 0) { + if (DebugFlag == ~0) { /* if DebugFlag is not specified on the command line */ + if (DbgInfo->DebugFlag == 0) { /* if pc_debug did not set DebugFlag (i.e.pc_debug is * not specified or specified outside the 4-8 range */ DbgInfo->DebugFlag |= DBG_DEFAULTS; @@ -388,250 +390,230 @@ void translate_option( char *buffer, struct wl_private *lp ) DbgInfo->DebugFlag = simple_strtoul(value, NULL, 0); //;?Delete ASAP } #endif /* DBG */ - if ( strcmp( key, PARM_NAME_AUTH_KEY_MGMT_SUITE ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_AUTH_KEY_MGMT_SUITE, value ); + if (strcmp(key, PARM_NAME_AUTH_KEY_MGMT_SUITE) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_AUTH_KEY_MGMT_SUITE, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_AUTH_KEY_MGMT_SUITE ) || ( value_convert <= PARM_MAX_AUTH_KEY_MGMT_SUITE )) { + if ((value_convert >= PARM_MIN_AUTH_KEY_MGMT_SUITE) || (value_convert <= PARM_MAX_AUTH_KEY_MGMT_SUITE)) { lp->AuthKeyMgmtSuite = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_AUTH_KEY_MGMT_SUITE ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_AUTH_KEY_MGMT_SUITE); } - } - else if ( strcmp( key, PARM_NAME_BRSC_2GHZ ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_BRSC_2GHZ, value ); + } else if (strcmp(key, PARM_NAME_BRSC_2GHZ) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_BRSC_2GHZ, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_BRSC ) || ( value_convert <= PARM_MAX_BRSC )) { + if ((value_convert >= PARM_MIN_BRSC) || (value_convert <= PARM_MAX_BRSC)) { lp->brsc[0] = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_BRSC_2GHZ ); + DBG_WARNING(DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_BRSC_2GHZ); } - } - else if ( strcmp( key, PARM_NAME_BRSC_5GHZ ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_BRSC_5GHZ, value ); + } else if (strcmp(key, PARM_NAME_BRSC_5GHZ) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_BRSC_5GHZ, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_BRSC ) || ( value_convert <= PARM_MAX_BRSC )) { + if ((value_convert >= PARM_MIN_BRSC) || (value_convert <= PARM_MAX_BRSC)) { lp->brsc[1] = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_BRSC_5GHZ ); + DBG_WARNING(DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_BRSC_5GHZ); } - } - else if (( strcmp( key, PARM_NAME_DESIRED_SSID ) == 0 ) || ( strcmp( key, PARM_NAME_OWN_SSID ) == 0 )) { - DBG_TRACE( DbgInfo, "SSID, value: %s\n", value ); + } else if ((strcmp(key, PARM_NAME_DESIRED_SSID) == 0) || (strcmp(key, PARM_NAME_OWN_SSID) == 0)) { + DBG_TRACE(DbgInfo, "SSID, value: %s\n", value); - memset( lp->NetworkName, 0, ( PARM_MAX_NAME_LEN + 1 )); + memset(lp->NetworkName, 0, (PARM_MAX_NAME_LEN + 1)); /* Make sure the value isn't too long */ - string_length = strlen( value ); - if ( string_length > PARM_MAX_NAME_LEN ) { - DBG_WARNING( DbgInfo, "SSID too long; will be truncated\n" ); + string_length = strlen(value); + if (string_length > PARM_MAX_NAME_LEN) { + DBG_WARNING(DbgInfo, "SSID too long; will be truncated\n"); string_length = PARM_MAX_NAME_LEN; } - memcpy( lp->NetworkName, value, string_length ); + memcpy(lp->NetworkName, value, string_length); } #if 0 - else if ( strcmp( key, PARM_NAME_DOWNLOAD_FIRMWARE ) == 0 ) { - DBG_TRACE( DbgInfo, "DOWNLOAD_FIRMWARE, value: %s\n", value ); - memset( lp->fw_image_filename, 0, ( MAX_LINE_SIZE + 1 )); + else if (strcmp(key, PARM_NAME_DOWNLOAD_FIRMWARE) == 0) { + DBG_TRACE(DbgInfo, "DOWNLOAD_FIRMWARE, value: %s\n", value); + memset(lp->fw_image_filename, 0, (MAX_LINE_SIZE + 1)); /* Make sure the value isn't too long */ - string_length = strlen( value ); - if ( string_length > MAX_LINE_SIZE ) { - DBG_WARNING( DbgInfo, "F/W image file name too long; will be ignored\n" ); + string_length = strlen(value); + if (string_length > MAX_LINE_SIZE) { + DBG_WARNING(DbgInfo, "F/W image file name too long; will be ignored\n"); } else { - memcpy( lp->fw_image_filename, value, string_length ); + memcpy(lp->fw_image_filename, value, string_length); } } #endif - else if ( strcmp( key, PARM_NAME_ENABLE_ENCRYPTION ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_ENABLE_ENCRYPTION, value ); + else if (strcmp(key, PARM_NAME_ENABLE_ENCRYPTION) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_ENABLE_ENCRYPTION, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_ENABLE_ENCRYPTION ) && ( value_convert <= PARM_MAX_ENABLE_ENCRYPTION )) { + if ((value_convert >= PARM_MIN_ENABLE_ENCRYPTION) && (value_convert <= PARM_MAX_ENABLE_ENCRYPTION)) { lp->EnableEncryption = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_ENABLE_ENCRYPTION ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_ENABLE_ENCRYPTION); } - } - else if ( strcmp( key, PARM_NAME_ENCRYPTION ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_ENCRYPTION, value ); + } else if (strcmp(key, PARM_NAME_ENCRYPTION) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_ENCRYPTION, value); - memset( lp->szEncryption, 0, sizeof( lp->szEncryption )); + memset(lp->szEncryption, 0, sizeof(lp->szEncryption)); /* Make sure the value isn't too long */ - string_length = strlen( value ); - if ( string_length > sizeof( lp->szEncryption ) ) { - DBG_WARNING( DbgInfo, "%s too long; will be truncated\n", PARM_NAME_ENCRYPTION ); - string_length = sizeof( lp->szEncryption ); + string_length = strlen(value); + if (string_length > sizeof(lp->szEncryption)) { + DBG_WARNING(DbgInfo, "%s too long; will be truncated\n", PARM_NAME_ENCRYPTION); + string_length = sizeof(lp->szEncryption); } - memcpy( lp->szEncryption, value, string_length ); - } - else if ( strcmp( key, PARM_NAME_KEY1 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_KEY1, value ); + memcpy(lp->szEncryption, value, string_length); + } else if (strcmp(key, PARM_NAME_KEY1) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_KEY1, value); - if ( is_valid_key_string( value )) { - memset( lp->DefaultKeys.key[0].key, 0, MAX_KEY_SIZE ); + if (is_valid_key_string(value)) { + memset(lp->DefaultKeys.key[0].key, 0, MAX_KEY_SIZE); - key_string2key( value, &lp->DefaultKeys.key[0] ); + key_string2key(value, &lp->DefaultKeys.key[0]); } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY1 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY1); } - } - else if ( strcmp( key, PARM_NAME_KEY2 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_KEY2, value ); + } else if (strcmp(key, PARM_NAME_KEY2) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_KEY2, value); - if ( is_valid_key_string( value )) { - memset( lp->DefaultKeys.key[1].key, 0, MAX_KEY_SIZE ); + if (is_valid_key_string(value)) { + memset(lp->DefaultKeys.key[1].key, 0, MAX_KEY_SIZE); - key_string2key( value, &lp->DefaultKeys.key[1] ); + key_string2key(value, &lp->DefaultKeys.key[1]); } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY2 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY2); } - } - else if ( strcmp( key, PARM_NAME_KEY3 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_KEY3, value ); + } else if (strcmp(key, PARM_NAME_KEY3) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_KEY3, value); - if ( is_valid_key_string( value )) { - memset( lp->DefaultKeys.key[2].key, 0, MAX_KEY_SIZE ); + if (is_valid_key_string(value)) { + memset(lp->DefaultKeys.key[2].key, 0, MAX_KEY_SIZE); - key_string2key( value, &lp->DefaultKeys.key[2] ); + key_string2key(value, &lp->DefaultKeys.key[2]); } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY3 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY3); } - } - else if ( strcmp( key, PARM_NAME_KEY4 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_KEY4, value ); + } else if (strcmp(key, PARM_NAME_KEY4) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_KEY4, value); - if ( is_valid_key_string( value )) { - memset( lp->DefaultKeys.key[3].key, 0, MAX_KEY_SIZE ); + if (is_valid_key_string(value)) { + memset(lp->DefaultKeys.key[3].key, 0, MAX_KEY_SIZE); - key_string2key( value, &lp->DefaultKeys.key[3] ); + key_string2key(value, &lp->DefaultKeys.key[3]); } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY4 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY4); } } /* New Parameters for WARP */ - else if ( strcmp( key, PARM_NAME_LOAD_BALANCING ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_LOAD_BALANCING, value ); + else if (strcmp(key, PARM_NAME_LOAD_BALANCING) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_LOAD_BALANCING, value); lp->loadBalancing = parse_yes_no(value); - } - else if ( strcmp( key, PARM_NAME_MEDIUM_DISTRIBUTION ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MEDIUM_DISTRIBUTION, value ); + } else if (strcmp(key, PARM_NAME_MEDIUM_DISTRIBUTION) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MEDIUM_DISTRIBUTION, value); lp->mediumDistribution = parse_yes_no(value); - } - else if ( strcmp( key, PARM_NAME_MICROWAVE_ROBUSTNESS) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MICROWAVE_ROBUSTNESS, value ); + } else if (strcmp(key, PARM_NAME_MICROWAVE_ROBUSTNESS) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MICROWAVE_ROBUSTNESS, value); lp->MicrowaveRobustness = parse_yes_no(value); - } - else if ( strcmp( key, PARM_NAME_MULTICAST_RATE ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_RATE, value ); + } else if (strcmp(key, PARM_NAME_MULTICAST_RATE) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_RATE, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_MULTICAST_RATE ) && ( value_convert <= PARM_MAX_MULTICAST_RATE )) { + if ((value_convert >= PARM_MIN_MULTICAST_RATE) && (value_convert <= PARM_MAX_MULTICAST_RATE)) { lp->MulticastRate[0] = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MULTICAST_RATE ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MULTICAST_RATE); } - } - else if ( strcmp( key, PARM_NAME_OWN_CHANNEL ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_CHANNEL, value ); + } else if (strcmp(key, PARM_NAME_OWN_CHANNEL) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_CHANNEL, value); value_convert = simple_strtoul(value, NULL, 0); - if ( wl_is_a_valid_chan( value_convert )) { - if ( value_convert > 14 ) { + if (wl_is_a_valid_chan(value_convert)) { + if (value_convert > 14) { value_convert = value_convert | 0x100; } lp->Channel = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_CHANNEL ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_CHANNEL); } - } - else if ( strcmp( key, PARM_NAME_OWN_NAME ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_NAME, value ); + } else if (strcmp(key, PARM_NAME_OWN_NAME) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_NAME, value); - memset( lp->StationName, 0, ( PARM_MAX_NAME_LEN + 1 )); + memset(lp->StationName, 0, (PARM_MAX_NAME_LEN + 1)); /* Make sure the value isn't too long */ - string_length = strlen( value ); - if ( string_length > PARM_MAX_NAME_LEN ) { - DBG_WARNING( DbgInfo, "%s too long; will be truncated\n", PARM_NAME_OWN_NAME ); + string_length = strlen(value); + if (string_length > PARM_MAX_NAME_LEN) { + DBG_WARNING(DbgInfo, "%s too long; will be truncated\n", PARM_NAME_OWN_NAME); string_length = PARM_MAX_NAME_LEN; } - memcpy( lp->StationName, value, string_length ); - } - else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD, value ); + memcpy(lp->StationName, value, string_length); + } else if (strcmp(key, PARM_NAME_RTS_THRESHOLD) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) { + if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) { lp->RTSThreshold = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD); } - } - else if ( strcmp( key, PARM_NAME_SRSC_2GHZ ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_SRSC_2GHZ, value ); + } else if (strcmp(key, PARM_NAME_SRSC_2GHZ) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_SRSC_2GHZ, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_SRSC ) || ( value_convert <= PARM_MAX_SRSC )) { + if ((value_convert >= PARM_MIN_SRSC) || (value_convert <= PARM_MAX_SRSC)) { lp->srsc[0] = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_SRSC_2GHZ ); + DBG_WARNING(DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_SRSC_2GHZ); } - } - else if ( strcmp( key, PARM_NAME_SRSC_5GHZ ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_SRSC_5GHZ, value ); + } else if (strcmp(key, PARM_NAME_SRSC_5GHZ) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_SRSC_5GHZ, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_SRSC ) || ( value_convert <= PARM_MAX_SRSC )) { + if ((value_convert >= PARM_MIN_SRSC) || (value_convert <= PARM_MAX_SRSC)) { lp->srsc[1] = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_SRSC_5GHZ ); + DBG_WARNING(DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_SRSC_5GHZ); } - } - else if ( strcmp( key, PARM_NAME_SYSTEM_SCALE ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_SYSTEM_SCALE, value ); + } else if (strcmp(key, PARM_NAME_SYSTEM_SCALE) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_SYSTEM_SCALE, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_SYSTEM_SCALE ) && ( value_convert <= PARM_MAX_SYSTEM_SCALE )) { + if ((value_convert >= PARM_MIN_SYSTEM_SCALE) && (value_convert <= PARM_MAX_SYSTEM_SCALE)) { lp->DistanceBetweenAPs = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_SYSTEM_SCALE ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_SYSTEM_SCALE); } - } - else if ( strcmp( key, PARM_NAME_TX_KEY ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_KEY, value ); + } else if (strcmp(key, PARM_NAME_TX_KEY) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_KEY, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_TX_KEY ) && ( value_convert <= PARM_MAX_TX_KEY )) { + if ((value_convert >= PARM_MIN_TX_KEY) && (value_convert <= PARM_MAX_TX_KEY)) { lp->TransmitKeyID = simple_strtoul(value, NULL, 0); } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_KEY ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_KEY); } - } - else if ( strcmp( key, PARM_NAME_TX_RATE ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE, value ); + } else if (strcmp(key, PARM_NAME_TX_RATE) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) { + if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) { lp->TxRateControl[0] = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE); } - } - else if ( strcmp( key, PARM_NAME_TX_POW_LEVEL ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_POW_LEVEL, value ); + } else if (strcmp(key, PARM_NAME_TX_POW_LEVEL) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_POW_LEVEL, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_TX_POW_LEVEL ) || ( value_convert <= PARM_MAX_TX_POW_LEVEL )) { + if ((value_convert >= PARM_MIN_TX_POW_LEVEL) || (value_convert <= PARM_MAX_TX_POW_LEVEL)) { lp->txPowLevel = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_POW_LEVEL ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_POW_LEVEL); } } @@ -640,101 +622,91 @@ void translate_option( char *buffer, struct wl_private *lp ) /* Configuration parameters specific to STA mode */ #if 1 //;? (HCF_TYPE) & HCF_TYPE_STA //;?seems reasonable that even an AP-only driver could afford this small additional footprint - if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_STA ) { + if (CNV_INT_TO_LITTLE(lp->hcfCtx.IFB_FWIdentity.comp_id) == COMP_ID_FW_STA) { //;?should we return an error status in AP mode - if ( strcmp( key, PARM_NAME_PORT_TYPE ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_PORT_TYPE, value ); + if (strcmp(key, PARM_NAME_PORT_TYPE) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_PORT_TYPE, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert == PARM_MIN_PORT_TYPE ) || ( value_convert == PARM_MAX_PORT_TYPE )) { + if ((value_convert == PARM_MIN_PORT_TYPE) || (value_convert == PARM_MAX_PORT_TYPE)) { lp->PortType = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PORT_TYPE ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PORT_TYPE); } - } - else if ( strcmp( key, PARM_NAME_PM_ENABLED ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_PM_ENABLED, value ); + } else if (strcmp(key, PARM_NAME_PM_ENABLED) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_PM_ENABLED, value); value_convert = simple_strtoul(value, NULL, 0); /* ;? how about wl_main.c containing - * VALID_PARAM( PARM_PM_ENABLED <= WVLAN_PM_STATE_STANDARD || - * ( PARM_PM_ENABLED & 0x7FFF ) <= WVLAN_PM_STATE_STANDARD ); + * VALID_PARAM(PARM_PM_ENABLED <= WVLAN_PM_STATE_STANDARD || + * (PARM_PM_ENABLED & 0x7FFF) <= WVLAN_PM_STATE_STANDARD); */ - if ( ( value_convert & 0x7FFF ) <= PARM_MAX_PM_ENABLED) { + if ((value_convert & 0x7FFF) <= PARM_MAX_PM_ENABLED) { lp->PMEnabled = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PM_ENABLED ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PM_ENABLED); //;?this is a data entry error, hence not a DBG_WARNING } - } - else if ( strcmp( key, PARM_NAME_CREATE_IBSS ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_CREATE_IBSS, value ); + } else if (strcmp(key, PARM_NAME_CREATE_IBSS) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_CREATE_IBSS, value); lp->CreateIBSS = parse_yes_no(value); - } - else if ( strcmp( key, PARM_NAME_MULTICAST_RX ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_RX, value ); + } else if (strcmp(key, PARM_NAME_MULTICAST_RX) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_RX, value); lp->MulticastReceive = parse_yes_no(value); - } - else if ( strcmp( key, PARM_NAME_MAX_SLEEP ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MAX_SLEEP, value ); + } else if (strcmp(key, PARM_NAME_MAX_SLEEP) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MAX_SLEEP, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= 0 ) && ( value_convert <= 65535 )) { + if ((value_convert >= 0) && (value_convert <= 65535)) { lp->MaxSleepDuration = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MAX_SLEEP ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MAX_SLEEP); } - } - else if ( strcmp( key, PARM_NAME_NETWORK_ADDR ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_NETWORK_ADDR, value ); + } else if (strcmp(key, PARM_NAME_NETWORK_ADDR) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_NETWORK_ADDR, value); - if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) { - memcpy( lp->MACAddress, mac_value, ETH_ALEN ); + if (parse_mac_address(value, mac_value) == ETH_ALEN) { + memcpy(lp->MACAddress, mac_value, ETH_ALEN); } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_NETWORK_ADDR ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_NETWORK_ADDR); } - } - else if ( strcmp( key, PARM_NAME_AUTHENTICATION ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_AUTHENTICATION, value ); + } else if (strcmp(key, PARM_NAME_AUTHENTICATION) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_AUTHENTICATION, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_AUTHENTICATION ) && ( value_convert <= PARM_MAX_AUTHENTICATION )) { + if ((value_convert >= PARM_MIN_AUTHENTICATION) && (value_convert <= PARM_MAX_AUTHENTICATION)) { lp->authentication = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_AUTHENTICATION ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_AUTHENTICATION); } - } - else if ( strcmp( key, PARM_NAME_OWN_ATIM_WINDOW ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_ATIM_WINDOW, value ); + } else if (strcmp(key, PARM_NAME_OWN_ATIM_WINDOW) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_ATIM_WINDOW, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_OWN_ATIM_WINDOW ) && ( value_convert <= PARM_MAX_OWN_ATIM_WINDOW )) { + if ((value_convert >= PARM_MIN_OWN_ATIM_WINDOW) && (value_convert <= PARM_MAX_OWN_ATIM_WINDOW)) { lp->atimWindow = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_ATIM_WINDOW ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_ATIM_WINDOW); } - } - else if ( strcmp( key, PARM_NAME_PM_HOLDOVER_DURATION ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_PM_HOLDOVER_DURATION, value ); + } else if (strcmp(key, PARM_NAME_PM_HOLDOVER_DURATION) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_PM_HOLDOVER_DURATION, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_PM_HOLDOVER_DURATION ) && ( value_convert <= PARM_MAX_PM_HOLDOVER_DURATION )) { + if ((value_convert >= PARM_MIN_PM_HOLDOVER_DURATION) && (value_convert <= PARM_MAX_PM_HOLDOVER_DURATION)) { lp->holdoverDuration = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PM_HOLDOVER_DURATION ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PM_HOLDOVER_DURATION); } - } - else if ( strcmp( key, PARM_NAME_PROMISCUOUS_MODE ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_PROMISCUOUS_MODE, value ); + } else if (strcmp(key, PARM_NAME_PROMISCUOUS_MODE) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_PROMISCUOUS_MODE, value); lp->promiscuousMode = parse_yes_no(value); - } - else if ( strcmp( key, PARM_NAME_CONNECTION_CONTROL ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_CONNECTION_CONTROL, value ); + } else if (strcmp(key, PARM_NAME_CONNECTION_CONTROL) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_CONNECTION_CONTROL, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_CONNECTION_CONTROL ) && ( value_convert <= PARM_MAX_CONNECTION_CONTROL )) { + if ((value_convert >= PARM_MIN_CONNECTION_CONTROL) && (value_convert <= PARM_MAX_CONNECTION_CONTROL)) { lp->connectionControl = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_CONNECTION_CONTROL ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_CONNECTION_CONTROL); } } @@ -745,227 +717,204 @@ void translate_option( char *buffer, struct wl_private *lp ) /* Configuration parameters specific to AP mode */ #if 1 //;? (HCF_TYPE) & HCF_TYPE_AP //;?should we restore this to allow smaller memory footprint - if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ) { - if ( strcmp( key, PARM_NAME_OWN_DTIM_PERIOD ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_DTIM_PERIOD, value ); + if (CNV_INT_TO_LITTLE(lp->hcfCtx.IFB_FWIdentity.comp_id) == COMP_ID_FW_AP) { + if (strcmp(key, PARM_NAME_OWN_DTIM_PERIOD) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_DTIM_PERIOD, value); value_convert = simple_strtoul(value, NULL, 0); - if ( value_convert >= PARM_MIN_OWN_DTIM_PERIOD ) { + if (value_convert >= PARM_MIN_OWN_DTIM_PERIOD) { lp->DTIMPeriod = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_DTIM_PERIOD ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_DTIM_PERIOD); } - } - else if ( strcmp( key, PARM_NAME_REJECT_ANY ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_REJECT_ANY, value ); + } else if (strcmp(key, PARM_NAME_REJECT_ANY) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_REJECT_ANY, value); lp->RejectAny = parse_yes_no(value); - } - else if ( strcmp( key, PARM_NAME_EXCLUDE_UNENCRYPTED ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_EXCLUDE_UNENCRYPTED, value ); + } else if (strcmp(key, PARM_NAME_EXCLUDE_UNENCRYPTED) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_EXCLUDE_UNENCRYPTED, value); lp->ExcludeUnencrypted = parse_yes_no(value); - } - else if ( strcmp( key, PARM_NAME_MULTICAST_PM_BUFFERING ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_PM_BUFFERING, value ); + } else if (strcmp(key, PARM_NAME_MULTICAST_PM_BUFFERING) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_PM_BUFFERING, value); lp->ExcludeUnencrypted = parse_yes_no(value); - } - else if ( strcmp( key, PARM_NAME_INTRA_BSS_RELAY ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_INTRA_BSS_RELAY, value ); + } else if (strcmp(key, PARM_NAME_INTRA_BSS_RELAY) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_INTRA_BSS_RELAY, value); lp->ExcludeUnencrypted = parse_yes_no(value); - } - else if ( strcmp( key, PARM_NAME_OWN_BEACON_INTERVAL ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_BEACON_INTERVAL, value ); + } else if (strcmp(key, PARM_NAME_OWN_BEACON_INTERVAL) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_BEACON_INTERVAL, value); value_convert = simple_strtoul(value, NULL, 0); - if ( value_convert >= PARM_MIN_OWN_BEACON_INTERVAL ) { + if (value_convert >= PARM_MIN_OWN_BEACON_INTERVAL) { lp->ownBeaconInterval = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_BEACON_INTERVAL ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_BEACON_INTERVAL); } - } - else if ( strcmp( key, PARM_NAME_COEXISTENCE ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_COEXISTENCE, value ); + } else if (strcmp(key, PARM_NAME_COEXISTENCE) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_COEXISTENCE, value); value_convert = simple_strtoul(value, NULL, 0); - if ( value_convert >= PARM_MIN_COEXISTENCE ) { + if (value_convert >= PARM_MIN_COEXISTENCE) { lp->coexistence = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_COEXISTENCE ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_COEXISTENCE); } } #ifdef USE_WDS - else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD1 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD1, value ); + else if (strcmp(key, PARM_NAME_RTS_THRESHOLD1) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD1, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) { + if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) { lp->wds_port[0].rtsThreshold = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD1 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD1); } - } - else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD2 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD2, value ); + } else if (strcmp(key, PARM_NAME_RTS_THRESHOLD2) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD2, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) { + if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) { lp->wds_port[1].rtsThreshold = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD2 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD2); } - } - else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD3 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD3, value ); + } else if (strcmp(key, PARM_NAME_RTS_THRESHOLD3) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD3, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) { + if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) { lp->wds_port[2].rtsThreshold = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD3 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD3); } - } - else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD4 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD4, value ); + } else if (strcmp(key, PARM_NAME_RTS_THRESHOLD4) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD4, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) { + if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) { lp->wds_port[3].rtsThreshold = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD4 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD4); } - } - else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD5 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD5, value ); + } else if (strcmp(key, PARM_NAME_RTS_THRESHOLD5) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD5, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) { + if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) { lp->wds_port[4].rtsThreshold = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD5 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD5); } - } - else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD6 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD6, value ); + } else if (strcmp(key, PARM_NAME_RTS_THRESHOLD6) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD6, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) { + if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) { lp->wds_port[5].rtsThreshold = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD6 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD6); } - } - else if ( strcmp( key, PARM_NAME_TX_RATE1 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE1, value ); + } else if (strcmp(key, PARM_NAME_TX_RATE1) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE1, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) { + if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) { lp->wds_port[0].txRateCntl = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE1 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE1); } - } - else if ( strcmp( key, PARM_NAME_TX_RATE2 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE2, value ); + } else if (strcmp(key, PARM_NAME_TX_RATE2) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE2, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) { + if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) { lp->wds_port[1].txRateCntl = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE2 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE2); } - } - else if ( strcmp( key, PARM_NAME_TX_RATE3 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE3, value ); + } else if (strcmp(key, PARM_NAME_TX_RATE3) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE3, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) { + if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) { lp->wds_port[2].txRateCntl = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE3 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE3); } - } - else if ( strcmp( key, PARM_NAME_TX_RATE4 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE4, value ); + } else if (strcmp(key, PARM_NAME_TX_RATE4) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE4, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) { + if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) { lp->wds_port[3].txRateCntl = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE4 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE4); } - } - else if ( strcmp( key, PARM_NAME_TX_RATE5 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE5, value ); + } else if (strcmp(key, PARM_NAME_TX_RATE5) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE5, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) { + if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) { lp->wds_port[4].txRateCntl = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE5 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE5); } - } - else if ( strcmp( key, PARM_NAME_TX_RATE6 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE6, value ); + } else if (strcmp(key, PARM_NAME_TX_RATE6) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE6, value); value_convert = simple_strtoul(value, NULL, 0); - if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) { + if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) { lp->wds_port[5].txRateCntl = value_convert; } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE6 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE6); } - } - else if ( strcmp( key, PARM_NAME_WDS_ADDRESS1 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS1, value ); + } else if (strcmp(key, PARM_NAME_WDS_ADDRESS1) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS1, value); - if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) { - memcpy( lp->wds_port[0].wdsAddress, mac_value, ETH_ALEN ); + if (parse_mac_address(value, mac_value) == ETH_ALEN) { + memcpy(lp->wds_port[0].wdsAddress, mac_value, ETH_ALEN); } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS1 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS1); } - } - else if ( strcmp( key, PARM_NAME_WDS_ADDRESS2 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS2, value ); + } else if (strcmp(key, PARM_NAME_WDS_ADDRESS2) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS2, value); - if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) { - memcpy( lp->wds_port[1].wdsAddress, mac_value, ETH_ALEN ); + if (parse_mac_address(value, mac_value) == ETH_ALEN) { + memcpy(lp->wds_port[1].wdsAddress, mac_value, ETH_ALEN); } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS2 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS2); } - } - else if ( strcmp( key, PARM_NAME_WDS_ADDRESS3 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS3, value ); + } else if (strcmp(key, PARM_NAME_WDS_ADDRESS3) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS3, value); - if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) { - memcpy( lp->wds_port[2].wdsAddress, mac_value, ETH_ALEN ); + if (parse_mac_address(value, mac_value) == ETH_ALEN) { + memcpy(lp->wds_port[2].wdsAddress, mac_value, ETH_ALEN); } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS3 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS3); } - } - else if ( strcmp( key, PARM_NAME_WDS_ADDRESS4 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS4, value ); + } else if (strcmp(key, PARM_NAME_WDS_ADDRESS4) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS4, value); - if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) { - memcpy( lp->wds_port[3].wdsAddress, mac_value, ETH_ALEN ); + if (parse_mac_address(value, mac_value) == ETH_ALEN) { + memcpy(lp->wds_port[3].wdsAddress, mac_value, ETH_ALEN); } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS4 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS4); } - } - else if ( strcmp( key, PARM_NAME_WDS_ADDRESS5 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS5, value ); + } else if (strcmp(key, PARM_NAME_WDS_ADDRESS5) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS5, value); - if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) { - memcpy( lp->wds_port[4].wdsAddress, mac_value, ETH_ALEN ); + if (parse_mac_address(value, mac_value) == ETH_ALEN) { + memcpy(lp->wds_port[4].wdsAddress, mac_value, ETH_ALEN); } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS5 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS5); } - } - else if ( strcmp( key, PARM_NAME_WDS_ADDRESS6 ) == 0 ) { - DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS6, value ); + } else if (strcmp(key, PARM_NAME_WDS_ADDRESS6) == 0) { + DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS6, value); - if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) { - memcpy( lp->wds_port[5].wdsAddress, mac_value, ETH_ALEN ); + if (parse_mac_address(value, mac_value) == ETH_ALEN) { + memcpy(lp->wds_port[5].wdsAddress, mac_value, ETH_ALEN); } else { - DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS6 ); + DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS6); } } #endif /* USE_WDS */ @@ -996,7 +945,7 @@ void translate_option( char *buffer, struct wl_private *lp ) * The number of bytes in the final MAC address, should equal to ETH_ALEN. * ******************************************************************************/ -int parse_mac_address( char *value, u_char *byte_array ) +int parse_mac_address(char *value, u_char *byte_array) { int value_offset = 0; int array_offset = 0; @@ -1004,11 +953,11 @@ int parse_mac_address( char *value, u_char *byte_array ) char byte_field[3]; /*------------------------------------------------------------------------*/ - memset( byte_field, '\0', 3 ); + memset(byte_field, '\0', 3); - while( value[value_offset] != '\0' ) { + while (value[value_offset] != '\0') { /* Skip over the colon chars seperating the bytes, if they exist */ - if ( value[value_offset] == ':' ) { + if (value[value_offset] == ':') { value_offset++; continue; } @@ -1018,9 +967,9 @@ int parse_mac_address( char *value, u_char *byte_array ) value_offset++; /* Once the byte_field is filled, convert it and store it */ - if ( field_offset == 2 ) { + if (field_offset == 2) { byte_field[field_offset] = '\0'; - byte_array[array_offset] = simple_strtoul( byte_field, NULL, 16 ); + byte_array[array_offset] = simple_strtoul(byte_field, NULL, 16); field_offset = 0; array_offset++; } @@ -1052,42 +1001,42 @@ int parse_mac_address( char *value, u_char *byte_array ) * N/A * ******************************************************************************/ -void ParseConfigLine( char *pszLine, char **ppszLVal, char **ppszRVal ) +void ParseConfigLine(char *pszLine, char **ppszLVal, char **ppszRVal) { int i; int size; /*------------------------------------------------------------------------*/ - DBG_FUNC( "ParseConfigLine" ); - DBG_ENTER( DbgInfo ); + DBG_FUNC("ParseConfigLine"); + DBG_ENTER(DbgInfo); /* get a snapshot of our string size */ - size = strlen( pszLine ); + size = strlen(pszLine); *ppszLVal = NULL; *ppszRVal = NULL; - if ( pszLine[0] != '#' && /* skip the line if it is a comment */ - pszLine[0] != '\n'&& /* if it's an empty UNIX line, do nothing */ - !( pszLine[0] == '\r' && pszLine[1] == '\n' ) /* if it's an empty MS-DOS line, do nothing */ - ) { + if (pszLine[0] != '#' && /* skip the line if it is a comment */ + pszLine[0] != '\n' && /* if it's an empty UNIX line, do nothing */ + !(pszLine[0] == '\r' && pszLine[1] == '\n') /* if it's an empty MS-DOS line, do nothing */ + ) { /* advance past any whitespace, and assign the L-value */ - for( i = 0; i < size; i++ ) { - if ( pszLine[i] != ' ' ) { + for (i = 0; i < size; i++) { + if (pszLine[i] != ' ') { *ppszLVal = &pszLine[i]; break; } } /* advance to the end of the l-value*/ - for( i++; i < size; i++ ) { - if ( pszLine[i] == ' ' || pszLine[i] == '=' ) { + for (i++; i < size; i++) { + if (pszLine[i] == ' ' || pszLine[i] == '=') { pszLine[i] = '\0'; break; } } /* make any whitespace and the equal sign a NULL character, and advance to the R-Value */ - for( i++; i < size; i++ ) { - if ( pszLine[i] == ' ' || pszLine[i] == '=' ) { + for (i++; i < size; i++) { + if (pszLine[i] == ' ' || pszLine[i] == '=') { pszLine[i] = '\0'; continue; } @@ -1095,16 +1044,16 @@ void ParseConfigLine( char *pszLine, char **ppszLVal, char **ppszRVal ) break; } /* make the line ending character(s) a NULL */ - for( i++; i < size; i++ ) { - if ( pszLine[i] == '\n' ) { + for (i++; i < size; i++) { + if (pszLine[i] == '\n') { pszLine[i] = '\0'; } - if (( pszLine[i] == '\r' ) && ( pszLine[i+1] == '\n' )) { + if ((pszLine[i] == '\r') && (pszLine[i+1] == '\n')) { pszLine[i] = '\0'; } } } - DBG_LEAVE( DbgInfo ); + DBG_LEAVE(DbgInfo); } // ParseConfigLine /*============================================================================*/ -- cgit v1.1 From ce7f6389790f24e07e7e32518c798451e799a830 Mon Sep 17 00:00:00 2001 From: "Prashant P. Shah" Date: Sun, 9 May 2010 22:41:46 +0530 Subject: Staging: wlags49_h2: fixed unnecessary braces issues in wl_profile.c This is a patch to the wl_profile.c file that fixes the unnecessary braces style issues found by the checkpatch.pl tool. Signed-off-by: Prashant P. Shah Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/wl_profile.c | 228 +++++++++++++------------------- 1 file changed, 90 insertions(+), 138 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/wl_profile.c b/drivers/staging/wlags49_h2/wl_profile.c index e4e78a4..13ade70 100644 --- a/drivers/staging/wlags49_h2/wl_profile.c +++ b/drivers/staging/wlags49_h2/wl_profile.c @@ -189,9 +189,8 @@ void parse_config(struct net_device *dev) DBG_TRACE(DbgInfo, "Wireless config file found. Parsing options...\n"); /* Read out the options */ - while (readline(file_desc, buffer)) { + while (readline(file_desc, buffer)) translate_option(buffer, wvlan_config); - } /* Close the file */ close(file_desc); //;?even if file_desc == -1 ??? } else { @@ -259,9 +258,8 @@ void parse_config(struct net_device *dev) } else if (rc > 0) { DBG_TRACE(DbgInfo, "read O.K.: %d bytes %.12s\n", rc, cp); rc = read(file_desc, &cp[rc], 1); - if (rc == 0) { + if (rc == 0) DBG_TRACE(DbgInfo, "no more to read\n"); - } } if (rc != 0) { DBG_ERROR(DbgInfo, "file not read in one swoop or other error"\ @@ -320,11 +318,10 @@ int readline(int filedesc, char *buffer) } /* Return the number of bytes read */ - if (result == -1) { + if (result == -1) return result; - } else { + else return bytes_read; - } } // readline /*============================================================================*/ @@ -366,9 +363,8 @@ void translate_option(char *buffer, struct wl_private *lp) ParseConfigLine(buffer, &key, &value); - if (key == NULL || value == NULL) { + if (key == NULL || value == NULL) return; - } /* Determine which key it is and perform the appropriate action */ @@ -394,29 +390,26 @@ void translate_option(char *buffer, struct wl_private *lp) DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_AUTH_KEY_MGMT_SUITE, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_AUTH_KEY_MGMT_SUITE) || (value_convert <= PARM_MAX_AUTH_KEY_MGMT_SUITE)) { + if ((value_convert >= PARM_MIN_AUTH_KEY_MGMT_SUITE) || (value_convert <= PARM_MAX_AUTH_KEY_MGMT_SUITE)) lp->AuthKeyMgmtSuite = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_AUTH_KEY_MGMT_SUITE); - } } else if (strcmp(key, PARM_NAME_BRSC_2GHZ) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_BRSC_2GHZ, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_BRSC) || (value_convert <= PARM_MAX_BRSC)) { + if ((value_convert >= PARM_MIN_BRSC) || (value_convert <= PARM_MAX_BRSC)) lp->brsc[0] = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_BRSC_2GHZ); - } } else if (strcmp(key, PARM_NAME_BRSC_5GHZ) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_BRSC_5GHZ, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_BRSC) || (value_convert <= PARM_MAX_BRSC)) { + if ((value_convert >= PARM_MIN_BRSC) || (value_convert <= PARM_MAX_BRSC)) lp->brsc[1] = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_BRSC_5GHZ); - } } else if ((strcmp(key, PARM_NAME_DESIRED_SSID) == 0) || (strcmp(key, PARM_NAME_OWN_SSID) == 0)) { DBG_TRACE(DbgInfo, "SSID, value: %s\n", value); @@ -437,22 +430,20 @@ void translate_option(char *buffer, struct wl_private *lp) memset(lp->fw_image_filename, 0, (MAX_LINE_SIZE + 1)); /* Make sure the value isn't too long */ string_length = strlen(value); - if (string_length > MAX_LINE_SIZE) { + if (string_length > MAX_LINE_SIZE) DBG_WARNING(DbgInfo, "F/W image file name too long; will be ignored\n"); - } else { + else memcpy(lp->fw_image_filename, value, string_length); - } } #endif else if (strcmp(key, PARM_NAME_ENABLE_ENCRYPTION) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_ENABLE_ENCRYPTION, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_ENABLE_ENCRYPTION) && (value_convert <= PARM_MAX_ENABLE_ENCRYPTION)) { + if ((value_convert >= PARM_MIN_ENABLE_ENCRYPTION) && (value_convert <= PARM_MAX_ENABLE_ENCRYPTION)) lp->EnableEncryption = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_ENABLE_ENCRYPTION); - } } else if (strcmp(key, PARM_NAME_ENCRYPTION) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_ENCRYPTION, value); @@ -522,19 +513,17 @@ void translate_option(char *buffer, struct wl_private *lp) value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_MULTICAST_RATE) && (value_convert <= PARM_MAX_MULTICAST_RATE)) { + if ((value_convert >= PARM_MIN_MULTICAST_RATE) && (value_convert <= PARM_MAX_MULTICAST_RATE)) lp->MulticastRate[0] = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MULTICAST_RATE); - } } else if (strcmp(key, PARM_NAME_OWN_CHANNEL) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_CHANNEL, value); value_convert = simple_strtoul(value, NULL, 0); if (wl_is_a_valid_chan(value_convert)) { - if (value_convert > 14) { + if (value_convert > 14) value_convert = value_convert | 0x100; - } lp->Channel = value_convert; } else { DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_CHANNEL); @@ -556,65 +545,58 @@ void translate_option(char *buffer, struct wl_private *lp) DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) { + if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) lp->RTSThreshold = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD); - } } else if (strcmp(key, PARM_NAME_SRSC_2GHZ) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_SRSC_2GHZ, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_SRSC) || (value_convert <= PARM_MAX_SRSC)) { + if ((value_convert >= PARM_MIN_SRSC) || (value_convert <= PARM_MAX_SRSC)) lp->srsc[0] = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_SRSC_2GHZ); - } } else if (strcmp(key, PARM_NAME_SRSC_5GHZ) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_SRSC_5GHZ, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_SRSC) || (value_convert <= PARM_MAX_SRSC)) { + if ((value_convert >= PARM_MIN_SRSC) || (value_convert <= PARM_MAX_SRSC)) lp->srsc[1] = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_SRSC_5GHZ); - } } else if (strcmp(key, PARM_NAME_SYSTEM_SCALE) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_SYSTEM_SCALE, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_SYSTEM_SCALE) && (value_convert <= PARM_MAX_SYSTEM_SCALE)) { + if ((value_convert >= PARM_MIN_SYSTEM_SCALE) && (value_convert <= PARM_MAX_SYSTEM_SCALE)) lp->DistanceBetweenAPs = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_SYSTEM_SCALE); - } } else if (strcmp(key, PARM_NAME_TX_KEY) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_KEY, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_TX_KEY) && (value_convert <= PARM_MAX_TX_KEY)) { + if ((value_convert >= PARM_MIN_TX_KEY) && (value_convert <= PARM_MAX_TX_KEY)) lp->TransmitKeyID = simple_strtoul(value, NULL, 0); - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_KEY); - } } else if (strcmp(key, PARM_NAME_TX_RATE) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) { + if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) lp->TxRateControl[0] = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE); - } } else if (strcmp(key, PARM_NAME_TX_POW_LEVEL) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_POW_LEVEL, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_TX_POW_LEVEL) || (value_convert <= PARM_MAX_TX_POW_LEVEL)) { + if ((value_convert >= PARM_MIN_TX_POW_LEVEL) || (value_convert <= PARM_MAX_TX_POW_LEVEL)) lp->txPowLevel = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_POW_LEVEL); - } } /* Need to add? : Country code, Short/Long retry */ @@ -628,11 +610,10 @@ void translate_option(char *buffer, struct wl_private *lp) DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_PORT_TYPE, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert == PARM_MIN_PORT_TYPE) || (value_convert == PARM_MAX_PORT_TYPE)) { + if ((value_convert == PARM_MIN_PORT_TYPE) || (value_convert == PARM_MAX_PORT_TYPE)) lp->PortType = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PORT_TYPE); - } } else if (strcmp(key, PARM_NAME_PM_ENABLED) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_PM_ENABLED, value); value_convert = simple_strtoul(value, NULL, 0); @@ -656,46 +637,41 @@ void translate_option(char *buffer, struct wl_private *lp) DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_MAX_SLEEP, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= 0) && (value_convert <= 65535)) { + if ((value_convert >= 0) && (value_convert <= 65535)) lp->MaxSleepDuration = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MAX_SLEEP); - } } else if (strcmp(key, PARM_NAME_NETWORK_ADDR) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_NETWORK_ADDR, value); - if (parse_mac_address(value, mac_value) == ETH_ALEN) { + if (parse_mac_address(value, mac_value) == ETH_ALEN) memcpy(lp->MACAddress, mac_value, ETH_ALEN); - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_NETWORK_ADDR); - } } else if (strcmp(key, PARM_NAME_AUTHENTICATION) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_AUTHENTICATION, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_AUTHENTICATION) && (value_convert <= PARM_MAX_AUTHENTICATION)) { + if ((value_convert >= PARM_MIN_AUTHENTICATION) && (value_convert <= PARM_MAX_AUTHENTICATION)) lp->authentication = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_AUTHENTICATION); - } } else if (strcmp(key, PARM_NAME_OWN_ATIM_WINDOW) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_ATIM_WINDOW, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_OWN_ATIM_WINDOW) && (value_convert <= PARM_MAX_OWN_ATIM_WINDOW)) { + if ((value_convert >= PARM_MIN_OWN_ATIM_WINDOW) && (value_convert <= PARM_MAX_OWN_ATIM_WINDOW)) lp->atimWindow = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_ATIM_WINDOW); - } } else if (strcmp(key, PARM_NAME_PM_HOLDOVER_DURATION) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_PM_HOLDOVER_DURATION, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_PM_HOLDOVER_DURATION) && (value_convert <= PARM_MAX_PM_HOLDOVER_DURATION)) { + if ((value_convert >= PARM_MIN_PM_HOLDOVER_DURATION) && (value_convert <= PARM_MAX_PM_HOLDOVER_DURATION)) lp->holdoverDuration = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PM_HOLDOVER_DURATION); - } } else if (strcmp(key, PARM_NAME_PROMISCUOUS_MODE) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_PROMISCUOUS_MODE, value); lp->promiscuousMode = parse_yes_no(value); @@ -703,11 +679,10 @@ void translate_option(char *buffer, struct wl_private *lp) DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_CONNECTION_CONTROL, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_CONNECTION_CONTROL) && (value_convert <= PARM_MAX_CONNECTION_CONTROL)) { + if ((value_convert >= PARM_MIN_CONNECTION_CONTROL) && (value_convert <= PARM_MAX_CONNECTION_CONTROL)) lp->connectionControl = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_CONNECTION_CONTROL); - } } /* Need to add? : Probe Data Rate */ @@ -722,11 +697,10 @@ void translate_option(char *buffer, struct wl_private *lp) DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_DTIM_PERIOD, value); value_convert = simple_strtoul(value, NULL, 0); - if (value_convert >= PARM_MIN_OWN_DTIM_PERIOD) { + if (value_convert >= PARM_MIN_OWN_DTIM_PERIOD) lp->DTIMPeriod = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_DTIM_PERIOD); - } } else if (strcmp(key, PARM_NAME_REJECT_ANY) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_REJECT_ANY, value); lp->RejectAny = parse_yes_no(value); @@ -743,20 +717,18 @@ void translate_option(char *buffer, struct wl_private *lp) DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_BEACON_INTERVAL, value); value_convert = simple_strtoul(value, NULL, 0); - if (value_convert >= PARM_MIN_OWN_BEACON_INTERVAL) { + if (value_convert >= PARM_MIN_OWN_BEACON_INTERVAL) lp->ownBeaconInterval = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_BEACON_INTERVAL); - } } else if (strcmp(key, PARM_NAME_COEXISTENCE) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_COEXISTENCE, value); value_convert = simple_strtoul(value, NULL, 0); - if (value_convert >= PARM_MIN_COEXISTENCE) { + if (value_convert >= PARM_MIN_COEXISTENCE) lp->coexistence = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_COEXISTENCE); - } } #ifdef USE_WDS @@ -764,158 +736,140 @@ void translate_option(char *buffer, struct wl_private *lp) DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD1, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) { + if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) lp->wds_port[0].rtsThreshold = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD1); - } } else if (strcmp(key, PARM_NAME_RTS_THRESHOLD2) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD2, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) { + if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) lp->wds_port[1].rtsThreshold = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD2); - } } else if (strcmp(key, PARM_NAME_RTS_THRESHOLD3) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD3, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) { + if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) lp->wds_port[2].rtsThreshold = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD3); - } } else if (strcmp(key, PARM_NAME_RTS_THRESHOLD4) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD4, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) { + if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) lp->wds_port[3].rtsThreshold = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD4); - } } else if (strcmp(key, PARM_NAME_RTS_THRESHOLD5) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD5, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) { + if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) lp->wds_port[4].rtsThreshold = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD5); - } } else if (strcmp(key, PARM_NAME_RTS_THRESHOLD6) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD6, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) { + if ((value_convert >= PARM_MIN_RTS_THRESHOLD) && (value_convert <= PARM_MAX_RTS_THRESHOLD)) lp->wds_port[5].rtsThreshold = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD6); - } } else if (strcmp(key, PARM_NAME_TX_RATE1) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE1, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) { + if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) lp->wds_port[0].txRateCntl = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE1); - } } else if (strcmp(key, PARM_NAME_TX_RATE2) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE2, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) { + if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) lp->wds_port[1].txRateCntl = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE2); - } } else if (strcmp(key, PARM_NAME_TX_RATE3) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE3, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) { + if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) lp->wds_port[2].txRateCntl = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE3); - } } else if (strcmp(key, PARM_NAME_TX_RATE4) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE4, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) { + if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) lp->wds_port[3].txRateCntl = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE4); - } } else if (strcmp(key, PARM_NAME_TX_RATE5) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE5, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) { + if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) lp->wds_port[4].txRateCntl = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE5); - } } else if (strcmp(key, PARM_NAME_TX_RATE6) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE6, value); value_convert = simple_strtoul(value, NULL, 0); - if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) { + if ((value_convert >= PARM_MIN_TX_RATE) && (value_convert <= PARM_MAX_TX_RATE)) lp->wds_port[5].txRateCntl = value_convert; - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE6); - } } else if (strcmp(key, PARM_NAME_WDS_ADDRESS1) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS1, value); - if (parse_mac_address(value, mac_value) == ETH_ALEN) { + if (parse_mac_address(value, mac_value) == ETH_ALEN) memcpy(lp->wds_port[0].wdsAddress, mac_value, ETH_ALEN); - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS1); - } } else if (strcmp(key, PARM_NAME_WDS_ADDRESS2) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS2, value); - if (parse_mac_address(value, mac_value) == ETH_ALEN) { + if (parse_mac_address(value, mac_value) == ETH_ALEN) memcpy(lp->wds_port[1].wdsAddress, mac_value, ETH_ALEN); - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS2); - } } else if (strcmp(key, PARM_NAME_WDS_ADDRESS3) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS3, value); - if (parse_mac_address(value, mac_value) == ETH_ALEN) { + if (parse_mac_address(value, mac_value) == ETH_ALEN) memcpy(lp->wds_port[2].wdsAddress, mac_value, ETH_ALEN); - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS3); - } } else if (strcmp(key, PARM_NAME_WDS_ADDRESS4) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS4, value); - if (parse_mac_address(value, mac_value) == ETH_ALEN) { + if (parse_mac_address(value, mac_value) == ETH_ALEN) memcpy(lp->wds_port[3].wdsAddress, mac_value, ETH_ALEN); - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS4); - } } else if (strcmp(key, PARM_NAME_WDS_ADDRESS5) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS5, value); - if (parse_mac_address(value, mac_value) == ETH_ALEN) { + if (parse_mac_address(value, mac_value) == ETH_ALEN) memcpy(lp->wds_port[4].wdsAddress, mac_value, ETH_ALEN); - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS5); - } } else if (strcmp(key, PARM_NAME_WDS_ADDRESS6) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS6, value); - if (parse_mac_address(value, mac_value) == ETH_ALEN) { + if (parse_mac_address(value, mac_value) == ETH_ALEN) memcpy(lp->wds_port[5].wdsAddress, mac_value, ETH_ALEN); - } else { + else DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS6); - } } #endif /* USE_WDS */ } @@ -1045,12 +999,10 @@ void ParseConfigLine(char *pszLine, char **ppszLVal, char **ppszRVal) } /* make the line ending character(s) a NULL */ for (i++; i < size; i++) { - if (pszLine[i] == '\n') { + if (pszLine[i] == '\n') pszLine[i] = '\0'; - } - if ((pszLine[i] == '\r') && (pszLine[i+1] == '\n')) { + if ((pszLine[i] == '\r') && (pszLine[i+1] == '\n')) pszLine[i] = '\0'; - } } } DBG_LEAVE(DbgInfo); -- cgit v1.1 From 83e13438d6adadce30de40c27e902f9a34eca0ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles=20Cl=C3=A9ment?= Date: Sun, 9 May 2010 11:00:51 -0700 Subject: Staging: wlags49_h2*: wireless driver Kconfig update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change the wireless drivers to depend on CONFIG_WLAN instead of CONFIG_WLAN_80211 which is gone. Signed-off-by: Charles ClĂ©ment Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/Kconfig b/drivers/staging/wlags49_h2/Kconfig index 92053fe..b6fc2ca 100644 --- a/drivers/staging/wlags49_h2/Kconfig +++ b/drivers/staging/wlags49_h2/Kconfig @@ -1,6 +1,6 @@ config WLAGS49_H2 tristate "Agere Systems HERMES II Wireless PC Card Model 0110" - depends on WLAN_80211 && WIRELESS_EXT && PCMCIA + depends on WLAN && WIRELESS_EXT && PCMCIA select WEXT_SPY ---help--- Driver for wireless cards using Agere's HERMES II chipset -- cgit v1.1 From 5ae8cb9525f0481025b9bc156c7a181aff7ded47 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 11 May 2010 15:51:53 -0700 Subject: Staging: wlags49: build fixes Now that the code actually gets selected in the kernel config properly, all of the build errors start showing up. This patch papers over a few of them to get the code to build, I have no idea if it actually works now or not... Cc: Henk de Groot Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/dhf.c | 10 +++++----- drivers/staging/wlags49_h2/wl_cs.c | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/dhf.c b/drivers/staging/wlags49_h2/dhf.c index d5fb1a9..80a4707 100644 --- a/drivers/staging/wlags49_h2/dhf.c +++ b/drivers/staging/wlags49_h2/dhf.c @@ -286,14 +286,14 @@ int i; fw->signature[i+1] != (/* HCF_BIG_ENDIAN ? 'B' : */ 'L')) rc = DHF_ERR_INCOMP_FW; else { /* Little Endian Binary format */ - fw->codep = (CFG_PROG_STRCT FAR*)((PSEUDO_CHARP)fw->codep + (hcf_32)fw); - fw->identity = (CFG_IDENTITY_STRCT FAR*)((PSEUDO_CHARP)fw->identity + (hcf_32)fw); - fw->compat = (CFG_RANGE20_STRCT FAR*)((PSEUDO_CHARP)fw->compat + (hcf_32)fw); + fw->codep = (CFG_PROG_STRCT FAR*)((char *)fw->codep + (hcf_32)fw); + fw->identity = (CFG_IDENTITY_STRCT FAR*)((char *)fw->identity + (hcf_32)fw); + fw->compat = (CFG_RANGE20_STRCT FAR*)((char *)fw->compat + (hcf_32)fw); for (i = 0; fw->p[i]; i++) - fw->p[i] = ((PSEUDO_CHARP)fw->p[i] + (hcf_32)fw); + fw->p[i] = ((char *)fw->p[i] + (hcf_32)fw); p = fw->codep; while (p->len) { - p->host_addr = (PSEUDO_CHARP)p->host_addr + (hcf_32)fw; + p->host_addr = (char *)p->host_addr + (hcf_32)fw; p++; } } diff --git a/drivers/staging/wlags49_h2/wl_cs.c b/drivers/staging/wlags49_h2/wl_cs.c index 9da42e6..7c33ead 100644 --- a/drivers/staging/wlags49_h2/wl_cs.c +++ b/drivers/staging/wlags49_h2/wl_cs.c @@ -157,14 +157,14 @@ static int wl_adapter_attach(struct pcmcia_device *link) link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; link->io.IOAddrLines = 6; link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT; - link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID; +// link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID; link->irq.Handler = &wl_isr; link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.IntType = INT_MEMORY_AND_IO; link->conf.ConfigIndex = 5; link->conf.Present = PRESENT_OPTION; - link->priv = link->irq.Instance = dev; + link->priv = dev; lp = wl_priv(dev); lp->link = link; @@ -317,15 +317,15 @@ void wl_adapter_insert( struct pcmcia_device *link ) /* Do we need to allocate an interrupt? */ link->conf.Attributes |= CONF_ENABLE_IRQ; - CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); - CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); - CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); +// CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); +// CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); +// CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); dev->irq = link->irq.AssignedIRQ; dev->base_addr = link->io.BasePort1; - SET_NETDEV_DEV(dev, &handle_to_dev(link)); + SET_NETDEV_DEV(dev, &link->dev); if (register_netdev(dev) != 0) { printk("%s: register_netdev() failed\n", MODULE_NAME); goto failed; @@ -345,7 +345,7 @@ void wl_adapter_insert( struct pcmcia_device *link ) cs_failed: - cs_error( link, last_fn, last_ret ); +// cs_error( link, last_fn, last_ret ); failed: -- cgit v1.1 From 801de52358abc9f42ee6291dae2425bca04228d6 Mon Sep 17 00:00:00 2001 From: "Prashant P. Shah" Date: Mon, 10 May 2010 22:18:24 +0530 Subject: Staging: wlags49_h2: fixed C99 comments style issues in wl_profile.c This is a patch to the wl_profile.c file that fixes the C99 comments style issues found by the checkpatch.pl tool. Signed-off-by: Prashant P. Shah Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/wl_profile.c | 54 ++++++++++++++++----------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/wl_profile.c b/drivers/staging/wlags49_h2/wl_profile.c index 13ade70..292d579 100644 --- a/drivers/staging/wlags49_h2/wl_profile.c +++ b/drivers/staging/wlags49_h2/wl_profile.c @@ -91,7 +91,7 @@ #include #include -//#include +/* #include */ #include #include @@ -118,17 +118,17 @@ int parse_yes_no(char *value); int parse_yes_no(char *value) { -int rc = 0; //default to NO for invalid parameters +int rc = 0; /* default to NO for invalid parameters */ if (strlen(value) == 1) { if ((value[0] | ('Y'^'y')) == 'y') rc = 1; -// } else { -// this should not be debug time info, it is an enduser data entry error ;? -// DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MICROWAVE_ROBUSTNESS); + /* } else { */ + /* this should not be debug time info, it is an enduser data entry error ;? */ + /* DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MICROWAVE_ROBUSTNESS); */ } return rc; -} // parse_yes_no +} /* parse_yes_no */ /******************************************************************************* @@ -154,10 +154,10 @@ int rc = 0; //default to NO for invalid parameters void parse_config(struct net_device *dev) { int file_desc; -#if 0 // BIN_DL +#if 0 /* BIN_DL */ int rc; char *cp = NULL; -#endif // BIN_DL +#endif /* BIN_DL */ char buffer[MAX_LINE_SIZE]; char filename[MAX_LINE_SIZE]; mm_segment_t fs; @@ -192,7 +192,7 @@ void parse_config(struct net_device *dev) while (readline(file_desc, buffer)) translate_option(buffer, wvlan_config); /* Close the file */ - close(file_desc); //;?even if file_desc == -1 ??? + close(file_desc); /* ;?even if file_desc == -1 ??? */ } else { DBG_TRACE(DbgInfo, "No iwconfig file found for this device; " "config.opts or wireless.opts will be used\n"); @@ -235,19 +235,19 @@ void parse_config(struct net_device *dev) memcpy(&wvlan_config->DefaultKeys, &sEncryption.EncStr, sizeof(CFG_DEFAULT_KEYS_STRCT)); -#if 0 //BIN_DL +#if 0 /* BIN_DL */ /* Obtain a user-space process context, storing the original context */ fs = get_fs(); set_fs(get_ds()); - //;?just to fake something + /* ;?just to fake something */ strcpy(/*wvlan_config->fw_image_*/filename, "/etc/agere/fw.bin"); file_desc = open(/*wvlan_config->fw_image_*/filename, 0, 0); if (file_desc == -1) { DBG_ERROR(DbgInfo, "No image file found\n"); } else { DBG_TRACE(DbgInfo, "F/W image file found\n"); -#define DHF_ALLOC_SIZE 96000 //just below 96K, let's hope it suffices for now and for the future +#define DHF_ALLOC_SIZE 96000 /* just below 96K, let's hope it suffices for now and for the future */ cp = (char *)vmalloc(DHF_ALLOC_SIZE); if (cp == NULL) { DBG_ERROR(DbgInfo, "error in vmalloc\n"); @@ -270,11 +270,11 @@ void parse_config(struct net_device *dev) close(file_desc); } set_fs(fs); /* Return to the original context */ -#endif // BIN_DL +#endif /* BIN_DL */ DBG_LEAVE(DbgInfo); return; -} // parse_config +} /* parse_config */ /******************************************************************************* * readline() @@ -322,7 +322,7 @@ int readline(int filedesc, char *buffer) return result; else return bytes_read; -} // readline +} /* readline */ /*============================================================================*/ /******************************************************************************* @@ -381,9 +381,9 @@ void translate_option(char *buffer, struct wl_private *lp) DbgInfo->DebugFlag |= DBG_DEFAULTS; } } else { - DbgInfo->DebugFlag = simple_strtoul(value, NULL, 0); //;?DebugFlag; + DbgInfo->DebugFlag = simple_strtoul(value, NULL, 0); /* ;?DebugFlag; */ } - DbgInfo->DebugFlag = simple_strtoul(value, NULL, 0); //;?Delete ASAP + DbgInfo->DebugFlag = simple_strtoul(value, NULL, 0); /* ;?Delete ASAP */ } #endif /* DBG */ if (strcmp(key, PARM_NAME_AUTH_KEY_MGMT_SUITE) == 0) { @@ -602,10 +602,10 @@ void translate_option(char *buffer, struct wl_private *lp) /* Need to add? : Country code, Short/Long retry */ /* Configuration parameters specific to STA mode */ -#if 1 //;? (HCF_TYPE) & HCF_TYPE_STA -//;?seems reasonable that even an AP-only driver could afford this small additional footprint +#if 1 /* ;? (HCF_TYPE) & HCF_TYPE_STA */ +/* ;?seems reasonable that even an AP-only driver could afford this small additional footprint */ if (CNV_INT_TO_LITTLE(lp->hcfCtx.IFB_FWIdentity.comp_id) == COMP_ID_FW_STA) { - //;?should we return an error status in AP mode + /* ;?should we return an error status in AP mode */ if (strcmp(key, PARM_NAME_PORT_TYPE) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_PORT_TYPE, value); @@ -625,7 +625,7 @@ void translate_option(char *buffer, struct wl_private *lp) lp->PMEnabled = value_convert; } else { DBG_WARNING(DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PM_ENABLED); - //;?this is a data entry error, hence not a DBG_WARNING + /* ;?this is a data entry error, hence not a DBG_WARNING */ } } else if (strcmp(key, PARM_NAME_CREATE_IBSS) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_CREATE_IBSS, value); @@ -690,8 +690,8 @@ void translate_option(char *buffer, struct wl_private *lp) #endif /* (HCF_TYPE) & HCF_TYPE_STA */ /* Configuration parameters specific to AP mode */ -#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP - //;?should we restore this to allow smaller memory footprint +#if 1 /* ;? (HCF_TYPE) & HCF_TYPE_AP */ + /* ;?should we restore this to allow smaller memory footprint */ if (CNV_INT_TO_LITTLE(lp->hcfCtx.IFB_FWIdentity.comp_id) == COMP_ID_FW_AP) { if (strcmp(key, PARM_NAME_OWN_DTIM_PERIOD) == 0) { DBG_TRACE(DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_DTIM_PERIOD, value); @@ -876,7 +876,7 @@ void translate_option(char *buffer, struct wl_private *lp) #endif /* (HCF_TYPE) & HCF_TYPE_AP */ return; -} // translate_option +} /* translate_option */ /*============================================================================*/ /******************************************************************************* @@ -932,7 +932,7 @@ int parse_mac_address(char *value, u_char *byte_array) /* Use the array_offset as a check; 6 bytes should be written to the byte_array */ return array_offset; -} // parse_mac_address +} /* parse_mac_address */ /*============================================================================*/ /******************************************************************************* @@ -1006,7 +1006,7 @@ void ParseConfigLine(char *pszLine, char **ppszLVal, char **ppszRVal) } } DBG_LEAVE(DbgInfo); -} // ParseConfigLine +} /* ParseConfigLine */ /*============================================================================*/ -#endif // USE_PROFILE +#endif /* USE_PROFILE */ -- cgit v1.1 From 324148788bf3744d90fb6894ec5744eb0ca91b74 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Tue, 11 May 2010 20:26:57 +0200 Subject: Staging: Drop memory allocation cast Drop cast on the result of kmalloc and similar functions. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ type T; @@ - (T *) (\(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\)(...)) // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/wl_priv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/wl_priv.c b/drivers/staging/wlags49_h2/wl_priv.c index a67ff52..f2bfd30 100644 --- a/drivers/staging/wlags49_h2/wl_priv.c +++ b/drivers/staging/wlags49_h2/wl_priv.c @@ -618,7 +618,7 @@ int wvlan_uil_put_info( struct uilreq *urq, struct wl_private *lp ) LTV record, try to allocate it from the kernel stack. Otherwise, we just use our local LTV record. */ if( urq->len > sizeof( lp->ltvRecord )) { - pLtv = (ltv_t *)kmalloc( urq->len, GFP_KERNEL ); + pLtv = kmalloc(urq->len, GFP_KERNEL); if (pLtv != NULL) { ltvAllocated = TRUE; } else { @@ -1298,7 +1298,7 @@ int wvlan_uil_get_info( struct uilreq *urq, struct wl_private *lp ) LTV record, try to allocate it from the kernel stack. Otherwise, we just use our local LTV record. */ if( urq->len > sizeof( lp->ltvRecord )) { - pLtv = (ltv_t *)kmalloc( urq->len, GFP_KERNEL ); + pLtv = kmalloc(urq->len, GFP_KERNEL); if (pLtv != NULL) { ltvAllocated = TRUE; -- cgit v1.1 From 935e99fb0739aa64d0dd7e8a0bc82faec5d8f830 Mon Sep 17 00:00:00 2001 From: Anand Gadiyar Date: Wed, 12 May 2010 13:03:13 +0530 Subject: staging: trivial: fix typo "seperate" s/seperate/separate Signed-off-by: Anand Gadiyar Cc: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/README.wlags49 | 2 +- drivers/staging/wlags49_h2/wl_priv.c | 2 +- drivers/staging/wlags49_h2/wl_wext.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/README.wlags49 b/drivers/staging/wlags49_h2/README.wlags49 index 7586fd0..f65acd6 100644 --- a/drivers/staging/wlags49_h2/README.wlags49 +++ b/drivers/staging/wlags49_h2/README.wlags49 @@ -84,7 +84,7 @@ TABLE OF CONTENTS. the functions to interface to the Network Interface Card (NIC). The HCF provides for all WaveLAN NIC types one standard interface to the MSF. This I/F is called the Wireless Connection Interface (WCI) and is the - subject of a seperate document (025726). + subject of a separate document (025726). The HCF directory contains firmware images to allow the card to operate in either station (STA) or Access Point (AP) mode. In the build process, the diff --git a/drivers/staging/wlags49_h2/wl_priv.c b/drivers/staging/wlags49_h2/wl_priv.c index f2bfd30..260d4f0 100644 --- a/drivers/staging/wlags49_h2/wl_priv.c +++ b/drivers/staging/wlags49_h2/wl_priv.c @@ -654,7 +654,7 @@ int wvlan_uil_put_info( struct uilreq *urq, struct wl_private *lp ) pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] ); break; /* CFG_CNF_OWN_SSID currently same as CNF_DESIRED_SSID. Do we - need seperate storage for this? */ + need separate storage for this? */ //case CFG_CNF_OWN_SSID: case CFG_CNF_OWN_ATIM_WINDOW: lp->atimWindow = pLtv->u.u16[0]; diff --git a/drivers/staging/wlags49_h2/wl_wext.c b/drivers/staging/wlags49_h2/wl_wext.c index 4434e00..311d3c5 100644 --- a/drivers/staging/wlags49_h2/wl_wext.c +++ b/drivers/staging/wlags49_h2/wl_wext.c @@ -3940,7 +3940,7 @@ void wl_wext_event_mic_failed( struct net_device *dev ) MLME-MICHAELMICFAILURE.indication(keyid=# broadcast/unicast addr=addr2) */ - /* NOTE: Format of MAC address (using colons to seperate bytes) may cause + /* NOTE: Format of MAC address (using colons to separate bytes) may cause a problem in future versions of the supplicant, if they ever actually parse these parameters */ #if DBG -- cgit v1.1 From 93822ad193f1b1d92422dc3d539456acbe1a85ef Mon Sep 17 00:00:00 2001 From: Henk de Groot Date: Thu, 13 May 2010 16:27:33 +0200 Subject: Staging: wlags49_hs2: Fix wlags49_hs2 driver after build fixes broke it Fixes the driver after merge into the 2.6.34 kernel. Driver should be functional again (a fix to make it compile broke the driver). Patch against 2.6.34 RC7 with patch-v2.6.34-rc7-next-20100513 already applied. Removed conditional code based on kernel version, this is pointless now the driver is part of the kernel. Also removed obsolte code left over from previous patches. Includes also small fixes to compile clean again. Signed-off-by: Henk de Groot Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/dhf.c | 14 -------------- drivers/staging/wlags49_h2/wl_cs.c | 30 ++++++++++++------------------ drivers/staging/wlags49_h2/wl_cs.h | 4 ---- drivers/staging/wlags49_h2/wl_internal.h | 8 ++------ drivers/staging/wlags49_h2/wl_netdev.c | 27 --------------------------- drivers/staging/wlags49_h2/wl_wext.c | 7 ------- 6 files changed, 14 insertions(+), 76 deletions(-) (limited to 'drivers/staging/wlags49_h2') diff --git a/drivers/staging/wlags49_h2/dhf.c b/drivers/staging/wlags49_h2/dhf.c index 80a4707..bb80b54 100644 --- a/drivers/staging/wlags49_h2/dhf.c +++ b/drivers/staging/wlags49_h2/dhf.c @@ -109,20 +109,6 @@ /* 12345678901234 */ char signature[14] = "FUPU7D37dhfwci"; -/* The binary download function "relocates" the image using constructions like: - fw->identity = (CFG_IDENTITY_STRCT FAR *)((char FAR *)fw->identity + (hcf_32)fw ); - under some of the memory models under MSVC 1.52 these constructions degrade to 16-bits pointer arithmetic. - fw->identity is limited, such that adding it to fw, does not need to carry over from offset to segment. - However the segment is not set at all. - As a workaround the PSEUDO_CHARP macro is introduced which is a char pointer except for MSVC 1.52, in - which case we know that a 32-bit quantity is adequate as a pointer. - Note that other platforms may experience comparable problems when using the binary download feature. */ -#if defined(_MSC_VER) && _MSC_VER == 800 /* Visual C++ 1.5 */ -#define PSEUDO_CHARP hcf_32 -#else -#define PSEUDO_CHARP (hcf_8 *) -#endif - /*----------------------------------------------------------------------------- * * LTV-records retrieved from the NIC to: diff --git a/drivers/staging/wlags49_h2/wl_cs.c b/drivers/staging/wlags49_h2/wl_cs.c index 7c33ead..568993f 100644 --- a/drivers/staging/wlags49_h2/wl_cs.c +++ b/drivers/staging/wlags49_h2/wl_cs.c @@ -105,13 +105,6 @@ /******************************************************************************* - * macro definitions - ******************************************************************************/ -#define CS_CHECK(fn, ret) do { \ - last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \ - } while (0) - -/******************************************************************************* * global definitions ******************************************************************************/ #if DBG @@ -305,7 +298,7 @@ void wl_adapter_insert( struct pcmcia_device *link ) { struct net_device *dev; int i; - int last_fn, last_ret; + int ret; /*------------------------------------------------------------------------*/ DBG_FUNC( "wl_adapter_insert" ); @@ -317,10 +310,17 @@ void wl_adapter_insert( struct pcmcia_device *link ) /* Do we need to allocate an interrupt? */ link->conf.Attributes |= CONF_ENABLE_IRQ; -// CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io)); -// CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); -// CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); + ret = pcmcia_request_io(link, &link->io); + if (ret != 0) + goto failed; + + ret = pcmcia_request_irq(link, (void *) wl_isr); + if (ret != 0) + goto failed; + ret = pcmcia_request_configuration(link, &link->conf); + if (ret != 0) + goto failed; dev->irq = link->irq.AssignedIRQ; dev->base_addr = link->io.BasePort1; @@ -330,8 +330,7 @@ void wl_adapter_insert( struct pcmcia_device *link ) printk("%s: register_netdev() failed\n", MODULE_NAME); goto failed; } - link->dev_node = &( wl_priv(dev) )->node; - strcpy(( wl_priv(dev) )->node.dev_name, dev->name); + register_wlags_sysfs(dev); printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, ""mac_address ", @@ -343,11 +342,6 @@ void wl_adapter_insert( struct pcmcia_device *link ) DBG_LEAVE( DbgInfo ); return; - -cs_failed: -// cs_error( link, last_fn, last_ret ); - - failed: wl_adapter_release( link ); diff --git a/drivers/staging/wlags49_h2/wl_cs.h b/drivers/staging/wlags49_h2/wl_cs.h index 2a0e674..a9b8828 100644 --- a/drivers/staging/wlags49_h2/wl_cs.h +++ b/drivers/staging/wlags49_h2/wl_cs.h @@ -84,10 +84,6 @@ int wl_adapter_close(struct net_device *dev); int wl_adapter_is_open(struct net_device *dev); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) -void cs_error(client_handle_t handle, int func, int ret); -#endif - const char *DbgEvent( int mask ); diff --git a/drivers/staging/wlags49_h2/wl_internal.h b/drivers/staging/wlags49_h2/wl_internal.h index 466fb62..d9a0ad0 100644 --- a/drivers/staging/wlags49_h2/wl_internal.h +++ b/drivers/staging/wlags49_h2/wl_internal.h @@ -69,9 +69,6 @@ ******************************************************************************/ #include #ifdef BUS_PCMCIA -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) -#include -#endif #include #include #include @@ -866,7 +863,6 @@ struct wl_private { #ifdef BUS_PCMCIA - dev_node_t node; struct pcmcia_device *link; #endif // BUS_PCMCIA @@ -1013,13 +1009,13 @@ extern inline struct wl_private *wl_priv(struct net_device *dev) * SPARC, due to its weird semantics for save/restore flags. extern * inline should prevent the kernel from linking or module from * loading if they are not inlined. */ -extern inline void wl_lock(struct wl_private *lp, +static inline void wl_lock(struct wl_private *lp, unsigned long *flags) { spin_lock_irqsave(&lp->slock, *flags); } -extern inline void wl_unlock(struct wl_private *lp, +static inline void wl_unlock(struct wl_private *lp, unsigned long *flags) { spin_unlock_irqrestore(&lp->slock, *flags); diff --git a/drivers/staging/wlags49_h2/wl_netdev.c b/drivers/staging/wlags49_h2/wl_netdev.c index 1cfaee3..91fd309 100644 --- a/drivers/staging/wlags49_h2/wl_netdev.c +++ b/drivers/staging/wlags49_h2/wl_netdev.c @@ -463,15 +463,10 @@ static void wl_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) // strncpy(info.fw_version, priv->fw_name, // sizeof(info.fw_version) - 1); -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20)) if (dev->dev.parent) { dev_set_name(dev->dev.parent, "%s", info->bus_info); //strncpy(info->bus_info, dev->dev.parent->bus_id, // sizeof(info->bus_info) - 1); -#else - if (dev->class_dev.parent) { - sizeof(info->bus_info) - 1); -#endif } else { snprintf(info->bus_info, sizeof(info->bus_info) - 1, "PCMCIA FIXME"); @@ -1179,7 +1174,6 @@ void wl_multicast( struct net_device *dev, int num_addrs, void *addrs ) #endif /* NEW_MULTICAST */ -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)) static const struct net_device_ops wl_netdev_ops = { .ndo_start_xmit = &wl_tx_port0, @@ -1199,7 +1193,6 @@ static const struct net_device_ops wl_netdev_ops = .ndo_poll_controller = wl_poll, #endif }; -#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)) /******************************************************************************* * wl_device_alloc() @@ -1253,27 +1246,7 @@ struct net_device * wl_device_alloc( void ) lp->wireless_data.spy_data = &lp->spy_data; dev->wireless_data = &lp->wireless_data; -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)) dev->netdev_ops = &wl_netdev_ops; -#else - dev->hard_start_xmit = &wl_tx_port0; - - dev->set_config = &wl_config; - dev->get_stats = &wl_stats; - dev->set_multicast_list = &wl_multicast; - - dev->init = &wl_insert; - dev->open = &wl_adapter_open; - dev->stop = &wl_adapter_close; - dev->do_ioctl = &wl_ioctl; - - dev->tx_timeout = &wl_tx_timeout; - -#ifdef CONFIG_NET_POLL_CONTROLLER - dev->poll_controller = wl_poll; -#endif - -#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30)) dev->watchdog_timeo = TX_TIMEOUT; diff --git a/drivers/staging/wlags49_h2/wl_wext.c b/drivers/staging/wlags49_h2/wl_wext.c index 311d3c5..06467f1 100644 --- a/drivers/staging/wlags49_h2/wl_wext.c +++ b/drivers/staging/wlags49_h2/wl_wext.c @@ -82,17 +82,10 @@ in the build. */ #ifdef WIRELESS_EXT -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) -#define IWE_STREAM_ADD_EVENT(info, buf, end, iwe, len) \ - iwe_stream_add_event(buf, end, iwe, len) -#define IWE_STREAM_ADD_POINT(info, buf, end, iwe, msg) \ - iwe_stream_add_point(buf, end, iwe, msg) -#else #define IWE_STREAM_ADD_EVENT(info, buf, end, iwe, len) \ iwe_stream_add_event(info, buf, end, iwe, len) #define IWE_STREAM_ADD_POINT(info, buf, end, iwe, msg) \ iwe_stream_add_point(info, buf, end, iwe, msg) -#endif -- cgit v1.1