Change pdwKey u32 pointer to key u8 pointer.
Callers are already u8 remove u32 pointer cast.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/key.c | 15 +++++++++++----
drivers/staging/vt6656/mac.c | 5 ++---
drivers/staging/vt6656/mac.h | 2 +-
3 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/vt6656/key.c b/drivers/staging/vt6656/key.c
index a88c6b18..9283612 100644
--- a/drivers/staging/vt6656/key.c
+++ b/drivers/staging/vt6656/key.c
@@ -247,7 +247,9 @@ int KeybSetKey(struct vnt_private *pDevice, PSKeyManagement pTable,
if (uKeyLength == WLAN_WEP104_KEYLEN)
pKey->abyKey[15] |= 0x80;
}
- MACvSetKeyEntry(pDevice, pTable->KeyTable[i].wKeyCtl, i, uKeyIdx, pbyBSSID, (u32 *)pKey->abyKey);
+
+ MACvSetKeyEntry(pDevice, pTable->KeyTable[i].wKeyCtl, i, uKeyIdx,
+ pbyBSSID, pKey->abyKey);
if ((dwKeyIndex & USE_KEYRSC) == 0)
pKey->KeyRSC = 0; /* RSC set by NIC */
@@ -315,7 +317,9 @@ int KeybSetKey(struct vnt_private *pDevice, PSKeyManagement pTable,
if (uKeyLength == WLAN_WEP104_KEYLEN)
pKey->abyKey[15] |= 0x80;
}
- MACvSetKeyEntry(pDevice, pTable->KeyTable[j].wKeyCtl, j, uKeyIdx, pbyBSSID, (u32 *)pKey->abyKey);
+
+ MACvSetKeyEntry(pDevice, pTable->KeyTable[j].wKeyCtl, j, uKeyIdx,
+ pbyBSSID, pKey->abyKey);
if ((dwKeyIndex & USE_KEYRSC) == 0)
pKey->KeyRSC = 0; /* RSC set by NIC */
@@ -610,7 +614,9 @@ int KeybSetDefaultKey(struct vnt_private *pDevice, PSKeyManagement pTable,
pKey->abyKey[15] |= 0x80;
}
- MACvSetKeyEntry(pDevice, pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl, MAX_KEY_TABLE-1, uKeyIdx, pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID, (u32 *) pKey->abyKey);
+ MACvSetKeyEntry(pDevice, pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl,
+ MAX_KEY_TABLE-1, uKeyIdx,
+ pTable->KeyTable[MAX_KEY_TABLE-1].abyBSSID, pKey->abyKey);
if ((dwKeyIndex & USE_KEYRSC) == 0)
pKey->KeyRSC = 0; /* RSC set by NIC */
@@ -704,7 +710,8 @@ int KeybSetAllGroupKey(struct vnt_private *pDevice, PSKeyManagement pTable,
pKey->abyKey[15] |= 0x80;
}
- MACvSetKeyEntry(pDevice, pTable->KeyTable[i].wKeyCtl, i, uKeyIdx, pTable->KeyTable[i].abyBSSID, (u32 *) pKey->abyKey);
+ MACvSetKeyEntry(pDevice, pTable->KeyTable[i].wKeyCtl, i, uKeyIdx,
+ pTable->KeyTable[i].abyBSSID, pKey->abyKey);
if ((dwKeyIndex & USE_KEYRSC) == 0)
pKey->KeyRSC = 0; /* RSC set by NIC */
diff --git a/drivers/staging/vt6656/mac.c b/drivers/staging/vt6656/mac.c
index bc72144..a030c59 100644
--- a/drivers/staging/vt6656/mac.c
+++ b/drivers/staging/vt6656/mac.c
@@ -123,10 +123,9 @@ void MACvDisableKeyEntry(struct vnt_private *priv, u8 entry_idx)
*
*/
void MACvSetKeyEntry(struct vnt_private *pDevice, u16 wKeyCtl, u32 uEntryIdx,
- u32 uKeyIdx, u8 *pbyAddr, u32 *pdwKey)
+ u32 uKeyIdx, u8 *pbyAddr, u8 *key)
{
struct vnt_mac_set_key set_key;
- u8 *pbyKey = (u8 *)pdwKey;
u16 wOffset;
if (pDevice->byLocalID <= MAC_REVISION_A1)
@@ -142,7 +141,7 @@ void MACvSetKeyEntry(struct vnt_private *pDevice, u16 wKeyCtl, u32 uEntryIdx,
/* swap over swap[0] and swap[1] to get correct write order */
swap(set_key.u.swap[0], set_key.u.swap[1]);
- memcpy(set_key.key, pbyKey, WLAN_KEY_LEN_CCMP);
+ memcpy(set_key.key, key, WLAN_KEY_LEN_CCMP);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"offset %d key ctl %d set key %24ph\n",
diff --git a/drivers/staging/vt6656/mac.h b/drivers/staging/vt6656/mac.h
index 8100685..6e45d47 100644
--- a/drivers/staging/vt6656/mac.h
+++ b/drivers/staging/vt6656/mac.h
@@ -418,7 +418,7 @@ void MACvWriteMultiAddr(struct vnt_private *, u64);
void MACbShutdown(struct vnt_private *);
void MACvSetBBType(struct vnt_private *, u8);
void MACvDisableKeyEntry(struct vnt_private *, u8);
-void MACvSetKeyEntry(struct vnt_private *, u16, u32, u32, u8 *, u32 *);
+void MACvSetKeyEntry(struct vnt_private *, u16, u32, u32, u8 *, u8 *);
void MACvRegBitsOff(struct vnt_private *, u8, u8);
void MACvRegBitsOn(struct vnt_private *, u8, u8);
void MACvWriteWord(struct vnt_private *, u8, u16);
--
1.9.1
Create vnt_mac_set_led to set state and led.
state has two modes LEDSTS_TMLEN which sets the blink rate
on TX activity and LEDSTS_STS which sets the led.
As result of this patch ControlvMaskByte becomes dead code.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/bssdb.c | 14 ++++++--------
drivers/staging/vt6656/iwctl.c | 4 +---
drivers/staging/vt6656/mac.c | 13 +++++++++++++
drivers/staging/vt6656/mac.h | 1 +
drivers/staging/vt6656/main_usb.c | 6 ++----
drivers/staging/vt6656/wcmd.c | 30 +++++++++++++++++++++---------
drivers/staging/vt6656/wmgr.c | 14 ++++++++++----
7 files changed, 54 insertions(+), 28 deletions(-)
diff --git a/drivers/staging/vt6656/bssdb.c b/drivers/staging/vt6656/bssdb.c
index 5f631c8..12b6436 100644
--- a/drivers/staging/vt6656/bssdb.c
+++ b/drivers/staging/vt6656/bssdb.c
@@ -1015,10 +1015,10 @@ void BSSvSecondCallBack(struct work_struct *work)
pMgmt->eCurrState = WMAC_STATE_IDLE;
netif_stop_queue(pDevice->dev);
pDevice->bLinkPass = false;
- ControlvMaskByte(pDevice,
- MESSAGE_REQUEST_MACREG,
- MAC_REG_PAPEDELAY, LEDSTS_STS,
- LEDSTS_SLOW);
+
+ vnt_mac_set_led(pDevice, LEDSTS_STS,
+ LEDSTS_SLOW);
+
pDevice->bRoaming = true;
pDevice->bIsRoaming = false;
@@ -1126,10 +1126,8 @@ void BSSvSecondCallBack(struct work_struct *work)
pMgmt->eCurrState = WMAC_STATE_STARTED;
netif_stop_queue(pDevice->dev);
pDevice->bLinkPass = false;
- ControlvMaskByte(pDevice,
- MESSAGE_REQUEST_MACREG,
- MAC_REG_PAPEDELAY, LEDSTS_STS,
- LEDSTS_SLOW);
+ vnt_mac_set_led(pDevice, LEDSTS_STS,
+ LEDSTS_SLOW);
}
}
}
diff --git a/drivers/staging/vt6656/iwctl.c b/drivers/staging/vt6656/iwctl.c
index e7b7ca5..0a8e438 100644
--- a/drivers/staging/vt6656/iwctl.c
+++ b/drivers/staging/vt6656/iwctl.c
@@ -442,9 +442,7 @@ int iwctl_siwmode(struct net_device *dev, struct iw_request_info *info,
memset(pMgmt->abyCurrBSSID, 0, 6);
}
- ControlvMaskByte(pDevice,
- MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY,
- LEDSTS_STS, LEDSTS_SLOW);
+ vnt_mac_set_led(pDevice, LEDSTS_STS, LEDSTS_SLOW);
netif_stop_queue(pDevice->dev);
diff --git a/drivers/staging/vt6656/mac.c b/drivers/staging/vt6656/mac.c
index 51e4a355..fdb244f 100644
--- a/drivers/staging/vt6656/mac.c
+++ b/drivers/staging/vt6656/mac.c
@@ -240,3 +240,16 @@ void MACvWriteBeaconInterval(struct vnt_private *priv, u16 interval)
vnt_control_out(priv, MESSAGE_TYPE_WRITE,
MAC_REG_BI, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data);
}
+
+void vnt_mac_set_led(struct vnt_private *priv, u8 state, u8 led)
+{
+ u8 data[2];
+
+ data[0] = led;
+ data[1] = state;
+
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_PAPEDELAY,
+ MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data);
+
+ return;
+}
diff --git a/drivers/staging/vt6656/mac.h b/drivers/staging/vt6656/mac.h
index 6e45d47..986ca95 100644
--- a/drivers/staging/vt6656/mac.h
+++ b/drivers/staging/vt6656/mac.h
@@ -428,5 +428,6 @@ void MACvDisableProtectMD(struct vnt_private *);
void MACvEnableBarkerPreambleMd(struct vnt_private *);
void MACvDisableBarkerPreambleMd(struct vnt_private *);
void MACvWriteBeaconInterval(struct vnt_private *, u16);
+void vnt_mac_set_led(struct vnt_private *priv, u8, u8);
#endif /* __MAC_H__ */
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 6cc056d..df206e6 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -551,11 +551,9 @@ static int device_init_registers(struct vnt_private *pDevice)
}
- ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG,
- MAC_REG_PAPEDELAY, LEDSTS_TMLEN, 0x38);
+ vnt_mac_set_led(pDevice, LEDSTS_TMLEN, 0x38);
- ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG,
- MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_SLOW);
+ vnt_mac_set_led(pDevice, LEDSTS_STS, LEDSTS_SLOW);
MACvRegBitsOn(pDevice, MAC_REG_GPIOCTL0, 0x01);
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index aae573b..79f7463 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -426,7 +426,9 @@ void vRunCommand(struct work_struct *work)
(8),
&Status);
pDevice->bLinkPass = false;
- ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_SLOW);
+
+ vnt_mac_set_led(pDevice, LEDSTS_STS, LEDSTS_SLOW);
+
// unlock command busy
pItemSSID = (PWLAN_IE_SSID)pMgmt->abyCurrSSID;
pItemSSID->len = 0;
@@ -472,7 +474,8 @@ void vRunCommand(struct work_struct *work)
}
netif_stop_queue(pDevice->dev);
pDevice->bLinkPass = false;
- ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_SLOW);
+
+ vnt_mac_set_led(pDevice, LEDSTS_STS, LEDSTS_SLOW);
}
// set initial state
pMgmt->eCurrState = WMAC_STATE_IDLE;
@@ -507,7 +510,9 @@ void vRunCommand(struct work_struct *work)
if (netif_queue_stopped(pDevice->dev))
netif_wake_queue(pDevice->dev);
pDevice->bLinkPass = true;
- ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
+
+ vnt_mac_set_led(pDevice, LEDSTS_STS, LEDSTS_INTER);
+
pMgmt->sNodeDBTable[0].bActive = true;
pMgmt->sNodeDBTable[0].uInActiveCount = 0;
} else {
@@ -538,7 +543,6 @@ void vRunCommand(struct work_struct *work)
s_bClearBSSID_SCAN(pDevice);
/*
pDevice->bLinkPass = true;
- ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_INTER);
if (netif_queue_stopped(pDevice->dev)){
netif_wake_queue(pDevice->dev);
}
@@ -600,7 +604,9 @@ void vRunCommand(struct work_struct *work)
pDevice->byLinkWaitCount = 0;
pDevice->byReAssocCount = 0;
pDevice->bLinkPass = true;
- ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
+
+ vnt_mac_set_led(pDevice, LEDSTS_STS, LEDSTS_INTER);
+
s_bClearBSSID_SCAN(pDevice);
if (netif_queue_stopped(pDevice->dev))
@@ -626,7 +632,8 @@ void vRunCommand(struct work_struct *work)
pMgmt->eCurrState = WMAC_STATE_IDLE;
pMgmt->eCurrMode = WMAC_MODE_STANDBY;
pDevice->bLinkPass = false;
- ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_SLOW);
+
+ vnt_mac_set_led(pDevice, LEDSTS_STS, LEDSTS_SLOW);
BSSvClearNodeDBTable(pDevice, 0);
@@ -647,7 +654,9 @@ void vRunCommand(struct work_struct *work)
if (netif_queue_stopped(pDevice->dev))
netif_wake_queue(pDevice->dev);
pDevice->bLinkPass = true;
- ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_INTER);
+
+ vnt_mac_set_led(pDevice, LEDSTS_STS, LEDSTS_INTER);
+
schedule_delayed_work(&pDevice->second_callback_work, HZ);
}
break;
@@ -791,14 +800,17 @@ void vRunCommand(struct work_struct *work)
netif_stop_queue(pDevice->dev);
CARDbRadioPowerOff(pDevice);
MACvRegBitsOn(pDevice, MAC_REG_GPIOCTL1, GPIO3_INTMD);
- ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_OFF);
+
+ vnt_mac_set_led(pDevice, LEDSTS_STS, LEDSTS_OFF);
+
pDevice->bHWRadioOff = true;
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" WLAN_CMD_RADIO_START_ON........................\n");
pDevice->bHWRadioOff = false;
CARDbRadioPowerOn(pDevice);
MACvRegBitsOff(pDevice, MAC_REG_GPIOCTL1, GPIO3_INTMD);
- ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_ON);
+
+ vnt_mac_set_led(pDevice, LEDSTS_STS, LEDSTS_ON);
}
}
diff --git a/drivers/staging/vt6656/wmgr.c b/drivers/staging/vt6656/wmgr.c
index 4f46aa6..8cb80a6 100644
--- a/drivers/staging/vt6656/wmgr.c
+++ b/drivers/staging/vt6656/wmgr.c
@@ -756,7 +756,8 @@ static void s_vMgrRxAssocResponse(struct vnt_private *pDevice,
pItemSSID = (PWLAN_IE_SSID)pMgmt->abyCurrSSID;
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "Link with AP(SSID): %s\n", pItemSSID->abySSID);
pDevice->bLinkPass = true;
- ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_INTER);
+
+ vnt_mac_set_led(pDevice, LEDSTS_STS, LEDSTS_INTER);
//if(pDevice->bWPASuppWextEnabled == true)
{
@@ -1398,7 +1399,8 @@ static void s_vMgrRxDeauthentication(struct vnt_private *pDevice,
pMgmt->eCurrState = WMAC_STATE_IDLE;
netif_stop_queue(pDevice->dev);
pDevice->bLinkPass = false;
- ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_SLOW);
+
+ vnt_mac_set_led(pDevice, LEDSTS_STS, LEDSTS_SLOW);
}
}
@@ -1883,7 +1885,9 @@ if(ChannelExceedZoneType(pDevice,byCurrChannel)==true)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Current IBSS State: [Started]........to: [Jointed] \n");
pMgmt->eCurrState = WMAC_STATE_JOINTED;
pDevice->bLinkPass = true;
- ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_INTER);
+
+ vnt_mac_set_led(pDevice, LEDSTS_STS, LEDSTS_INTER);
+
if (netif_queue_stopped(pDevice->dev)){
netif_wake_queue(pDevice->dev);
}
@@ -2488,7 +2492,9 @@ void vMgrJoinBSSBegin(struct vnt_private *pDevice, PCMD_STATUS pStatus)
// Adopt BSS state in Adapter Device Object
pDevice->op_mode = NL80211_IFTYPE_ADHOC;
pDevice->bLinkPass = true;
- ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_INTER);
+
+ vnt_mac_set_led(pDevice, LEDSTS_STS, LEDSTS_INTER);
+
memcpy(pDevice->abyBSSID, pCurr->abyBSSID, WLAN_BSSID_LEN);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Join IBSS ok:%pM\n",
--
1.9.1
Rename all CONTROLnsRequestOut and remove macro from control.h
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/baseband.c | 8 ++++----
drivers/staging/vt6656/card.c | 14 +++++++-------
drivers/staging/vt6656/control.c | 6 +++---
drivers/staging/vt6656/control.h | 3 ---
drivers/staging/vt6656/firmware.c | 4 ++--
drivers/staging/vt6656/key.c | 23 +++++++----------------
drivers/staging/vt6656/mac.c | 28 ++++++++++++++--------------
drivers/staging/vt6656/main_usb.c | 2 +-
drivers/staging/vt6656/power.c | 2 +-
drivers/staging/vt6656/rf.c | 12 ++++++------
drivers/staging/vt6656/usbpipe.c | 4 ++--
drivers/staging/vt6656/usbpipe.h | 3 +--
drivers/staging/vt6656/wcmd.c | 2 +-
13 files changed, 49 insertions(+), 62 deletions(-)
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index 309a3cb..8a509d8 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -865,7 +865,7 @@ void BBvSetAntennaMode(struct vnt_private *priv, u8 antenna_mode)
break;
}
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_SET_ANTMD,
+ vnt_control_out(priv, MESSAGE_TYPE_SET_ANTMD,
(u16)antenna_mode, 0, 0, NULL);
}
@@ -1018,12 +1018,12 @@ int BBbVT3184Init(struct vnt_private *priv)
memcpy(array, addr, length);
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE, 0,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0,
MESSAGE_REQUEST_BBREG, length, array);
memcpy(array, agc, length_agc);
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE, 0,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0,
MESSAGE_REQUEST_BBAGC, length_agc, array);
if ((priv->byRFType == RF_VT3226) ||
@@ -1049,7 +1049,7 @@ int BBbVT3184Init(struct vnt_private *priv)
data |= 0x2;
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE, USB_REG4,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE, USB_REG4,
MESSAGE_REQUEST_MEM, sizeof(data), &data);
return true;
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 6da912b..1f20e9a 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -94,7 +94,7 @@ void CARDbSetMediaChannel(struct vnt_private *priv, u32 connection_channel)
/* Set Channel[7] = 0 to tell H/W channel is changing now. */
MACvRegBitsOff(priv, MAC_REG_CHANNEL, 0xb0);
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_SELECT_CHANNLE,
+ vnt_control_out(priv, MESSAGE_TYPE_SELECT_CHANNLE,
connection_channel, 0, 0, NULL);
if (priv->byBBType == BB_TYPE_11A) {
@@ -373,7 +373,7 @@ void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type)
data[16 + i * 2 + 1] = rsv_time[i];
}
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE,
MAC_REG_RSPINF_B_1, MESSAGE_REQUEST_MACREG, 34, &data[0]);
}
@@ -461,12 +461,12 @@ void vUpdateIFS(struct vnt_private *priv)
data[2] = (u8)priv->uEIFS;
data[3] = (u8)priv->uSlot;
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE, MAC_REG_SIFS,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE, MAC_REG_SIFS,
MESSAGE_REQUEST_MACREG, 4, &data[0]);
max_min |= 0xa0;
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE, MAC_REG_CWMAXMIN0,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE, MAC_REG_CWMAXMIN0,
MESSAGE_REQUEST_MACREG, 1, &max_min);
}
@@ -603,7 +603,7 @@ void CARDvAdjustTSF(struct vnt_private *priv, u8 rx_rate,
data[6] = (u8)(tsf_offset >> 48);
data[7] = (u8)(tsf_offset >> 56);
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_SET_TSFTBTT,
+ vnt_control_out(priv, MESSAGE_TYPE_SET_TSFTBTT,
MESSAGE_REQUEST_TSF, 0, 8, data);
}
/*
@@ -712,7 +712,7 @@ void CARDvSetFirstNextTBTT(struct vnt_private *priv, u16 beacon_interval)
data[6] = (u8)(next_tbtt >> 48);
data[7] = (u8)(next_tbtt >> 56);
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_SET_TSFTBTT,
+ vnt_control_out(priv, MESSAGE_TYPE_SET_TSFTBTT,
MESSAGE_REQUEST_TBTT, 0, 8, data);
return;
@@ -749,7 +749,7 @@ void CARDvUpdateNextTBTT(struct vnt_private *priv, u64 tsf,
data[6] = (u8)(tsf >> 48);
data[7] = (u8)(tsf >> 56);
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_SET_TSFTBTT,
+ vnt_control_out(priv, MESSAGE_TYPE_SET_TSFTBTT,
MESSAGE_REQUEST_TBTT, 0, 8, data);
dev_dbg(&priv->usb->dev, "%s TBTT: %8llx\n", __func__, tsf);
diff --git a/drivers/staging/vt6656/control.c b/drivers/staging/vt6656/control.c
index fc19166..0740521 100644
--- a/drivers/staging/vt6656/control.c
+++ b/drivers/staging/vt6656/control.c
@@ -26,7 +26,7 @@
* Date: Apr. 5, 2004
*
* Functions:
- * CONTROLnsRequestOut - Write variable length bytes to MEM/BB/MAC/EEPROM
+ * vnt_control_out - Write variable length bytes to MEM/BB/MAC/EEPROM
* CONTROLnsRequestIn - Read variable length bytes from MEM/BB/MAC/EEPROM
* ControlvWriteByte - Write one byte to MEM/BB/MAC/EEPROM
* ControlvReadByte - Read one byte from MEM/BB/MAC/EEPROM
@@ -49,7 +49,7 @@ void ControlvWriteByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
u8 data)
{
- CONTROLnsRequestOut(pDevice, MESSAGE_TYPE_WRITE, reg_off, reg,
+ vnt_control_out(pDevice, MESSAGE_TYPE_WRITE, reg_off, reg,
sizeof(u8), &data);
return;
@@ -71,7 +71,7 @@ void ControlvMaskByte(struct vnt_private *pDevice, u8 reg_type, u8 reg_off,
reg_data[0] = data;
reg_data[1] = reg_mask;
- CONTROLnsRequestOut(pDevice, MESSAGE_TYPE_WRITE_MASK, reg_off,
+ vnt_control_out(pDevice, MESSAGE_TYPE_WRITE_MASK, reg_off,
reg_type, ARRAY_SIZE(reg_data), reg_data);
return;
diff --git a/drivers/staging/vt6656/control.h b/drivers/staging/vt6656/control.h
index 4658910..17a23d5 100644
--- a/drivers/staging/vt6656/control.h
+++ b/drivers/staging/vt6656/control.h
@@ -33,9 +33,6 @@
#include "device.h"
#include "usbpipe.h"
-#define CONTROLnsRequestOut(Device, Request, Value, Index, Length, Buffer) \
- PIPEnsControlOut(Device, Request, Value, Index, Length, Buffer)
-
#define CONTROLnsRequestIn(Device, Request, Value, Index, Length, Buffer) \
PIPEnsControlIn(Device, Request, Value, Index, Length, Buffer)
diff --git a/drivers/staging/vt6656/firmware.c b/drivers/staging/vt6656/firmware.c
index 1d3d268..13b68d5 100644
--- a/drivers/staging/vt6656/firmware.c
+++ b/drivers/staging/vt6656/firmware.c
@@ -70,7 +70,7 @@ int FIRMWAREbDownload(struct vnt_private *pDevice)
wLength = min_t(int, fw->size - ii, FIRMWARE_CHUNK_SIZE);
memcpy(pBuffer, fw->data + ii, wLength);
- NdisStatus = CONTROLnsRequestOut(pDevice,
+ NdisStatus = vnt_control_out(pDevice,
0,
0x1200+ii,
0x0000,
@@ -100,7 +100,7 @@ int FIRMWAREbBrach2Sram(struct vnt_private *pDevice)
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Branch to Sram\n");
- NdisStatus = CONTROLnsRequestOut(pDevice,
+ NdisStatus = vnt_control_out(pDevice,
1,
0x1200,
0x0000,
diff --git a/drivers/staging/vt6656/key.c b/drivers/staging/vt6656/key.c
index 9283612..11aa82a 100644
--- a/drivers/staging/vt6656/key.c
+++ b/drivers/staging/vt6656/key.c
@@ -67,15 +67,10 @@ static void s_vCheckKeyTableValid(struct vnt_private *pDevice,
//MACvDisableKeyEntry(pDevice, i);
}
}
- if ( wLength != 0 ) {
- CONTROLnsRequestOut(pDevice,
- MESSAGE_TYPE_CLRKEYENTRY,
- 0,
- 0,
- wLength,
- pbyData
- );
- }
+
+ if (wLength != 0)
+ vnt_control_out(pDevice, MESSAGE_TYPE_CLRKEYENTRY,
+ 0, 0, wLength, pbyData);
}
@@ -112,13 +107,9 @@ void KeyvInitTable(struct vnt_private *pDevice, PSKeyManagement pTable)
pbyData[i] = (u8) i;
}
pbyData[i] = (u8) i;
- CONTROLnsRequestOut(pDevice,
- MESSAGE_TYPE_CLRKEYENTRY,
- 0,
- 0,
- 11,
- pbyData
- );
+
+ vnt_control_out(pDevice, MESSAGE_TYPE_CLRKEYENTRY,
+ 0, 0, 11, pbyData);
return;
}
diff --git a/drivers/staging/vt6656/mac.c b/drivers/staging/vt6656/mac.c
index 9211ec1..51e4a355 100644
--- a/drivers/staging/vt6656/mac.c
+++ b/drivers/staging/vt6656/mac.c
@@ -54,7 +54,7 @@ void MACvWriteMultiAddr(struct vnt_private *priv, u64 mc_filter)
{
__le64 le_mc = cpu_to_le64(mc_filter);
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE, MAC_REG_MAR0,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE, MAC_REG_MAR0,
MESSAGE_REQUEST_MACREG, sizeof(le_mc), (u8 *)&le_mc);
}
@@ -71,7 +71,7 @@ void MACvWriteMultiAddr(struct vnt_private *priv, u64 mc_filter)
*/
void MACbShutdown(struct vnt_private *priv)
{
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_MACSHUTDOWN, 0, 0, 0, NULL);
+ vnt_control_out(priv, MESSAGE_TYPE_MACSHUTDOWN, 0, 0, 0, NULL);
}
void MACvSetBBType(struct vnt_private *priv, u8 type)
@@ -81,7 +81,7 @@ void MACvSetBBType(struct vnt_private *priv, u8 type)
data[0] = type;
data[1] = EnCFG_BBType_MASK;
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG0,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK, MAC_REG_ENCFG0,
MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data);
}
@@ -101,7 +101,7 @@ void MACvSetBBType(struct vnt_private *priv, u8 type)
*/
void MACvDisableKeyEntry(struct vnt_private *priv, u8 entry_idx)
{
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_CLRKEYENTRY, 0, 0,
+ vnt_control_out(priv, MESSAGE_TYPE_CLRKEYENTRY, 0, 0,
sizeof(entry_idx), &entry_idx);
}
@@ -143,7 +143,7 @@ void MACvSetKeyEntry(struct vnt_private *priv, u16 key_ctl, u32 entry_idx,
dev_dbg(&priv->usb->dev, "offset %d key ctl %d set key %24ph\n",
offset, key_ctl, (u8 *)&set_key);
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_SETKEY, offset,
+ vnt_control_out(priv, MESSAGE_TYPE_SETKEY, offset,
(u16)key_idx, sizeof(struct vnt_mac_set_key), (u8 *)&set_key);
}
@@ -154,7 +154,7 @@ void MACvRegBitsOff(struct vnt_private *priv, u8 reg_ofs, u8 bits)
data[0] = 0;
data[1] = bits;
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE_MASK,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK,
reg_ofs, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data);
}
@@ -165,7 +165,7 @@ void MACvRegBitsOn(struct vnt_private *priv, u8 reg_ofs, u8 bits)
data[0] = bits;
data[1] = bits;
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE_MASK,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK,
reg_ofs, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data);
}
@@ -176,13 +176,13 @@ void MACvWriteWord(struct vnt_private *priv, u8 reg_ofs, u16 word)
data[0] = (u8)(word & 0xff);
data[1] = (u8)(word >> 8);
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE,
reg_ofs, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data);
}
void MACvWriteBSSIDAddress(struct vnt_private *priv, u8 *addr)
{
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE, MAC_REG_BSSID0,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE, MAC_REG_BSSID0,
MESSAGE_REQUEST_MACREG, ETH_ALEN, addr);
}
@@ -193,7 +193,7 @@ void MACvEnableProtectMD(struct vnt_private *priv)
data[0] = EnCFG_ProtectMd;
data[1] = EnCFG_ProtectMd;
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE_MASK,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK,
MAC_REG_ENCFG0, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data);
}
@@ -204,7 +204,7 @@ void MACvDisableProtectMD(struct vnt_private *priv)
data[0] = 0;
data[1] = EnCFG_ProtectMd;
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE_MASK,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK,
MAC_REG_ENCFG0, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data);
}
@@ -215,7 +215,7 @@ void MACvEnableBarkerPreambleMd(struct vnt_private *priv)
data[0] = EnCFG_BarkerPream;
data[1] = EnCFG_BarkerPream;
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE_MASK,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK,
MAC_REG_ENCFG2, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data);
}
@@ -226,7 +226,7 @@ void MACvDisableBarkerPreambleMd(struct vnt_private *priv)
data[0] = 0;
data[1] = EnCFG_BarkerPream;
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE_MASK,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE_MASK,
MAC_REG_ENCFG2, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data);
}
@@ -237,6 +237,6 @@ void MACvWriteBeaconInterval(struct vnt_private *priv, u16 interval)
data[0] = (u8)(interval & 0xff);
data[1] = (u8)(interval >> 8);
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE,
MAC_REG_BI, MESSAGE_REQUEST_MACREG, ARRAY_SIZE(data), data);
}
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index ed04804..9e70aa5 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -314,7 +314,7 @@ static int device_init_registers(struct vnt_private *pDevice)
init_cmd->long_retry_limit = pDevice->byLongRetryLimit;
/* issue card_init command to device */
- ntStatus = CONTROLnsRequestOut(pDevice,
+ ntStatus = vnt_control_out(pDevice,
MESSAGE_TYPE_CARDINIT, 0, 0,
sizeof(struct vnt_cmd_card_init), (u8 *)init_cmd);
if (ntStatus != STATUS_SUCCESS) {
diff --git a/drivers/staging/vt6656/power.c b/drivers/staging/vt6656/power.c
index c4bea74..a5cea43 100644
--- a/drivers/staging/vt6656/power.c
+++ b/drivers/staging/vt6656/power.c
@@ -129,7 +129,7 @@ void PSvDisablePowerSaving(struct vnt_private *pDevice)
{
/* disable power saving hw function */
- CONTROLnsRequestOut(pDevice, MESSAGE_TYPE_DISABLE_PS, 0,
+ vnt_control_out(pDevice, MESSAGE_TYPE_DISABLE_PS, 0,
0, 0, NULL);
/* clear AutoSleep */
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index 7217f2c..58ea16c 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -715,7 +715,7 @@ int IFRFbWriteEmbedded(struct vnt_private *pDevice, u32 dwData)
pbyData[2] = (u8)(dwData >> 16);
pbyData[3] = (u8)(dwData >> 24);
- CONTROLnsRequestOut(pDevice,
+ vnt_control_out(pDevice,
MESSAGE_TYPE_WRITE_IFRF, 0, 0, 4, pbyData);
return true;
@@ -1046,7 +1046,7 @@ void RFbRFTableDownload(struct vnt_private *priv)
/* Init Table */
memcpy(array, addr1, length1);
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE, 0,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0,
MESSAGE_REQUEST_RF_INIT, length1, array);
/* Channel Table 0 */
@@ -1059,7 +1059,7 @@ void RFbRFTableDownload(struct vnt_private *priv)
memcpy(array, addr2, length);
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE,
value, MESSAGE_REQUEST_RF_CH0, length, array);
length2 -= length;
@@ -1077,7 +1077,7 @@ void RFbRFTableDownload(struct vnt_private *priv)
memcpy(array, addr3, length);
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE,
value, MESSAGE_REQUEST_RF_CH1, length, array);
length3 -= length;
@@ -1094,7 +1094,7 @@ void RFbRFTableDownload(struct vnt_private *priv)
memcpy(array, addr1, length1);
/* Init Table 2 */
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE,
0, MESSAGE_REQUEST_RF_INIT2, length1, array);
/* Channel Table 0 */
@@ -1107,7 +1107,7 @@ void RFbRFTableDownload(struct vnt_private *priv)
memcpy(array, addr2, length);
- CONTROLnsRequestOut(priv, MESSAGE_TYPE_WRITE,
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE,
value, MESSAGE_REQUEST_RF_CH2, length, array);
length2 -= length;
diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c
index 2dfa16e..443338e 100644
--- a/drivers/staging/vt6656/usbpipe.c
+++ b/drivers/staging/vt6656/usbpipe.c
@@ -26,7 +26,7 @@
* Date: Mar. 29, 2005
*
* Functions:
- * CONTROLnsRequestOut - Write variable length bytes to MEM/BB/MAC/EEPROM
+ * vnt_control_out - Write variable length bytes to MEM/BB/MAC/EEPROM
* CONTROLnsRequestIn - Read variable length bytes from MEM/BB/MAC/EEPROM
* ControlvWriteByte - Write one byte to MEM/BB/MAC/EEPROM
* ControlvReadByte - Read one byte from MEM/BB/MAC/EEPROM
@@ -61,7 +61,7 @@ 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 *priv, u8 request, u16 value,
+int vnt_control_out(struct vnt_private *priv, u8 request, u16 value,
u16 index, u16 length, u8 *buffer)
{
int status = 0;
diff --git a/drivers/staging/vt6656/usbpipe.h b/drivers/staging/vt6656/usbpipe.h
index 42ad4f7..6ca250f 100644
--- a/drivers/staging/vt6656/usbpipe.h
+++ b/drivers/staging/vt6656/usbpipe.h
@@ -32,8 +32,7 @@
#include "device.h"
-int PIPEnsControlOut(struct vnt_private *, u8 byRequest, u16 wValue,
- u16 wIndex, u16 wLength, u8 *pbyBuffer);
+int vnt_control_out(struct vnt_private *, u8, u16, u16, u16, u8 *);
int PIPEnsControlIn(struct vnt_private *, u8 byRequest, u16 wValue,
u16 wIndex, u16 wLength, u8 *pbyBuffer);
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index ff4e4ae..9947794 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -852,7 +852,7 @@ void vRunCommand(struct work_struct *work)
ControlvReadByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PSCTL, &byData);
if ((byData & PSCTL_PS) != 0) {
// disable power saving hw function
- CONTROLnsRequestOut(pDevice,
+ vnt_control_out(pDevice,
MESSAGE_TYPE_DISABLE_PS,
0,
0,
--
1.9.1
Replace with dev_dbg
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/mac.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/staging/vt6656/mac.c b/drivers/staging/vt6656/mac.c
index 573ea4f..9211ec1 100644
--- a/drivers/staging/vt6656/mac.c
+++ b/drivers/staging/vt6656/mac.c
@@ -37,9 +37,6 @@
#include "80211hdr.h"
#include "control.h"
-//static int msglevel =MSG_LEVEL_DEBUG;
-static int msglevel =MSG_LEVEL_INFO;
-
/*
* Description:
* Write MAC Multicast Address Mask
@@ -143,8 +140,7 @@ void MACvSetKeyEntry(struct vnt_private *priv, u16 key_ctl, u32 entry_idx,
memcpy(set_key.key, key, WLAN_KEY_LEN_CCMP);
- DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
- "offset %d key ctl %d set key %24ph\n",
+ dev_dbg(&priv->usb->dev, "offset %d key ctl %d set key %24ph\n",
offset, key_ctl, (u8 *)&set_key);
CONTROLnsRequestOut(priv, MESSAGE_TYPE_SETKEY, offset,
--
1.9.1
add new function in usbpipe.c to replace ControlvWriteByte
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/baseband.c | 26 +++++++++++++-------------
drivers/staging/vt6656/card.c | 12 ++++++------
drivers/staging/vt6656/control.c | 11 -----------
drivers/staging/vt6656/control.h | 3 ---
drivers/staging/vt6656/main_usb.c | 12 ++++++------
drivers/staging/vt6656/usbpipe.c | 8 +++++++-
drivers/staging/vt6656/usbpipe.h | 2 ++
7 files changed, 34 insertions(+), 40 deletions(-)
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index 8a965bf..3373812 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -1028,17 +1028,17 @@ int BBbVT3184Init(struct vnt_private *priv)
if ((priv->byRFType == RF_VT3226) ||
(priv->byRFType == RF_VT3342A0)) {
- ControlvWriteByte(priv, MESSAGE_REQUEST_MACREG,
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_MACREG,
MAC_REG_ITRTMSET, 0x23);
MACvRegBitsOn(priv, MAC_REG_PAPEDELAY, 0x01);
} else if (priv->byRFType == RF_VT3226D0) {
- ControlvWriteByte(priv, MESSAGE_REQUEST_MACREG,
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_MACREG,
MAC_REG_ITRTMSET, 0x11);
MACvRegBitsOn(priv, MAC_REG_PAPEDELAY, 0x01);
}
- ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x04, 0x7f);
- ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0x01);
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x04, 0x7f);
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0x01);
RFbRFTableDownload(priv);
@@ -1081,13 +1081,13 @@ void BBvSetShortSlotTime(struct vnt_private *priv)
if (bb_vga == priv->abyBBVGA[0])
priv->byBBRxConf |= 0x20;
- ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0a, priv->byBBRxConf);
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0a, priv->byBBRxConf);
}
void BBvSetVGAGainOffset(struct vnt_private *priv, u8 data)
{
- ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0xE7, data);
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xE7, data);
/* patch for 3253B0 Baseband with Cardbus module */
if (priv->bShortSlotTime)
@@ -1095,7 +1095,7 @@ void BBvSetVGAGainOffset(struct vnt_private *priv, u8 data)
else
priv->byBBRxConf |= 0x20; /* 0010 0000 */
- ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0a, priv->byBBRxConf);
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0a, priv->byBBRxConf);
}
/*
@@ -1112,14 +1112,14 @@ void BBvSetVGAGainOffset(struct vnt_private *priv, u8 data)
*/
void BBvSetDeepSleep(struct vnt_private *priv)
{
- ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0c, 0x17);/* CR12 */
- ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0xB9);/* CR13 */
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0c, 0x17);/* CR12 */
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0xB9);/* CR13 */
}
void BBvExitDeepSleep(struct vnt_private *priv)
{
- ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0c, 0x00);/* CR12 */
- ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0x01);/* CR13 */
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0c, 0x00);/* CR12 */
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x0d, 0x01);/* CR13 */
}
void BBvUpdatePreEDThreshold(struct vnt_private *priv, int scanning)
@@ -1384,7 +1384,7 @@ void BBvUpdatePreEDThreshold(struct vnt_private *priv, int scanning)
if (!cr_201 && !cr_206)
return;
- ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0xc9, cr_201);
- ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0xce, cr_206);
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xc9, cr_201);
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xce, cr_206);
}
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 1f20e9a..9313730 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -111,7 +111,7 @@ void CARDbSetMediaChannel(struct vnt_private *priv, u32 connection_channel)
priv->abyCCKPwrTbl[connection_channel-1], RATE_1M);
}
- ControlvWriteByte(priv, MESSAGE_REQUEST_MACREG, MAC_REG_CHANNEL,
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_MACREG, MAC_REG_CHANNEL,
(u8)(connection_channel|0x80));
}
@@ -844,11 +844,11 @@ void CARDvSetBSSMode(struct vnt_private *priv)
priv->byPacketType = CARDbyGetPktType(priv);
if (priv->byBBType == BB_TYPE_11A)
- ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x03);
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x03);
else if (priv->byBBType == BB_TYPE_11B)
- ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x02);
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x02);
else if (priv->byBBType == BB_TYPE_11G)
- ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x08);
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0x88, 0x08);
vUpdateIFS(priv);
CARDvSetRSPINF(priv, (u8)priv->byBBType);
@@ -857,7 +857,7 @@ void CARDvSetBSSMode(struct vnt_private *priv)
if (priv->byRFType == RF_AIROHA7230) {
priv->abyBBVGA[0] = 0x20;
- ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG,
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG,
0xe7, priv->abyBBVGA[0]);
}
@@ -867,7 +867,7 @@ void CARDvSetBSSMode(struct vnt_private *priv)
if (priv->byRFType == RF_AIROHA7230) {
priv->abyBBVGA[0] = 0x1c;
- ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG,
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG,
0xe7, priv->abyBBVGA[0]);
}
diff --git a/drivers/staging/vt6656/control.c b/drivers/staging/vt6656/control.c
index 0c59d6d..14346a6 100644
--- a/drivers/staging/vt6656/control.c
+++ b/drivers/staging/vt6656/control.c
@@ -27,7 +27,6 @@
*
* Functions:
* vnt_control_out - Write variable length bytes to MEM/BB/MAC/EEPROM
- * ControlvWriteByte - Write one byte to MEM/BB/MAC/EEPROM
* ControlvReadByte - Read one byte from MEM/BB/MAC/EEPROM
* ControlvMaskByte - Read one byte from MEM/BB/MAC/EEPROM and clear/set
* some bits in the same address
@@ -44,16 +43,6 @@
/* static int msglevel =MSG_LEVEL_INFO; */
/* static int msglevel =MSG_LEVEL_DEBUG; */
-void ControlvWriteByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
- u8 data)
-{
-
- vnt_control_out(pDevice, MESSAGE_TYPE_WRITE, reg_off, reg,
- sizeof(u8), &data);
-
- return;
-}
-
void ControlvReadByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
u8 *data)
{
diff --git a/drivers/staging/vt6656/control.h b/drivers/staging/vt6656/control.h
index db9dd54..e4e252e 100644
--- a/drivers/staging/vt6656/control.h
+++ b/drivers/staging/vt6656/control.h
@@ -33,9 +33,6 @@
#include "device.h"
#include "usbpipe.h"
-void ControlvWriteByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
- u8 data);
-
void ControlvReadByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
u8 *data);
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 01dd068..6cc056d 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -468,28 +468,28 @@ static int device_init_registers(struct vnt_private *pDevice)
byCalibRXIQ = pDevice->abyEEPROM[EEP_OFS_CALIB_RX_IQ];
if (byCalibTXIQ || byCalibTXDC || byCalibRXIQ) {
/* CR255, enable TX/RX IQ and DC compensation mode */
- ControlvWriteByte(pDevice,
+ vnt_control_out_u8(pDevice,
MESSAGE_REQUEST_BBREG,
0xff,
0x03);
/* CR251, TX I/Q Imbalance Calibration */
- ControlvWriteByte(pDevice,
+ vnt_control_out_u8(pDevice,
MESSAGE_REQUEST_BBREG,
0xfb,
byCalibTXIQ);
/* CR252, TX DC-Offset Calibration */
- ControlvWriteByte(pDevice,
+ vnt_control_out_u8(pDevice,
MESSAGE_REQUEST_BBREG,
0xfC,
byCalibTXDC);
/* CR253, RX I/Q Imbalance Calibration */
- ControlvWriteByte(pDevice,
+ vnt_control_out_u8(pDevice,
MESSAGE_REQUEST_BBREG,
0xfd,
byCalibRXIQ);
} else {
/* CR255, turn off BB Calibration compensation */
- ControlvWriteByte(pDevice,
+ vnt_control_out_u8(pDevice,
MESSAGE_REQUEST_BBREG,
0xff,
0x0);
@@ -1310,7 +1310,7 @@ void vnt_configure_filter(struct vnt_private *priv)
priv->byRxMode &= ~(RCR_UNICAST);
}
- ControlvWriteByte(priv, MESSAGE_REQUEST_MACREG,
+ vnt_control_out_u8(priv, MESSAGE_REQUEST_MACREG,
MAC_REG_RCR, priv->byRxMode);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c
index 7d4e131..2264c8c 100644
--- a/drivers/staging/vt6656/usbpipe.c
+++ b/drivers/staging/vt6656/usbpipe.c
@@ -28,7 +28,7 @@
* Functions:
* vnt_control_out - Write variable length bytes to MEM/BB/MAC/EEPROM
* vnt_control_in - Read variable length bytes from MEM/BB/MAC/EEPROM
- * ControlvWriteByte - Write one byte to MEM/BB/MAC/EEPROM
+ * vnt_control_out_u8 - Write one byte to MEM/BB/MAC/EEPROM
* ControlvReadByte - Read one byte from MEM/BB/MAC/EEPROM
* ControlvMaskByte - Read one byte from MEM/BB/MAC/EEPROM and clear/set some bits in the same address
*
@@ -83,6 +83,12 @@ int vnt_control_out(struct vnt_private *priv, u8 request, u16 value,
return STATUS_SUCCESS;
}
+void vnt_control_out_u8(struct vnt_private *priv, u8 reg, u8 reg_off, u8 data)
+{
+ vnt_control_out(priv, MESSAGE_TYPE_WRITE,
+ reg_off, reg, sizeof(u8), &data);
+}
+
int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,
u16 index, u16 length, u8 *buffer)
{
diff --git a/drivers/staging/vt6656/usbpipe.h b/drivers/staging/vt6656/usbpipe.h
index f04e30b..a3d3bac 100644
--- a/drivers/staging/vt6656/usbpipe.h
+++ b/drivers/staging/vt6656/usbpipe.h
@@ -35,6 +35,8 @@
int vnt_control_out(struct vnt_private *, u8, u16, u16, u16, u8 *);
int vnt_control_in(struct vnt_private *, u8, u16, u16, u16, u8 *);
+void vnt_control_out_u8(struct vnt_private *, u8, u8, u8);
+
int PIPEnsInterruptRead(struct vnt_private *);
int PIPEnsBulkInUsbRead(struct vnt_private *, struct vnt_rcb *pRCB);
int PIPEnsSendBulkOut(struct vnt_private *,
--
1.9.1
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/control.c | 14 --------------
drivers/staging/vt6656/control.h | 3 ---
2 files changed, 17 deletions(-)
diff --git a/drivers/staging/vt6656/control.c b/drivers/staging/vt6656/control.c
index 14346a6..b6e31f3 100644
--- a/drivers/staging/vt6656/control.c
+++ b/drivers/staging/vt6656/control.c
@@ -50,17 +50,3 @@ void ControlvReadByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
reg_off, reg, sizeof(u8), data);
return;
}
-
-void ControlvMaskByte(struct vnt_private *pDevice, u8 reg_type, u8 reg_off,
- u8 reg_mask, u8 data)
-{
- u8 reg_data[2];
-
- reg_data[0] = data;
- reg_data[1] = reg_mask;
-
- vnt_control_out(pDevice, MESSAGE_TYPE_WRITE_MASK, reg_off,
- reg_type, ARRAY_SIZE(reg_data), reg_data);
-
- return;
-}
diff --git a/drivers/staging/vt6656/control.h b/drivers/staging/vt6656/control.h
index e4e252e..48f4836 100644
--- a/drivers/staging/vt6656/control.h
+++ b/drivers/staging/vt6656/control.h
@@ -36,7 +36,4 @@
void ControlvReadByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
u8 *data);
-void ControlvMaskByte(struct vnt_private *pDevice, u8 reg_type, u8 reg_off,
- u8 reg_mask, u8 data);
-
#endif /* __CONTROL_H__ */
--
1.9.1
Fix warning: symbol 'CARDvCalculateOFDMRParameter' was not declared. Should it be static?
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/card.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 06f8b00..5ad0a98 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -197,7 +197,7 @@ static u16 swGetOFDMControlRate(struct vnt_private *priv, u16 rate_idx)
* Return Value: none
*
*/
-void CARDvCalculateOFDMRParameter(u16 rate, u8 bb_type,
+static void CARDvCalculateOFDMRParameter(u16 rate, u8 bb_type,
u8 *tx_rate, u8 *rsv_time)
{
--
1.9.1
Replace control.h headers with usbpipe.h
Also add to usbpipe.c its header
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/Makefile | 1 -
drivers/staging/vt6656/baseband.c | 2 +-
drivers/staging/vt6656/bssdb.c | 2 +-
drivers/staging/vt6656/card.c | 2 +-
drivers/staging/vt6656/control.c | 52 ---------------------------------------
drivers/staging/vt6656/control.h | 39 -----------------------------
drivers/staging/vt6656/firmware.c | 2 +-
drivers/staging/vt6656/iwctl.c | 2 +-
drivers/staging/vt6656/key.c | 2 +-
drivers/staging/vt6656/mac.c | 2 +-
drivers/staging/vt6656/main_usb.c | 2 +-
drivers/staging/vt6656/power.c | 2 +-
drivers/staging/vt6656/rf.c | 2 +-
drivers/staging/vt6656/usbpipe.c | 1 +
drivers/staging/vt6656/wcmd.c | 2 +-
drivers/staging/vt6656/wmgr.c | 2 +-
drivers/staging/vt6656/wpactl.c | 2 +-
17 files changed, 14 insertions(+), 105 deletions(-)
delete mode 100644 drivers/staging/vt6656/control.c
delete mode 100644 drivers/staging/vt6656/control.h
diff --git a/drivers/staging/vt6656/Makefile b/drivers/staging/vt6656/Makefile
index e39d249..b5ec483 100644
--- a/drivers/staging/vt6656/Makefile
+++ b/drivers/staging/vt6656/Makefile
@@ -27,7 +27,6 @@ vt6656_stage-y += main_usb.o \
wpactl.o \
usbpipe.o \
channel.o \
- control.o \
firmware.o \
int.o
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index 4cdea2c..d96308f 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -40,7 +40,7 @@
#include "mac.h"
#include "baseband.h"
#include "rf.h"
-#include "control.h"
+#include "usbpipe.h"
#include "datarate.h"
static u8 abyVT3184_AGC[] = {
diff --git a/drivers/staging/vt6656/bssdb.c b/drivers/staging/vt6656/bssdb.c
index 12b6436..f53d3bf 100644
--- a/drivers/staging/vt6656/bssdb.c
+++ b/drivers/staging/vt6656/bssdb.c
@@ -53,7 +53,7 @@
#include "card.h"
#include "mac.h"
#include "wpa2.h"
-#include "control.h"
+#include "usbpipe.h"
#include "iowpa.h"
#include "power.h"
diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index 9313730..06f8b00 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -57,7 +57,7 @@
#include "rc4.h"
#include "country.h"
#include "datarate.h"
-#include "control.h"
+#include "usbpipe.h"
//const u16 cwRXBCNTSFOff[MAX_RATE] =
//{17, 34, 96, 192, 34, 23, 17, 11, 8, 5, 4, 3};
diff --git a/drivers/staging/vt6656/control.c b/drivers/staging/vt6656/control.c
deleted file mode 100644
index b6e31f3..0000000
--- a/drivers/staging/vt6656/control.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- *
- * File: control.c
- *
- * Purpose: Handle USB control endpoint
- *
- * Author: Jerry Chen
- *
- * Date: Apr. 5, 2004
- *
- * Functions:
- * vnt_control_out - Write variable length bytes to MEM/BB/MAC/EEPROM
- * ControlvReadByte - Read one byte from MEM/BB/MAC/EEPROM
- * ControlvMaskByte - Read one byte from MEM/BB/MAC/EEPROM and clear/set
- * some bits in the same address
- *
- * Revision History:
- * 04-05-2004 Jerry Chen: Initial release
- * 11-24-2004 Warren Hsu: Add ControlvWriteByte, ControlvReadByte,
- * ControlvMaskByte
- *
- */
-
-#include "control.h"
-
-/* static int msglevel =MSG_LEVEL_INFO; */
-/* static int msglevel =MSG_LEVEL_DEBUG; */
-
-void ControlvReadByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
- u8 *data)
-{
- vnt_control_in(pDevice, MESSAGE_TYPE_READ,
- reg_off, reg, sizeof(u8), data);
- return;
-}
diff --git a/drivers/staging/vt6656/control.h b/drivers/staging/vt6656/control.h
deleted file mode 100644
index 48f4836..0000000
--- a/drivers/staging/vt6656/control.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- *
- * File: control.h
- *
- * Purpose:
- *
- * Author: Jerry Chen
- *
- * Date: Apr. 5, 2004
- *
- */
-
-#ifndef __CONTROL_H__
-#define __CONTROL_H__
-
-#include "device.h"
-#include "usbpipe.h"
-
-void ControlvReadByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
- u8 *data);
-
-#endif /* __CONTROL_H__ */
diff --git a/drivers/staging/vt6656/firmware.c b/drivers/staging/vt6656/firmware.c
index f9d685f..1159f0b 100644
--- a/drivers/staging/vt6656/firmware.c
+++ b/drivers/staging/vt6656/firmware.c
@@ -33,7 +33,7 @@
#include <linux/compiler.h>
#include "firmware.h"
-#include "control.h"
+#include "usbpipe.h"
static int msglevel = MSG_LEVEL_INFO;
/* static int msglevel = MSG_LEVEL_DEBUG; */
diff --git a/drivers/staging/vt6656/iwctl.c b/drivers/staging/vt6656/iwctl.c
index 0a8e438..94b7fe8 100644
--- a/drivers/staging/vt6656/iwctl.c
+++ b/drivers/staging/vt6656/iwctl.c
@@ -38,7 +38,7 @@
#include "rf.h"
#include "iowpa.h"
#include "wpactl.h"
-#include "control.h"
+#include "usbpipe.h"
#include "baseband.h"
static const long frequency_list[] = {
diff --git a/drivers/staging/vt6656/key.c b/drivers/staging/vt6656/key.c
index 11aa82a..38ea675 100644
--- a/drivers/staging/vt6656/key.c
+++ b/drivers/staging/vt6656/key.c
@@ -39,7 +39,7 @@
#include "mac.h"
#include "tmacro.h"
#include "key.h"
-#include "control.h"
+#include "usbpipe.h"
static int msglevel =MSG_LEVEL_INFO;
//static int msglevel =MSG_LEVEL_DEBUG;
diff --git a/drivers/staging/vt6656/mac.c b/drivers/staging/vt6656/mac.c
index fdb244f..cadf7cd 100644
--- a/drivers/staging/vt6656/mac.c
+++ b/drivers/staging/vt6656/mac.c
@@ -35,7 +35,7 @@
#include "desc.h"
#include "mac.h"
#include "80211hdr.h"
-#include "control.h"
+#include "usbpipe.h"
/*
* Description:
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index df206e6..e18071f 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -65,7 +65,7 @@
#include "datarate.h"
#include "rf.h"
#include "firmware.h"
-#include "control.h"
+#include "usbpipe.h"
#include "channel.h"
#include "int.h"
#include "iowpa.h"
diff --git a/drivers/staging/vt6656/power.c b/drivers/staging/vt6656/power.c
index b8ebf58..ddbd046 100644
--- a/drivers/staging/vt6656/power.c
+++ b/drivers/staging/vt6656/power.c
@@ -44,7 +44,7 @@
#include "wcmd.h"
#include "rxtx.h"
#include "card.h"
-#include "control.h"
+#include "usbpipe.h"
static int msglevel = MSG_LEVEL_INFO;
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index 58ea16c..d244dab 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -38,7 +38,7 @@
#include "mac.h"
#include "rf.h"
#include "baseband.h"
-#include "control.h"
+#include "usbpipe.h"
#include "datarate.h"
static int msglevel =MSG_LEVEL_INFO;
diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c
index fc68bad..e4751b7 100644
--- a/drivers/staging/vt6656/usbpipe.c
+++ b/drivers/staging/vt6656/usbpipe.c
@@ -43,6 +43,7 @@
#include "dpc.h"
#include "desc.h"
#include "device.h"
+#include "usbpipe.h"
//endpoint def
//endpoint 0: control
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index 91754fd..9a166fb 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -48,7 +48,7 @@
#include "power.h"
#include "wctl.h"
#include "baseband.h"
-#include "control.h"
+#include "usbpipe.h"
#include "rxtx.h"
#include "rf.h"
#include "channel.h"
diff --git a/drivers/staging/vt6656/wmgr.c b/drivers/staging/vt6656/wmgr.c
index 8cb80a6..18723ea 100644
--- a/drivers/staging/vt6656/wmgr.c
+++ b/drivers/staging/vt6656/wmgr.c
@@ -78,7 +78,7 @@
#include "wpa.h"
#include "rf.h"
#include "iowpa.h"
-#include "control.h"
+#include "usbpipe.h"
static int msglevel = MSG_LEVEL_INFO;
//static int msglevel =MSG_LEVEL_DEBUG;
diff --git a/drivers/staging/vt6656/wpactl.c b/drivers/staging/vt6656/wpactl.c
index 587e111..0a06715 100644
--- a/drivers/staging/vt6656/wpactl.c
+++ b/drivers/staging/vt6656/wpactl.c
@@ -38,7 +38,7 @@
#include "wmgr.h"
#include "iocmd.h"
#include "iowpa.h"
-#include "control.h"
+#include "usbpipe.h"
#include "rf.h"
static int msglevel = MSG_LEVEL_INFO;
--
1.9.1
ControlvReadByte will be removed in next patch
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/baseband.c | 2 +-
drivers/staging/vt6656/power.c | 2 +-
drivers/staging/vt6656/usbpipe.c | 9 +++++++--
drivers/staging/vt6656/usbpipe.h | 1 +
drivers/staging/vt6656/wcmd.c | 2 +-
5 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index 3373812..4cdea2c 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -1076,7 +1076,7 @@ void BBvSetShortSlotTime(struct vnt_private *priv)
else
priv->byBBRxConf |= 0x20;
- ControlvReadByte(priv, MESSAGE_REQUEST_BBREG, 0xe7, &bb_vga);
+ vnt_control_in_u8(priv, MESSAGE_REQUEST_BBREG, 0xe7, &bb_vga);
if (bb_vga == priv->abyBBVGA[0])
priv->byBBRxConf |= 0x20;
diff --git a/drivers/staging/vt6656/power.c b/drivers/staging/vt6656/power.c
index a5cea43..b8ebf58 100644
--- a/drivers/staging/vt6656/power.c
+++ b/drivers/staging/vt6656/power.c
@@ -162,7 +162,7 @@ int PSbConsiderPowerDown(struct vnt_private *pDevice, int bCheckRxDMA,
u8 byData;
/* check if already in Doze mode */
- ControlvReadByte(pDevice, MESSAGE_REQUEST_MACREG,
+ vnt_control_in_u8(pDevice, MESSAGE_REQUEST_MACREG,
MAC_REG_PSCTL, &byData);
if ((byData & PSCTL_PS) != 0)
diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c
index 2264c8c..fc68bad 100644
--- a/drivers/staging/vt6656/usbpipe.c
+++ b/drivers/staging/vt6656/usbpipe.c
@@ -29,7 +29,7 @@
* vnt_control_out - Write variable length bytes to MEM/BB/MAC/EEPROM
* vnt_control_in - Read variable length bytes from MEM/BB/MAC/EEPROM
* vnt_control_out_u8 - Write one byte to MEM/BB/MAC/EEPROM
- * ControlvReadByte - Read one byte from MEM/BB/MAC/EEPROM
+ * vnt_control_in_u8 - Read one byte from MEM/BB/MAC/EEPROM
* ControlvMaskByte - Read one byte from MEM/BB/MAC/EEPROM and clear/set some bits in the same address
*
* Revision History:
@@ -41,7 +41,6 @@
#include "int.h"
#include "rxtx.h"
#include "dpc.h"
-#include "control.h"
#include "desc.h"
#include "device.h"
@@ -111,6 +110,12 @@ int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,
return STATUS_SUCCESS;
}
+void vnt_control_in_u8(struct vnt_private *priv, u8 reg, u8 reg_off, u8 *data)
+{
+ vnt_control_in(priv, MESSAGE_TYPE_READ,
+ reg_off, reg, sizeof(u8), data);
+}
+
/*
* Description:
* Allocates an usb interrupt in irp and calls USBD.
diff --git a/drivers/staging/vt6656/usbpipe.h b/drivers/staging/vt6656/usbpipe.h
index a3d3bac..ea71782 100644
--- a/drivers/staging/vt6656/usbpipe.h
+++ b/drivers/staging/vt6656/usbpipe.h
@@ -36,6 +36,7 @@ int vnt_control_out(struct vnt_private *, u8, u16, u16, u16, u8 *);
int vnt_control_in(struct vnt_private *, u8, u16, u16, u16, u8 *);
void vnt_control_out_u8(struct vnt_private *, u8, u8, u8);
+void vnt_control_in_u8(struct vnt_private *, u8, u8, u8 *);
int PIPEnsInterruptRead(struct vnt_private *);
int PIPEnsBulkInUsbRead(struct vnt_private *, struct vnt_rcb *pRCB);
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index 79f7463..91754fd 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -861,7 +861,7 @@ void vRunCommand(struct work_struct *work)
break;
case WLAN_CMD_MAC_DISPOWERSAVING_START:
- ControlvReadByte(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PSCTL, &byData);
+ vnt_control_in_u8(pDevice, MESSAGE_REQUEST_MACREG, MAC_REG_PSCTL, &byData);
if ((byData & PSCTL_PS) != 0) {
// disable power saving hw function
vnt_control_out(pDevice,
--
1.9.1
camel case changes
pDevice -> priv
wKeyCtl -> key_ctl
uEntryIdx -> entry_idx
uKeyIdx -> key_idx
pbyAddr -> addr
wOffset -> offset
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/mac.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/vt6656/mac.c b/drivers/staging/vt6656/mac.c
index a030c59..573ea4f 100644
--- a/drivers/staging/vt6656/mac.c
+++ b/drivers/staging/vt6656/mac.c
@@ -122,21 +122,21 @@ void MACvDisableKeyEntry(struct vnt_private *priv, u8 entry_idx)
* Return Value: none
*
*/
-void MACvSetKeyEntry(struct vnt_private *pDevice, u16 wKeyCtl, u32 uEntryIdx,
- u32 uKeyIdx, u8 *pbyAddr, u8 *key)
+void MACvSetKeyEntry(struct vnt_private *priv, u16 key_ctl, u32 entry_idx,
+ u32 key_idx, u8 *addr, u8 *key)
{
struct vnt_mac_set_key set_key;
- u16 wOffset;
+ u16 offset;
- if (pDevice->byLocalID <= MAC_REVISION_A1)
- if (pDevice->vnt_mgmt.byCSSPK == KEY_CTL_CCMP)
+ if (priv->byLocalID <= MAC_REVISION_A1)
+ if (priv->vnt_mgmt.byCSSPK == KEY_CTL_CCMP)
return;
- wOffset = MISCFIFO_KEYETRY0;
- wOffset += (uEntryIdx * MISCFIFO_KEYENTRYSIZE);
+ offset = MISCFIFO_KEYETRY0;
+ offset += (entry_idx * MISCFIFO_KEYENTRYSIZE);
- set_key.u.write.key_ctl = cpu_to_le16(wKeyCtl);
- memcpy(set_key.u.write.addr, pbyAddr, ETH_ALEN);
+ set_key.u.write.key_ctl = cpu_to_le16(key_ctl);
+ memcpy(set_key.u.write.addr, addr, ETH_ALEN);
/* swap over swap[0] and swap[1] to get correct write order */
swap(set_key.u.swap[0], set_key.u.swap[1]);
@@ -145,10 +145,10 @@ void MACvSetKeyEntry(struct vnt_private *pDevice, u16 wKeyCtl, u32 uEntryIdx,
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"offset %d key ctl %d set key %24ph\n",
- wOffset, wKeyCtl, (u8 *)&set_key);
+ offset, key_ctl, (u8 *)&set_key);
- CONTROLnsRequestOut(pDevice, MESSAGE_TYPE_SETKEY, wOffset,
- (u16)uKeyIdx, sizeof(struct vnt_mac_set_key), (u8 *)&set_key);
+ CONTROLnsRequestOut(priv, MESSAGE_TYPE_SETKEY, offset,
+ (u16)key_idx, sizeof(struct vnt_mac_set_key), (u8 *)&set_key);
}
void MACvRegBitsOff(struct vnt_private *priv, u8 reg_ofs, u8 bits)
--
1.9.1
Replace all to CONTROLnsRequestIn with vnt_control_in and remove macro.
Signed-off-by: Malcolm Priestley <[email protected]>
---
drivers/staging/vt6656/baseband.c | 4 ++--
drivers/staging/vt6656/control.c | 3 +--
drivers/staging/vt6656/control.h | 3 ---
drivers/staging/vt6656/firmware.c | 2 +-
drivers/staging/vt6656/main_usb.c | 8 ++++----
drivers/staging/vt6656/usbpipe.c | 4 ++--
drivers/staging/vt6656/usbpipe.h | 3 +--
drivers/staging/vt6656/wcmd.c | 2 +-
8 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/drivers/staging/vt6656/baseband.c b/drivers/staging/vt6656/baseband.c
index 8a509d8..8a965bf 100644
--- a/drivers/staging/vt6656/baseband.c
+++ b/drivers/staging/vt6656/baseband.c
@@ -893,7 +893,7 @@ int BBbVT3184Init(struct vnt_private *priv)
u8 array[256];
u8 data;
- status = CONTROLnsRequestIn(priv, MESSAGE_TYPE_READ, 0,
+ status = vnt_control_in(priv, MESSAGE_TYPE_READ, 0,
MESSAGE_REQUEST_EEPROM, EEP_MAX_CONTEXT_SIZE,
priv->abyEEPROM);
if (status != STATUS_SUCCESS)
@@ -1044,7 +1044,7 @@ int BBbVT3184Init(struct vnt_private *priv)
/* Fix for TX USB resets from vendors driver */
- CONTROLnsRequestIn(priv, MESSAGE_TYPE_READ, USB_REG4,
+ vnt_control_in(priv, MESSAGE_TYPE_READ, USB_REG4,
MESSAGE_REQUEST_MEM, sizeof(data), &data);
data |= 0x2;
diff --git a/drivers/staging/vt6656/control.c b/drivers/staging/vt6656/control.c
index 0740521..0c59d6d 100644
--- a/drivers/staging/vt6656/control.c
+++ b/drivers/staging/vt6656/control.c
@@ -27,7 +27,6 @@
*
* Functions:
* vnt_control_out - Write variable length bytes to MEM/BB/MAC/EEPROM
- * CONTROLnsRequestIn - Read variable length bytes from MEM/BB/MAC/EEPROM
* ControlvWriteByte - Write one byte to MEM/BB/MAC/EEPROM
* ControlvReadByte - Read one byte from MEM/BB/MAC/EEPROM
* ControlvMaskByte - Read one byte from MEM/BB/MAC/EEPROM and clear/set
@@ -58,7 +57,7 @@ void ControlvWriteByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
void ControlvReadByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
u8 *data)
{
- CONTROLnsRequestIn(pDevice, MESSAGE_TYPE_READ,
+ vnt_control_in(pDevice, MESSAGE_TYPE_READ,
reg_off, reg, sizeof(u8), data);
return;
}
diff --git a/drivers/staging/vt6656/control.h b/drivers/staging/vt6656/control.h
index 17a23d5..db9dd54 100644
--- a/drivers/staging/vt6656/control.h
+++ b/drivers/staging/vt6656/control.h
@@ -33,9 +33,6 @@
#include "device.h"
#include "usbpipe.h"
-#define CONTROLnsRequestIn(Device, Request, Value, Index, Length, Buffer) \
- PIPEnsControlIn(Device, Request, Value, Index, Length, Buffer)
-
void ControlvWriteByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
u8 data);
diff --git a/drivers/staging/vt6656/firmware.c b/drivers/staging/vt6656/firmware.c
index 13b68d5..f9d685f 100644
--- a/drivers/staging/vt6656/firmware.c
+++ b/drivers/staging/vt6656/firmware.c
@@ -116,7 +116,7 @@ int FIRMWAREbCheckVersion(struct vnt_private *pDevice)
{
int ntStatus;
- ntStatus = CONTROLnsRequestIn(pDevice,
+ ntStatus = vnt_control_in(pDevice,
MESSAGE_TYPE_READ,
0,
MESSAGE_REQUEST_VERSION,
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index 9e70aa5..01dd068 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -322,7 +322,7 @@ static int device_init_registers(struct vnt_private *pDevice)
return false;
}
- ntStatus = CONTROLnsRequestIn(pDevice, MESSAGE_TYPE_INIT_RSP, 0, 0,
+ ntStatus = vnt_control_in(pDevice, MESSAGE_TYPE_INIT_RSP, 0, 0,
sizeof(struct vnt_rsp_card_init), (u8 *)init_rsp);
if (ntStatus != STATUS_SUCCESS) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
@@ -331,7 +331,7 @@ static int device_init_registers(struct vnt_private *pDevice)
}
/* local ID for AES functions */
- ntStatus = CONTROLnsRequestIn(pDevice, MESSAGE_TYPE_READ,
+ ntStatus = vnt_control_in(pDevice, MESSAGE_TYPE_READ,
MAC_REG_LOCALID, MESSAGE_REQUEST_MACREG, 1,
&pDevice->byLocalID);
if (ntStatus != STATUS_SUCCESS)
@@ -535,7 +535,7 @@ static int device_init_registers(struct vnt_private *pDevice)
pDevice->bHWRadioOff = false;
if ((pDevice->byRadioCtl & EEP_RADIOCTL_ENABLE) != 0) {
- ntStatus = CONTROLnsRequestIn(pDevice, MESSAGE_TYPE_READ,
+ ntStatus = vnt_control_in(pDevice, MESSAGE_TYPE_READ,
MAC_REG_GPIOCTL1, MESSAGE_REQUEST_MACREG, 1, &byTmp);
if (ntStatus != STATUS_SUCCESS)
@@ -1269,7 +1269,7 @@ void vnt_configure_filter(struct vnt_private *priv)
u8 tmp = 0;
int rc;
- rc = CONTROLnsRequestIn(priv, MESSAGE_TYPE_READ,
+ rc = vnt_control_in(priv, MESSAGE_TYPE_READ,
MAC_REG_RCR, MESSAGE_REQUEST_MACREG, 1, &tmp);
if (rc == 0)
priv->byRxMode = tmp;
diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c
index 443338e..7d4e131 100644
--- a/drivers/staging/vt6656/usbpipe.c
+++ b/drivers/staging/vt6656/usbpipe.c
@@ -27,7 +27,7 @@
*
* Functions:
* vnt_control_out - Write variable length bytes to MEM/BB/MAC/EEPROM
- * CONTROLnsRequestIn - Read variable length bytes from MEM/BB/MAC/EEPROM
+ * vnt_control_in - Read variable length bytes from MEM/BB/MAC/EEPROM
* ControlvWriteByte - Write one byte to MEM/BB/MAC/EEPROM
* ControlvReadByte - Read one byte from MEM/BB/MAC/EEPROM
* ControlvMaskByte - Read one byte from MEM/BB/MAC/EEPROM and clear/set some bits in the same address
@@ -83,7 +83,7 @@ int vnt_control_out(struct vnt_private *priv, u8 request, u16 value,
return STATUS_SUCCESS;
}
-int PIPEnsControlIn(struct vnt_private *priv, u8 request, u16 value,
+int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,
u16 index, u16 length, u8 *buffer)
{
int status;
diff --git a/drivers/staging/vt6656/usbpipe.h b/drivers/staging/vt6656/usbpipe.h
index 6ca250f..f04e30b 100644
--- a/drivers/staging/vt6656/usbpipe.h
+++ b/drivers/staging/vt6656/usbpipe.h
@@ -33,8 +33,7 @@
#include "device.h"
int vnt_control_out(struct vnt_private *, u8, u16, u16, u16, u8 *);
-int PIPEnsControlIn(struct vnt_private *, u8 byRequest, u16 wValue,
- u16 wIndex, u16 wLength, u8 *pbyBuffer);
+int vnt_control_in(struct vnt_private *, u8, u16, u16, u16, u8 *);
int PIPEnsInterruptRead(struct vnt_private *);
int PIPEnsBulkInUsbRead(struct vnt_private *, struct vnt_rcb *pRCB);
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c
index 9947794..aae573b 100644
--- a/drivers/staging/vt6656/wcmd.c
+++ b/drivers/staging/vt6656/wcmd.c
@@ -725,7 +725,7 @@ void vRunCommand(struct work_struct *work)
int ntStatus = STATUS_SUCCESS;
u8 byTmp;
- ntStatus = CONTROLnsRequestIn(pDevice,
+ ntStatus = vnt_control_in(pDevice,
MESSAGE_TYPE_READ,
MAC_REG_GPIOCTL1,
MESSAGE_REQUEST_MACREG,
--
1.9.1