Skip to contentSkip to conversation

staging: vt6656: rf.c additional power.

PATCH New Malcolm Priestley 1 participant 22 messages May 17, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/22 staging: vt6656: rf.c additional power.

Provides extra power on weak RSSI.

The values orginate from the vendors driver.

It is applied later in RFbRawSetPower to simplify and check that it doesn't exceed the max power.

Vendor driver VT6656_Linux_src_v1.21.03_x86_11.04.zip
http://www.viaembedded.com/servlet/downloadSvl?id=1890&download_file_id=14704
This is GPL-licensed code.

vendors code
...

if (pDevice->byRFType == RF_VT3226D0) {
	if (lRSSI == 0){
		lAdditionalPower = 7;
	}
	else if ((lRSSI < -60) && (lRSSI >= -65)){
		lAdditionalPower = 5;
		//lAdditionalPower = 9;
	}
	else if ((lRSSI < -65) && (lRSSI >= -70)){
		lAdditionalPower = 7;
		//lAdditionalPower = 9;
	}
	else if ((lRSSI < -70) && (lRSSI >= -80)){
		lAdditionalPower = 9;
		}
	else if (lRSSI < -80) {
		lAdditionalPower = 9;
	}
}
else {
	if (lRSSI == 0){
		lAdditionalPower = 7;
	}
	else if ((lRSSI < -70) && (lRSSI >= -75)){
		lAdditionalPower = 5;
	}
	else if ((lRSSI < -75) && (lRSSI >= -80)){
			lAdditionalPower = 7;
		}
		else if (lRSSI < -80) {
			lAdditionalPower = 9;
		}
	}

...

---
 drivers/staging/vt6656/rf.c | 30 ++++++++++++++++++++++++++++++
 drivers/staging/vt6656/rf.h |  2 ++
 2 files changed, 32 insertions(+)
drivers/staging/vt6656/rf.c +30 -0
index 1e8f64b..64632e9 100644
@@ -769,6 +769,32 @@ int RFbSetPower(struct vnt_private *priv, u32 rate, u32 channel)
 	return ret;
 }
 
+static u8 vnt_rf_addpower(struct vnt_private *priv)
+{
+	s32 rssi = -priv->uCurrRSSI;
+
+	if (!rssi)
+		return 7;
+
+	if (priv->byRFType == RF_VT3226D0) {
+		if (rssi < -70)
+			return 9;
+		else if (rssi < -65)
+			return 7;
+		else if (rssi < -60)
+			return 5;
+	} else {
+		if (rssi < -80)
+			return 9;
+		else if (rssi < -75)
+			return 7;
+		else if (rssi < -70)
+			return 5;
+	}
+
+	return 0;
+}
+
 /*
  * Description: Set Tx power
  *
@@ -788,6 +814,10 @@ int RFbRawSetPower(struct vnt_private *priv, u8 power, u32 rate)
 	u32 power_setting = 0;
 	int ret = true;
 
+	power += vnt_rf_addpower(priv);
+	if (power > VNT_RF_MAX_POWER)
+		power = VNT_RF_MAX_POWER;
+
 	if (priv->byCurPwr == power)
 		return true;
 
drivers/staging/vt6656/rf.h +2 -0
index de5c613..e9a01fe 100644
@@ -53,6 +53,8 @@
 #define RF_EMU              0x80
 #define RF_MASK             0x7F
 
+#define VNT_RF_MAX_POWER    0x3f
+
 extern const u8 RFaby11aChannelIndex[200];
 
 int IFRFbWriteEmbedded(struct vnt_private *, u32 dwData);
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/22 staging: vt6656: usbpipe: get rid of in/out debug messages.

Remove all in/out debug messages.

---
 drivers/staging/vt6656/usbpipe.c | 20 --------------------
 1 file changed, 20 deletions(-)
drivers/staging/vt6656/usbpipe.c +0 -20
index 433edca..8d0705d 100644
@@ -126,9 +126,6 @@ int PIPEnsInterruptRead(struct vnt_private *priv)
 {
 	int status = STATUS_FAILURE;
 
-	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
-			"---->s_nsStartInterruptUsbRead()\n");
-
 	if (priv->int_buf.in_use == true)
 		return STATUS_FAILURE;
 
@@ -150,9 +147,6 @@ int PIPEnsInterruptRead(struct vnt_private *priv)
 		priv->int_buf.in_use = false;
 	}
 
-	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
-		"<----s_nsStartInterruptUsbRead Return(%x)\n", status);
-
 	return status;
 }
 
@@ -176,9 +170,6 @@ static void s_nsInterruptUsbIoCompleteRead(struct urb *urb)
 	struct vnt_private *priv = urb->context;
 	int status;
 
-	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
-			"---->s_nsInterruptUsbIoCompleteRead\n");
-
 	switch (urb->status) {
 	case 0:
 	case -ETIMEDOUT:
@@ -194,9 +185,6 @@ static void s_nsInterruptUsbIoCompleteRead(struct urb *urb)
 
 	status = urb->status;
 
-	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
-		"s_nsInterruptUsbIoCompleteRead Status %d\n", status);
-
 	if (status != STATUS_SUCCESS) {
 		priv->int_buf.in_use = false;
 
@@ -236,8 +224,6 @@ int PIPEnsBulkInUsbRead(struct vnt_private *priv, struct vnt_rcb *rcb)
 	int status = 0;
 	struct urb *urb;
 
-	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsStartBulkInUsbRead\n");
-
 	if (priv->Flags & fMP_DISCONNECTED)
 		return STATUS_FAILURE;
 
@@ -290,8 +276,6 @@ static void s_nsBulkInUsbIoCompleteRead(struct urb *urb)
 	unsigned long flags;
 	int re_alloc_skb = false;
 
-	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsBulkInUsbIoCompleteRead\n");
-
 	switch (urb->status) {
 	case 0:
 		break;
@@ -351,8 +335,6 @@ int PIPEnsSendBulkOut(struct vnt_private *priv,
 
 	priv->bPWBitOn = false;
 
-	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"s_nsSendBulkOut\n");
-
 	if (!(MP_IS_READY(priv) && priv->Flags & fMP_POST_WRITES)) {
 		context->in_use = false;
 		return STATUS_RESOURCES;
@@ -413,8 +395,6 @@ static void s_nsBulkOutIoCompleteWrite(struct urb *urb)
 	struct vnt_private *priv = context->priv;
 	u8 context_type = context->type;
 
-	DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsBulkOutIoCompleteWrite\n");
-
 	switch (urb->status) {
 	case 0:
 		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
Signature · 1 line
1.9.1
#2 lore raw

PATCH 3/22 staging: vt6656: usbpipe: replace debug messsages.

In reply to Malcolm Priestley

Replace all DBG_PRT wiht dev_dbg

---
 drivers/staging/vt6656/usbpipe.c | 39 +++++++++++++++------------------------
 1 file changed, 15 insertions(+), 24 deletions(-)
drivers/staging/vt6656/usbpipe.c +15 -24
index 8d0705d..5a466653 100644
@@ -51,9 +51,6 @@
 //endpoint 2: read bulk
 //endpoint 3: write bulk
 
-//static int          msglevel                =MSG_LEVEL_DEBUG;
-static int          msglevel                =MSG_LEVEL_INFO;
-
 #define USB_CTL_WAIT   500 //ms
 
 #ifndef URB_ASYNC_UNLINK
@@ -142,8 +139,7 @@ int PIPEnsInterruptRead(struct vnt_private *priv)
 
 	status = usb_submit_urb(priv->pInterruptURB, GFP_ATOMIC);
 	if (status) {
-		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
-			"Submit int URB failed %d\n", status);
+		dev_dbg(&priv->usb->dev, "Submit int URB failed %d\n", status);
 		priv->int_buf.in_use = false;
 	}
 
@@ -188,16 +184,14 @@ static void s_nsInterruptUsbIoCompleteRead(struct urb *urb)
 	if (status != STATUS_SUCCESS) {
 		priv->int_buf.in_use = false;
 
-		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
-			"IntUSBIoCompleteControl STATUS = %d\n", status);
+		dev_dbg(&priv->usb->dev, "%s status = %d\n", __func__, status);
 	} else {
 		INTnsProcessData(priv);
 	}
 
 	status = usb_submit_urb(priv->pInterruptURB, GFP_ATOMIC);
 	if (status) {
-		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
-			"Submit int URB failed %d\n", status);
+		dev_dbg(&priv->usb->dev, "Submit int URB failed %d\n", status);
 	} else {
 		priv->int_buf.in_use = true;
 	}
@@ -229,7 +223,7 @@ int PIPEnsBulkInUsbRead(struct vnt_private *priv, struct vnt_rcb *rcb)
 
 	urb = rcb->pUrb;
 	if (rcb->skb == NULL) {
-		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"rcb->skb is null\n");
+		dev_dbg(&priv->usb->dev, "rcb->skb is null\n");
 		return status;
 	}
 
@@ -243,8 +237,7 @@ int PIPEnsBulkInUsbRead(struct vnt_private *priv, struct vnt_rcb *rcb)
 
 	status = usb_submit_urb(urb, GFP_ATOMIC);
 	if (status != 0) {
-		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
-				"Submit Rx URB failed %d\n", status);
+		dev_dbg(&priv->usb->dev, "Submit Rx URB failed %d\n", status);
 		return STATUS_FAILURE ;
 	}
 
@@ -285,8 +278,7 @@ static void s_nsBulkInUsbIoCompleteRead(struct urb *urb)
 		return;
 	case -ETIMEDOUT:
 	default:
-		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
-				"BULK In failed %d\n", urb->status);
+		dev_dbg(&priv->usb->dev, "BULK In failed %d\n", urb->status);
 		break;
 	}
 
@@ -301,8 +293,9 @@ static void s_nsBulkInUsbIoCompleteRead(struct urb *urb)
 
 	rcb->Ref--;
 	if (rcb->Ref == 0) {
-		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"RxvFreeNormal %d\n",
-							priv->NumRecvFreeList);
+		dev_dbg(&priv->usb->dev,
+				"RxvFreeNormal %d\n", priv->NumRecvFreeList);
+
 		spin_lock_irqsave(&priv->lock, flags);
 
 		RXvFreeRCB(rcb, re_alloc_skb);
@@ -352,8 +345,8 @@ int PIPEnsSendBulkOut(struct vnt_private *priv,
 
 	status = usb_submit_urb(urb, GFP_ATOMIC);
 	if (status != 0) {
-		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
-				"Submit Tx URB failed %d\n", status);
+		dev_dbg(&priv->usb->dev, "Submit Tx URB failed %d\n", status);
+
 		context->in_use = false;
 		return STATUS_FAILURE;
 	}
@@ -397,8 +390,7 @@ static void s_nsBulkOutIoCompleteWrite(struct urb *urb)
 
 	switch (urb->status) {
 	case 0:
-		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
-			"Write %d bytes\n", context->buf_len);
+		dev_dbg(&priv->usb->dev, "Write %d bytes\n", context->buf_len);
 		break;
 	case -ECONNRESET:
 	case -ENOENT:
@@ -407,8 +399,7 @@ static void s_nsBulkOutIoCompleteWrite(struct urb *urb)
 		return;
 	case -ETIMEDOUT:
 	default:
-		DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
-				"BULK Out failed %d\n", urb->status);
+		dev_dbg(&priv->usb->dev, "BULK Out failed %d\n", urb->status);
 		break;
 	}
 
@@ -419,8 +410,8 @@ static void s_nsBulkOutIoCompleteWrite(struct urb *urb)
 		if (context->skb != NULL) {
 			dev_kfree_skb_irq(context->skb);
 			context->skb = NULL;
-			DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
-				"tx  %d bytes\n", context->buf_len);
+			dev_dbg(&priv->usb->dev,
+					"tx  %d bytes\n", context->buf_len);
 		}
 
 		priv->dev->trans_start = jiffies;
Signature · 1 line
1.9.1
#3 lore raw

PATCH 4/22 staging: vt6656: PIPEnsControlOut remove camel case.

In reply to Malcolm Priestley

Camel case changes
pDevice, byRequest, wValue, wIndex, wLength, pbyBuffer, ntStatus

->

priv, request, value, index, length, buffer, status

---
 drivers/staging/vt6656/usbpipe.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/staging/vt6656/usbpipe.c +10 -10
index 5a466653..76fa19e 100644
@@ -61,23 +61,23 @@ static void s_nsInterruptUsbIoCompleteRead(struct urb *urb);
 static void s_nsBulkInUsbIoCompleteRead(struct urb *urb);
 static void s_nsBulkOutIoCompleteWrite(struct urb *urb);
 
-int PIPEnsControlOut(struct vnt_private *pDevice, u8 byRequest, u16 wValue,
-		u16 wIndex, u16 wLength, u8 *pbyBuffer)
+int PIPEnsControlOut(struct vnt_private *priv, u8 request, u16 value,
+		u16 index, u16 length, u8 *buffer)
 {
-	int ntStatus = 0;
+	int status = 0;
 
-	if (pDevice->Flags & fMP_DISCONNECTED)
+	if (priv->Flags & fMP_DISCONNECTED)
 		return STATUS_FAILURE;
 
-	mutex_lock(&pDevice->usb_lock);
+	mutex_lock(&priv->usb_lock);
 
-	ntStatus = usb_control_msg(pDevice->usb,
-		usb_sndctrlpipe(pDevice->usb, 0), byRequest, 0x40, wValue,
-			wIndex, pbyBuffer, wLength, USB_CTL_WAIT);
+	status = usb_control_msg(priv->usb,
+		usb_sndctrlpipe(priv->usb, 0), request, 0x40, value,
+			index, buffer, length, USB_CTL_WAIT);
 
-	mutex_unlock(&pDevice->usb_lock);
+	mutex_unlock(&priv->usb_lock);
 
-	if (ntStatus < (int)wLength)
+	if (status < (int)length)
 		return STATUS_FAILURE;
 
 	return STATUS_SUCCESS;
Signature · 1 line
1.9.1
#4 lore raw

PATCH 5/22 staging: vt6656: PIPEnsControlIn remove camel case.

In reply to Malcolm Priestley

Camel case changes
pDevice, byRequest, wValue, wIndex, wLength, pbyBuffer, ntStatus

->

priv, request, value, index, length, buffer, status

---
 drivers/staging/vt6656/usbpipe.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/staging/vt6656/usbpipe.c +10 -10
index 76fa19e..2dfa16e 100644
@@ -83,23 +83,23 @@ int PIPEnsControlOut(struct vnt_private *priv, u8 request, u16 value,
 	return STATUS_SUCCESS;
 }
 
-int PIPEnsControlIn(struct vnt_private *pDevice, u8 byRequest, u16 wValue,
-	u16 wIndex, u16 wLength, u8 *pbyBuffer)
+int PIPEnsControlIn(struct vnt_private *priv, u8 request, u16 value,
+		u16 index, u16 length, u8 *buffer)
 {
-	int ntStatus;
+	int status;
 
-	if (pDevice->Flags & fMP_DISCONNECTED)
+	if (priv->Flags & fMP_DISCONNECTED)
 		return STATUS_FAILURE;
 
-	mutex_lock(&pDevice->usb_lock);
+	mutex_lock(&priv->usb_lock);
 
-	ntStatus = usb_control_msg(pDevice->usb,
-		usb_rcvctrlpipe(pDevice->usb, 0), byRequest, 0xc0, wValue,
-			wIndex, pbyBuffer, wLength, USB_CTL_WAIT);
+	status = usb_control_msg(priv->usb,
+		usb_rcvctrlpipe(priv->usb, 0), request, 0xc0, value,
+			index, buffer, length, USB_CTL_WAIT);
 
-	mutex_unlock(&pDevice->usb_lock);
+	mutex_unlock(&priv->usb_lock);
 
-	if (ntStatus < (int)wLength)
+	if (status < (int)length)
 		return STATUS_FAILURE;
 
 	return STATUS_SUCCESS;
Signature · 1 line
1.9.1
#5 lore raw

PATCH 6/22 staging: vt6656: device_cfg.h remove dead code.

In reply to Malcolm Priestley

Also unneeded #ifndef

---
 drivers/staging/vt6656/device_cfg.h | 45 -------------------------------------
 1 file changed, 45 deletions(-)
drivers/staging/vt6656/device_cfg.h +0 -45
index 0b9d834..b018339 100644
@@ -27,61 +27,16 @@
 #ifndef __DEVICE_CONFIG_H
 #define __DEVICE_CONFIG_H
 
-#include <linux/types.h>
-
-typedef
-struct _version {
-    unsigned char   major;
-    unsigned char   minor;
-    unsigned char   build;
-} version_t, *pversion_t;
-
-#ifndef false
-#define false   (0)
-#endif
-
-#ifndef true
-#define true    (!(false))
-#endif
-
-#define VID_TABLE_SIZE      64
-#define MCAST_TABLE_SIZE    64
-#define MCAM_SIZE           32
-#define VCAM_SIZE           32
-#define TX_QUEUE_NO         8
-
 #define DEVICE_NAME         "vt6656"
 #define DEVICE_FULL_DRV_NAM "VIA Networking Wireless LAN USB Driver"
 
-#ifndef MAJOR_VERSION
-#define MAJOR_VERSION       1
-#endif
-
-#ifndef MINOR_VERSION
-#define MINOR_VERSION       13
-#endif
-
-#ifndef DEVICE_VERSION
 #define DEVICE_VERSION       "1.19_12"
-#endif
 
 #define MAX_RATE	12
 
-/* config file */
-#include <linux/fs.h>
-#include <linux/fcntl.h>
-#ifndef CONFIG_PATH
 #define CONFIG_PATH            "/etc/vntconfiguration.dat"
-#endif
-
-/* Max: 2378 = 2312 Payload + 30HD + 4CRC + 2Padding + 4Len + 8TSF + 4RSR */
-#define PKT_BUF_SZ          2390
 
 #define MAX_UINTS           8
 #define OPTION_DEFAULT      { [0 ... MAX_UINTS-1] = -1}
 
-typedef enum  _chip_type {
-    VT3184 = 1
-} CHIP_TYPE, *PCHIP_TYPE;
-
 #endif
Signature · 1 line
1.9.1
#6 lore raw

PATCH 7/22 staging: vt6656: device_cfg.h Move macros to device.h

In reply to Malcolm Priestley

Remove device_cfg.h

---
 drivers/staging/vt6656/device.h     | 13 +++++++++++-
 drivers/staging/vt6656/device_cfg.h | 42 -------------------------------------
 2 files changed, 12 insertions(+), 43 deletions(-)
 delete mode 100644 drivers/staging/vt6656/device_cfg.h
drivers/staging/vt6656/device.h +12 -1
index 410e028..3c2c4ce 100644
@@ -60,11 +60,12 @@
 #define RT_DOWNDEV_EVENT_FLAG                        0x0105
 #define RT_RMMOD_EVENT_FLAG                              0x0106
 
+#define MAX_RATE			12
+
 /*
  * device specific
  */
 
-#include "device_cfg.h"
 #include "80211hdr.h"
 #include "tether.h"
 #include "wmgr.h"
@@ -79,6 +80,16 @@
 #define VNT_USB_VENDOR_ID                     0x160a
 #define VNT_USB_PRODUCT_ID                    0x3184
 
+#define DEVICE_NAME			"vt6656"
+#define DEVICE_FULL_DRV_NAM		"VIA Networking Wireless LAN USB Driver"
+
+#define DEVICE_VERSION			"1.19_12"
+
+#define CONFIG_PATH			"/etc/vntconfiguration.dat"
+
+#define MAX_UINTS			8
+#define OPTION_DEFAULT			{ [0 ... MAX_UINTS-1] = -1}
+
 #define MAC_MAX_CONTEXT_REG     (256+128)
 
 #define MAX_MULTICAST_ADDRESS_NUM       32
drivers/staging/vt6656/device_cfg.h deleted +0 -42

42 lines not on this page · raw message

Signature · 1 line
1.9.1
#7 lore raw

PATCH 8/22 staging: vt6656: device.h remove dead macros

In reply to Malcolm Priestley
---
 drivers/staging/vt6656/device.h | 67 +----------------------------------------
 1 file changed, 1 insertion(+), 66 deletions(-)
drivers/staging/vt6656/device.h +1 -66
index 3c2c4ce..f8591a2 100644
@@ -52,14 +52,6 @@
 #undef DEVICE_ETHTOOL_IOCTL_SUPPORT
 #endif
 
-/* please copy below macro to driver_event.c for API */
-#define RT_INSMOD_EVENT_FLAG                             0x0101
-#define RT_UPDEV_EVENT_FLAG                               0x0102
-#define RT_DISCONNECTED_EVENT_FLAG               0x0103
-#define RT_WPACONNECTED_EVENT_FLAG             0x0104
-#define RT_DOWNDEV_EVENT_FLAG                        0x0105
-#define RT_RMMOD_EVENT_FLAG                              0x0106
-
 #define MAX_RATE			12
 
 /*
@@ -90,27 +82,8 @@
 #define MAX_UINTS			8
 #define OPTION_DEFAULT			{ [0 ... MAX_UINTS-1] = -1}
 
-#define MAC_MAX_CONTEXT_REG     (256+128)
-
-#define MAX_MULTICAST_ADDRESS_NUM       32
-#define MULTICAST_ADDRESS_LIST_SIZE     (MAX_MULTICAST_ADDRESS_NUM * ETH_ALEN)
-
 #define DUPLICATE_RX_CACHE_LENGTH       5
 
-#define NUM_KEY_ENTRY                   11
-
-#define TX_WEP_NONE                     0
-#define TX_WEP_OTF                      1
-#define TX_WEP_SW                       2
-#define TX_WEP_SWOTP                    3
-#define TX_WEP_OTPSW                    4
-#define TX_WEP_SW232                    5
-
-#define KEYSEL_WEP40                    0
-#define KEYSEL_WEP104                   1
-#define KEYSEL_TKIP                     2
-#define KEYSEL_CCMP                     3
-
 #define AUTO_FB_NONE            0
 #define AUTO_FB_0               1
 #define AUTO_FB_1               2
@@ -130,13 +103,6 @@
 #define ANT_RXA                 2
 #define ANT_RXB                 3
 
-#define MAXCHECKHANGCNT         4
-
-/* Packet type */
-#define TX_PKT_UNI              0x00
-#define TX_PKT_MULTI            0x01
-#define TX_PKT_BROAD            0x02
-
 #define BB_VGA_LEVEL            4
 #define BB_VGA_CHANGE_THRESHOLD 3
 
@@ -144,9 +110,6 @@
 #define RUN_AT(x)                       (jiffies+(x))
 #endif
 
-/* DMA related */
-#define RESERV_AC0DMA                   4
-
 #define PRIVATE_Message                 0
 
 #define DBG_PRT(l, p, args...) { if (l <= msglevel) printk(p, ##args); }
@@ -320,29 +283,9 @@ typedef struct tagSDeFragControlBlock
 
 /* flags for options */
 #define     DEVICE_FLAGS_UNPLUG          0x00000001UL
-#define     DEVICE_FLAGS_PREAMBLE_TYPE   0x00000002UL
-#define     DEVICE_FLAGS_OP_MODE         0x00000004UL
-#define     DEVICE_FLAGS_PS_MODE         0x00000008UL
-#define		DEVICE_FLAGS_80211h_MODE	 0x00000010UL
 
 /* flags for driver status */
 #define     DEVICE_FLAGS_OPENED          0x00010000UL
-#define     DEVICE_FLAGS_WOL_ENABLED     0x00080000UL
-/* flags for capabilities */
-#define     DEVICE_FLAGS_TX_ALIGN        0x01000000UL
-#define     DEVICE_FLAGS_HAVE_CAM        0x02000000UL
-#define     DEVICE_FLAGS_FLOW_CTRL       0x04000000UL
-
-/* flags for MII status */
-#define     DEVICE_LINK_FAIL             0x00000001UL
-#define     DEVICE_SPEED_10              0x00000002UL
-#define     DEVICE_SPEED_100             0x00000004UL
-#define     DEVICE_SPEED_1000            0x00000008UL
-#define     DEVICE_DUPLEX_FULL           0x00000010UL
-#define     DEVICE_AUTONEG_ENABLE        0x00000020UL
-#define     DEVICE_FORCED_BY_EEPROM      0x00000040UL
-/* for device_set_media_duplex */
-#define     DEVICE_LINK_CHANGE           0x00000001UL
 
 typedef struct __device_opt {
 	int nRxDescs0;  /* number of RX descriptors 0 */
@@ -742,14 +685,7 @@ struct vnt_private {
         (uVar)++;                                   \
 }
 
-#define fMP_RESET_IN_PROGRESS               0x00000001
 #define fMP_DISCONNECTED                    0x00000002
-#define fMP_HALT_IN_PROGRESS                0x00000004
-#define fMP_SURPRISE_REMOVED                0x00000008
-#define fMP_RECV_LOOKASIDE                  0x00000010
-#define fMP_INIT_IN_PROGRESS                0x00000020
-#define fMP_SEND_SIDE_RESOURCE_ALLOCATED    0x00000040
-#define fMP_RECV_SIDE_RESOURCE_ALLOCATED    0x00000080
 #define fMP_POST_READS                      0x00000100
 #define fMP_POST_WRITES                     0x00000200
 
@@ -757,8 +693,7 @@ struct vnt_private {
 #define MP_CLEAR_FLAG(_M, _F)            ((_M)->Flags &= ~(_F))
 #define MP_TEST_FLAGS(_M, _F)            (((_M)->Flags & (_F)) == (_F))
 
-#define MP_IS_READY(_M)        (((_M)->Flags & \
-                                 (fMP_DISCONNECTED | fMP_RESET_IN_PROGRESS | fMP_HALT_IN_PROGRESS | fMP_INIT_IN_PROGRESS | fMP_SURPRISE_REMOVED)) == 0)
+#define MP_IS_READY(_M)        (((_M)->Flags & fMP_DISCONNECTED) == 0)
 
 int device_alloc_frag_buf(struct vnt_private *, PSDeFragControlBlock pDeF);
 void vnt_configure_filter(struct vnt_private *);
Signature · 1 line
1.9.1
#8 lore raw

PATCH 9/22 staging: vt6656: desc.h Remove unused macros

In reply to Malcolm Priestley
---
 drivers/staging/vt6656/desc.h | 13 -------------
 1 file changed, 13 deletions(-)
drivers/staging/vt6656/desc.h +0 -13
index 171315a..617d479 100644
@@ -39,28 +39,15 @@
 /* max transmit or receive buffer size */
 #define CB_MAX_BUF_SIZE     2900U       /* NOTE: must be multiple of 4 */
 
-/* max TX buffer size */
-#define CB_MAX_TX_BUF_SIZE        CB_MAX_BUF_SIZE
-/* max RX buffer size when not use Multi-RD */
-#define CB_MAX_RX_BUF_SIZE_NORMAL CB_MAX_BUF_SIZE
-
-#define CB_BEACON_BUF_SIZE  512U        /* default beacon buffer size */
-
 #define MAX_TOTAL_SIZE_WITH_ALL_HEADERS CB_MAX_BUF_SIZE
 
 #define MAX_INTERRUPT_SIZE              32
 
-#define RX_BLOCKS           64          /* from 0x60 to 0xA0 */
-#define TX_BLOCKS           32          /* from 0xA0 to 0xC0 */
-
 #define CB_MAX_RX_DESC      128         /* max # of descriptors */
 #define CB_MIN_RX_DESC      16          /* min # of RX descriptors */
 #define CB_MAX_TX_DESC      128         /* max # of descriptors */
 #define CB_MIN_TX_DESC      16          /* min # of TX descriptors */
 
-#define CB_RD_NUM           64          /* default # of RD */
-#define CB_TD_NUM           64          /* default # of TD */
-
 /*
  * bits in the RSR register
  */
Signature · 1 line
1.9.1
#9 lore raw

PATCH 10/22 staging: vt6656: srom.h : Remove dead code.

In reply to Malcolm Priestley

Remove macros and unused strutures.

---
 drivers/staging/vt6656/srom.h | 38 --------------------------------------
 1 file changed, 38 deletions(-)
drivers/staging/vt6656/srom.h +0 -38
index 488192d..ce61ab4 100644
@@ -32,10 +32,6 @@
 
 #define EEP_MAX_CONTEXT_SIZE    256
 
-#define CB_EEPROM_READBYTE_WAIT 900     //us
-
-#define W_MAX_I2CRETRY          0x0fff
-
 //
 // Contents in the EEPROM
 //
@@ -75,38 +71,4 @@
 //
 #define EEP_RADIOCTL_ENABLE 0x80
 
-// AT24C02 eeprom contents
-//      2048 bits = 256 bytes = 128 words
-//
-typedef struct tagSSromReg {
-    u8    abyPAR[6];                  // 0x00 (u16)
-
-    u16    wSUB_VID;                   // 0x03 (u16)
-    u16    wSUB_SID;
-
-    u8    byBCFG0;                    // 0x05 (u16)
-    u8    byBCFG1;
-
-    u8    byFCR0;                     // 0x06 (u16)
-    u8    byFCR1;
-    u8    byPMC0;                     // 0x07 (u16)
-    u8    byPMC1;
-    u8    byMAXLAT;                   // 0x08 (u16)
-    u8    byMINGNT;
-    u8    byCFG0;                     // 0x09 (u16)
-    u8    byCFG1;
-    u16    wCISPTR;                    // 0x0A (u16)
-    u16    wRsv0;                      // 0x0B (u16)
-    u16    wRsv1;                      // 0x0C (u16)
-    u8    byBBPAIR;                   // 0x0D (u16)
-    u8    byRFTYPE;
-    u8    byMinChannel;               // 0x0E (u16)
-    u8    byMaxChannel;
-    u8    bySignature;                // 0x0F (u16)
-    u8    byCheckSum;
-
-    u8    abyReserved0[96];           // 0x10 (u16)
-    u8    abyCIS[128];                // 0x80 (u16)
-} SSromReg, *PSSromReg;
-
 #endif /* __EEPROM_H__ */
Signature · 1 line
1.9.1
#10 lore raw

PATCH 11/22 staging: vt6656: srom.h move all macros to device.h

In reply to Malcolm Priestley

Remove srom.h

---
 drivers/staging/vt6656/baseband.c |  1 -
 drivers/staging/vt6656/datarate.c |  1 -
 drivers/staging/vt6656/device.h   | 36 ++++++++++++++++++-
 drivers/staging/vt6656/srom.h     | 74 ---------------------------------------
 4 files changed, 35 insertions(+), 77 deletions(-)
 delete mode 100644 drivers/staging/vt6656/srom.h
drivers/staging/vt6656/baseband.c +0 -1
index 3d4610e..9f3b2fb 100644
@@ -40,7 +40,6 @@
 #include "mac.h"
 #include "baseband.h"
 #include "rf.h"
-#include "srom.h"
 #include "control.h"
 #include "datarate.h"
 #include "rndis.h"
drivers/staging/vt6656/datarate.c +0 -1
index 547db6f..8032d6b 100644
@@ -40,7 +40,6 @@
 #include "datarate.h"
 #include "card.h"
 #include "baseband.h"
-#include "srom.h"
 #include "rf.h"
 
 /* static int msglevel = MSG_LEVEL_DEBUG; */
drivers/staging/vt6656/device.h +35 -1
index f8591a2..990b345 100644
@@ -62,7 +62,6 @@
 #include "tether.h"
 #include "wmgr.h"
 #include "wcmd.h"
-#include "srom.h"
 #include "rc4.h"
 #include "desc.h"
 #include "key.h"
@@ -106,6 +105,41 @@
 #define BB_VGA_LEVEL            4
 #define BB_VGA_CHANGE_THRESHOLD 3
 
+#define EEP_MAX_CONTEXT_SIZE    256
+
+/* Contents in the EEPROM */
+#define EEP_OFS_PAR		0x0
+#define EEP_OFS_ANTENNA		0x17
+#define EEP_OFS_RADIOCTL	0x18
+#define EEP_OFS_RFTYPE		0x1b
+#define EEP_OFS_MINCHANNEL	0x1c
+#define EEP_OFS_MAXCHANNEL	0x1d
+#define EEP_OFS_SIGNATURE	0x1e
+#define EEP_OFS_ZONETYPE	0x1f
+#define EEP_OFS_RFTABLE		0x20
+#define EEP_OFS_PWR_CCK		0x20
+#define EEP_OFS_SETPT_CCK	0x21
+#define EEP_OFS_PWR_OFDMG	0x23
+
+#define EEP_OFS_CALIB_TX_IQ	0x24
+#define EEP_OFS_CALIB_TX_DC	0x25
+#define EEP_OFS_CALIB_RX_IQ	0x26
+
+#define EEP_OFS_MAJOR_VER	0x2e
+#define EEP_OFS_MINOR_VER	0x2f
+
+#define EEP_OFS_CCK_PWR_TBL	0x30
+#define EEP_OFS_OFDM_PWR_TBL	0x40
+#define EEP_OFS_OFDMA_PWR_TBL	0x50
+
+/* Bits in EEP_OFS_ANTENNA */
+#define EEP_ANTENNA_MAIN	0x1
+#define EEP_ANTENNA_AUX		0x2
+#define EEP_ANTINV		0x4
+
+/* Bits in EEP_OFS_RADIOCTL */
+#define EEP_RADIOCTL_ENABLE	0x80
+
 #ifndef RUN_AT
 #define RUN_AT(x)                       (jiffies+(x))
 #endif
drivers/staging/vt6656/srom.h deleted +0 -74

74 lines not on this page · raw message

Signature · 1 line
1.9.1
#11 lore raw

PATCH 12/22 staging: vt6656: rndis.h remove dead code.

In reply to Malcolm Priestley

Remove dead structures and macros.

---
 drivers/staging/vt6656/rndis.h | 64 ------------------------------------------
 1 file changed, 64 deletions(-)
drivers/staging/vt6656/rndis.h +0 -64
index 3661f82..cf4e0e0 100644
@@ -64,21 +64,8 @@
 #define MESSAGE_REQUEST_RF_CH1          0x0C
 #define MESSAGE_REQUEST_RF_CH2          0x0D
 
-#define VIAUSB20_PACKET_HEADER          0x04
-
 #define USB_REG4	0x604
 
-typedef struct _CMD_MESSAGE
-{
-    u8        byData[256];
-} CMD_MESSAGE, *PCMD_MESSAGE;
-
-typedef struct _CMD_WRITE_MASK
-{
-    u8        byData;
-    u8        byMask;
-} CMD_WRITE_MASK, *PCMD_WRITE_MASK;
-
 struct vnt_cmd_card_init
 {
 	u8 init_class;
@@ -97,55 +84,4 @@ struct vnt_rsp_card_init
 	u8 max_channel;
 };
 
-typedef struct _CMD_SET_KEY
-{
-    u16        wKCTL;
-    u8        abyMacAddr[6];
-    u8        abyKey[16];
-} CMD_SET_KEY, *PCMD_SET_KEY;
-
-typedef struct _CMD_CLRKEY_ENTRY
-{
-    u8        abyKeyEntry[11];
-} CMD_CLRKEY_ENTRY, *PCMD_CLRKEY_ENTRY;
-
-typedef struct _CMD_WRITE_MISCFF
-{
-    u32       adwMiscFFData[22][4];  //a key entry has only 22 dwords
-} CMD_WRITE_MISCFF, *PCMD_WRITE_MISCFF;
-
-typedef struct _CMD_SET_TSFTBTT
-{
-    u8        abyTSF_TBTT[8];
-} CMD_SET_TSFTBTT, *PCMD_SET_TSFTBTT;
-
-typedef struct _CMD_SET_SSTIFS
-{
-    u8        bySIFS;
-    u8        byDIFS;
-    u8        byEIFS;
-    u8        bySlotTime;
-    u8        byCwMax_Min;
-    u8        byBBCR10;
-} CMD_SET_SSTIFS, *PCMD_SET_SSTIFS;
-
-typedef struct _CMD_CHANGE_BBTYPE
-{
-    u8        bySIFS;
-    u8        byDIFS;
-    u8        byEIFS;
-    u8        bySlotTime;
-    u8        byCwMax_Min;
-    u8        byBBCR10;
-    u8        byBB_BBType;    //CR88
-    u8        byMAC_BBType;
-    u32       dwRSPINF_b_1;
-    u32       dwRSPINF_b_2;
-    u32       dwRSPINF_b_55;
-    u32       dwRSPINF_b_11;
-    u16        wRSPINF_a[9];
-} CMD_CHANGE_BBTYPE, *PCMD_CHANGE_BBTYPE;
-
-#define EXCH_WORD(w) ((u16)((u16)(w)<<8) | (u16)((u16)(w)>>8))
-
 #endif /* _RNDIS_H_ */
Signature · 1 line
1.9.1
#12 lore raw

PATCH 13/22 staging: vt6656: rndis.h move all to device.h

In reply to Malcolm Priestley

Commands macros are common to all source files.

---
 drivers/staging/vt6656/baseband.c |  1 -
 drivers/staging/vt6656/bssdb.c    |  1 -
 drivers/staging/vt6656/card.c     |  1 -
 drivers/staging/vt6656/control.c  |  1 -
 drivers/staging/vt6656/device.h   | 56 ++++++++++++++++++++++++-
 drivers/staging/vt6656/firmware.c |  1 -
 drivers/staging/vt6656/iwctl.c    |  1 -
 drivers/staging/vt6656/key.c      |  1 -
 drivers/staging/vt6656/mac.c      |  1 -
 drivers/staging/vt6656/power.c    |  1 -
 drivers/staging/vt6656/rf.c       |  1 -
 drivers/staging/vt6656/rndis.h    | 87 ---------------------------------------
 drivers/staging/vt6656/wcmd.c     |  1 -
 drivers/staging/vt6656/wmgr.c     |  1 -
 drivers/staging/vt6656/wpactl.c   |  1 -
 15 files changed, 55 insertions(+), 101 deletions(-)
 delete mode 100644 drivers/staging/vt6656/rndis.h
drivers/staging/vt6656/baseband.c +0 -1
index 9f3b2fb..b4489d6 100644
@@ -42,7 +42,6 @@
 #include "rf.h"
 #include "control.h"
 #include "datarate.h"
-#include "rndis.h"
 
 static int          msglevel                =MSG_LEVEL_INFO;
 //static int          msglevel                =MSG_LEVEL_DEBUG;
drivers/staging/vt6656/bssdb.c +0 -1
index b018955..7e8e67a 100644
@@ -54,7 +54,6 @@
 #include "mac.h"
 #include "wpa2.h"
 #include "control.h"
-#include "rndis.h"
 #include "iowpa.h"
 #include "power.h"
 
drivers/staging/vt6656/card.c +0 -1
index 0d87728..b8f35e7 100644
@@ -57,7 +57,6 @@
 #include "rc4.h"
 #include "country.h"
 #include "datarate.h"
-#include "rndis.h"
 #include "control.h"
 
 //static int          msglevel                =MSG_LEVEL_DEBUG;
drivers/staging/vt6656/control.c +0 -1
index 026784f..fc19166 100644
@@ -41,7 +41,6 @@
  */
 
 #include "control.h"
-#include "rndis.h"
 
 /* static int          msglevel                =MSG_LEVEL_INFO;  */
 /* static int          msglevel                =MSG_LEVEL_DEBUG; */
drivers/staging/vt6656/device.h +55 -1

74 lines not on this page · raw message

drivers/staging/vt6656/firmware.c +0 -1
index e03f1f9..1d3d268 100644
@@ -34,7 +34,6 @@
 #include <linux/compiler.h>
 #include "firmware.h"
 #include "control.h"
-#include "rndis.h"
 
 static int msglevel = MSG_LEVEL_INFO;
 /* static int msglevel = MSG_LEVEL_DEBUG; */
drivers/staging/vt6656/iwctl.c +0 -1
index bfd5f37..38739fa 100644
@@ -40,7 +40,6 @@
 #include "iowpa.h"
 #include "wpactl.h"
 #include "control.h"
-#include "rndis.h"
 #include "baseband.h"
 
 static const long frequency_list[] = {
drivers/staging/vt6656/key.c +0 -1
index b173ca1..a88c6b18 100644
@@ -39,7 +39,6 @@
 #include "mac.h"
 #include "tmacro.h"
 #include "key.h"
-#include "rndis.h"
 #include "control.h"
 
 static int          msglevel                =MSG_LEVEL_INFO;
drivers/staging/vt6656/mac.c +0 -1
index 8bd3ab0..8298a9e 100644
@@ -35,7 +35,6 @@
 #include "desc.h"
 #include "mac.h"
 #include "80211hdr.h"
-#include "rndis.h"
 #include "control.h"
 
 //static int          msglevel                =MSG_LEVEL_DEBUG;
drivers/staging/vt6656/power.c +0 -1
index 43da589..c4bea74 100644
@@ -45,7 +45,6 @@
 #include "rxtx.h"
 #include "card.h"
 #include "control.h"
-#include "rndis.h"
 
 static int msglevel = MSG_LEVEL_INFO;
 
drivers/staging/vt6656/rf.c +0 -1
index 64632e9..7217f2c 100644
@@ -39,7 +39,6 @@
 #include "rf.h"
 #include "baseband.h"
 #include "control.h"
-#include "rndis.h"
 #include "datarate.h"
 
 static int          msglevel                =MSG_LEVEL_INFO;
drivers/staging/vt6656/rndis.h deleted +0 -87

87 lines not on this page · raw message

drivers/staging/vt6656/wcmd.c +0 -1
index 66d59d5..8fecb34 100644
@@ -51,7 +51,6 @@
 #include "control.h"
 #include "rxtx.h"
 #include "rf.h"
-#include "rndis.h"
 #include "channel.h"
 #include "iowpa.h"
 
drivers/staging/vt6656/wmgr.c +0 -1
index cce67cd..64edc16 100644
@@ -79,7 +79,6 @@
 #include "rf.h"
 #include "iowpa.h"
 #include "control.h"
-#include "rndis.h"
 
 static int msglevel = MSG_LEVEL_INFO;
 //static int          msglevel                =MSG_LEVEL_DEBUG;
drivers/staging/vt6656/wpactl.c +0 -1
index f4a8a5c..b6885a9 100644
@@ -39,7 +39,6 @@
 #include "iocmd.h"
 #include "iowpa.h"
 #include "control.h"
-#include "rndis.h"
 #include "rf.h"
 
 static int msglevel = MSG_LEVEL_INFO;
Signature · 1 line
1.9.1
#13 lore raw

PATCH 14/22 staging: vt6656: Remove unused variable byRevId.

In reply to Malcolm Priestley
---
 drivers/staging/vt6656/device.h   | 2 --
 drivers/staging/vt6656/main_usb.c | 7 +------
 2 files changed, 1 insertion(+), 8 deletions(-)
drivers/staging/vt6656/device.h +0 -2
index 59d3828..aefbe93 100644
@@ -409,8 +409,6 @@ struct vnt_private {
 
 	u32 rx_bytes;
 
-	u8 byRevId;
-
 	u32 flags;
 	unsigned long Flags;
 
drivers/staging/vt6656/main_usb.c +1 -6
index 1b58cca..68ae97c 100644
@@ -387,7 +387,7 @@ static int device_init_registers(struct vnt_private *pDevice)
 
 	pDevice->byTopOFDMBasicRate = RATE_24M;
 	pDevice->byTopCCKBasicRate = RATE_1M;
-	pDevice->byRevId = 0;
+
 	/* target to IF pin while programming to RF chip */
 	pDevice->byCurPwr = 0xFF;
 
@@ -508,11 +508,6 @@ static int device_init_registers(struct vnt_private *pDevice)
 	/* get RFType */
 	pDevice->byRFType = init_rsp->rf_type;
 
-	if ((pDevice->byRFType & RF_EMU) != 0) {
-		/* force change RevID for VT3253 emu */
-		pDevice->byRevId = 0x80;
-	}
-
 	/* load vt3266 calibration parameters in EEPROM */
 	if (pDevice->byRFType == RF_VT3226D0) {
 		if ((pDevice->abyEEPROM[EEP_OFS_MAJOR_VER] == 0x1) &&
Signature · 1 line
1.9.1
#14 lore raw

PATCH 15/22 staging: vt6656: Remove unused variable ulTxPower.

In reply to Malcolm Priestley
---
 drivers/staging/vt6656/device.h   | 1 -
 drivers/staging/vt6656/main_usb.c | 3 ---
 2 files changed, 4 deletions(-)
drivers/staging/vt6656/device.h +0 -1
index aefbe93..7e7ac80 100644
@@ -639,7 +639,6 @@ struct vnt_private {
 	u8 bSameBSSCurNum;
 	int bRoaming;
 	int b11hEable;
-	unsigned long ulTxPower;
 
 	/* Encryption */
 	NDIS_802_11_WEP_STATUS eEncryptionStatus;
drivers/staging/vt6656/main_usb.c +0 -3
index 68ae97c..3832bcb 100644
@@ -498,9 +498,6 @@ static int device_init_registers(struct vnt_private *pDevice)
 	pDevice->eConfigPHYMode = PHY_TYPE_AUTO;
 	pDevice->byBBType = BB_TYPE_11G;
 
-	/* initialize BBP registers */
-	pDevice->ulTxPower = 25;
-
 	/* get channel range */
 	pDevice->byMinChannel = 1;
 	pDevice->byMaxChannel = CB_MAX_CHANNEL;
Signature · 1 line
1.9.1
#15 lore raw

PATCH 16/22 staging: vt6656: Remove dead variable bCCK.

In reply to Malcolm Priestley

bCCK is always true remove all false conditions and local variable.

---
 drivers/staging/vt6656/baseband.c | 6 ------
 drivers/staging/vt6656/device.h   | 1 -
 drivers/staging/vt6656/main_usb.c | 2 --
 drivers/staging/vt6656/wmgr.c     | 1 -
 4 files changed, 10 deletions(-)
drivers/staging/vt6656/baseband.c +0 -6
index b4489d6..a70b278 100644
@@ -737,7 +737,6 @@ void BBvCalculateParameter(struct vnt_private *pDevice, u32 cbFrameLength,
 	u32 cbTmp;
 	int bExtBit;
 	u8 byPreambleType = pDevice->byPreambleType;
-	int bCCK = pDevice->bCCK;
 
     cbBitCount = cbFrameLength * 8;
     bExtBit = false;
@@ -757,8 +756,6 @@ void BBvCalculateParameter(struct vnt_private *pDevice, u32 cbFrameLength,
         break;
 
     case RATE_5M :
-        if (bCCK == false)
-            cbBitCount ++;
         cbUsCount = (cbBitCount * 10) / 55;
         cbTmp = (cbUsCount * 55) / 10;
         if (cbTmp != cbBitCount)
@@ -770,9 +767,6 @@ void BBvCalculateParameter(struct vnt_private *pDevice, u32 cbFrameLength,
         break;
 
     case RATE_11M :
-
-        if (bCCK == false)
-            cbBitCount ++;
         cbUsCount = cbBitCount / 11;
         cbTmp = cbUsCount * 11;
         if (cbTmp != cbBitCount) {
drivers/staging/vt6656/device.h +0 -1
index 7e7ac80..8248824 100644
@@ -581,7 +581,6 @@ struct vnt_private {
 
 	u32 dwMaxReceiveLifetime;  /* dot11MaxReceiveLifetime */
 
-	int bCCK;
 	int bEncryptionEnable;
 	int bShortSlotTime;
 	int bProtectMode;
drivers/staging/vt6656/main_usb.c +0 -2
index 3832bcb..ea0c9e7 100644
@@ -368,8 +368,6 @@ static int device_init_registers(struct vnt_private *pDevice)
 
 	/* do MACbSoftwareReset in MACvInitialize */
 
-	/* force CCK */
-	pDevice->bCCK = true;
 	pDevice->bProtectMode = false;
 	/* only used in 11g type, sync with ERP IE */
 	pDevice->bNonERPPresent = false;
drivers/staging/vt6656/wmgr.c +0 -1
index 64edc16..d08f290 100644
@@ -2571,7 +2571,6 @@ static void s_vMgrSynchBSS(struct vnt_private *pDevice, u32 uBSSMode,
     }
 
     // Init the BSS informations
-    pDevice->bCCK = true;
     pDevice->bProtectMode = false;
     MACvDisableProtectMD(pDevice);
     pDevice->bBarkerPreambleMd = false;
Signature · 1 line
1.9.1
#16 lore raw

PATCH 17/22 staging: vt6656: Remove unused variable uScanTime.

In reply to Malcolm Priestley
---
 drivers/staging/vt6656/device.h   | 1 -
 drivers/staging/vt6656/main_usb.c | 3 ---
 2 files changed, 4 deletions(-)
drivers/staging/vt6656/device.h +0 -1
index 8248824..eff50c8 100644
@@ -607,7 +607,6 @@ struct vnt_private {
 	int bBeaconSent;
 	int bFixRate;
 	u8 byCurrentCh;
-	u32 uScanTime;
 
 	CMD_STATE eCommandState;
 
drivers/staging/vt6656/main_usb.c +0 -3
index ea0c9e7..c00a16c 100644
@@ -488,9 +488,6 @@ static int device_init_registers(struct vnt_private *pDevice)
 	/* get Auto Fall Back type */
 	pDevice->byAutoFBCtrl = AUTO_FB_0;
 
-	/* set SCAN Time */
-	pDevice->uScanTime = WLAN_SCAN_MINITIME;
-
 	/* default Auto Mode */
 	/* pDevice->NetworkType = Ndis802_11Automode; */
 	pDevice->eConfigPHYMode = PHY_TYPE_AUTO;
Signature · 1 line
1.9.1
#17 lore raw

PATCH 18/22 staging: vt6656: Remove unused variable byACKRate.

In reply to Malcolm Priestley
---
 drivers/staging/vt6656/device.h | 1 -
 drivers/staging/vt6656/rxtx.c   | 2 --
 2 files changed, 3 deletions(-)
drivers/staging/vt6656/device.h +0 -1
index eff50c8..73bce9e 100644
@@ -535,7 +535,6 @@ struct vnt_private {
 	u8 byBBType; /* 0: 11A, 1:11B, 2:11G */
 	u8 byPacketType; /* 0:11a 1:11b 2:11gb 3:11ga */
 	u16 wBasicRate;
-	u8 byACKRate;
 	u8 byTopOFDMBasicRate;
 	u8 byTopCCKBasicRate;
 
drivers/staging/vt6656/rxtx.c +0 -2
index 7287467..4ec79c4 100644
@@ -2341,12 +2341,10 @@ int nsDMA_tx_packet(struct vnt_private *pDevice, struct sk_buff *skb)
 	if (pDevice->sTxEthHeader.h_proto == cpu_to_be16(ETH_P_PAE)) {
 		if (pDevice->byBBType != BB_TYPE_11A) {
 			pDevice->wCurrentRate = RATE_1M;
-			pDevice->byACKRate = RATE_1M;
 			pDevice->byTopCCKBasicRate = RATE_1M;
 			pDevice->byTopOFDMBasicRate = RATE_6M;
 		} else {
 			pDevice->wCurrentRate = RATE_6M;
-			pDevice->byACKRate = RATE_6M;
 			pDevice->byTopCCKBasicRate = RATE_1M;
 			pDevice->byTopOFDMBasicRate = RATE_6M;
 		}
Signature · 1 line
1.9.1
#18 lore raw

PATCH 19/22 staging: vt6656: vnt_private remove dead variables.

In reply to Malcolm Priestley

dwAotoRateTxOkCnt
dwAotoRateTxFailCnt
dwErrorRateThreshold
dwTPTable

---
 drivers/staging/vt6656/device.h | 4 ----
 1 file changed, 4 deletions(-)
drivers/staging/vt6656/device.h +0 -4
index 73bce9e..f3072dd 100644
@@ -538,10 +538,6 @@ struct vnt_private {
 	u8 byTopOFDMBasicRate;
 	u8 byTopCCKBasicRate;
 
-	u32 dwAotoRateTxOkCnt;
-	u32 dwAotoRateTxFailCnt;
-	u32 dwErrorRateThreshold[13];
-	u32 dwTPTable[MAX_RATE];
 	u8 abyEEPROM[EEP_MAX_CONTEXT_SIZE];  /*u32 alignment */
 
 	u8 byMinChannel;
Signature · 1 line
1.9.1
#19 lore raw

PATCH 20/22 staging: vt6656: vnt_private remove dead variables

In reply to Malcolm Priestley

byFOETuning
byAutoPwrTunning

---
 drivers/staging/vt6656/device.h   | 6 ------
 drivers/staging/vt6656/main_usb.c | 2 --
 2 files changed, 8 deletions(-)
drivers/staging/vt6656/device.h +0 -6
index f3072dd..a8637ec 100644
@@ -672,12 +672,6 @@ struct vnt_private {
 
 	int bRadioCmd;
 
-	/* For FOE Tuning */
-	u8  byFOETuning;
-
-	/* For Auto Power Tunning */
-	u8  byAutoPwrTunning;
-
 	/* BaseBand Loopback Use */
 	u8 byBBCR4d;
 	u8 byBBCRc9;
drivers/staging/vt6656/main_usb.c +0 -2
index c00a16c..a9d9cc8 100644
@@ -263,8 +263,6 @@ device_set_options(struct vnt_private *pDevice) {
     pDevice->byPacketType = pDevice->byBBType;
     pDevice->byAutoFBCtrl = AUTO_FB_0;
     pDevice->bUpdateBBVGA = true;
-    pDevice->byFOETuning = 0;
-    pDevice->byAutoPwrTunning = 0;
     pDevice->byPreambleType = 0;
     pDevice->bExistSWNetAddr = false;
     /* pDevice->bDiversityRegCtlON = true; */
Signature · 1 line
1.9.1
#20 lore raw

PATCH 21/22 staging: vt6656: vnt_private remove dead variables.

In reply to Malcolm Priestley

byBBCR4d
byBBCRc9
byBBCR88
byBBCR09

---
 drivers/staging/vt6656/device.h | 6 ------
 1 file changed, 6 deletions(-)
drivers/staging/vt6656/device.h +0 -6
index a8637ec..ee3fb0b 100644
@@ -672,12 +672,6 @@ struct vnt_private {
 
 	int bRadioCmd;
 
-	/* BaseBand Loopback Use */
-	u8 byBBCR4d;
-	u8 byBBCRc9;
-	u8 byBBCR88;
-	u8 byBBCR09;
-
 	/* command timer */
 	struct delayed_work run_command_work;
 	/* One second callback */
Signature · 1 line
1.9.1
#21 lore raw

PATCH 22/22 staging: vt6656: Remove always true bUpdateBBVGA

In reply to Malcolm Priestley

Remove true if statements.

---
 drivers/staging/vt6656/bssdb.c    | 29 ++++++++++++-----------------
 drivers/staging/vt6656/device.h   |  1 -
 drivers/staging/vt6656/main_usb.c |  9 +++------
 drivers/staging/vt6656/wcmd.c     | 17 +++++++----------
 drivers/staging/vt6656/wmgr.c     |  3 +--
 5 files changed, 23 insertions(+), 36 deletions(-)
drivers/staging/vt6656/bssdb.c +12 -17
index 7e8e67a..de60c99 100644
@@ -455,16 +455,14 @@ int BSSbInsertToBSSList(struct vnt_private *pDevice,
 		}
 	}
 
-	if (pDevice->bUpdateBBVGA) {
-		/* Monitor if RSSI is too strong. */
-		pBSSList->byRSSIStatCnt = 0;
-		RFvRSSITodBm(pDevice, (u8) (pRxPacket->uRSSI),
+	/* Monitor if RSSI is too strong. */
+	pBSSList->byRSSIStatCnt = 0;
+	RFvRSSITodBm(pDevice, (u8) (pRxPacket->uRSSI),
 			     &pBSSList->ldBmMAX);
-		pBSSList->ldBmAverage[0] = pBSSList->ldBmMAX;
-		pBSSList->ldBmAverRange = pBSSList->ldBmMAX;
-		for (ii = 1; ii < RSSI_STAT_COUNT; ii++)
-			pBSSList->ldBmAverage[ii] = 0;
-	}
+	pBSSList->ldBmAverage[0] = pBSSList->ldBmMAX;
+	pBSSList->ldBmAverRange = pBSSList->ldBmMAX;
+	for (ii = 1; ii < RSSI_STAT_COUNT; ii++)
+		pBSSList->ldBmAverage[ii] = 0;
 
 	pBSSList->uIELength = uIELength;
 	if (pBSSList->uIELength > WLAN_BEACON_FR_MAXLEN)
@@ -998,10 +996,8 @@ void BSSvSecondCallBack(struct work_struct *work)
 
 		if (pMgmt->sNodeDBTable[0].bActive) { /* Assoc with BSS */
 
-			if (pDevice->bUpdateBBVGA) {
-				s_vCheckSensitivity(pDevice);
-				s_vCheckPreEDThreshold(pDevice);
-			}
+			s_vCheckSensitivity(pDevice);
+			s_vCheckPreEDThreshold(pDevice);
 
 			if (pMgmt->sNodeDBTable[0].uInActiveCount >=
 							(LOST_BEACON_COUNT/2) &&
@@ -1118,10 +1114,9 @@ void BSSvSecondCallBack(struct work_struct *work)
 		}
 		if (pMgmt->eCurrState == WMAC_STATE_JOINTED) {
 
-			if (pDevice->bUpdateBBVGA) {
-				s_vCheckSensitivity(pDevice);
-				s_vCheckPreEDThreshold(pDevice);
-			}
+			s_vCheckSensitivity(pDevice);
+			s_vCheckPreEDThreshold(pDevice);
+
 			if (pMgmt->sNodeDBTable[0].uInActiveCount >=
 						ADHOC_LOST_BEACON_COUNT) {
 				DBG_PRT(MSG_LEVEL_NOTICE,
drivers/staging/vt6656/device.h +0 -1
index ee3fb0b..606ca9f 100644
@@ -660,7 +660,6 @@ struct vnt_private {
 	int bRxMICFail;
 
 	/* For Update BaseBand VGA Gain Offset */
-	int bUpdateBBVGA;
 	u32 uBBVGADiffCount;
 	u8 byBBVGANew;
 	u8 byBBVGACurrent;
drivers/staging/vt6656/main_usb.c +3 -6
index a9d9cc8..3a576fa 100644
@@ -262,7 +262,6 @@ device_set_options(struct vnt_private *pDevice) {
     pDevice->byBBType = BBP_TYPE_DEF;
     pDevice->byPacketType = pDevice->byBBType;
     pDevice->byAutoFBCtrl = AUTO_FB_0;
-    pDevice->bUpdateBBVGA = true;
     pDevice->byPreambleType = 0;
     pDevice->bExistSWNetAddr = false;
     /* pDevice->bDiversityRegCtlON = true; */
@@ -566,12 +565,10 @@ static int device_init_registers(struct vnt_private *pDevice)
 	BBvSetShortSlotTime(pDevice);
 	CARDvSetBSSMode(pDevice);
 
-	if (pDevice->bUpdateBBVGA) {
-		pDevice->byBBVGACurrent = pDevice->abyBBVGA[0];
-		pDevice->byBBVGANew = pDevice->byBBVGACurrent;
+	pDevice->byBBVGACurrent = pDevice->abyBBVGA[0];
+	pDevice->byBBVGANew = pDevice->byBBVGACurrent;
 
-		BBvSetVGAGainOffset(pDevice, pDevice->abyBBVGA[0]);
-	}
+	BBvSetVGAGainOffset(pDevice, pDevice->abyBBVGA[0]);
 
 	pDevice->byRadioCtl = pDevice->abyEEPROM[EEP_OFS_RADIOCTL];
 	pDevice->bHWRadioOff = false;
drivers/staging/vt6656/wcmd.c +7 -10
index 8fecb34..b742460 100644
@@ -344,11 +344,10 @@ void vRunCommand(struct work_struct *work)
 			CARDbSetMediaChannel(pDevice, pMgmt->uScanChannel);
 			// Set Baseband to be more sensitive.
 
-			if (pDevice->bUpdateBBVGA) {
-				BBvSetShortSlotTime(pDevice);
-				BBvSetVGAGainOffset(pDevice, pDevice->abyBBVGA[0]);
-				BBvUpdatePreEDThreshold(pDevice, true);
-			}
+			BBvSetShortSlotTime(pDevice);
+			BBvSetVGAGainOffset(pDevice, pDevice->abyBBVGA[0]);
+			BBvUpdatePreEDThreshold(pDevice, true);
+
 			pMgmt->uScanChannel++;
 
 			while (!ChannelValid(pDevice->byZoneType, pMgmt->uScanChannel) &&
@@ -381,11 +380,9 @@ void vRunCommand(struct work_struct *work)
 			CARDvSetBSSMode(pDevice);
 		}
 
-		if (pDevice->bUpdateBBVGA) {
-			BBvSetShortSlotTime(pDevice);
-			BBvSetVGAGainOffset(pDevice, pDevice->byBBVGACurrent);
-			BBvUpdatePreEDThreshold(pDevice, false);
-		}
+		BBvSetShortSlotTime(pDevice);
+		BBvSetVGAGainOffset(pDevice, pDevice->byBBVGACurrent);
+		BBvUpdatePreEDThreshold(pDevice, false);
 
 		// Set channel back
 		vAdHocBeaconRestart(pDevice);
drivers/staging/vt6656/wmgr.c +1 -2
index d08f290..e6eec7f 100644
@@ -2653,8 +2653,7 @@ static void s_vMgrSynchBSS(struct vnt_private *pDevice, u32 uBSSMode,
     pMgmt->uCurrChannel = pCurr->uChannel;
     DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "<----s_bSynchBSS Set Channel [%d]\n", pCurr->uChannel);
 
-    if ((pDevice->bUpdateBBVGA) &&
-        (pDevice->byBBVGACurrent != pDevice->abyBBVGA[0])) {
+    if (pDevice->byBBVGACurrent != pDevice->abyBBVGA[0]) {
         pDevice->byBBVGACurrent = pDevice->abyBBVGA[0];
         BBvSetVGAGainOffset(pDevice, pDevice->byBBVGACurrent);
         BBvSetShortSlotTime(pDevice);
Signature · 1 line
1.9.1