Commit cbc06fb1 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6656: cleanup device_init_registers

White space and formatting clean up.
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 748bf69c
......@@ -294,7 +294,6 @@ static void device_init_diversity_timer(struct vnt_private *pDevice)
/*
* initialization of MAC & BBP registers
*/
static int device_init_registers(struct vnt_private *pDevice)
{
struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
......@@ -317,27 +316,26 @@ static int device_init_registers(struct vnt_private *pDevice)
memcpy(pDevice->abyBroadcastAddr, abyBroadcastAddr, ETH_ALEN);
memcpy(pDevice->abySNAP_RFC1042, abySNAP_RFC1042, ETH_ALEN);
memcpy(pDevice->abySNAP_Bridgetunnel,
abySNAP_Bridgetunnel,
ETH_ALEN);
memcpy(pDevice->abySNAP_Bridgetunnel, abySNAP_Bridgetunnel, ETH_ALEN);
if ( !FIRMWAREbCheckVersion(pDevice) ) {
if (!FIRMWAREbCheckVersion(pDevice)) {
if (FIRMWAREbDownload(pDevice) == true) {
if (FIRMWAREbBrach2Sram(pDevice) == false) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" FIRMWAREbBrach2Sram fail \n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
" FIRMWAREbBrach2Sram fail\n");
spin_unlock_irq(&pDevice->lock);
return false;
}
} else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" FIRMWAREbDownload fail \n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
" FIRMWAREbDownload fail\n");
spin_unlock_irq(&pDevice->lock);
return false;
}
}
if ( !BBbVT3184Init(pDevice) ) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" BBbVT3184Init fail \n");
if (!BBbVT3184Init(pDevice)) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" BBbVT3184Init fail\n");
spin_unlock_irq(&pDevice->lock);
return false;
}
......@@ -353,9 +351,8 @@ static int device_init_registers(struct vnt_private *pDevice)
ntStatus = CONTROLnsRequestOut(pDevice,
MESSAGE_TYPE_CARDINIT, 0, 0,
sizeof(struct vnt_cmd_card_init), (u8 *)init_cmd);
if ( ntStatus != STATUS_SUCCESS ) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Issue Card init fail \n");
if (ntStatus != STATUS_SUCCESS) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Issue Card init fail\n");
spin_unlock_irq(&pDevice->lock);
return false;
}
......@@ -537,32 +534,33 @@ static int device_init_registers(struct vnt_private *pDevice)
/* CR255, enable TX/RX IQ and DC compensation mode */
ControlvWriteByte(pDevice,
MESSAGE_REQUEST_BBREG,
0xFF,
0xff,
0x03);
/* CR251, TX I/Q Imbalance Calibration */
ControlvWriteByte(pDevice,
MESSAGE_REQUEST_BBREG,
0xFB,
0xfb,
byCalibTXIQ);
/* CR252, TX DC-Offset Calibration */
ControlvWriteByte(pDevice,
MESSAGE_REQUEST_BBREG,
0xFC,
0xfC,
byCalibTXDC);
/* CR253, RX I/Q Imbalance Calibration */
ControlvWriteByte(pDevice,
MESSAGE_REQUEST_BBREG,
0xFD,
0xfd,
byCalibRXIQ);
} else {
/* CR255, turn off BB Calibration compensation */
ControlvWriteByte(pDevice,
MESSAGE_REQUEST_BBREG,
0xFF,
0xff,
0x0);
}
}
}
pMgmt->eScanType = WMAC_SCAN_PASSIVE;
pMgmt->uCurrChannel = pDevice->uChannel;
pMgmt->uIBSSChannel = pDevice->uChannel;
......@@ -571,8 +569,7 @@ static int device_init_registers(struct vnt_private *pDevice)
/* get permanent network address */
memcpy(pDevice->abyPermanentNetAddr, init_rsp->net_addr, 6);
memcpy(pDevice->abyCurrentNetAddr,
pDevice->abyPermanentNetAddr,
ETH_ALEN);
pDevice->abyPermanentNetAddr, ETH_ALEN);
/* if exist SW network address, use it */
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Network address = %pM\n",
......@@ -589,51 +586,59 @@ static int device_init_registers(struct vnt_private *pDevice)
CARDbAddBasicRate(pDevice, RATE_1M);
pDevice->bShortSlotTime = false;
}
BBvSetShortSlotTime(pDevice);
CARDvSetBSSMode(pDevice);
if (pDevice->bUpdateBBVGA) {
pDevice->byBBVGACurrent = pDevice->abyBBVGA[0];
pDevice->byBBVGANew = pDevice->byBBVGACurrent;
BBvSetVGAGainOffset(pDevice, pDevice->abyBBVGA[0]);
}
pDevice->byRadioCtl = pDevice->abyEEPROM[EEP_OFS_RADIOCTL];
pDevice->bHWRadioOff = false;
if ( (pDevice->byRadioCtl & EEP_RADIOCTL_ENABLE) != 0 ) {
ntStatus = CONTROLnsRequestIn(pDevice,
MESSAGE_TYPE_READ,
MAC_REG_GPIOCTL1,
MESSAGE_REQUEST_MACREG,
1,
&byTmp);
if ( ntStatus != STATUS_SUCCESS ) {
if ((pDevice->byRadioCtl & EEP_RADIOCTL_ENABLE) != 0) {
ntStatus = CONTROLnsRequestIn(pDevice, MESSAGE_TYPE_READ,
MAC_REG_GPIOCTL1, MESSAGE_REQUEST_MACREG, 1, &byTmp);
if (ntStatus != STATUS_SUCCESS) {
spin_unlock_irq(&pDevice->lock);
return false;
}
if ( (byTmp & GPIO3_DATA) == 0 ) {
if ((byTmp & GPIO3_DATA) == 0) {
pDevice->bHWRadioOff = true;
MACvRegBitsOn(pDevice,MAC_REG_GPIOCTL1,GPIO3_INTMD);
MACvRegBitsOn(pDevice, MAC_REG_GPIOCTL1, GPIO3_INTMD);
} else {
MACvRegBitsOff(pDevice,MAC_REG_GPIOCTL1,GPIO3_INTMD);
MACvRegBitsOff(pDevice, MAC_REG_GPIOCTL1, GPIO3_INTMD);
pDevice->bHWRadioOff = false;
}
}
ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_TMLEN,0x38);
ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_SLOW);
MACvRegBitsOn(pDevice,MAC_REG_GPIOCTL0,0x01);
ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG,
MAC_REG_PAPEDELAY, LEDSTS_TMLEN, 0x38);
if ((pDevice->bHWRadioOff == true) || (pDevice->bRadioControlOff == true)) {
ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG,
MAC_REG_PAPEDELAY, LEDSTS_STS, LEDSTS_SLOW);
MACvRegBitsOn(pDevice, MAC_REG_GPIOCTL0, 0x01);
if ((pDevice->bHWRadioOff == true) ||
(pDevice->bRadioControlOff == true)) {
CARDbRadioPowerOff(pDevice);
} else {
CARDbRadioPowerOn(pDevice);
}
spin_unlock_irq(&pDevice->lock);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"<----INIbInitAdapter Exit\n");
return true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment