otus: build fixes
cover otus: build fixes
Hi,
here are some minor build fixes for the staging/otus driver.
PATCH 1/6 otus: dont mix declarations and code
$ gcc (Debian 4.4.2-8) 4.4.2 Copyright (C) 2009 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ make ... drivers/staging/otus/ioctl.c: In function 'usbdrv_wpa_ioctl': drivers/staging/otus/ioctl.c:2253: warning: ISO C90 forbids mixed declarations and code ...
drivers/staging/otus/ioctl.c +5 -3
@@ -2227,7 +2227,8 @@ int usbdrv_wpa_ioctl(struct net_device *case ZD_CMD_SCAN_REQ :printk (KERN_ERR "usbdrv_wpa_ioctl: ZD_CMD_SCAN_REQ\n" );break ; -case ZD_CMD_SET_GENERIC_ELEMENT : +case ZD_CMD_SET_GENERIC_ELEMENT : { +u8_t len, *wpaie;printk (KERN_ERR "usbdrv_wpa_ioctl:" " ZD_CMD_SET_GENERIC_ELEMENT\n" );
@@ -2250,8 +2251,8 @@ int usbdrv_wpa_ioctl(struct net_device */* zfiWlanSetWpaIe(dev, zdparm->u.generic_elem.data, * zdparm->u.generic_elem.len); */ -u8_t len = zdparm->u.generic_elem.len; -u8_t *wpaie = (u8_t *)zdparm->u.generic_elem.data; + len = zdparm->u.generic_elem.len; + wpaie = zdparm->u.generic_elem.data;printk (KERN_ERR "wd->ap.wpaLen : % d\n" , len);
@@ -2273,6 +2274,7 @@ int usbdrv_wpa_ioctl(struct net_device ** #endif */ break ; + }/* #ifdef ZM_HOSTAPD_SUPPORT */ case ZD_CMD_GET_TSC :
PATCH 2/6 otus: remove unused variables
In reply to [email protected]drivers/staging/otus/hal/hprw.c +0 -1
@@ -282,7 +282,6 @@ void zfIdlRsp(zdev_t* dev, u32_t* rsp, uelse if (src ==ZM_OID_FLASH_READ ) {u32_t datalen; -u16_t i; datalen = (rsp[0 ] &255 );
drivers/staging/otus/80211core/cagg.c +1 -2
@@ -1832,8 +1832,7 @@ u16_t zfAggRxClear(zdev_t* dev, u32_t tistruct agg_tid_rx *zfAggRxEnabled (zdev_t * dev,zbuf_t * buf) { -u16_t dst0, src[3 ], ac, aid, fragOff; -u8_t up; +u16_t dst0, src[3 ], aid;u16_t offset =0 ;u16_t seq_no;u16_t frameType;
drivers/staging/otus/80211core/ledmgr.c +0 -1
@@ -187,7 +187,6 @@ void zfLedCtrlType2_scan(zdev_t* dev);void zfLedCtrlType2 (zdev_t * dev) { -u32_t ton, toff, tmp, period;u16_t OperateLED;zmw_get_wlan_dev (dev);
drivers/staging/otus/80211core/cmm.c +0 -4
@@ -346,8 +346,6 @@ u16_t zfFindSuperGElement(zdev_t* dev, zu8_t super_feature;u8_t ouiSuperG[6 ] = {0x00 ,0x03 ,0x7f ,0x01 ,0x01 ,0x00 }; -zmw_get_wlan_dev (dev); -/* Get offset of first element */ subType = (zmw_rx_buf_readb (dev, buf,0 ) >>4 );if ((offset = zgElementOffsetTable[subType]) ==0xff )
@@ -411,8 +409,6 @@ u16_t zfFindXRElement(zdev_t* dev, zbuf_u8_t id;u8_t ouixr[6 ] = {0x00 ,0x03 ,0x7f ,0x03 ,0x01 ,0x00 }; -zmw_get_wlan_dev (dev); -/* Get offset of first element */ subType = (zmw_rx_buf_readb (dev, buf,0 ) >>4 );if ((offset = zgElementOffsetTable[subType]) ==0xff )
drivers/staging/otus/80211core/cmmsta.c +0 -5
@@ -4848,8 +4848,6 @@ u16_t zfStaAddIePowerCap(zdev_t* dev, zbu8_t MaxTxPower;u8_t MinTxPower; -zmw_get_wlan_dev (dev); -/* Element ID */ zmw_tx_buf_writeb (dev, buf, offset++,ZM_WLAN_EID_POWER_CAPABILITY );
@@ -5276,7 +5274,6 @@ u16_t zfStaRxValidateFrame(zdev_t* dev,u8_t da0;//u16_t sa[3]; u16_t ret; -u16_t i;//u8_t sa0; zmw_get_wlan_dev (dev);
@@ -5738,8 +5735,6 @@ u16_t zfComputeBssInfoWeightValue(zdev_tu8_t weightOfN40BelowThr =16 ;u8_t weightOfN40UpThr =32 ; -zmw_get_wlan_dev (dev); -if ( isBMode ==0 )return (signalStrength + weightOfB);// pure b mode , do not add the weight value for this AP ! else
drivers/staging/otus/80211core/ctxrx.c +0 -5
@@ -882,7 +882,6 @@ zlError:/************************************************************************/ u16_t zfTxSendEth (zdev_t * dev,zbuf_t * buf,u16_t port,u16_t bufType,u16_t flag) { -u16_t err;//u16_t addrTblSize; //struct zsAddrTbl addrTbl; u16_t removeLen;
@@ -904,7 +903,6 @@ u16_t zfTxSendEth(zdev_t* dev, zbuf_t* bu8_t qosType, keyIdx =0 ;u16_t fragOff;u16_t newFlag; -struct zsMicVar * pMicKey;u8_t tkipFrameOffset =0 ;zmw_get_wlan_dev (dev);
@@ -1692,8 +1690,6 @@ void zfShowTxEAPOL(zdev_t* dev, zbuf_t*u16_t packetLen, keyInfo, keyLen, keyDataLen, length, Op_Code;u32_t replayCounterH, replayCounterL, vendorId, VendorType; -zmw_get_wlan_dev (dev); -zm_debug_msg1 ("EAPOL Packet size = " ,zfwBufGetSize (dev, buf));/* EAPOL packet type */
@@ -2436,7 +2432,6 @@ void zfiRecv80211(zdev_t* dev, zbuf_t* bu16_t IvOffset;u8_t keyLen =5 ;u8_t iv[3 ]; -u8_t *wepKey;u8_t keyIdx; IvOffset = offset +ZM_SIZE_OF_WLAN_DATA_HEADER ;
drivers/staging/otus/hal/hpmain.c +0 -4
@@ -1316,7 +1316,6 @@ void zfHpSetFrequencyEx(zdev_t* dev, u32 u8_t extOffset, u8_t initRF) {u32_t cmd[9 ]; -u32_t cmdB[3 ];u16_t ret;u8_t old_band;u8_t new_band;
@@ -3434,7 +3433,6 @@ void zfSetPowerCalTable(zdev_t* dev, u32/* Write PHY regs 672-703 */ for (i=0 ; i<128 ; i+=4 ) { -u32_t regAddr =0x9800 + (672 *4 );u32_t val; val = ((u32_t)vpd_chain1[i+3]<<24) |
@@ -3485,7 +3483,6 @@ void zfSetPowerCalTable(zdev_t* dev, u32/* Write PHY regs 672-703 + 0x1000 */ for (i=0 ; i<128 ; i+=4 ) { -u32_t regAddr =0x9800 + (672 *4 ) +0x1000 ;u32_t val; val = ((u32_t)vpd_chain3[i+3]<<24) |
@@ -4584,7 +4581,6 @@ void zfHpSetRollCallTable(zdev_t* dev)void zfHpSetTTSIFSTime (zdev_t * dev,u8_t sifs_time) {u32_t reg_value =0 ; -zmw_get_wlan_dev (dev); sifs_time &=0x3f ; reg_value =0x14400b | (((u32_t )sifs_time)<<24 );
drivers/staging/otus/80211core/cfunc.c +0 -2
@@ -1194,8 +1194,6 @@ u16_t zfFindMinimumUtilizationChannelIndu8_t i;u16_t tempMinIndex, tempMinValue; -zmw_get_wlan_dev (dev); - i =1 ; tempMinIndex =0 ; tempMinValue = array[tempMinIndex];
drivers/staging/otus/80211core/cpsmgr.c +0 -2
@@ -381,8 +381,6 @@ static void zfPowerSavingMgrSleepIfIdle(static void zfPowerSavingMgrDisconnectMain (zdev_t * dev) { -zmw_get_wlan_dev (dev); -#ifdef ZM_ENABLE_DISCONNECT_PS switch (wd->sta.psMgr.state) {
drivers/staging/otus/80211core/cscanmgr.c +0 -2
@@ -289,8 +289,6 @@ static void zfScanMgrEventSetFreqCompletstatic void zfScanMgrEventScanCompleteCb (zdev_t * dev) { -zmw_get_wlan_dev (dev); -if ((zfStaIsConnected (dev)) && (!zfPowerSavingMgrIsSleeping (dev))) {zfSendNullData (dev,0 );
PATCH 3/6 otus: remove unused constants
In reply to [email protected]drivers/staging/otus/hal/hpreg.c +0 -133
@@ -786,45 +786,6 @@ enum { WT1_5760_5800, }; -static REG_DMN_FREQ_BAND regDmn5GhzTurboFreq[] = { - {5130 ,5210 ,5 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* T1_5130_5210 */ - {5250 ,5330 ,5 ,6 ,40 ,40 ,DFS_FCC3 ,NO_PSCAN ,0 ,0 },/* T1_5250_5330 */ - {5370 ,5490 ,5 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* T1_5370_5490 */ - {5530 ,5650 ,5 ,6 ,40 ,40 ,DFS_FCC3 ,NO_PSCAN ,0 ,0 },/* T1_5530_5650 */ - - {5150 ,5190 ,5 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* T1_5150_5190 */ - {5230 ,5310 ,5 ,6 ,40 ,40 ,DFS_FCC3 ,NO_PSCAN ,0 ,0 },/* T1_5230_5310 */ - {5350 ,5470 ,5 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* T1_5350_5470 */ - {5510 ,5670 ,5 ,6 ,40 ,40 ,DFS_FCC3 ,NO_PSCAN ,0 ,0 },/* T1_5510_5670 */ - - {5200 ,5240 ,17 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* T1_5200_5240 */ - {5200 ,5240 ,23 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* T2_5200_5240 */ - {5210 ,5210 ,17 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* T1_5210_5210 */ - {5210 ,5210 ,23 ,0 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* T2_5210_5210 */ - - {5280 ,5280 ,23 ,6 ,40 ,40 ,DFS_FCC3 ,PSCAN_FCC_T ,0 ,0 },/* T1_5280_5280 */ - {5280 ,5280 ,20 ,6 ,40 ,40 ,DFS_FCC3 ,PSCAN_FCC_T ,0 ,0 },/* T2_5280_5280 */ - {5250 ,5250 ,17 ,0 ,40 ,40 ,DFS_FCC3 ,PSCAN_FCC_T ,0 ,0 },/* T1_5250_5250 */ - {5290 ,5290 ,20 ,0 ,40 ,40 ,DFS_FCC3 ,PSCAN_FCC_T ,0 ,0 },/* T1_5290_5290 */ - {5250 ,5290 ,20 ,0 ,40 ,40 ,DFS_FCC3 ,PSCAN_FCC_T ,0 ,0 },/* T1_5250_5290 */ - {5250 ,5290 ,23 ,6 ,40 ,40 ,DFS_FCC3 ,PSCAN_FCC_T ,0 ,0 },/* T2_5250_5290 */ - - {5540 ,5660 ,20 ,6 ,40 ,40 ,DFS_FCC3 ,PSCAN_FCC_T ,0 ,0 },/* T1_5540_5660 */ - {5760 ,5800 ,20 ,0 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* T1_5760_5800 */ - {5760 ,5800 ,30 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* T2_5760_5800 */ - - {5765 ,5805 ,30 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* T1_5765_5805 */ - -/* -* Below are the WWR frequencies -*/ - - {5210 ,5250 ,15 ,0 ,40 ,40 ,DFS_FCC3 |DFS_ETSI ,PSCAN_WWR ,0 ,0 },/* WT1_5210_5250 */ - {5290 ,5290 ,18 ,0 ,40 ,40 ,DFS_FCC3 |DFS_ETSI ,PSCAN_WWR ,0 ,0 },/* WT1_5290_5290 */ - {5540 ,5660 ,20 ,0 ,40 ,40 ,DFS_FCC3 |DFS_ETSI ,PSCAN_WWR ,0 ,0 },/* WT1_5540_5660 */ - {5760 ,5800 ,20 ,0 ,40 ,40 ,NO_DFS ,PSCAN_WWR ,0 ,0 },/* WT1_5760_5800 */ -}; -/* * 2GHz 11b channel tags */
@@ -864,45 +825,6 @@ enum { W2_2484_2484, }; -static REG_DMN_FREQ_BAND regDmn2GhzFreq[] = { - {2312 ,2372 ,5 ,6 ,20 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* F1_2312_2372 */ - {2312 ,2372 ,20 ,0 ,20 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* F2_2312_2372 */ - - {2412 ,2472 ,5 ,6 ,20 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* F1_2412_2472 */ - {2412 ,2472 ,20 ,0 ,20 ,5 ,NO_DFS ,PSCAN_MKKA ,0 ,0 },/* F2_2412_2472 */ - {2412 ,2472 ,30 ,0 ,20 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* F3_2412_2472 */ - - {2412 ,2462 ,27 ,6 ,20 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* F1_2412_2462 */ - {2412 ,2462 ,20 ,0 ,20 ,5 ,NO_DFS ,PSCAN_MKKA ,0 ,0 },/* F2_2412_2462 */ - {2432 ,2442 ,20 ,0 ,20 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* F1_2432_2442 */ - - {2457 ,2472 ,20 ,0 ,20 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* F1_2457_2472 */ - - {2467 ,2472 ,20 ,0 ,20 ,5 ,NO_DFS ,PSCAN_MKKA2 |PSCAN_MKKA ,0 ,0 },/* F1_2467_2472 */ - - {2484 ,2484 ,5 ,6 ,20 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* F1_2484_2484 */ - {2484 ,2484 ,20 ,0 ,20 ,5 ,NO_DFS ,PSCAN_MKKA |PSCAN_MKKA1 |PSCAN_MKKA2 ,0 ,0 },/* F2_2484_2484 */ - - {2512 ,2732 ,5 ,6 ,20 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* F1_2512_2732 */ - -/* -* WWR have powers opened up to 20dBm. Limits should often come from CTL/Max powers -*/ - - {2312 ,2372 ,20 ,0 ,20 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* W1_2312_2372 */ - {2412 ,2412 ,20 ,0 ,20 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* W1_2412_2412 */ - {2417 ,2432 ,20 ,0 ,20 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* W1_2417_2432 */ - {2437 ,2442 ,20 ,0 ,20 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* W1_2437_2442 */ - {2447 ,2457 ,20 ,0 ,20 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* W1_2447_2457 */ - {2462 ,2462 ,20 ,0 ,20 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* W1_2462_2462 */ - {2467 ,2467 ,20 ,0 ,20 ,5 ,NO_DFS ,PSCAN_WWR |IS_ECM_CHAN ,0 ,0 },/* W1_2467_2467 */ - {2467 ,2467 ,20 ,0 ,20 ,5 ,NO_DFS ,NO_PSCAN |IS_ECM_CHAN ,0 ,0 },/* W2_2467_2467 */ - {2472 ,2472 ,20 ,0 ,20 ,5 ,NO_DFS ,PSCAN_WWR |IS_ECM_CHAN ,0 ,0 },/* W1_2472_2472 */ - {2472 ,2472 ,20 ,0 ,20 ,5 ,NO_DFS ,NO_PSCAN |IS_ECM_CHAN ,0 ,0 },/* W2_2472_2472 */ - {2484 ,2484 ,20 ,0 ,20 ,5 ,NO_DFS ,PSCAN_WWR |IS_ECM_CHAN ,0 ,0 },/* W1_2484_2484 */ - {2484 ,2484 ,20 ,0 ,20 ,5 ,NO_DFS ,NO_PSCAN |IS_ECM_CHAN ,0 ,0 },/* W2_2484_2484 */ -}; -/* * 2GHz 11g channel tags
@@ -984,16 +906,6 @@ enum { T1_2512_2732 }; -static REG_DMN_FREQ_BAND regDmn2Ghz11gTurboFreq[] = { - {2312 ,2372 ,5 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* T1_2312_2372 */ - {2437 ,2437 ,5 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* T1_2437_2437 */ - {2437 ,2437 ,20 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* T2_2437_2437 */ - {2437 ,2437 ,18 ,6 ,40 ,40 ,NO_DFS ,PSCAN_WWR ,0 ,0 },/* T3_2437_2437 */ - {2512 ,2732 ,5 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* T1_2512_2732 */ -}; - - -/* * 2GHz 11n frequency tags */
@@ -1005,15 +917,6 @@ enum { NG_DEMO_ALL_CHANNELS, }; -static REG_DMN_FREQ_BAND regDmn2Ghz11ngFreq[] = { - {2422 ,2452 ,20 ,0 ,40 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* NG1_2422_2452 */ - {2422 ,2452 ,27 ,0 ,40 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* NG2_2422_2452 */ - {2422 ,2452 ,30 ,0 ,40 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* NG3_2422_2452 */ - - {2312 ,2732 ,27 ,6 ,20 ,5 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* NG_DEMO_ALL_CHANNELS */ -}; - -/* * 5GHz 11n frequency tags */
@@ -1050,42 +953,6 @@ enum { NA_DEMO_ALL_CHANNELS, }; -static REG_DMN_FREQ_BAND regDmn5Ghz11naFreq[] = { -/* -* ToDo: This table needs to be completely populated with 5GHz 11n properties -*/ - {5190 ,5230 ,15 ,0 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* NA1_5190_5230 */ - {5190 ,5230 ,17 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* NA2_5190_5230 */ - {5190 ,5230 ,18 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* NA3_5190_5230 */ - {5190 ,5230 ,20 ,0 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* NA4_5190_5230 */ - {5190 ,5230 ,23 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* NA5_5190_5230 */ - - {5270 ,5270 ,23 ,6 ,40 ,40 ,DFS_FCC3 |DFS_ETSI ,NO_PSCAN ,0 ,1 },/* NA1_5270_5270 */ - - {5270 ,5310 ,18 ,6 ,40 ,40 ,DFS_FCC3 |DFS_ETSI ,NO_PSCAN ,0 ,1 },/* NA1_5270_5310 */ - {5270 ,5310 ,20 ,0 ,40 ,40 ,DFS_FCC3 |DFS_ETSI |DFS_MKK4 ,NO_PSCAN ,0 ,1 },/* NA2_5270_5310 */ - {5270 ,5310 ,23 ,6 ,40 ,40 ,DFS_FCC3 |DFS_ETSI ,NO_PSCAN ,0 ,1 },/* NA3_5270_5310 */ - {5270 ,5310 ,30 ,6 ,40 ,40 ,DFS_FCC3 |DFS_ETSI ,NO_PSCAN ,0 ,1 },/* NA4_5270_5310 */ - - {5310 ,5310 ,17 ,6 ,40 ,40 ,DFS_FCC3 |DFS_ETSI ,NO_PSCAN ,0 ,1 },/* NA1_5310_5310 */ - - {5510 ,5630 ,30 ,6 ,40 ,40 ,DFS_FCC3 |DFS_ETSI ,NO_PSCAN ,0 ,1 },/* NA1_5510_5630 */ - - {5510 ,5670 ,20 ,6 ,40 ,40 ,DFS_FCC3 |DFS_ETSI |DFS_MKK4 ,NO_PSCAN ,0 ,1 },/* NA1_5510_5670 */ - {5510 ,5670 ,27 ,0 ,40 ,40 ,DFS_FCC3 |DFS_ETSI ,NO_PSCAN ,0 ,1 },/* NA2_5510_5670 */ - {5510 ,5670 ,30 ,6 ,40 ,40 ,DFS_FCC3 ,NO_PSCAN ,0 ,1 },/* NA3_5510_5670 */ - - {5755 ,5795 ,17 ,0 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* NA1_5755_5795 */ - {5755 ,5795 ,20 ,6 ,40 ,40 ,DFS_ETSI ,NO_PSCAN ,0 ,0 },/* NA2_5755_5795 */ - {5755 ,5795 ,23 ,0 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* NA3_5755_5795 */ - {5755 ,5795 ,30 ,0 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* NA4_5755_5795 */ - {5755 ,5795 ,30 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* NA5_5755_5795 */ - - {5795 ,5795 ,30 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* NA1_5795_5795 */ - - {4920 ,6100 ,30 ,6 ,40 ,40 ,NO_DFS ,NO_PSCAN ,0 ,0 },/* NA_DEMO_ALL_CHANNELS */ -}; - typedef struct regDomain { u16_t regDmnEnum; /* value from EnumRd table */ u8_t conformanceTestLimit;
PATCH 4/6 otus: Fix ZM_SEQ_DEBUG macro for no-debug case
In reply to [email protected]tcp_seq is only initialised in case where ZM_ENABLE_PERFORMANCE_EVALUATION is defined. So move the call to ZM_SEQ_DEBUG() and the decleration of tcp_seq in there too. This allows ZM_SEQ_DEBUG() to be removed from the non-ZM_ENABLE_PERFORMANCE_EVALUATION case in the header file.
This resolves several compile warnings for the
non-ZM_ENABLE_PERFORMANCE_EVALUATION case.
However, the ZM_ENABLE_PERFORMANCE_EVALUATION
case seems to be completely broken.
$ gcc (Debian 4.4.2-8) 4.4.2 Copyright (C) 2009 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ make ... drivers/staging/otus/80211core/cagg.c: In function 'zfAggRxEnabled': drivers/staging/otus/80211core/cagg.c:1872: warning: left-hand operand of comma expression has no effect drivers/staging/otus/80211core/cagg.c:1872: warning: left-hand operand of comma expression has no effect drivers/staging/otus/80211core/cagg.c:1872: warning: statement with no effect ...
drivers/staging/otus/80211core/pub_zfi.h +0 -1
@@ -814,7 +814,6 @@ extern void zfiRxPerformanceReg(zdev_t*#define ZM_PERFORMANCE_RX_AMSDU (dev, buf, len)#define ZM_PERFORMANCE_RX_FLUSH (dev)#define ZM_PERFORMANCE_RX_CLEAR (dev) -#define ZM_SEQ_DEBUG #define ZM_PERFORMANCE_RX_REORDER (dev)#endif /***** End of section 3 *****/
drivers/staging/otus/80211core/cagg.c +9 -6
@@ -1838,7 +1838,6 @@ struct agg_tid_rx* zfAggRxEnabled(zdev_tu16_t frameType;u16_t frameCtrl;u16_t frameSubtype; -u32_t tcp_seq;//struct aggSta *agg_sta; #if ZM_AGG_FPGA_REORDERING struct agg_tid_rx *tid_rx;
@@ -1863,13 +1862,17 @@ struct agg_tid_rx* zfAggRxEnabled(zdev_treturn NULL ; }#ifdef ZM_ENABLE_PERFORMANCE_EVALUATION - tcp_seq =zmw_rx_buf_readb (dev, buf,22 +36 ) <<24 ; - tcp_seq +=zmw_rx_buf_readb (dev, buf,22 +37 ) <<16 ; - tcp_seq +=zmw_rx_buf_readb (dev, buf,22 +38 ) <<8 ; - tcp_seq +=zmw_rx_buf_readb (dev, buf,22 +39 ); + { +u32_t tcp_seq; + + tcp_seq =zmw_rx_buf_readb (dev, buf,22 +36 ) <<24 ; + tcp_seq +=zmw_rx_buf_readb (dev, buf,22 +37 ) <<16 ; + tcp_seq +=zmw_rx_buf_readb (dev, buf,22 +38 ) <<8 ; + tcp_seq +=zmw_rx_buf_readb (dev, buf,22 +39 ); +ZM_SEQ_DEBUG ("In %5d, %12u\n" , seq_no, tcp_seq); + }#endif -ZM_SEQ_DEBUG ("In %5d, %12u\n" , seq_no, tcp_seq); dst0 =zmw_rx_buf_readh (dev, buf, offset+4 ); src[0 ] =zmw_rx_buf_readh (dev, buf, offset+10 );
PATCH 5/6 otus: zfTkipInit(): increment pointer
In reply to [email protected]Increment the pointer rather than its value.
This appears to be a logic error.
$ gcc (Debian 4.4.2-8) 4.4.2 Copyright (C) 2009 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ make ... drivers/staging/otus/80211core/ctkip.c: In function 'zfTkipInit': drivers/staging/otus/80211core/ctkip.c:267: warning: value computed is not used ...
drivers/staging/otus/80211core/ctkip.c +1 -1
@@ -264,7 +264,7 @@ void zfTkipInit(u8_t* key, u8_t* ta, strfor (i=0 ; i<4 ; i++)// initiv is little endian { iv32 += *initIv<<(i*8 ); - *initIv++; + initIv++; } pSeed->iv32 = iv32+1 ;// Force Recalculating on Tkip Phase1
PATCH 1/1 otus: zfTkipInit(): increment another pointer
This applies on top of Simon Horman's patch set, particularly [patch 5/6]. Feel free to roll them into one and change the sign-off to yourself.
There was another pointer that needed to be incremented. Now all six of the bytes are used.
drivers/staging/otus/80211core/ctkip.c +2 -1
@@ -255,7 +255,8 @@ void zfTkipInit(u8_t* key, u8_t* ta, strzfMemoryCopy (pSeed->ta, ta,6 );zfMemoryCopy (pSeed->tk, key,16 ); - iv16 = *initIv++; + iv16 = *initIv; + initIv++; iv16 += *initIv<<8 ; initIv++;
Re: [patch] tch 5/6 v2] otus: zfTkipInit(): increment another pointer
Increment the pointer rather than its value.
These appear to be logic errors.
Thanks to Dan Carpenter for the first hunk of this change.
drivers/staging/otus/80211core/ctkip.c +3 -2
@@ -255,7 +255,8 @@ void zfTkipInit(u8_t* key, u8_t* ta, strzfMemoryCopy (pSeed->ta, ta,6 );zfMemoryCopy (pSeed->tk, key,16 ); - iv16 = *initIv++; + iv16 = *initIv; + initIv++; iv16 += *initIv<<8 ; initIv++;
@@ -264,7 +265,7 @@ void zfTkipInit(u8_t* key, u8_t* ta, strfor (i=0 ; i<4 ; i++)// initiv is little endian { iv32 += *initIv<<(i*8 ); - *initIv++; + initIv++; } pSeed->iv32 = iv32+1 ;// Force Recalculating on Tkip Phase1
PATCH 6/6 otus: zfRateCtrlRateDiff(): remove duplicate comparison
In reply to [email protected]I think this is correct.
$ gcc (Debian 4.4.2-8) 4.4.2 Copyright (C) 2009 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ make ... drivers/staging/otus/80211core/ratectrl.c: In function 'zfRateCtrlRateDiff': drivers/staging/otus/80211core/ratectrl.c:433: warning: suggest parentheses around comparison in operand of '==' ...
drivers/staging/otus/80211core/ratectrl.c +1 -1
@@ -430,7 +430,7 @@ u8_t zfRateCtrlRateDiff(struct zsRcCell* {return ((rcCell->currentRateIndex - i)+1 )>>1 ; } - else if (i == rcCell->currentRateIndex == 0) + else if (i == rcCell->currentRateIndex) {return 1 ; }
Re: [patch 6/6] otus: zfRateCtrlRateDiff(): remove duplicate comparison
Quoted 22 lines · On Fri, Jan 08, 2010 at 06:57:54PM +1100, [email protected] wrote:
I think this is correct.
$ gcc (Debian 4.4.2-8) 4.4.2 Copyright (C) 2009 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.$ make ... drivers/staging/otus/80211core/ratectrl.c: In function 'zfRateCtrlRateDiff': drivers/staging/otus/80211core/ratectrl.c:433: warning: suggest parentheses around comparison in operand of '==' ...Signed-off-by Simon Horman <[email protected]>Index:
linux-2.6/drivers/staging/otus/80211core/ratectrl.c
===================================================================
drivers/staging/otus/80211core/ratectrl.c u8_t zfRateCtrlRateDiff(struct zsRcCell* · line 433
Quoted 5 lines
drivers/staging/otus/80211core/ratectrl.c +1
-1@@ -430,7 +430,7 @@ u8_t zfRateCtrlRateDiff(struct zsRcCell* {return ((rcCell->currentRateIndex - i)+1 )>>1 ; } - else if (i == rcCell->currentRateIndex == 0) + else if (i == rcCell->currentRateIndex)
You realize you have reversed the meaning of the test? The original was the same as if (i != rcCell->currentRateIndex).
Your patch is possibly correct, but it's hard to know. I would leave this for now until someone grovels through the code to find out for sure if it should be == or !=. If we silence the warning, no one will ever look at this code again.
regards,
dan carpenter
Re: [patch 6/6] otus: zfRateCtrlRateDiff(): remove duplicate comparison
Quoted 32 lines · Dan Carpenter
Quoted 22 lines · On Fri, Jan 08, 2010 at 06:57:54PM +1100, [email protected] wrote:
I think this is correct.
$ gcc (Debian 4.4.2-8) 4.4.2 Copyright (C) 2009 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.$ make ... drivers/staging/otus/80211core/ratectrl.c: In function 'zfRateCtrlRateDiff': drivers/staging/otus/80211core/ratectrl.c:433: warning: suggest parentheses around comparison in operand of '==' ...Signed-off-by Simon Horman <[email protected]>Index:
linux-2.6/drivers/staging/otus/80211core/ratectrl.c
===================================================================drivers/staging/otus/80211core/ratectrl.c u8_t zfRateCtrlRateDiff(struct zsRcCell* · line 433
Quoted 5 lines
drivers/staging/otus/80211core/ratectrl.c +1
-1@@ -430,7 +430,7 @@ u8_t zfRateCtrlRateDiff(struct zsRcCell* {return ((rcCell->currentRateIndex - i)+1 )>>1 ; } - else if (i == rcCell->currentRateIndex == 0) + else if (i == rcCell->currentRateIndex)You realize you have reversed the meaning of the test? The original was the same as if (i !=
rcCell->currentRateIndex).
Quoted 4 lines
Your patch is possibly correct, but it's hard to know. I would leave this for now until someone grovels through the code to find out for sure if it should be == or !=. If we silence the warning, no one will ever look at this code again.
Good point, I withdraw this patch.