Commit Graph

798 Commits

Author SHA1 Message Date
Cristina Opriceana 19cd22972f Staging: drivers: Bool initializations should use true/false
This patch replaces bool initializations of 1/0 with true/false in order
to increase readability and respect the standards. Warning found by
coccinelle.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 15:30:07 -08:00
Aya Mahfouz 0c596a31ec staging: vt6655: remove unused variable
This patch removes a variable that was simply used to
store the return value of a function call before
returning it.

The issue was detected and resolved using the following
coccinelle script:

@@
identifier len,f;
@@

-int len;
 ... when != len
     when strict
-len =
+return
        f(...);
-return len;

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 15:11:08 -08:00
Yeliz Taneroglu 0a19b14cc5 Staging: vt6655: Fix do not use C99 // comments
Fix checkpatch.pl issues with do not use C99 //
comments in key.h

Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 15:11:08 -08:00
Hatice ERTÜRK 34c3a15061 Staging: vt6655: changed C99 // comments
// erased and replace it with /* */ used.
Error found with checkpatch.pl

Signed-off-by: Hatice ERTURK <haticeerturk27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:23:58 -08:00
Katie Dunne 4d36302448 Staging: vt6655: break lines over 80 characters
Addresses checkpatch.pl warning:
WARNING: line over 80 characters

Break 2 lines over 80 characters and align with opening parenthesis

Signed-off-by: Katie Dunne <kdunne@mail.ccsf.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:23:58 -08:00
Katie Dunne 0cc5a4f9d5 Staging: vt6655: Replace C99 comments with C89
Addresses the checkpatch.pl error:
ERROR: Do not use C99 // comments

Remove an unneeded comment line
Replace C99 comments with C89
Reduce multiple line comments to one line
Shorten comments over 80 line by removing blank space

Signed-off-by: Katie Dunne <kdunne@mail.ccsf.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 12:23:58 -08:00
Malcolm Priestley 6d85412726 staging: vt6655: vnt_rx_data add track rsr and new_rsr errors
If not rsr & RSR_CRCOK report RX_FLAG_FAILED_FCS_CRC

If not rsr & (RSR_IVLDTYP | RSR_IVLDLEN) drop packet

If not NEWRSR_DECRYPTOK on new_rsr drop packet.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07 17:16:59 +08:00
Malcolm Priestley d17f4c8a42 staging: vt6655: Fix TD_FLAGS_NETIF_SKB only on TYPE_AC0DMA
Allow only TD_FLAGS_NETIF_SKB on ring buffer TYPE_AC0DMA for data
only transfers for correct reporting of tx rates.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07 17:16:59 +08:00
Malcolm Priestley 64e4fd5142 staging: vt6655: parse bb vga code out of device_intr.
Reordering the code and reversing the priv->byBBVGANew verses
priv->byBBVGACurrent check and using dev_dbg for pr_debug.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07 17:16:59 +08:00
Malcolm Priestley 187e2a8180 staging: vt6655: move setting of PSTxDesc->buff_addr to vnt_tx_packet
Keep setting of this part of the structure with the others.

Only pTDInfo needs carried in the buffer structure.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-07 17:16:59 +08:00
Mariam Mohamed Fawzy 1167ff91da staging: vt6655: fix that open brace { should be on the previous line
This patch fixes the following checkpatch.pl error:
fix that open brace { should be on the previous line

Signed-off-by: Mariam Mohamed Fawzy <maryammohamed61@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-28 11:22:21 -08:00
Malcolm Priestley 7a9331c0c0 staging: vt6655: RFbSetPower remove unused variable byPwrdBm
byPwrdBm is set but never used.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:16 +08:00
Malcolm Priestley b0c5881e78 staging: vt6655: Fix RFbSetPower() error: buffer overflow 'priv->abyCCKPwrTbl' 15 <= 56
Check uCH is not more than CB_MAX_CHANNEL_24G(14) on rates RATE_1M to RATE_11M

Return false as the call is invalid as these rates do not exist
above channel 14.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:16 +08:00
Malcolm Priestley 918185f666 staging: vt6655: device_init_registers alway set initial antenna mode
BBvSetTxAntennaMode and BBvSetRxAntennaMode need to be set correcty
on start up

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:16 +08:00
Malcolm Priestley e6f534bc2f staging: vt6655: remove antenna diversity functions
The vendor had disabled these functions in their last version.

On test this can be troublesome, so remove this from the driver along
with its macros and timers.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:16 +08:00
Malcolm Priestley 63e8d787b0 staging: vt6655: common variable size channel numbers to ieee80211_channel->hw_value
hw_value is u16 so fix all to the same size.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:16 +08:00
Malcolm Priestley d7a4cfa8c1 staging: vt6655: set_channel replace parameter with ieee80211_channel
replacing uConnectionChannel for hw_value as set in vnt_init_bands.

This allows other signaling of ieee80211_channel to move deeper into
driver.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:16 +08:00
Ahmad Hassan 2a0a7b3dfa staging: vt6655: fix space prohibted before that ','
This patch fixes the following checkpatch.pl error:
fix space prohibited before that ','

Signed-off-by: Ahmad Hassan <ahmad.hassan612@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:16 +08:00
Heba Aamer 75b4d52bae staging: vt6655: fix space prohibited before that ','
This patch fixes the following checkpatch.pl error:
fix space prohibited before that ','

Signed-off-by: Heba Aamer <heba93aamer@gmail.com>
Reviewed-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-25 19:59:16 +08:00
Greg Kroah-Hartman 484c60e206 Merge 3.19-rc5 into staging-next
We want the staging fixes in this branch as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-19 10:59:48 +08:00
Emrys Bayliss 12b79518fb Staging: vt6655: Checkpatch fix: c99 comment headings
This patch fixes some of the following checkpatch.pl errors in mac.h
ERROR: do not use C99 // comments

This patch reformats all single line c99 style comments to the
preferred style.

Signed-off-by: Emrys Bayliss <emrys@paradise.net.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:53:21 -08:00
Emrys Bayliss 0d12e05799 Staging: vt6655: comment headings formatting
This patch makes the formatting of the comments in mac.h more
consistent.

* Where a heading takes up three comment lines it is reduced to one.
* A newline always separates column headings

Signed-off-by: Emrys Bayliss <emrys@paradise.net.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:53:20 -08:00
Emrys Bayliss 19bf265eae Staging: vt6655: Checkpatch fix: lines longer than 80 columns
This patch fixes the following checkpatch.pl errors in mac.h:
WARNING: line over 80 characters

Signed-off-by: Emrys Bayliss <emrys@paradise.net.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:53:20 -08:00
Emrys Bayliss 060b505b83 Staging: vt6655: Checkpatch fix: c99 comments after statements
This patch fixes some c99 errors in mac.h:
ERROR: do not use C99 // comments

All instances where the c99 comment occurs after a statement.

Signed-off-by: Emrys Bayliss <emrys@paradise.net.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:53:20 -08:00
Emrys Bayliss 644848af96 Staging: vt6655: comment after statement formatting
This patch makes the formatting of the comments in mac.h more
consistent.

* Where a comment follows a statement, it is separated by a single
  space.

Signed-off-by: Emrys Bayliss <emrys@paradise.net.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:53:20 -08:00
Emrys Bayliss 818b555760 Staging: vt6655: Checkpatch fix: empty c99 comments
This patch fixes some of the following checkpatch.pl errors in mac.h:
ERROR: do not use C99 // comments

This patch truncates statements which are followed by empty c99
comments.

Signed-off-by: Emrys Bayliss <emrys@paradise.net.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:49:35 -08:00
Emrys Bayliss b5aa3f17ef Staging: vt6655: Checkpatch fix: unnecessary whitespace
This patch fixes the following checkpatch.pl errors in mac.h:
ERROR: space prohibited before that ',' (ctx:WxW)

Signed-off-by: Emrys Bayliss <emrys@paradise.net.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:49:35 -08:00
Eddie Kovsky a307d1d6d4 staging: vt6655: fix sparse warning: argument type
Fixes following warning generated by sparse:

drivers/staging/vt6655/baseband.c:2180:45: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/vt6655/baseband.c:2180:45:    expected struct vnt_private *priv
drivers/staging/vt6655/baseband.c:2180:45:    got void [noderef] <asn:2>*dwIoBase

Compile tested on next-20141219.

Signed-off-by: Eddie Kovsky <ewk@edkovsky.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12 19:49:47 -08:00
Malcolm Priestley 3a9dda7925 staging: vt6655: Fix loss of distant/weak access points on channel change.
If the asssocated access point is strong byBBVGACurrent will be adjusted
accordingly.

Users will nolonger see distant access points without taking down interface.

When changing channel reset byBBVGACurrent back to pDevice->abyBBVGA[0] for
max sensitivity.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12 19:49:47 -08:00
Malcolm Priestley b5745290af staging: vt6655: vnt_tx_packet Fix corrupted tx packets.
Move PSTxDesc->m_td1TD1 to inside spin locks.

if m_td1TD1.byTCR has TCR_EDP and TCR_STP are set, the interrupt handler will
try and complete the buffer before it is completed. Usually on the tail
of a burst of tx packets.

This results in a partially completed packet being transmitted or worse
sitll dead lock when skb is freed by the interrupt handler.

Set head_td->m_td1TD1.byTCR to 0 in first lock of vnt_tx_packet to stop
interrupt handler completing the buffer. Move Set TSR1 & ReqCount in
s_cbFillTxBufHead to the second lock.

cbReqCount is carried to the second lock in pTDInfo->dwReqCount without
the padding removed.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12 19:49:47 -08:00
Mike Krinkin 84c00afef4 staging: vt6655: fix sparse warnings: incorrect argument type
this patch fixes following sparse warnings:

drivers/staging/vt6655/device_main.c:1503:25: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/vt6655/device_main.c:1503:25:    expected void [noderef] <asn:2>*<noident>
drivers/staging/vt6655/device_main.c:1503:25:    got struct vnt_private *
drivers/staging/vt6655/device_main.c:1503:25: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/vt6655/device_main.c:1503:25:    expected void [noderef] <asn:2>*<noident>
drivers/staging/vt6655/device_main.c:1503:25:    got struct vnt_private *
drivers/staging/vt6655/device_main.c:1505:25: warning: incorrect type in argument 1 (different address spaces)
drivers/staging/vt6655/device_main.c:1505:25:    expected void [noderef] <asn:2>*<noident>
drivers/staging/vt6655/device_main.c:1505:25:    got struct vnt_private *
drivers/staging/vt6655/device_main.c:1505:25: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/vt6655/device_main.c:1505:25:    expected void [noderef] <asn:2>*<noident>
drivers/staging/vt6655/device_main.c:1505:25:    got struct vnt_private *

Signed-off-by: Mike Krinkin <krinkin.m.u@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12 19:49:47 -08:00
Gustavo A. R. Silva b1797dfda6 Staging: vt6655: Fixed a typo
Fixed a typo in mac.c file.

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12 19:46:50 -08:00
Malcolm Priestley 95775d1221 staging: vt6655: [BUG] Protect MACvSelectPage1 with lock.
The device must not flip to page 1 while in interrupt lock causing
loss of connection or dead lock.

Protect from changes to page by adding lock where user can
change the page in CARDvSetRSPINF, vnt_configure and set_channel

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12 19:45:35 -08:00
Piotr Kubus bc22b4978d Staging: vt6655: fix a space coding style issue
Fixed a space coding style issue found by checkpatch.pl in rxtx.c.

Signed-off-by: Piotr Kubus <p.t.kubus@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12 19:45:35 -08:00
Sakshi Bansal 527ef70d1a Staging: vt6655: baseband.c: fixed line over 80 characters
Signed-off-by: Sakshi Bansal <sakshi.april5@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12 19:44:18 -08:00
Nicholas Parkanyi c3dd5a08d7 staging: vt6655: Replace C99 comments in power.c and upc.h.
This patch fixes the following checkpatch.pl warnings:

ERROR: do not use C99 // comments
+//

ERROR: do not use C99 // comments
+//  For memory mapped IO

ERROR: do not use C99 // comments
+//

ERROR: do not use C99 // comments
+#endif // __UPC_H__

ERROR: do not use C99 // comments
+	// set period of power up before TBTT

ERROR: do not use C99 // comments
+		// set AID

ERROR: do not use C99 // comments
+		// set ATIM Window

ERROR: do not use C99 // comments
+	// Set AutoSleep

ERROR: do not use C99 // comments
+	// Set HWUTSF

ERROR: do not use C99 // comments
+		// clear always listen beacon

ERROR: do not use C99 // comments
+		// first time set listen next beacon

ERROR: do not use C99 // comments
+		// always listen beacon

ERROR: do not use C99 // comments
+	// enable power saving hw function

ERROR: do not use C99 // comments
+	// disable power saving hw function

ERROR: do not use C99 // comments
+	//clear AutoSleep

ERROR: do not use C99 // comments
+	//clear HWUTSF

ERROR: do not use C99 // comments
+	// set always listen beacon

Signed-off-by: Nicholas Parkanyi <n.parkanyi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12 19:42:45 -08:00
Fred Chou 99ae87e755 staging: vt6655: remove unused function in mac.c
Removed the unused function MACvGetShortRetryLimit, which also
fixed the following sparse warning:
drivers/staging/vt6655/mac.c:162:6: warning:
symbol 'MACvGetShortRetryLimit' was not declared. Should it be static?

Signed-off-by: Fred Chou <fred.chou.nd@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12 19:39:44 -08:00
Sören Brinkmann b7c9cd450b staging: vt6655: Declare vnt_init() static
Fix sparse warning:
  drivers/staging/vt6655/device_main.c:1672:5: warning: symbol 'vnt_init' was not declared. Should it be static?

Signed-off-by: Sören Brinkmann <soeren.brinkmann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-12 19:34:48 -08:00
Malcolm Priestley 19f3ed3f1e staging: vt6655: s_cbFillTxBufHead remove parameter cbFrameBodySize
skb->len is available locally use that instead.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02 16:35:11 -08:00
Malcolm Priestley 154bb8bd43 staging: vt6655: s_cbFillTxBufHead remove parameter *pPacket
skb->data is available locally so use that instead.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02 16:35:10 -08:00
Malcolm Priestley 4b71166d78 staging: vt6655: s_cbFillTxBufHead remove unused parameter *puMACfragNum
*puMACfragNum was part of old legacy functions.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02 16:35:10 -08:00
Malcolm Priestley 4a7f0cff05 staging: vt6655: remove unused typedef struct tagSSromReg
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02 16:35:10 -08:00
Malcolm Priestley 950701a127 staging: vt6655: srom remove dead functions
Remove these unused functions
SROMbWriteEmbedded
SROMvRegBitsOn
SROMvRegBitsOff
SROMbIsRegBitsOn
SROMbIsRegBitsOff
SROMvWriteAllContents
SROMvWriteEtherAddress
SROMvReadSubSysVenId
SROMbAutoLoad

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02 16:35:10 -08:00
Malcolm Priestley da4f18ed3b staging: vt6655: remove duplicate MACvSetPacketFilter
Packet filtering is already done in vnt_configure.

A call to MACvSetPacketFilter is not necessary in MACvInitialize as
this will be done by vnt_configure when interface is up.

Also remove macros associated with this function.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02 16:35:10 -08:00
Malcolm Priestley 74ed42c73d staging: vt6655: rf.c clean up function comments
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:37:24 -08:00
Malcolm Priestley 7eb1570ff7 staging: vt6655: rf.c Removed unneeded comments
Type and function that are not present comments

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:37:24 -08:00
Malcolm Priestley 0a5ea1e352 staging: vt6655: rf.c: Remove author comments
Moving names to file header comment

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:37:24 -08:00
Malcolm Priestley ac3e134af2 staging: vt6655: rf.c camel calse vnt_private rename pDevice to priv
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:37:24 -08:00
Malcolm Priestley b310a0cdc2 staging: vt6655: IFRFbWriteEmbedded replace __iomem with vnt_private
Fixing callers to vnt_private

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:37:24 -08:00
Malcolm Priestley 817c985ba1 staging: vt6655: rf remove __iomem *dwIoBase from functions
replacing with vnt_private and removing dereferencing from callers

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:37:24 -08:00
Malcolm Priestley 738487ffc5 staging: vt6655: card.c move __iomem into functions.
Removing dereferencing from callers

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:37:24 -08:00
Malcolm Priestley 6d35b1fcaa staging: vt6655: card Remove function vUpdateIFS
vUpdateIFS does the same operations of CARDbSetPhyParameter there
is not need to call this function.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:37:24 -08:00
Malcolm Priestley c397d46fbe staging: vt6655: always keep abyCurrentNetAddr aligned to 2
Because the driver now uses ether_addr_copy the alignment of this
variable must be maintained at 2.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:36:54 -08:00
Malcolm Priestley bf8918de79 staging: vt6655: change typedef enum _VIA_PKT_TYPE to macro
Replacing for u8 type and removing cast for byBBType.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:36:54 -08:00
Malcolm Priestley ff8d9f0806 staging: vt6655: replace typedef enum _VIA_BB_TYPE with macros
Replacing type with u8

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:36:54 -08:00
Malcolm Priestley bfb6c86376 staging: vt6655: CARDbSetPhyParameter remove unused parameters
wCapInfo
byERPField,
*pvSupportRateIEs
*pvExtSupportRateIEs

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:36:53 -08:00
Malcolm Priestley b40d821dcc staging: vt6655: dead code remove typedef enum _CARD_PHY_TYPE
Removing unused eCurrentPHYType

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:36:53 -08:00
Malcolm Priestley d1ab52011c staging: vt6655: s_vCalculateOFDMRParameter use bb_type for CARD_PHY_TYPE
using u8 for bb_type and replacing PHY_TYPE_11A with BB_TYPE_11A

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:36:53 -08:00
Malcolm Priestley 6e1d14a56b staging: vt6655: CARDvSetRSPINF us bb_type for CARD_PHY_TYPE
Using u8 for bb_type

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:36:53 -08:00
Malcolm Priestley a558e3dcc3 staging: vt6655: CARDbSetPhyParameter change CARD_PHY_TYPE to bb_type
using u8 for bb_type

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:36:53 -08:00
Malcolm Priestley b930eb56e3 staging: vt6655: dead code remove CARDbAddBasicRate
we nonlonger set rates in the driver

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:36:53 -08:00
Malcolm Priestley 3008dd9d9b staging: vt6655: CARDvUpdateBasicTopRate use basic_rates to find top rate
basic_rates should now be used to find it.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-26 13:36:53 -08:00
Malcolm Priestley 61b90995d3 staging: vt6655: Fix issue of byPacketType is not set at all.
set by calling CARDbyGetPktType.

change CARDbIsOFDMinBasicRate to check basic_rates.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-07 09:23:29 -08:00
Malcolm Priestley 8e8a9f5133 staging: vt6655: BBbReadEmbedded replace __iomem with vnt_private
Changing callers to point to private

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-07 09:23:29 -08:00
Malcolm Priestley 377f5bc00f staging: vt6655: BBbWriteEmbedded replace __iomem with vnt_private for callers
Referencing dwIoBase inside function.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-07 09:23:28 -08:00
Malcolm Priestley 78b3c1fde0 staging: vt6655: baseband/rf s_bAL7230Init change __iomem for baseband functions
Replace __iomem with vnt_private providing pointer for dwIoBase

Change BBvPowerSaveModeON and BBvPowerSaveModeOFF to vnt_private and
reference __iomem there, to be removed later.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-07 09:23:28 -08:00
Malcolm Priestley a5f0eef38b staging: vt6655: baseband replace __iomem where caller is priv dereferenced.
Replace with stucture vnt_private *priv

in functions
BBvSoftwareReset
BBvSetTxAntennaMode
BBvSetRxAntennaMode
BBvSetDeepSleep
BBvExitDeepSleep

__iomem *dwIoBase will be moved into BBbWriteEmbedded and BBbReadEmbedded
later.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-07 09:23:28 -08:00
Malcolm Priestley 314e5caa4b staging: vt6655: baseband.h remove pDevice from struct vnt_private pointer
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-07 09:23:28 -08:00
Malcolm Priestley 54fbb2da8d staging: vt6655: change tx wake queue
Wake queue in the dwIsr loop of device_intr instead of device_tx_srv.

This fixes an issue when ISR_TXDMA0 or ISR_AC0DMA does not occur
device_tx_srv is not called and the queue gets stuck in stopped
condition.

On test if the queue is stuck another MACvTransmitAC0 or MACvTransmit0
in vnt_tx_packet will clear it.

Check on vif that both buffers are available and the queue is stopped.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 14:52:59 -08:00
Malcolm Priestley 8514408b9b staging: vt6655 baseband.c camel case replace pDevice -> priv
for struct vnt_private

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 14:49:14 -08:00
Malcolm Priestley d475d42db6 staging: vt6655: device.h remove dead member wstats
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 14:49:14 -08:00
Malcolm Priestley 2ee1ad7b32 staging: vt6655: device_set_options remove dead variables
uConnectionRate
wRTSThreshold
byOpMode
b11hEnable
uChannel

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 14:49:14 -08:00
Malcolm Priestley 3d42d26c83 staging: vt6655: baseband.c/h remove dead functions
These functions are not used so remove them
BBbIsRegBitsOn
BBbIsRegBitsOff
BBvReadAllRegs
BBvLoopbackOn
BBvLoopbackOff

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 14:49:14 -08:00
Malcolm Priestley bfa4b0febd staging: vt6655: device_init_registers remove uConnectionRate
The device starts up with a default rate of 54M

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 14:49:14 -08:00
Malcolm Priestley ac875c17a1 staging: vt6655: device_set_options remove unused ethernet addresses
Removing these variables
abyBroadcastAddr
abySNAP_RFC1042
abySNAP_Bridgetunnel

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 14:49:13 -08:00
Malcolm Priestley 1b8e512b41 staging: vt6655: device_get_options remove unused device parameters
IP_byte_align
Channel
PreambleType
RTSThreshold
ConnectionRate
OPMode
b80211hEnable

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 14:49:13 -08:00
Malcolm Priestley b1c4133657 staging: vt6655: remove fragmentation from driver
fragmentation is now handled by mac80211.

Remove functions
device_alloc_frag_buf
device_init_defrag_cb
device_free_frag_buf

Removing
typedef struct tagSDeFragControlBlock
frag_thresh
sRxDFCB
cbDFCB;
cbFreeDFCB;
uCurrentDFCBIdx;

macros
FRAG_THRESH_MIN
FRAG_THRESH_MAX

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 14:49:13 -08:00
Malcolm Priestley 87299d4c06 staging: vt6655: mac.c and mac.h remove dead functions.
MACvReadAllRegs
MACbyReadMultiAddr
MACvWriteMultiAddr
MACvSetMultiAddrByHash
MACvResetMultiAddrByHash
MACvSetRxThreshold
MACvGetRxThreshold
MACvSetTxThreshold
MACvGetTxThreshold
MACvSetDmaLength
MACvGetDmaLength
MACvGetLongRetryLimit
MACbIsInLoopbackMode
MACbCompareContext
MACvOneShotTimer0MicroSec
MACbTxDMAOff
MACvClearBusSusInd
MACvEnableBusSusEn
MACbFlushSYNCFifo
MACvSetDefaultKeyEntry
MACvEnableDefaultKey
MACvDisableDefaultKey
MACvSetDefaultTKIPKeyEntry
MACvSetDefaultKeyCtl

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 14:49:13 -08:00
Malcolm Priestley 6b5db44ecd staging: vt6655: mac.c/h remove member type comments
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 14:49:13 -08:00
Malcolm Priestley 5116d9fcf1 staging: vt6655: mac remove dead variable TxRate_iwconfig
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-05 14:49:13 -08:00
Malcolm Priestley 0fbdd5ca6f staging: vt6655: dead code remove header type.h
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:47 -07:00
Malcolm Priestley 33785983ca staging: vt6655: dead code remove wmgr.h
on removal needs to be replaced by card.h in device.h

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:47 -07:00
Malcolm Priestley c3fb46429b staging: vt6655: move MAKE_BEACON_RESERVED to device.h
Used only in function device_intr in device_main.c move macro.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:47 -07:00
Malcolm Priestley 1903e6dd05 staging: vt6655: Move LIFETIME RES 64us macros to rxtx.h
Used only by vnt_generate_fifo_header move these macros.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:47 -07:00
Malcolm Priestley e11cdc39f3 staging: vt6655: remove typedef void *TimerFunction
Covert functions TimerSQ3CallBack and TimerState1CallBack to
the correct type for struct timer_list.function to remove
the cast altogether.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:47 -07:00
Malcolm Priestley dd46cf735d staging: vt6655: dead code remove 80211hdr.h
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:47 -07:00
Malcolm Priestley 9c644a05c6 staging: vt6655: device.h remove dead strutures and macros
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:46 -07:00
Malcolm Priestley 146761058f staging: vt6655: struct vnt_private remove dead members
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:46 -07:00
Malcolm Priestley 4cf8e50303 staging: vt6655: dead code remove country.h
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:46 -07:00
Malcolm Priestley 651a39cad5 staging: vt6655: dead code remove iocmd.h
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:46 -07:00
Malcolm Priestley 47a2a3cb75 staging: vt6655: dead code remove iowpa.h
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:46 -07:00
Malcolm Priestley 8224e771ca staging: vt6655: dead code remove 80211mgr.h
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:46 -07:00
Malcolm Priestley d54435d3fb staging: vt6655: dead code remove tether.h
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:46 -07:00
Malcolm Priestley d853ce2291 staging: vt6655: dead code remove bssdb.h header
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:45 -07:00
Malcolm Priestley 37cc22b1c4 staging: vt6655: dead remove wcmd.h and typedefs
CMD_STATE
CMD_CODE
CMD_ITEM

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:45 -07:00
Malcolm Priestley 38ad4a00eb staging: vt6655: dead code remove ndis and pmkid strutures.
struct pmkid_candidate
typedef struct _BSSID_INFO
typedef struct tagSPMKID
typedef struct tagSPMKIDCandidateEvent
NDIS_802_11_MAC_ADDRESS
typedef struct _NDIS_802_11_AI_REQFI
typedef struct _NDIS_802_11_AI_RESFI
typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION
typedef struct tagSAssocInfo

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:45 -07:00
Malcolm Priestley ab2eb50af8 staging: vt6655: wmgr.h remove management structures
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:45 -07:00
Malcolm Priestley 8ec94797eb staging: vt6655: dead code remove vntwifi.h
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:45 -07:00
Malcolm Priestley b0437f281d staging: vt6655: move all RATE_* macros to device.h
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:45 -07:00
Malcolm Priestley d40c444668 staging: vt6655: channel.c remove dead functions
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:45 -07:00
Malcolm Priestley b4ba0cb10f staging: vt6655: dead code remove wctl.c/h
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:45 -07:00
Malcolm Priestley 7910356c7f staging: vt6655: dead code remove 80211mgr.c and functions
80211mgr.h header will be removed later

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:45 -07:00
Malcolm Priestley 5e6fc9d7e4 staging: vt6655: dead code remove tcrc.c/h
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:45 -07:00
Malcolm Priestley 029c7d225a staging: vt6655L remove tether.c functions
remove
ETHbyGetHashIndexByCrc32
ETHbIsBufferCrc32Ok

tether.h header will be removed later

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:44 -07:00
Malcolm Priestley 1243317b46 staging: vt6655: mib remove unused functions and structure members
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:44 -07:00
Malcolm Priestley 77bb9975d4 staging: vt6655: key.c remove dead functions
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:44 -07:00
Malcolm Priestley 610cc9d98b staging: vt6655: dead code remove vntwifi.c functions
Header will be removed later

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:44 -07:00
Malcolm Priestley e813580c36 staging: vt6655: dead code remove michael.c/h
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:43 -07:00
Malcolm Priestley 7c23c2d25d staging: vt6655: deadcode remove aes_ccmp/rc4/tkip
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:43 -07:00
Malcolm Priestley 6bedc35b75 staging: vt6655: dead code remove wpa/wpa2
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:43 -07:00
Malcolm Priestley c49802bfb6 staging: vt6655: deadcode remove wroute.c/h
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:42 -07:00
Malcolm Priestley dd1c689cec staging: vt6655: card.c/h remove dead functions
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:34:37 -07:00
Malcolm Priestley 86b5afa757 staging: vt6655: dead code remove IEEE11.h.c/h
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:33:35 -07:00
Malcolm Priestley f3de0df9b0 staging: vt6655: dead code datarate.c/h
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:33:35 -07:00
Malcolm Priestley 7d48710aec staging: vt6655: dead code remove bssdb.c
header will be removed later

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:33:35 -07:00
Malcolm Priestley 1a48e8c412 staging: vt6655: s_cbFillTxBufHead remove unused parameters
Remove the following parameters
PSEthernetHeader psEthHeader
PSKeyItem pTransmitKey
bool bNeedEncrypt

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:33:35 -07:00
Malcolm Priestley d829163fa9 staging: vt6655: rxtx remove dead functions
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:33:35 -07:00
Malcolm Priestley 8d0126b1f0 staging: vt6655: dead code remove wcmd.c
header will be removed later.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:33:35 -07:00
Malcolm Priestley 185cb4e6ce staging: vt6655: dead code remove wmgr.c
Remove all functions

Header will be deleted later

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:33:35 -07:00
Malcolm Priestley 55340d6bb8 staging: vt6655: remove dead functions in power.c/h
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:33:35 -07:00
Malcolm Priestley 01b8979244 staging: vt6655: dpc.c/h remove dead functions
s_byGetRateIdx
s_vGetDASA
s_vProcessRxMACHeader
s_bAPModeRxCtl
s_bAPModeRxData
s_bHandleRxEncryption
s_bHostWepRxEncryption
s_vProcessRxMACHeader
s_byGetRateIdx
s_vGetDASA
device_receive_frame
s_bAPModeRxCtl

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:33:35 -07:00
Malcolm Priestley 2759e2172d staging: vt6655: dead code remove wpactl.c/h
All these functions are now dead.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:33:35 -07:00
Malcolm Priestley ee1464902c staging: vt6655: dead code remove legacy hostap.c/h
hoatap is now supported by mac80211 in nl80211 mode

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:33:34 -07:00
Malcolm Priestley ae1927eb34 staging: vt6655: dead code remove ioctl.c/h
The driver nolonger supports these io functions

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:33:34 -07:00
Malcolm Priestley 0d24c97093 staging: vt6655: dead code remove iwctl.c/h
The iw handler and functions are nolonger required.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:33:34 -07:00
Malcolm Priestley 7af1ead431 staging: vt6655: dead code remove net device code
All functions are dead and nolonger of use.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:33:34 -07:00
Malcolm Priestley 3f9aceeddb staging: vt6655: dead code remove zones and channel table elements
emply functions will be deleted later

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:33:34 -07:00
Malcolm Priestley f4cf678fd7 staging: vt6655: deadcode remove zone file operations and vntconfiguration.dat
These are now all handled by mac80211.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:33:34 -07:00
Malcolm Priestley c7b14ea096 staging: vt6655: reset tsf on dissociation
Ensuring that tsf counter does not run while idle.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:31 -07:00
Malcolm Priestley d855802b8d staging: vt6655: don't update bUpdateBBVGA when off channel
Check flag conf IEEE80211_CONF_OFFCHANNEL so that RSSI doesn't swing wildly
on scanning.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:31 -07:00
Malcolm Priestley f218f40d48 staging: vt6655: vnt_rx_data: uCurrRSSI should have the value of *rssi
Fixes issue of byBBVGANew is wrong in device_intr

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:31 -07:00
Malcolm Priestley 9aa5bedaa0 staging: vt6655: fifo & frag control remove big endian values
Endian conversion now happens at run time only little endian
values are valid.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:31 -07:00
Malcolm Priestley a9c049b86d staging: vt6655: baseband.c timers replace spin lock
Use spin_lock_irqsave and spin_unlock_irqrestore

in functions TimerSQ3CallBack and TimerState1CallBack

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:31 -07:00
Malcolm Priestley 10d6f1b743 staging: vt6655: device_init_registers replace spin lock
Use spin_lock_irqsave and spin_unlock_irqrestore.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:31 -07:00
Malcolm Priestley f038ad0e72 staging: vt6655: s_vGenerateTxParameter remove unused cbMACHdLen
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:31 -07:00
Malcolm Priestley 837a38f71b staging: vt6655: baseband.c replace BIT0 with BIT(0)
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:31 -07:00
Malcolm Priestley b0a08a8a73 staging: vt6655: MACvSetDefaultKeyEntry replace WLAN_WEP104_KEYLEN
with WLAN_KEY_LEN_WEP40

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:31 -07:00
Malcolm Priestley e24c235b5d staging: vt6655: mac80211 conversion: PSbIsNextTBTTWakeUp convert to mac80211
Wake up to listen to next beacon when struct ieee80211_conf -> listen_interval == 1

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:31 -07:00
Malcolm Priestley b4bdf94d7d staging: vt6655: vt6655_probe remove management pointers
All these pointers are now dead.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:30 -07:00
Malcolm Priestley 7e5d88d89b staging: vt6655: mac80211 conversion: device_error remove legacy functions
Remove netif_stop_queue, bCmdRunning and timer functions

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:30 -07:00
Malcolm Priestley 64fea6e455 staging: vt6655: phy type same as bb type
To maintain functionality

typedef enum _CARD_PHY_TYPE should have the same values as
typedef enum _VIA_PKT_TYPE

TODO both these types need merging.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:30 -07:00
Malcolm Priestley 1f7a081abf staging: vt6655: switch driver over to mac80211
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:30 -07:00
Malcolm Priestley 14e5300631 staging: vt6655: mac80211 conversion: device_free_info
Remove net device code and add mac80211 unregister code.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:30 -07:00
Malcolm Priestley 1d6d3c1a62 staging: vt6655: mac80211 conversion: device_init_registers remove legacy code
Remove pMgmt, byCurrentCh, VNTWIFIbConfigPhyMode, eEncryptionStatus and netif_stop_queue.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:30 -07:00
Malcolm Priestley 3fbbb75f55 staging: vt6655: CARDbSetPhyParameter replace s_vSetRSPINF with CARDvSetRSPINF
Removing s_vSetRSPINF

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:30 -07:00
Malcolm Priestley c01ef29e38 staging: vt6655: mac80211 conversion: card.c use basic_rates
Use basic_rates to find cck and ofdm rates.

wBasicRate will be removed later.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:30 -07:00
Malcolm Priestley 0614a0e84d staging: vt6655: mac80211 conversion: changes to CARDbSetPhyParameter
CARDbSetPhyParameter appears to use two different strutures to find supported
rates.

Remove PWLAN_IE_SUPP_RATES and use basic_rates to find rates supported.

mac80211 now sets bShortSlotTime, bBarkerPreambleMd and byPreambleType remove
these.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:30 -07:00
Malcolm Priestley e99d357c6f staging: vt6655: mac80211 conversion: enable power saving
Convert PSvEnablePowerSaving and PSvEnablePowerSaving

Remove mgmt->wCurrAID and use pDevice->current_aid

We nolonger send the PSbSendNullPacket.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:30 -07:00
Malcolm Priestley b956374239 staging: vt6655: mac80211 conversion: changes to set channel
Remove call to sChannelTbl, the channel under mac80211 is always valid.

CARDbSetPhyParameter is nolonger set here.

RFbSetPower is now set on byBBType

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:29 -07:00
Malcolm Priestley 59918beada staging: vt6655: mac80211 conversion: device_tx_srv tx and add report rates
vnt_int_report_rate reports backs tx rate and is replacment for STAvUpdateTDStatCounter
and BSSvUpdateNodeTxCounter.

Replacing existing code.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:29 -07:00
Malcolm Priestley e70abceb05 staging: vt6655: mac80211 conversion: changes to device_intr
Remove net device code.

Remove current measure code and function s_vCompleteCurrentMeasure
and switch code which are now handled by mac80211

Change beaconing to mac80211.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:29 -07:00
Malcolm Priestley bc5d431c9b staging: vt6655: mac80211 conversion: device_print_info remove netdevice.
use dev_info for device name and pcid->irq for irq number.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:29 -07:00
Malcolm Priestley 000fe0f534 staging: vt6655: mac80211 conversion replace suspend resume functions
add vt6655_suspend and vt6655_resume

remove viawget_suspend and viawget_resume.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:29 -07:00
Malcolm Priestley 3d75b9e235 staging: vt6655: mac80211 conversion add channel bands
Add rates and channels according to rf type for vnt_init_bands which is a
mac80211 replacement for init_channel_table.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:31:29 -07:00
Malcolm Priestley 67013f2c0e staging: vt6655: mac80211 conversion add main mac80211 functions
Replace existing vt6655_probe with one converted to mac80211
with the following operations

vnt_tx_80211
vnt_start
vnt_stop
vnt_add_interface
vnt_remove_interface
vnt_config
vnt_bss_info_changed
vnt_prepare_multicast
vnt_configure
vnt_set_key
vnt_get_tsf
vnt_set_tsf
vnt_reset_tsf

The following variables are also added.
basic_rates
mc_list_count
mac_hw

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 13:30:55 -07:00
Malcolm Priestley 89cf9be6e6 staging: vt6655: mac80211 conversion: s_uFillDataHead add power saving poll
Replace variable wCurrentRate with is_pspoll.

add current_aid to structure vnt_private which is to be used by
mac80211 operations.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 11:35:51 -07:00
Malcolm Priestley 7c0496d191 staging: vt6655: mac80211 conversion: s_vFillRTSHead convert to using struct ieee80211_hdr
Removing PSEthernetHeader

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 11:35:51 -07:00
Malcolm Priestley 9c71cb3209 staging: vt6655: dead code remove s_vFillFragParameter.
s_vFillFragParameter is nolonger used.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 11:35:51 -07:00
Malcolm Priestley cfd9f0d6b1 staging: vt6655: mac80211 conversion: s_cbFillTxBufHead
Covert to handle mac80211 sk_buff data removing fragmentation processing
via s_vFillFragParameter and calls to vGenerateMACHeader and s_vSWencryption

fragmentation is now handled by mac80211.

There is still more todos with this function when legacy net device code
have been remove from driver.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 11:35:51 -07:00
Malcolm Priestley 01eec153ab staging: vt6655: mac8021 conversion: add new tx functions
vnt_fill_txkey a mac80211 repacement for s_vFillTxKey

vnt_generate_fifo_header mac80211 replacement for vGenerateFIFOHeader

vnt_beacon_make for making and despatching beacon.

vnt_beacon_enable to enabling beacon

struct vnt_tx_fifo_head is also added to replace typedef
struct tagSTxBufHead that will be removed later.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 11:35:51 -07:00
Malcolm Priestley fee7506a12 staging: vt6655: mac80211 conversion: add new key functions
vnt_key_init_table to initialize the table

vnt_set_keys to set the keys

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 11:35:51 -07:00
Malcolm Priestley 33b1c8c13f staging: vt6655: mac80211 conversion: add new rx functions
vnt_receive_frame which replaces device_receive_frame

and vnt_rx_data which handles mac80211 rx data

structures ieee80211_hw, ieee80211_vif and variable rx_rate are added
in structure vnt_private

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 11:35:51 -07:00
Nicky Chorley 79bffc5344 Staging: vt6655: Remove C99 comments
This patch fixes the following errors identified by
checkpatch.pl:

ERROR: do not use C99 // comments
36: FILE: card.h:36:
//

ERROR: do not use C99 // comments
37: FILE: card.h:37:
// Loopback mode

ERROR: do not use C99 // comments
38: FILE: card.h:38:
//

ERROR: do not use C99 // comments
39: FILE: card.h:39:
// LOBYTE is MAC LB mode, HIBYTE is MII LB mode

ERROR: do not use C99 // comments
41: FILE: card.h:41:
#define CARD_LB_MAC             MAKEWORD(MAC_LB_INTERNAL, 0)   // PHY must ISO, avoid MAC loopback packet go out

ERROR: do not use C99 // comments
44: FILE: card.h:44:
#define DEFAULT_MSDU_LIFETIME           512  // ms

ERROR: do not use C99 // comments
45: FILE: card.h:45:
#define DEFAULT_MSDU_LIFETIME_RES_64us  8000 // 64us

ERROR: do not use C99 // comments
47: FILE: card.h:47:
#define DEFAULT_MGN_LIFETIME            8    // ms

ERROR: do not use C99 // comments
48: FILE: card.h:48:
#define DEFAULT_MGN_LIFETIME_RES_64us   125  // 64us

ERROR: do not use C99 // comments
175: FILE: card.h:175:
#endif // __CARD_H__

Signed-off-by: Nicky Chorley <ndchorley@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 17:20:17 +08:00
Rasmus Villemoes c42645a2c5 staging: vt6655: Remove redundant cast
Both sides have type const struct iw_handler_def*, so the cast is
unnecessary and confusing.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 17:19:38 +08:00
Veronika Kabatova 1e06c3a492 staging: vt6655: iwctl.c: Comments fixes
Replace C99 "//" comments by "/* */", remove comments about
adding code, remove commented code (one left there for
debugging of the function)

Signed-off-by: Veronika Kabatova <veronicca114@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:11:14 +08:00
Veronika Kabatova af969c8457 staging: vt6655: iocmd.h: Replace C99 // comments by /* */
Replace C99 "//" comments by "/* */"

Signed-off-by: Veronika Kabatova <veronicca114@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:11:14 +08:00
Veronika Kabatova fab2f89359 staging: vt6655: iowpa.h: Replace C99 // comments by /* */
Replace C99 "//" comments by "/* */"

Signed-off-by: Veronika Kabatova <veronicca114@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:11:14 +08:00
Veronika Kabatova bd2ac90116 staging: vt6655: ioctl.h: Replace C99 // comment by /* */
Replace C99 "//" comment by "/* */"

Signed-off-by: Veronika Kabatova <veronicca114@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:11:14 +08:00
Veronika Kabatova d8e340de7d staging: vt6655: IEEE11h.h: Replace C99 // comment by /* */
Replace C99 "//" comment by "/* */"

Signed-off-by: Veronika Kabatova <veronicca114@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:11:14 +08:00
Veronika Kabatova c834e7656b staging: vt6655: channel.c: Comments fixes
Replace C99 "//" comments by "/* */", remove not needed
comments about adding code

Signed-off-by: Veronika Kabatova <veronicca114@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:11:14 +08:00
Veronika Kabatova 29425feb5c staging: vt6655: bssdb.h: Replace C99 // comments by /* */
Replace C99 "//" comments by "/* */"

Signed-off-by: Veronika Kabatova <veronicca114@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:11:13 +08:00
Veronika Kabatova b69c0bfd92 staging: vt6655: desc.h: Comments fixes
Replace C99 "//" comments by "/* */", remove blank
commented lines

Signed-off-by: Veronika Kabatova <veronicca114@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:09:34 +08:00
Veronika Kabatova 1d39fe040b staging: vt6655: dpc.c: Comment fixes
Replace C99 "//" comments by "/* */", remove not
needed comments about adding code

Signed-off-by: Veronika Kabatova <veronicca114@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:09:34 +08:00
Veronika Kabatova 99b4a7e0a2 staging: vt6655: dpc.h: Replace C99 // comment by /* */
Replace C99 "//" comment by "/* */"

Signed-off-by: Veronika Kabatova <veronicca114@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:09:34 +08:00
Veronika Kabatova 77b6a6a3f5 staging: vt6655: card.c: Comments fixes
Replace C99 "//" comments by "/* */", remove not needed
comments (year of adding code, commented code)

Signed-off-by: Veronika Kabatova <veronicca114@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:09:28 +08:00
Veronika Kabatova 81a4e959f2 staging: vt6655: device.h: Comments fixes
Replace C99 "//" comments by "/* */", remove not
needed comments (year of adding code, commented code)

Signed-off-by: Veronika Kabatova <veronicca114@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28 16:09:28 +08:00
Jiayi Ye 1d06bb4e9d staging: remove unneeded parentheses around the right hand side of an assignment
In assignments such as value = (FLASH_CMD_STATUS_REG_READ << 24);, parentheses
are not needed. The Coccinelle semantic patch was used to find cases.

@r@
identifier x;
expression e1, e2;
@@

- x = (e1 << e2);
+ x = e1 << e2;

Signed-off-by: Jiayi Ye <yejiayily@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-27 10:33:06 +08:00
Sarah Khan 861374fcf3 staging: vt6655: Replace C99 // comments by /* */
Replaced C99 // comments by /* */ in wroute.c

Signed-off-by: Sarah Khan <sarahjmi07@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-27 10:33:05 +08:00
Aya Mahfouz 0a98586890 staging: vt6655: wcmd.c: fix print priority warning
This patch fixes the following warning generated by checkpatch.pl
for the file wcmd.c

WARNING: printk() should include KERN_ facility level

printk was replaced by netdev_err since providing printk with the
facility level KERN_ERR generated the printing priority warning.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-23 08:22:53 +08:00
Aya Mahfouz 2359b5c2d9 staging: vt6655: replace memcpy() by ether_addr_copy() using coccinelle and pack variables
This patch focuses on fixing the following warning generated
by checkpatch.pl for the file rxtx.c :

Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)

The changes were applied using the following coccinelle rule:

@@ expression e1, e2; @@

- memcpy(e1, e2, ETH_ALEN);
+ ether_addr_copy(e1, e2);

After applying the rule, some referencing operations were
adjusted manually to avoid a gcc compilation warning.

According to ether_addr_copy() description and functionality,
all Ethernet addresses should align to the u16 datatype.
A check was made on the following datastructures:

        - vnt_mic_hdr
        - tagS802_11Header
        - tagSEthernetHeader
        - vnt_rts_g
        - ieee80211_rts
        - vnt_private

To maintain that the array abyCurrentNetAddr in vnt_private is aligned,
it was placed before the boolean bLinkPass in the struct definition.
The definition can be found in device.h. A couple of variables were
packed in holes detected by pahole.

Output of pahole when running it on rxtx.o after the changes:

truct tagSEthernetHeader {
        unsigned char          abyDstAddr[6];        /* 0     6 */
        unsigned char          abySrcAddr[6];        /* 6     6 */
        short unsigned int     wType;                /* 12    2 */

        /* size: 14, cachelines: 1, members: 3 */
        /* last cacheline: 14 bytes */
};
struct tagS802_11Header {
        short unsigned int     wFrameCtl;            /* 0     2 */
        short unsigned int     wDurationID;          /* 2     2 */
        unsigned char          abyAddr1[6];          /* 4     6 */
        unsigned char          abyAddr2[6];          /* 10    6 */
        unsigned char          abyAddr3[6];          /* 16    6 */
        short unsigned int     wSeqCtl;              /* 22    2 */
        unsigned char          abyAddr4[6];          /* 24    6 */

        /* size: 30, cachelines: 1, members: 7 */
        /* last cacheline: 30 bytes */
};
struct ieee80211_rts {
        __le16                 frame_control;        /* 0     2 */
        __le16                 duration;             /* 2     2 */
        u8                     ra[6];                /* 4     6 */
        u8                     ta[6];                /* 10    6 */

        /* size: 16, cachelines: 1, members: 4 */
        /* last cacheline: 16 bytes */
};
struct vnt_private {
        struct pci_dev *       pcid;                 /* 0     4 */
        struct net_device *    dev;                  /* 4     4 */
        dma_addr_t             pool_dma;             /* 8     4 */
        dma_addr_t             rd0_pool_dma;         /* 12    4 */
        dma_addr_t             rd1_pool_dma;         /* 16    4 */
        dma_addr_t             td0_pool_dma;         /* 20    4 */
        dma_addr_t             td1_pool_dma;         /* 24    4 */
        dma_addr_t             tx_bufs_dma0;         /* 28    4 */
        dma_addr_t             tx_bufs_dma1;         /* 32    4 */
        dma_addr_t             tx_beacon_dma;        /* 36    4 */
        unsigned char *        tx0_bufs;             /* 40    4 */
        unsigned char *        tx1_bufs;             /* 44    4 */
        unsigned char *        tx_beacon_bufs;       /* 48    4 */
        CHIP_TYPE              chip_id;              /* 52    4 */
        void *                 PortOffset;           /* 56    4 */
        long unsigned int      dwIsr;                /* 60    4 */
        /*--- cacheline 1 boundary (64 bytes) ---*/
        u32                    memaddr;              /* 64    4 */
        u32                    ioaddr;               /* 68    4 */
        u32                    io_size;              /* 72    4 */
        unsigned char          byRevId;              /* 76    1 */
        unsigned char          byRxMode;             /* 77    1 */
        short unsigned int     SubSystemID;          /* 78    2 */
        short unsigned int     SubVendorID;          /* 80    2 */
        spinlock_t             lock;                 /* 82    2 */
        int                    nTxQueues;            /* 84    4 */
        volatile int           iTDUsed;              /* 88    8 */
        volatile PSTxDesc      apCurrTD;             /* 96    8 */
        volatile PSTxDesc      apTailTD;             /* 104   8 */
        volatile PSTxDesc      apTD0Rings;           /* 112   4 */
        volatile PSTxDesc      apTD1Rings;           /* 116   4 */
        volatile PSRxDesc      aRD0Ring;             /* 120   4 */
        volatile PSRxDesc      aRD1Ring;             /* 124   4 */
        /*--- cacheline 2 boundary (128 bytes) ---*/
        volatile PSRxDesc      pCurrRD;              /* 128   8 */
        SCache                 sDupRxCache;          /* 136  44 */
        SDeFragControlBlock    sRxDFCB[64];          /* 180  2048 */
        /*--- cacheline 34 boundary (2176 bytes) was 52 bytes ago ---*/
        unsigned int           cbDFCB;               /* 2228  4 */
        unsigned int           cbFreeDFCB;           /* 2232  4 */
        unsigned int           uCurrentDFCBIdx;      /* 2236  4 */
        /*--- cacheline 35 boundary (2240 bytes) ---*/
        OPTIONS                sOpts;                /* 2240 52 */
        u32                    flags;                /* 2292  4 */
        u32                    rx_buf_sz;            /* 2296  4 */
        int                    multicast_limit;      /* 2300  4 */
        /*--- cacheline 36 boundary (2304 bytes) ---*/
        pid_t                  MLMEThr_pid;          /* 2304  4 */
        struct completion      notify;               /* 2308 16 */
        struct semaphore       mlme_semaphore;       /* 2324 16 */
        u32                    rx_bytes;             /* 2340  4 */
        unsigned char          byLocalID;            /* 2344  1 */
        unsigned char          byRFType;             /* 2345  1 */
        unsigned char          byMaxPwrLevel;        /* 2346  1 */
        unsigned char          byZoneType;           /* 2347  1 */
        bool                   bZoneRegExist;        /* 2348  1 */
        unsigned char          byOriginalZonetype;   /* 2349  1 */
        unsigned char          abyMacContext[384];   /* 2350  384 */
        /*--- cacheline 42 boundary (2688 bytes) was 46 bytes ago ---*/
        unsigned char          abyCurrentNetAddr[6]; /* 2734  6 */
        bool                   bLinkPass;            /* 2740  1 */

        /* XXX 3 bytes hole, try to pack */

        SStatCounter           scStatistic;          /* 2744  776 */
        /*--- cacheline 55 boundary (3520 bytes) ---*/
        SDot11Counters         s802_11Counter;       /* 3520  172 */
        /*--- cacheline 57 boundary (3648 bytes) was 44 bytes ago ---*/
        PSMgmtObject           pMgmt;                /* 3692  4 */
        SMgmtObject            sMgmtObj;             /* 3696 95840 */
        /*--- cacheline 1555 boundary (99520 bytes) was 16 bytes ago ---*/

        /* Bitfield combined with previous fields */

        unsigned int           uCurrRSSI;            /* 0    4 */
        unsigned char          byCurrSQ;             /* 0    1 */
        long unsigned int      dwTxAntennaSel;       /* 0    4 */
        long unsigned int      dwRxAntennaSel;       /* 0    4 */
        unsigned char          byAntennaCount;       /* 0    1 */
        unsigned char          byRxAntennaMode;      /* 0    1 */
        unsigned char          byTxAntennaMode;      /* 0    1 */
        bool                   bTxRxAntInv;          /* 0    1 */
        unsigned char *        pbyTmpBuff;           /* 0    4 */
        unsigned int           uSIFS;                /* 0    4 */
        unsigned int           uDIFS;                /* 0    4 */
        unsigned int           uEIFS;                /* 0    4 */
        unsigned int           uSlot;                /* 0    4 */
        unsigned int           uCwMin;               /* 0    4 */
        unsigned int           uCwMax;               /* 0    4 */
        unsigned char          bySIFS;               /* 0    1 */
        unsigned char          byDIFS;               /* 0    1 */
        unsigned char          byEIFS;               /* 0    1 */
        unsigned char          bySlot;               /* 0    1 */
        unsigned char          byCWMaxMin;           /* 0    1 */
        CARD_PHY_TYPE          eCurrentPHYType;      /* 0    4 */
        VIA_BB_TYPE            byBBType;             /* 0    4 */
        VIA_PKT_TYPE           byPacketType;         /* 0    4 */
        short unsigned int     wBasicRate;           /* 0    2 */
        unsigned char          byACKRate;            /* 0    1 */
        unsigned char          byTopOFDMBasicRate;   /* 0    1 */
        unsigned char          byTopCCKBasicRate;    /* 0    1 */
        unsigned char          byMinChannel;         /* 0    1 */
        unsigned char          byMaxChannel;         /* 0    1 */
        unsigned int           uConnectionRate;      /* 0    4 */
        unsigned char          byPreambleType;       /* 0    1 */
        unsigned char          byShortPreamble;      /* 0    1 */
        short unsigned int     wCurrentRate;         /* 0    2 */
        short unsigned int     wRTSThreshold;        /* 0    2 */
        short unsigned int     wFragmentationThreshold; /* 0    2 */
        unsigned char          byShortRetryLimit;    /* 0    1 */
        unsigned char          byLongRetryLimit;     /* 0    1 */
        enum nl80211_iftype    op_mode;              /* 0    4 */
        unsigned char          byOpMode;             /* 0    1 */
        bool                   bBSSIDFilter;         /* 0    1 */
        short unsigned int     wMaxTransmitMSDULifetime; /* 0     2 */
        unsigned char          abyBSSID[6];          /* 0    6 */
        unsigned char          abyDesireBSSID[6];    /* 0    6 */
        short unsigned int     wACKDuration;         /* 0    2 */
        short unsigned int     wRTSTransmitLen;      /* 0    2 */
        unsigned char          byRTSServiceField;    /* 0    1 */
        unsigned char          byRTSSignalField;     /* 0    1 */
        long unsigned int      dwMaxReceiveLifetime; /* 0    4 */
        bool                   bEncryptionEnable;    /* 0    1 */
        bool                   bLongHeader;          /* 0    1 */
        bool                   bShortSlotTime;       /* 0    1 */
        bool                   bProtectMode;         /* 0    1 */
        bool                   bNonERPPresent;       /* 0    1 */
        bool                   bBarkerPreambleMd;    /* 0    1 */
        unsigned char          byERPFlag;            /* 0    1 */
        short unsigned int     wUseProtectCntDown;   /* 0    2 */
        bool                   bRadioControlOff;     /* 0    1 */
        bool                   bRadioOff;            /* 0    1 */
        bool                   bEnablePSMode;        /* 0    1 */
        short unsigned int     wListenInterval;      /* 0    2 */
        bool                   bPWBitOn;             /* 0    1 */
        WMAC_POWER_MODE        ePSMode;              /* 0    4 */
        unsigned char          byRadioCtl;           /* 0    1 */
        unsigned char          byGPIO;               /* 0    1 */
        bool                   bHWRadioOff;          /* 0    1 */
        bool                   bPrvActive4RadioOFF;  /* 0    1 */
        bool                   bGPIOBlockRead;       /* 0    1 */
        short unsigned int     wSeqCounter;          /* 0    2 */
        short unsigned int     wBCNBufLen;           /* 0    2 */
        bool                   bBeaconBufReady;      /* 0    1 */
        bool                   bBeaconSent;          /* 0    1 */
        bool                   bIsBeaconBufReadySet; /* 0    1 */
        unsigned int           cbBeaconBufReadySetCnt; /* 0     4 */
        bool                   bFixRate;             /* 0    1 */
        unsigned char          byCurrentCh;          /* 0    1 */
        unsigned int           uScanTime;            /* 0    4 */
        CMD_STATE              eCommandState;        /* 0    4 */
        CMD_CODE               eCommand;             /* 0    4 */
        bool                   bBeaconTx;            /* 0    1 */
        bool                   bStopBeacon;          /* 0    1 */
        bool                   bStopDataPkt;         /* 0    1 */
        bool                   bStopTx0Pkt;          /* 0    1 */
        unsigned int           uAutoReConnectTime;   /* 0    4 */
        CMD_ITEM               eCmdQueue[32];        /* 0  1408 */
        unsigned int           uCmdDequeueIdx;       /* 0    4 */
        unsigned int           uCmdEnqueueIdx;       /* 0    4 */
        unsigned int           cbFreeCmdQueue;       /* 0    4 */
        bool                   bCmdRunning;          /* 0    1 */
        bool                   bCmdClear;            /* 0    1 */
        bool                   bRoaming;             /* 0    1 */
        unsigned char          abyIPAddr[4];         /* 0    4 */
        long unsigned int      ulTxPower;            /* 0    4 */
        NDIS_802_11_WEP_STATUS eEncryptionStatus;    /* 0    4 */
        bool                   bTransmitKey;         /* 0    1 */
        NDIS_802_11_WEP_STATUS eOldEncryptionStatus; /* 0    4 */
        SKeyManagement         sKey;                 /* 0  3784 */
        long unsigned int      dwIVCounter;          /* 0    4 */
        u64                    qwPacketNumber;       /* 0    8 */
        unsigned int           uCurrentWEPMode;      /* 0    4 */
        RC4Ext                 SBox;                 /* 0  264 */
        unsigned char          abyPRNG[35];          /* 0   35 */
        unsigned char          byKeyIndex;           /* 0    1 */
        unsigned int           uKeyLength;           /* 0    4 */
        unsigned char          abyKey[29];           /* 0   29 */
        bool                   bAES;                 /* 0    1 */
        unsigned char          byCntMeasure;         /* 0    1 */
        unsigned int           uAssocCount;          /* 0    4 */
        bool                   bMoreData;            /* 0    1 */
        bool                   bGrpAckPolicy;        /* 0    1 */
        bool                   bAssocInfoSet;        /* 0    1 */
        unsigned char          byAutoFBCtrl;         /* 0    1 */
        bool                   bTxMICFail;           /* 0    1 */
        bool                   bRxMICFail;           /* 0    1 */
        unsigned int           uRATEIdx;             /* 0    4 */
        bool                   bUpdateBBVGA;         /* 0    1 */
        unsigned int           uBBVGADiffCount;      /* 0    4 */
        unsigned char          byBBVGANew;           /* 0    1 */
        unsigned char          byBBVGACurrent;       /* 0    1 */
        unsigned char          abyBBVGA[4];          /* 0    4 */
        long int               ldBmThreshold[4];     /* 0   16 */
        unsigned char          byBBPreEDRSSI;        /* 0    1 */
        unsigned char          byBBPreEDIndex;       /* 0    1 */
        bool                   bRadioCmd;            /* 0    1 */
        long unsigned int      dwDiagRefCount;       /* 0    4 */
        unsigned char          byFOETuning;          /* 0    1 */
        unsigned char          byAutoPwrTunning;     /* 0    1 */
        short int              sPSetPointCCK;        /* 0    2 */
        short int              sPSetPointOFDMG;      /* 0    2 */
        short int              sPSetPointOFDMA;      /* 0    2 */
        long int               lPFormulaOffset;      /* 0    4 */
        short int              sPThreshold;          /* 0    2 */
        char                   cAdjustStep;          /* 0    1 */
        char                   cMinTxAGC;            /* 0    1 */
        unsigned char          byCCKPwr;             /* 0    1 */
        unsigned char          byOFDMPwrG;           /* 0    1 */
        unsigned char          byCurPwr;             /* 0    1 */
        char                   byCurPwrdBm;          /* 0    1 */
        unsigned char          abyCCKPwrTbl[15];     /* 0   15 */
        unsigned char          abyOFDMPwrTbl[57];    /* 0   57 */
        char                   abyCCKDefaultPwr[15]; /* 0   15 */
        char                   abyOFDMDefaultPwr[57]; /* 0  57 */
        char                   abyRegPwr[57];        /* 0   57 */
        char                   abyLocalPwr[57];      /* 0   57 */
        unsigned char          byBBCR4d;             /* 0    1 */
        unsigned char          byBBCRc9;             /* 0    1 */
        unsigned char          byBBCR88;             /* 0    1 */
        unsigned char          byBBCR09;             /* 0    1 */
        struct timer_list      sTimerCommand;        /* 0   52 */
        struct timer_list      sTimerTxData;         /* 0   52 */
        long unsigned int      nTxDataTimeCout;      /* 0    4 */
        bool                   fTxDataInSleep;       /* 0    1 */
        bool                   IsTxDataTrigger;      /* 0    1 */
        bool                   fWPA_Authened;        /* 0    1 */
        unsigned char          byReAssocCount;       /* 0    1 */
        unsigned char          byLinkWaitCount;      /* 0    1 */
        unsigned char          abyNodeName[17];      /* 0   17 */
        bool                   bDiversityRegCtlON;   /* 0    1 */
        bool                   bDiversityEnable;     /* 0    1 */
        long unsigned int      ulDiversityNValue;    /* 0    4 */
        long unsigned int      ulDiversityMValue;    /* 0    4 */
        unsigned char          byTMax;               /* 0    1 */
        unsigned char          byTMax2;              /* 0    1 */
        unsigned char          byTMax3;              /* 0    1 */
        long unsigned int      ulSQ3TH;              /* 0    4 */
        long unsigned int      uDiversityCnt;        /* 0    4 */
        unsigned char          byAntennaState;       /* 0    1 */
        long unsigned int      ulRatio_State0;       /* 0    4 */
        long unsigned int      ulRatio_State1;       /* 0    4 */
        struct timer_list      TimerSQ3Tmax1;        /* 0   52 */
        struct timer_list      TimerSQ3Tmax2;        /* 0   52 */
        struct timer_list      TimerSQ3Tmax3;        /* 0   52 */
        long unsigned int      uNumSQ3[12];          /* 0   48 */
        short unsigned int     wAntDiversityMaxRate; /* 0    2 */
        SEthernetHeader        sTxEthHeader;         /* 0   14 */
        SEthernetHeader        sRxEthHeader;         /* 0   14 */
        unsigned char          abyBroadcastAddr[6];  /* 0    6 */
        unsigned char          abySNAP_RFC1042[6];   /* 0    6 */
        unsigned char          abySNAP_Bridgetunnel[6]; /* 0     6 */
        unsigned char          abyEEPROM[256];       /* 0   256 */
        SPMKID                 gsPMKID;              /* 0   360 */
        SPMKIDCandidateEvent   gsPMKIDCandidate;     /* 0    72 */
        bool                   b11hEnable;           /* 0     1 */
        unsigned char          abyCountryCode[3];    /* 0     3 */
        unsigned int           uNumOfMeasureEIDs;    /* 0     4 */
        PWLAN_IE_MEASURE_REQ   pCurrMeasureEID;      /* 0     4 */
        bool                   bMeasureInProgress;   /* 0     1 */
        unsigned char          byOrgChannel;         /* 0     1 */
        unsigned char          byOrgRCR;             /* 0     1 */
        long unsigned int      dwOrgMAR0;            /* 0     4 */
        long unsigned int      dwOrgMAR4;            /* 0     4 */
        unsigned char          byBasicMap;           /* 0     1 */
        unsigned char          byCCAFraction;        /* 0     1 */
        unsigned char          abyRPIs[8];           /* 0     8 */
        long unsigned int      dwRPIs[8];            /* 0    32 */
        bool                   bChannelSwitch;       /* 0     1 */
        unsigned char          byNewChannel;         /* 0     1 */
        unsigned char          byChannelSwitchCount; /* 0     1 */
        bool                   bQuietEnable;         /* 0     1 */
        bool                   bEnableFirstQuiet;    /* 0     1 */
        unsigned char          byQuietStartCount;    /* 0     1 */
        unsigned int           uQuietEnqueue;        /* 0     4 */
        long unsigned int      dwCurrentQuietEndTime; /* 0     4 */
        SQuietControl          sQuiet[8];            /* 0    96 */
        bool                   bCountryInfo5G;       /* 0     1 */
        bool                   bCountryInfo24G;      /* 0     1 */
        short unsigned int     wBeaconInterval;      /* 0     2 */
        struct net_device *    wpadev;               /* 0     4 */
        bool                   bWPADEVUp;            /* 0     1 */
        struct sk_buff *       skb;                  /* 0     4 */
        unsigned int           bwextcount;           /* 0     4 */
        bool                   bWPASuppWextEnabled;  /* 0     1 */
        bool                   bEnableHostapd;       /* 0     1 */
        bool                   bEnable8021x;         /* 0     1 */
        bool                   bEnableHostWEP;       /* 0     1 */
        struct net_device *    apdev;                /* 0     4 */
        int                    (*tx_80211)(struct sk_buff *,
                                 struct net_device *); /* 0     4 */
        unsigned int           uChannel;             /* 0     4 */
        bool                   bMACSuspend;          /* 0     1 */
        struct iw_statistics   wstats;               /* 0    32 */
        bool                   bCommit;              /* 0     1 */
        /*--- cacheline 1672 boundary (107008 bytes) ---*/

        /* size: 107008, cachelines: 1672, members: 279 */
        /* sum members: 107005, holes: 1, sum holes: 3 */
        /* padding: 41471 */

        /* BRAIN FART ALERT! 107008 != 107005 + 3(holes), diff = 0 */

};
struct vnt_mic_hdr {
        u8                     id;                   /* 0     1 */
        u8                     tx_priority;          /* 1     1 */
        u8                     mic_addr2[6];         /* 2     6 */
        u8                     ccmp_pn[6];           /* 8     6 */
        __be16                 payload_len;          /* 14    2 */
        __be16                 hlen;                 /* 16    2 */
        __le16                 frame_control;        /* 18    2 */
        u8                     addr1[6];             /* 20    6 */
        u8                     addr2[6];             /* 26    6 */
        u8                     addr3[6];             /* 32    6 */
        __le16                 seq_ctrl;             /* 38    2 */
        u8                     addr4[6];             /* 40    6 */
        u16                    packing;              /* 46    2 */

        /* size: 48, cachelines: 1, members: 13 */
        /* last cacheline: 48 bytes */
};
struct vnt_rts_g {
        struct vnt_phy_field   b;                    /*  0    4 */
        struct vnt_phy_field   a;                    /*  4    4 */
        __le16                 duration_ba;          /*  8    2 */
        __le16                 duration_aa;          /* 10    2 */
        __le16                 duration_bb;          /* 12    2 */
        u16                    reserved;             /* 14    2 */
        struct ieee80211_rts   data;                 /* 16   16 */

        /* size: 32, cachelines: 1, members: 7 */
        /* last cacheline: 32 bytes */
};

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:30:15 +08:00
Aya Mahfouz 85061eb97a staging: vt6655: wmgr.c and wmgr.h: replace memcpy() by ether_addr_copy() using coccinelle and pack variable
This patch focuses on fixing the following warning generated
by checkpatch.pl for the file wmgr.c :

Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)

The changes were applied using the following coccinelle rule:

@@ expression e1, e2; @@

- memcpy(e1, e2, ETH_ALEN);
+ ether_addr_copy(e1, e2);

According to ether_addr_copy() description and functionality,
all Ethernet addresses should align to the u16 datatype.

To maintain that the array abyCurrBSSID in tagSMgmtObject is aligned,
it was placed after the int uCurrChannel in the struct definition.
This was done in wmgr.h

Here is the output of pahole for the relevant datastructures:

struct sockaddr {
        sa_family_t                sa_family;            /*     0     2 */
        char                       sa_data[14];          /*     2    14 */

        /* size: 16, cachelines: 1, members: 2 */
        /* last cacheline: 16 bytes */
};
struct tagSMgmtObject {
        void *                     pAdapter;             /*     0     4 */
        unsigned char              abyMACAddr[6];        /*     4     6 */

        /* XXX 2 bytes hole, try to pack */

        WMAC_CONFIG_MODE           eConfigMode;          /*    12     4 */
        CARD_PHY_TYPE              eCurrentPHYMode;      /*    16     4 */
        CARD_PHY_TYPE              eConfigPHYMode;       /*    20     4 */
        WMAC_CURRENT_MODE          eCurrMode;            /*    24     4 */
        WMAC_BSS_STATE             eCurrState;           /*    28     4 */
        PKnownBSS                  pCurrBSS;             /*    32     4 */
        unsigned char              byCSSGK;              /*    36     1 */
        unsigned char              byCSSPK;              /*    37     1 */

        /* XXX 2 bytes hole, try to pack */

        unsigned int               uCurrChannel;         /*    40     4 */
        unsigned char              abyCurrBSSID[6];      /*    44     6 */
        unsigned char              abyCurrSuppRates[19]; /*    50    19 */
        /* --- cacheline 1 boundary (64 bytes) was 5 bytes ago --- */
        unsigned char              abyCurrExtSuppRates[19]; /*    69    19 */
        unsigned char              abyCurrSSID[35];      /*    88    35 */

        /* XXX 1 byte hole, try to pack */

        short unsigned int         wCurrCapInfo;         /*   124     2 */
        short unsigned int         wCurrAID;             /*   126     2 */
        /* --- cacheline 2 boundary (128 bytes) --- */
        short unsigned int         wCurrATIMWindow;      /*   128     2 */
        short unsigned int         wCurrBeaconPeriod;    /*   130     2 */
        bool                       bIsDS;                /*   132     1 */
        unsigned char              byERPContext;         /*   133     1 */

        /* XXX 2 bytes hole, try to pack */

        CMD_STATE                  eCommandState;        /*   136     4 */
        unsigned int               uScanChannel;         /*   140     4 */
        unsigned char              abyDesireSSID[35];    /*   144    35 */
        unsigned char              abyDesireBSSID[6];    /*   179     6 */

        /* XXX 1 byte hole, try to pack */

        short unsigned int         wIBSSBeaconPeriod;    /*   186     2 */
        short unsigned int         wIBSSATIMWindow;      /*   188     2 */

        /* XXX 2 bytes hole, try to pack */

        /* --- cacheline 3 boundary (192 bytes) --- */
        unsigned int               uIBSSChannel;         /*   192     4 */
        unsigned char              abyIBSSSuppRates[19]; /*   196    19 */
        unsigned char              byAPBBType;           /*   215     1 */
        unsigned char              abyWPAIE[64];         /*   216    64 */
        /* --- cacheline 4 boundary (256 bytes) was 24 bytes ago --- */
        short unsigned int         wWPAIELen;            /*   280     2 */

        /* XXX 2 bytes hole, try to pack */

        unsigned int               uAssocCount;          /*   284     4 */
        bool                       bMoreData;            /*   288     1 */

        /* XXX 3 bytes hole, try to pack */

        WMAC_SCAN_STATE            eScanState;           /*   292     4 */
        WMAC_SCAN_TYPE             eScanType;            /*   296     4 */
        unsigned int               uScanStartCh;         /*   300     4 */
        unsigned int               uScanEndCh;           /*   304     4 */
        short unsigned int         wScanSteps;           /*   308     2 */

        /* XXX 2 bytes hole, try to pack */

        unsigned int               uScanBSSType;         /*   312     4 */
        unsigned char              abyScanSSID[35];      /*   316    35 */
        /* --- cacheline 5 boundary (320 bytes) was 31 bytes ago --- */
        unsigned char              abyScanBSSID[6];      /*   351     6 */

        /* XXX 3 bytes hole, try to pack */

        WMAC_AUTHENTICATION_MODE   eAuthenMode;          /*   360     4 */
        WMAC_ENCRYPTION_MODE       eEncryptionMode;      /*   364     4 */
        bool                       bShareKeyAlgorithm;   /*   368     1 */
        unsigned char              abyChallenge[128];    /*   369   128 */
        /* --- cacheline 7 boundary (448 bytes) was 49 bytes ago --- */
        bool                       bPrivacyInvoked;      /*   497     1 */
        bool                       bInTIM;               /*   498     1 */
        bool                       bMulticastTIM;        /*   499     1 */
        unsigned char              byDTIMCount;          /*   500     1 */
        unsigned char              byDTIMPeriod;         /*   501     1 */

        /* XXX 2 bytes hole, try to pack */

        WMAC_POWER_MODE            ePSMode;              /*   504     4 */
        short unsigned int         wListenInterval;      /*   508     2 */
        short unsigned int         wCountToWakeUp;       /*   510     2 */
        /* --- cacheline 8 boundary (512 bytes) --- */
        bool                       bInTIMWake;           /*   512     1 */

        /* XXX 3 bytes hole, try to pack */

        unsigned char *            pbyPSPacketPool;      /*   516     4 */
        unsigned char              byPSPacketPool[36];   /*   520    36 */
        bool                       bRxBeaconInTBTTWake;  /*   556     1 */
        unsigned char              abyPSTxMap[65];       /*   557    65 */

        /* XXX 2 bytes hole, try to pack */

        /* --- cacheline 9 boundary (576 bytes) was 48 bytes ago --- */
        unsigned int               uCmdBusy;             /*   624     4 */
        unsigned int               uCmdHostAPBusy;       /*   628     4 */
        unsigned char *            pbyMgmtPacketPool;    /*   632     4 */
        unsigned char              byMgmtPacketPool[2352]; /*   636  2352 */
        /* --- cacheline 46 boundary (2944 bytes) was 44 bytes ago --- */
        struct timer_list          sTimerSecondCallback; /*  2988    52 */
        /* --- cacheline 47 boundary (3008 bytes) was 32 bytes ago --- */
        SRxMgmtPacket              sRxPacket;            /*  3040    28 */
        KnownBSS                   sBSSList[42];         /*  3068 57288 */
        /* --- cacheline 943 boundary (60352 bytes) was 4 bytes ago --- */
        KnownNodeDB                sNodeDBTable[65];     /* 60356 20800 */
        /* --- cacheline 1268 boundary (81152 bytes) was 4 bytes ago --- */

        /* Bitfield combined with previous fields */

        SPMKIDCache                gsPMKIDCache;         /*     0   356 */
        bool                       bRoaming;             /*     0     1 */
        SAssocInfo                 sAssocInfo;           /*     0  7064 */
        bool                       b11hEnable;           /*     0     1 */
        bool                       bSwitchChannel;       /*     0     1 */
        unsigned char              byNewChannel;         /*     0     1 */
        PWLAN_IE_MEASURE_REP       pCurrMeasureEIDRep;   /*     0     4 */
        unsigned int               uLengthOfRepEIDs;     /*     0     4 */
        unsigned char              abyCurrentMSRReq[2352]; /*     0  2352 */
        unsigned char              abyCurrentMSRRep[2352]; /*     0  2352 */
        unsigned char              abyIECountry[2340];   /*     0  2340 */
        unsigned char              abyIBSSDFSOwner[6];   /*     0     6 */
        unsigned char              byIBSSDFSRecovery;    /*     0     1 */
        struct sk_buff             skb;                  /*     0   192 */

        /* XXX last struct has 4 bytes of padding */

        /* --- cacheline 1497 boundary (95808 bytes) was 32 bytes ago --- */

        /* size: 95840, cachelines: 1498, members: 81 */
        /* sum members: 95813, holes: 13, sum holes: 27 */
        /* padding: 30112 */
        /* paddings: 1, sum paddings: 4 */
        /* last cacheline: 32 bytes */

        /* BRAIN FART ALERT! 95840 != 95813 + 27(holes), diff = 0 */

};
struct pmkid_candidate {
        NDIS_802_11_MAC_ADDRESS    BSSID;                /*     0     6 */

        /* XXX 2 bytes hole, try to pack */

        long unsigned int          Flags;                /*     8     4 */

        /* size: 12, cachelines: 1, members: 2 */
        /* sum members: 10, holes: 1, sum holes: 2 */
        /* last cacheline: 12 bytes */
};

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:30:15 +08:00
Aya Mahfouz 87bb326ead staging: vt6655: dpc.c: replace memcpy() by ether_addr_copy() using coccinelle
This patch focuses on fixing the following warning generated
by checkpatch.pl for the file dpc.c :

Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)

The changes were applied using the following coccinelle rule:

@@ expression e1, e2; @@

- memcpy(e1, e2, ETH_ALEN);
+ ether_addr_copy(e1, e2);

According to ether_addr_copy() description and functionality,
all Ethernet addresses should align to the u16 datatype.

Here is the output of pahole for the relevant datastructures:

struct tagS802_11Header {
        short unsigned int         wFrameCtl;            /*     0     2 */
        short unsigned int         wDurationID;          /*     2     2 */
        unsigned char              abyAddr1[6];          /*     4     6 */
        unsigned char              abyAddr2[6];          /*    10     6 */
        unsigned char              abyAddr3[6];          /*    16     6 */
        short unsigned int         wSeqCtl;              /*    22     2 */
        unsigned char              abyAddr4[6];          /*    24     6 */

        /* size: 30, cachelines: 1, members: 7 */
        /* last cacheline: 30 bytes */
};
struct iw_michaelmicfailure {
        __u32                      flags;                /*     0     4 */
        struct sockaddr            src_addr;             /*     4    16 */
        __u8                       tsc[8];               /*    20     8 */

        /* size: 28, cachelines: 1, members: 3 */
        /* last cacheline: 28 bytes */
};
struct sockaddr {
        sa_family_t                sa_family;            /*     0     2 */
        char                       sa_data[14];          /*     2    14 */

        /* size: 16, cachelines: 1, members: 2 */
        /* last cacheline: 16 bytes */
};

There is one thing to note though, sa_data is a char array of size 14.
And the number of bytes copied using memcpy() or ether_addr_copy()
is 6.

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:30:15 +08:00
Aya Mahfouz e1499e8149 staging: vt6655: card.c: replace memcpy() by ether_addr_copy() using coccinelle
This patch focuses on fixing the following warning generated
by checkpatch.pl for the file rxtx.c :

Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)

The changes were applied using the following coccinelle rule:

@@ expression e1, e2; @@

- memcpy(e1, e2, ETH_ALEN);
+ ether_addr_copy(e1, e2);

According to ether_addr_copy() description and functionality,
all Ethernet addresses should align to the u16 datatype.

Here is the output of pahole for the relevant datastructures:

struct pmkid_candidate {
        NDIS_802_11_MAC_ADDRESS    BSSID;                /*     0     6 */

        /* XXX 2 bytes hole, try to pack */

        long unsigned int          Flags;                /*     8     4 */

        /* size: 12, cachelines: 1, members: 2 */
        /* sum members: 10, holes: 1, sum holes: 2 */
        /* last cacheline: 12 bytes */
};

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:30:15 +08:00
Vladimir A. Nazarenko 4a2bc3bdff staging: vt6655: delete SndEvt_ToAPI code
It's never enabled, so we can safely remove it.

Signed-off-by: Vladimir A. Nazarenko <naszar@ya.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:30:13 +08:00
Tapasweni Pathak 586e8b6845 staging: vt6655: Remove unused code inside switch case
This patch removes dead code in private_ioctl function and
iwctl_siwmode function, in file ioctl.c.

Inside switch, for a case no code gets executed
after break.

This was detected by smatch.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:30:13 +08:00
Vladimir A. Nazarenko 402eede3c0 staging: vt6655: remove useless #if 1
There is code encapsulated in #if 1, let's remove it.

Signed-off-by: Vladimir A. Nazarenko <naszar@ya.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:30:13 +08:00
Vladimir A. Nazarenko 5ba1b07a6e staging: vt6655: remove global variable wpa_Result
This variable unused, so remove it.

Signed-off-by: Vladimir A. Nazarenko <naszar@ya.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:30:13 +08:00
Vladimir A. Nazarenko 5e8dc1cbf7 staging: vt6655: delete non-standard ioctl 0xFF
Custom ioctl 0xff is legacy code that was used for
patched version of wpa_supplicant,  where function
wpa_authen_Status_transfer() called this ioctl  to
tell authentication   status to  the driver. While
from upstream  was added only driver code  to  the
kernel  but  not  patches to the wpa_supplicant we
can safely remove this unused ioctl.

Signed-off-by: Vladimir A. Nazarenko <naszar@ya.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:30:13 +08:00
Esra Altintas f3512d5fe8 staging: vt6655: Fixed C99 // comment errors in wpa.h
The following patch fixes the checkpatch.pl warning:
ERROR: do not use C99 // comments

Signed-off-by: Esra Altintas <es.altintas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:28 +08:00
Dilek Uzulmez 25ef419dc9 staging: vt6655: Use ether_addr_copy function
This patch fixes the following checkpatch.pl warnings:
WARNING: "Prefer ether_addr_copy() over memcpy() if the Ethernet
addresses are __aligned(2)" in file device_main.c
Pahole shows that the addresses are aligned

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:28 +08:00
Dilek Uzulmez 038862c4a3 staging: vt6655: Use ether_addr_copy function
This patch fixes the following checkpatch.pl warnings:
WARNING: "Prefer ether_addr_copy() over memcpy() if the Ethernet
addresses are __aligned(2)" in file iwctl.c
Pahole shows that the addresses are aligned

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:20 +08:00
Dilek Uzulmez 5ab665eb24 staging: vt6655: Use ether_addr_copy function
This patch fixes the following checkpatch.pl warnings:
WARNING: "Prefer ether_addr_copy() over memcpy() if the Ethernet
addresses are __aligned(2)" in file iwctl.c
Pahole shows that the addresses are aligned

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:16 +08:00
Dilek Uzulmez c5e1150178 staging: vt6655: Use ether_addr_copy function
This patch fixes the following checkpatch.pl warnings:
WARNING: "Prefer ether_addr_copy() over memcpy() if the Ethernet
addresses are __aligned(2)" in file device_main.c
Pahole shows that the addresses are aligned

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:16 +08:00
Dilek Uzulmez 5de55f6524 staging: vt6655: Use ether_addr_copy function
This patch fixes the following checkpatch.pl warnings:
WARNING: "Prefer ether_addr_copy() over memcpy() if the Ethernet
addresses are __aligned(2)" in file key.c
Pahole shows that the addresses are aligned

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:16 +08:00
Dilek Uzulmez 0c074871f7 staging: vt6655: Removing else after break statement to fix warning
This patch fixes the checkpatch.pl warning in key.c file
WARNING: else is not useful after a break or return

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:16 +08:00
Tapasweni Pathak 61d566a5a3 staging: vt6655: Remove unnecessary cast for argument of kfree
This patch removes all occurrences of unnecessary cast on the
argument to kfree, all over in rtl8712.

There is no need of the cast on the argument to kfree.

Greped to find occurrences.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:16 +08:00
Dilek Uzulmez 14cd1df4ba staging: vt6655: Remove unnecessary else after return
This patch fixes checkpatch.pl warning in files of vt6655
WARNING: else is not generally useful after a break or return

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:15 +08:00
Melike Yurtoglu 3aaa06e1cb staging: vt6655: fix do not use // c99 comments.
This patch fixes "do not use // C99 comments" checkpatch.pl errors in
hostap.h

Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:15 +08:00
Melike Yurtoglu b7f0790d73 staging: vt6655: Fixed else after return or break warning.
This patch fixes multiple instances of checkpatch.pl
WARNING : else is not generally useful after a break or return in
device_main.c

Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:15 +08:00
Melike Yurtoglu d84e63378b staging: vt6655: Fix do not use // c99 comments.
This patch fixes "do not use // C99 comments" errors in datarate.h

Signed-off-by: Melike Yurtoglu <aysemelikeyurtoglu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:15 +08:00