Loading drivers/staging/vt6656/main_usb.c +116 −111 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -317,20 +316,19 @@ 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 (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; } Loading @@ -353,7 +351,6 @@ 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"); spin_unlock_irq(&pDevice->lock); Loading Loading @@ -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; Loading @@ -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", Loading @@ -589,29 +586,29 @@ 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); 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) { pDevice->bHWRadioOff = true; MACvRegBitsOn(pDevice, MAC_REG_GPIOCTL1, GPIO3_INTMD); Loading @@ -622,18 +619,26 @@ static int device_init_registers(struct vnt_private *pDevice) } ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_TMLEN,0x38); ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_SLOW); 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); if ((pDevice->bHWRadioOff == true) || (pDevice->bRadioControlOff == true)) { 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; } Loading Loading
drivers/staging/vt6656/main_usb.c +116 −111 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -317,20 +316,19 @@ 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 (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; } Loading @@ -353,7 +351,6 @@ 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"); spin_unlock_irq(&pDevice->lock); Loading Loading @@ -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; Loading @@ -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", Loading @@ -589,29 +586,29 @@ 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); 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) { pDevice->bHWRadioOff = true; MACvRegBitsOn(pDevice, MAC_REG_GPIOCTL1, GPIO3_INTMD); Loading @@ -622,18 +619,26 @@ static int device_init_registers(struct vnt_private *pDevice) } ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_TMLEN,0x38); ControlvMaskByte(pDevice,MESSAGE_REQUEST_MACREG,MAC_REG_PAPEDELAY,LEDSTS_STS,LEDSTS_SLOW); 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); if ((pDevice->bHWRadioOff == true) || (pDevice->bRadioControlOff == true)) { 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; } Loading