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) ...@@ -294,7 +294,6 @@ static void device_init_diversity_timer(struct vnt_private *pDevice)
/* /*
* initialization of MAC & BBP registers * initialization of MAC & BBP registers
*/ */
static int device_init_registers(struct vnt_private *pDevice) static int device_init_registers(struct vnt_private *pDevice)
{ {
struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
...@@ -317,27 +316,26 @@ static int device_init_registers(struct vnt_private *pDevice) ...@@ -317,27 +316,26 @@ static int device_init_registers(struct vnt_private *pDevice)
memcpy(pDevice->abyBroadcastAddr, abyBroadcastAddr, ETH_ALEN); memcpy(pDevice->abyBroadcastAddr, abyBroadcastAddr, ETH_ALEN);
memcpy(pDevice->abySNAP_RFC1042, abySNAP_RFC1042, ETH_ALEN); memcpy(pDevice->abySNAP_RFC1042, abySNAP_RFC1042, ETH_ALEN);
memcpy(pDevice->abySNAP_Bridgetunnel, memcpy(pDevice->abySNAP_Bridgetunnel, abySNAP_Bridgetunnel, ETH_ALEN);
abySNAP_Bridgetunnel,
ETH_ALEN);
if ( !FIRMWAREbCheckVersion(pDevice) ) { if (!FIRMWAREbCheckVersion(pDevice)) {
if (FIRMWAREbDownload(pDevice) == true) { if (FIRMWAREbDownload(pDevice) == true) {
if (FIRMWAREbBrach2Sram(pDevice) == false) { 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); spin_unlock_irq(&pDevice->lock);
return false; return false;
} }
} else { } else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" FIRMWAREbDownload fail \n"); " FIRMWAREbDownload fail\n");
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
return false; return false;
} }
} }
if ( !BBbVT3184Init(pDevice) ) { if (!BBbVT3184Init(pDevice)) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" BBbVT3184Init fail \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" BBbVT3184Init fail\n");
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
return false; return false;
} }
...@@ -353,9 +351,8 @@ static int device_init_registers(struct vnt_private *pDevice) ...@@ -353,9 +351,8 @@ static int device_init_registers(struct vnt_private *pDevice)
ntStatus = CONTROLnsRequestOut(pDevice, ntStatus = CONTROLnsRequestOut(pDevice,
MESSAGE_TYPE_CARDINIT, 0, 0, MESSAGE_TYPE_CARDINIT, 0, 0,
sizeof(struct vnt_cmd_card_init), (u8 *)init_cmd); sizeof(struct vnt_cmd_card_init), (u8 *)init_cmd);
if (ntStatus != STATUS_SUCCESS) {
if ( ntStatus != STATUS_SUCCESS ) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Issue Card init fail\n");
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" Issue Card init fail \n");
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
return false; return false;
} }
...@@ -537,32 +534,33 @@ static int device_init_registers(struct vnt_private *pDevice) ...@@ -537,32 +534,33 @@ static int device_init_registers(struct vnt_private *pDevice)
/* CR255, enable TX/RX IQ and DC compensation mode */ /* CR255, enable TX/RX IQ and DC compensation mode */
ControlvWriteByte(pDevice, ControlvWriteByte(pDevice,
MESSAGE_REQUEST_BBREG, MESSAGE_REQUEST_BBREG,
0xFF, 0xff,
0x03); 0x03);
/* CR251, TX I/Q Imbalance Calibration */ /* CR251, TX I/Q Imbalance Calibration */
ControlvWriteByte(pDevice, ControlvWriteByte(pDevice,
MESSAGE_REQUEST_BBREG, MESSAGE_REQUEST_BBREG,
0xFB, 0xfb,
byCalibTXIQ); byCalibTXIQ);
/* CR252, TX DC-Offset Calibration */ /* CR252, TX DC-Offset Calibration */
ControlvWriteByte(pDevice, ControlvWriteByte(pDevice,
MESSAGE_REQUEST_BBREG, MESSAGE_REQUEST_BBREG,
0xFC, 0xfC,
byCalibTXDC); byCalibTXDC);
/* CR253, RX I/Q Imbalance Calibration */ /* CR253, RX I/Q Imbalance Calibration */
ControlvWriteByte(pDevice, ControlvWriteByte(pDevice,
MESSAGE_REQUEST_BBREG, MESSAGE_REQUEST_BBREG,
0xFD, 0xfd,
byCalibRXIQ); byCalibRXIQ);
} else { } else {
/* CR255, turn off BB Calibration compensation */ /* CR255, turn off BB Calibration compensation */
ControlvWriteByte(pDevice, ControlvWriteByte(pDevice,
MESSAGE_REQUEST_BBREG, MESSAGE_REQUEST_BBREG,
0xFF, 0xff,
0x0); 0x0);
} }
} }
} }
pMgmt->eScanType = WMAC_SCAN_PASSIVE; pMgmt->eScanType = WMAC_SCAN_PASSIVE;
pMgmt->uCurrChannel = pDevice->uChannel; pMgmt->uCurrChannel = pDevice->uChannel;
pMgmt->uIBSSChannel = pDevice->uChannel; pMgmt->uIBSSChannel = pDevice->uChannel;
...@@ -571,8 +569,7 @@ static int device_init_registers(struct vnt_private *pDevice) ...@@ -571,8 +569,7 @@ static int device_init_registers(struct vnt_private *pDevice)
/* get permanent network address */ /* get permanent network address */
memcpy(pDevice->abyPermanentNetAddr, init_rsp->net_addr, 6); memcpy(pDevice->abyPermanentNetAddr, init_rsp->net_addr, 6);
memcpy(pDevice->abyCurrentNetAddr, memcpy(pDevice->abyCurrentNetAddr,
pDevice->abyPermanentNetAddr, pDevice->abyPermanentNetAddr, ETH_ALEN);
ETH_ALEN);
/* if exist SW network address, use it */ /* if exist SW network address, use it */
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Network address = %pM\n", DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Network address = %pM\n",
...@@ -589,51 +586,59 @@ static int device_init_registers(struct vnt_private *pDevice) ...@@ -589,51 +586,59 @@ static int device_init_registers(struct vnt_private *pDevice)
CARDbAddBasicRate(pDevice, RATE_1M); CARDbAddBasicRate(pDevice, RATE_1M);
pDevice->bShortSlotTime = false; pDevice->bShortSlotTime = false;
} }
BBvSetShortSlotTime(pDevice); BBvSetShortSlotTime(pDevice);
CARDvSetBSSMode(pDevice); CARDvSetBSSMode(pDevice);
if (pDevice->bUpdateBBVGA) { if (pDevice->bUpdateBBVGA) {
pDevice->byBBVGACurrent = pDevice->abyBBVGA[0]; pDevice->byBBVGACurrent = pDevice->abyBBVGA[0];
pDevice->byBBVGANew = pDevice->byBBVGACurrent; pDevice->byBBVGANew = pDevice->byBBVGACurrent;
BBvSetVGAGainOffset(pDevice, pDevice->abyBBVGA[0]); BBvSetVGAGainOffset(pDevice, pDevice->abyBBVGA[0]);
} }
pDevice->byRadioCtl = pDevice->abyEEPROM[EEP_OFS_RADIOCTL]; pDevice->byRadioCtl = pDevice->abyEEPROM[EEP_OFS_RADIOCTL];
pDevice->bHWRadioOff = false; 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); spin_unlock_irq(&pDevice->lock);
return false; return false;
} }
if ( (byTmp & GPIO3_DATA) == 0 ) {
if ((byTmp & GPIO3_DATA) == 0) {
pDevice->bHWRadioOff = true; pDevice->bHWRadioOff = true;
MACvRegBitsOn(pDevice,MAC_REG_GPIOCTL1,GPIO3_INTMD); MACvRegBitsOn(pDevice, MAC_REG_GPIOCTL1, GPIO3_INTMD);
} else { } else {
MACvRegBitsOff(pDevice,MAC_REG_GPIOCTL1,GPIO3_INTMD); MACvRegBitsOff(pDevice, MAC_REG_GPIOCTL1, GPIO3_INTMD);
pDevice->bHWRadioOff = false; pDevice->bHWRadioOff = false;
} }
} }
ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_TMLEN,0x38); ControlvMaskByte(pDevice, MESSAGE_REQUEST_MACREG,
ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_SLOW); MAC_REG_PAPEDELAY, LEDSTS_TMLEN, 0x38);
MACvRegBitsOn(pDevice,MAC_REG_GPIOCTL0,0x01);
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); CARDbRadioPowerOff(pDevice);
} else { } else {
CARDbRadioPowerOn(pDevice); CARDbRadioPowerOn(pDevice);
} }
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"<----INIbInitAdapter Exit\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"<----INIbInitAdapter Exit\n");
return true; 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