Commit Graph

645 Commits

Author SHA1 Message Date
Malcolm Priestley 1f51d58018 vt6655: Fix late setting of byRFType.
byRFType is not set prior to registration of mac80211 causing
unpredictable operation after channel scans.

With byRFType unset all channels are enabled this causes tx power
to be set to values not present its eeprom.

Move setting of this variable to vt6655_probe.

byRFType must have a mask set. byRevId not used by driver and
is removed.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Cc: <stable@vger.kernel.org> # v3.19+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09 11:33:13 +01:00
Malcolm Priestley 40c8790bcb vt6655: RFbSetPower fix missing rate RATE_12M
When the driver sets this rate a power of zero value is set causing
data flow stoppage until another rate is tried.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09 11:33:13 +01:00
Malcolm Priestley c312530589 staging: vt6655: vnt_tx_packet fix dma_idx selection.
There is still a problem that dma_idx is causing packets to
go onto the wrong tx path.

Protect dma_idx fully with the present first lock and
use pTDInfo->byFlags TD_FLAGS_NETIF_SKB to set MACvTransmit.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09 08:12:40 +01: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