2015-03-07 17:05:30

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH resend 1/3] 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 <[email protected]>
Cc: <[email protected]>
---
drivers/staging/vt6655/rf.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index 941b2ad..7626f63 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -794,6 +794,7 @@ bool RFbSetPower(
break;
case RATE_6M:
case RATE_9M:
+ case RATE_12M:
case RATE_18M:
byPwr = priv->abyOFDMPwrTbl[uCH];
if (priv->byRFType == RF_UW2452)
--
2.1.4



2015-03-07 17:05:32

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH resend 2/3] 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 <[email protected]>
Cc: <[email protected]> # v3.19+
---
drivers/staging/vt6655/device_main.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 0204ea5..a512f83 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -330,16 +330,6 @@ static void device_init_registers(struct vnt_private *pDevice)
/* zonetype initial */
pDevice->byOriginalZonetype = pDevice->abyEEPROM[EEP_OFS_ZONETYPE];

- /* Get RFType */
- pDevice->byRFType = SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_RFTYPE);
-
- /* force change RevID for VT3253 emu */
- if ((pDevice->byRFType & RF_EMU) != 0)
- pDevice->byRevId = 0x80;
-
- pDevice->byRFType &= RF_MASK;
- pr_debug("pDevice->byRFType = %x\n", pDevice->byRFType);
-
if (!pDevice->bZoneRegExist)
pDevice->byZoneType = pDevice->abyEEPROM[EEP_OFS_ZONETYPE];

@@ -1780,6 +1770,12 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent)
MACvInitialize(priv->PortOffset);
MACvReadEtherAddress(priv->PortOffset, priv->abyCurrentNetAddr);

+ /* Get RFType */
+ priv->byRFType = SROMbyReadEmbedded(priv->PortOffset, EEP_OFS_RFTYPE);
+ priv->byRFType &= RF_MASK;
+
+ dev_dbg(&pcid->dev, "RF Type = %x\n", priv->byRFType);
+
device_get_options(priv);
device_set_options(priv);
/* Mask out the options cannot be set to the chip */
--
2.1.4


2015-03-07 17:05:34

by Malcolm Priestley

[permalink] [raw]
Subject: [PATCH resend 3/3] 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 <[email protected]>
---
drivers/staging/vt6655/device_main.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index a512f83..14c935f 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1179,12 +1179,14 @@ static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
{
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
PSTxDesc head_td;
- u32 dma_idx = TYPE_AC0DMA;
+ u32 dma_idx;
unsigned long flags;

spin_lock_irqsave(&priv->lock, flags);

- if (!ieee80211_is_data(hdr->frame_control))
+ if (ieee80211_is_data(hdr->frame_control))
+ dma_idx = TYPE_AC0DMA;
+ else
dma_idx = TYPE_TXDMA0;

if (AVAIL_TD(priv, dma_idx) < 1) {
@@ -1198,6 +1200,9 @@ static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)

head_td->pTDInfo->skb = skb;

+ if (dma_idx == TYPE_AC0DMA)
+ head_td->pTDInfo->byFlags = TD_FLAGS_NETIF_SKB;
+
priv->iTDUsed[dma_idx]++;

/* Take ownership */
@@ -1226,13 +1231,10 @@ static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)

head_td->buff_addr = cpu_to_le32(head_td->pTDInfo->skb_dma);

- if (dma_idx == TYPE_AC0DMA) {
- head_td->pTDInfo->byFlags = TD_FLAGS_NETIF_SKB;
-
+ if (head_td->pTDInfo->byFlags & TD_FLAGS_NETIF_SKB)
MACvTransmitAC0(priv->PortOffset);
- } else {
+ else
MACvTransmit0(priv->PortOffset);
- }

spin_unlock_irqrestore(&priv->lock, flags);

--
2.1.4