pDevice->bRadioOff = true;
//2007-0409-03,<Add> by chester
- printk("chester power off\n");
+ pr_debug("chester power off\n");
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_GPIOCTL0, LED_ACTSET); //LED issue
return bResult;
}
PSDevice pDevice = (PSDevice) pDeviceHandler;
bool bResult = true;
- printk("chester power on\n");
+ pr_debug("chester power on\n");
if (pDevice->bRadioControlOff == true) {
- if (pDevice->bHWRadioOff == true) printk("chester bHWRadioOff\n");
- if (pDevice->bRadioControlOff == true) printk("chester bRadioControlOff\n");
+ if (pDevice->bHWRadioOff == true) pr_debug("chester bHWRadioOff\n");
+ if (pDevice->bRadioControlOff == true) pr_debug("chester bRadioControlOff\n");
return false; }
if (pDevice->bRadioOff == false) {
- printk("chester pbRadioOff\n");
+ pr_debug("chester pbRadioOff\n");
return true; }
BBvExitDeepSleep(pDevice->PortOffset, pDevice->byLocalID);
pDevice->bRadioOff = false;
// 2007-0409-03,<Add> by chester
- printk("chester power on\n");
+ pr_debug("chester power on\n");
MACvRegBitsOff(pDevice->PortOffset, MAC_REG_GPIOCTL0, LED_ACTSET); //LED issue
return bResult;
}
#define ASSERT(x) \
do { \
if (!(x)) { \
- printk(KERN_ERR "assertion %s failed: file %s line %d\n", \
+ pr_err("assertion %s failed: file %s line %d\n", \
#x, __func__, __LINE__); \
*(int *)0 = 0; \
} \
else {
if (zonetype != pDevice->abyEEPROM[EEP_OFS_ZONETYPE])
- printk("zonetype in file[%02x] mismatch with in EEPROM[%02x]\n", zonetype, pDevice->abyEEPROM[EEP_OFS_ZONETYPE]);
+ pr_debug("zonetype in file[%02x] mismatch with in EEPROM[%02x]\n", zonetype, pDevice->abyEEPROM[EEP_OFS_ZONETYPE]);
else
- printk("Read Zonetype file success,use default zonetype setting[%02x]\n", zonetype);
+ pr_debug("Read Zonetype file success,use default zonetype setting[%02x]\n", zonetype);
}
} else
- printk("Read Zonetype file fail,use default zonetype setting[%02x]\n", SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_ZONETYPE));
+ pr_debug("Read Zonetype file fail,use default zonetype setting[%02x]\n", SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_ZONETYPE));
// Get RFType
pDevice->byRFType = SROMbyReadEmbedded(pDevice->PortOffset, EEP_OFS_RFTYPE);
PCHIP_INFO pChip_info = (PCHIP_INFO)ent->driver_data;
PSDevice pDevice;
int rc;
+
if (device_nics++ >= MAX_UINTS) {
- printk(KERN_NOTICE DEVICE_NAME ": already found %d NICs\n", device_nics);
+ pr_notice(DEVICE_NAME ": already found %d NICs\n", device_nics);
return -ENODEV;
}
pDevice = (PSDevice) netdev_priv(dev);
if (dev == NULL) {
- printk(KERN_ERR DEVICE_NAME ": allocate net device failed\n");
+ pr_err(DEVICE_NAME ": allocate net device failed\n");
return -ENOMEM;
}
SET_NETDEV_DEV(dev, &pcid->dev);
if (bFirst) {
- printk(KERN_NOTICE "%s Ver. %s\n", DEVICE_FULL_DRV_NAM, DEVICE_VERSION);
- printk(KERN_NOTICE "Copyright (c) 2003 VIA Networking Technologies, Inc.\n");
+ pr_notice("%s Ver. %s\n", DEVICE_FULL_DRV_NAM, DEVICE_VERSION);
+ pr_notice("Copyright (c) 2003 VIA Networking Technologies, Inc.\n");
bFirst = false;
}
dev->irq = pcid->irq;
#ifdef DEBUG
- printk("Before get pci_info memaddr is %x\n", pDevice->memaddr);
+ pr_debug("Before get pci_info memaddr is %x\n", pDevice->memaddr);
#endif
if (!device_get_pci_info(pDevice, pcid)) {
- printk(KERN_ERR DEVICE_NAME ": Failed to find PCI device.\n");
+ pr_err(DEVICE_NAME ": Failed to find PCI device.\n");
device_free_info(pDevice);
return -ENODEV;
}
#ifdef DEBUG
- printk("after get pci_info memaddr is %x, io addr is %x,io_size is %d\n", pDevice->memaddr, pDevice->ioaddr, pDevice->io_size);
+ pr_debug("after get pci_info memaddr is %x, io addr is %x,io_size is %d\n", pDevice->memaddr, pDevice->ioaddr, pDevice->io_size);
{
int i;
u32 bar, len;
0};
for (i = 0; address[i]; i++) {
pci_read_config_dword(pcid, address[i], &bar);
- printk("bar %d is %x\n", i, bar);
+ pr_debug("bar %d is %x\n", i, bar);
if (!bar) {
- printk("bar %d not implemented\n", i);
+ pr_debug("bar %d not implemented\n", i);
continue;
}
if (bar & PCI_BASE_ADDRESS_SPACE_IO) {
len = bar & (PCI_BASE_ADDRESS_IO_MASK & 0xFFFF);
len = len & ~(len - 1);
- printk("IO space: len in IO %x, BAR %d\n", len, i);
+ pr_debug("IO space: len in IO %x, BAR %d\n", len, i);
} else {
len = bar & 0xFFFFFFF0;
len = ~len + 1;
- printk("len in MEM %x, BAR %d\n", len, i);
+ pr_debug("len in MEM %x, BAR %d\n", len, i);
}
}
}
pDevice->PortOffset = ioremap(pDevice->memaddr & PCI_BASE_ADDRESS_MEM_MASK, pDevice->io_size);
if (pDevice->PortOffset == NULL) {
- printk(KERN_ERR DEVICE_NAME ": Failed to IO remapping ..\n");
+ pr_err(DEVICE_NAME ": Failed to IO remapping ..\n");
device_free_info(pDevice);
return -ENODEV;
}
rc = pci_request_regions(pcid, DEVICE_NAME);
if (rc) {
- printk(KERN_ERR DEVICE_NAME ": Failed to find PCI device\n");
+ pr_err(DEVICE_NAME ": Failed to find PCI device\n");
device_free_info(pDevice);
return -ENODEV;
}
unsigned char value;
VNSvInPortB(pDevice->PortOffset+0x4F, &value);
- printk("Before write: value is %x\n", value);
+ pr_debug("Before write: value is %x\n", value);
VNSvOutPortB(pDevice->PortOffset, value);
VNSvInPortB(pDevice->PortOffset+0x4F, &value);
- printk("After write: value is %x\n", value);
+ pr_debug("After write: value is %x\n", value);
#endif
#ifdef IO_MAP
#endif
// do reset
if (!MACbSoftwareReset(pDevice->PortOffset)) {
- printk(KERN_ERR DEVICE_NAME ": Failed to access MAC hardware..\n");
+ pr_err(DEVICE_NAME ": Failed to access MAC hardware..\n");
device_free_info(pDevice);
return -ENODEV;
}
rc = register_netdev(dev);
if (rc) {
- printk(KERN_ERR DEVICE_NAME " Failed to register netdev\n");
+ pr_err(DEVICE_NAME " Failed to register netdev\n");
device_free_info(pDevice);
return -ENODEV;
}
}
for (ii = 0, j = 1; ii < 0x100; ii++, j++) {
if (j % 16 == 0) {
- printk("%x:", pci_config[ii]);
- printk("\n");
+ pr_debug("%x:", pci_config[ii]);
+ pr_debug("\n");
} else {
- printk("%x:", pci_config[ii]);
+ pr_debug("%x:", pci_config[ii]);
}
}
#endif
//2008-07-21-01<Add>by MikeLiu
//unregister wpadev
if (wpa_set_wpadev(pDevice, 0) != 0)
- printk("unregister wpadev fail?\n");
+ pr_err("unregister wpadev fail?\n");
if (pDevice_Infos == NULL)
return;
mlme_kill = 0;
mlme_task = kthread_run(MlmeThread, (void *)pDevice, "MLME");
if (IS_ERR(mlme_task)) {
- printk("thread create fail\n");
+ pr_err("thread create fail\n");
return -1;
}
if (pDevice->bFixRate) {
#ifdef PLICE_DEBUG
- printk("Fix Rate: PhyType is %d,ConnectionRate is %d\n", pDevice->eCurrentPHYType, pDevice->uConnectionRate);
+ pr_debug("Fix Rate: PhyType is %d,ConnectionRate is %d\n", pDevice->eCurrentPHYType, pDevice->uConnectionRate);
#endif
if (pDevice->eCurrentPHYType == PHY_TYPE_11B) {
pDevice->apCurrTD[TYPE_AC0DMA] = pHeadTD;
if (pDevice->bFixRate)
- printk("FixRate:Rate is %d,TxPower is %d\n", pDevice->wCurrentRate, pDevice->byCurPwr);
+ pr_debug("FixRate:Rate is %d,TxPower is %d\n", pDevice->wCurrentRate, pDevice->byCurPwr);
{
unsigned char Protocol_Version; //802.1x Authentication
(Key_info & BIT8) && (Key_info & BIT9)) { //send 2/2 key
pDevice->fWPA_Authened = true;
if (Descriptor_type == 254)
- printk("WPA ");
+ pr_debug("WPA ");
else
- printk("WPA2 ");
- printk("Authentication completed!!\n");
+ pr_debug("WPA2 ");
+ pr_debug("Authentication completed!!\n");
}
}
}
int result=0;
if (!buffer) {
- printk("allocate mem for file fail?\n");
+ pr_err("allocate mem for file fail?\n");
return -1;
}
file = filp_open(CONFIG_PATH, O_RDONLY, 0);
if (IS_ERR(file)) {
kfree(buffer);
- printk("Config_FileOperation:open file fail?\n");
+ pr_err("Config_FileOperation:open file fail?\n");
return -1;
}
if (kernel_read(file, 0, buffer, 1024) < 0) {
- printk("read file error?\n");
+ pr_err("read file error?\n");
result = -1;
goto error1;
}
if (Config_FileGetParameter("ZONETYPE",tmpbuffer,buffer)!=true) {
- printk("get parameter error?\n");
+ pr_err("get parameter error?\n");
result = -1;
goto error1;
}
result = ZoneType_Europe;
} else {
result = -1;
- printk("Unknown Zonetype[%s]?\n",tmpbuffer);
+ pr_err("Unknown Zonetype[%s]?\n", tmpbuffer);
}
error1:
/* write zonetype */
if (sZoneTypeCmd.ZoneType == ZoneType_USA) {
/* set to USA */
- printk("set_ZoneType:USA\n");
+ pr_debug("set_ZoneType:USA\n");
} else if (sZoneTypeCmd.ZoneType == ZoneType_Japan) {
/* set to Japan */
- printk("set_ZoneType:Japan\n");
+ pr_debug("set_ZoneType:Japan\n");
} else if (sZoneTypeCmd.ZoneType == ZoneType_Europe) {
/* set to Europe */
- printk("set_ZoneType:Europe\n");
+ pr_debug("set_ZoneType:Europe\n");
}
} else {
/* read zonetype */
} else if (zonetype == 0x02) { /* Europe */
sZoneTypeCmd.ZoneType = ZoneType_Europe;
} else { /* Unknown ZoneType */
- printk("Error:ZoneType[%x] Unknown ???\n", zonetype);
+ pr_err("Error:ZoneType[%x] Unknown ???\n", zonetype);
result = -EFAULT;
break;
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWAP\n");
if (pMgmt->eScanState == WMAC_IS_SCANNING) {
// In scanning..
- printk("SIOCSIWAP(??)-->In scanning...\n");
+ pr_debug("SIOCSIWAP(??)-->In scanning..\n");
}
if (wrq->sa_family != ARPHRD_ETHER)
rc = -EINVAL;
pDevice->fWPA_Authened = false;
if (pMgmt->eScanState == WMAC_IS_SCANNING) {
// In scanning..
- printk("SIOCSIWESSID(??)-->In scanning...\n");
+ pr_debug("SIOCSIWESSID(??)-->In scanning..\n");
}
// Check if we asked for `any'
if (wrq->flags == 0) {
pItemSSID->len = wrq->length - 1;
} else
pItemSSID->len = wrq->length;
- printk("set essid to %s\n", pItemSSID->abySSID);
+ pr_debug("set essid to %s\n", pItemSSID->abySSID);
//2008-0409-05, <Add> by Einsn Liu
len = (pItemSSID->len > ((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->len) ? pItemSSID->len : ((PWLAN_IE_SSID)pMgmt->abyCurrSSID)->len;
if ((pDevice->bLinkPass == true) &&
}
}
if (uSameBssidNum >= 2) { //hit: desired AP is in hidden ssid mode!!!
- printk("SIOCSIWESSID:hidden ssid directly associate.......\n");
+ pr_debug("SIOCSIWESSID:hidden ssid directly associate.......\n");
vResetCommandTimer((void *)pDevice);
pMgmt->eScanType = WMAC_SCAN_PASSIVE; //this scan type,you'll submit scan result!
bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID);
if (wrq->fixed != 0) {
// Fixed mode
// One rate, fixed
- printk("Rate Fix\n");
+ pr_debug("Rate Fix\n");
pDevice->bFixRate = true;
if ((pDevice->byBBType == BB_TYPE_11B) && (brate > 3)) {
pDevice->uConnectionRate = 3;
} else {
pDevice->bFixRate = false;
pDevice->uConnectionRate = 13;
- printk("auto rate:connection_rate is 13\n");
+ pr_debug("auto rate:connection_rate is 13\n");
}
return rc;
}
if (pDevice->bwextcount == 4) {
- printk("SIOCSIWENCODEEXT:Enable WPA WEXT SUPPORT!!!!!\n");
+ pr_debug("SIOCSIWENCODEEXT:Enable WPA WEXT SUPPORT!!!!!\n");
pDevice->bwextcount = 0;
pDevice->bWPASuppWextEnabled = true;
}
break;
case IW_MLME_DISASSOC:
if (pDevice->bLinkPass == true) {
- printk("iwctl_siwmlme--->send DISASSOCIATE\n");
+ pr_debug("iwctl_siwmlme--->send DISASSOCIATE\n");
//clear related flags
memset(pMgmt->abyDesireBSSID, 0xFF, 6);
KeyvInitTable(&pDevice->sKey, pDevice->PortOffset);
wTxDataRate = (pMgmt->sNodeDBTable[0].wTxDataRate);
#ifdef PLICE_DEBUG
- printk(KERN_DEBUG "GetTxRate:AP MAC is %pM,TxRate is %d\n",
+ pr_debug("GetTxRate:AP MAC is %pM,TxRate is %d\n",
pMgmt->sNodeDBTable[0].abyMACAddr, wTxDataRate);
#endif
spin_unlock_irq(&pDevice->lock);
return;
}
- printk("chester-abyDesireSSID=%s\n", ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySSID);
+ pr_debug("chester-abyDesireSSID=%s\n", ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySSID);
pItemSSID = (PWLAN_IE_SSID)pMgmt->abyDesireSSID;
pItemSSIDCurr = (PWLAN_IE_SSID)pMgmt->abyCurrSSID;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " cmd: desire ssid = %s\n", pItemSSID->abySSID);
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
{
union iwreq_data wrqu;
+
memset(&wrqu, 0, sizeof(wrqu));
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
- printk("wireless_send_event--->SIOCGIWAP(disassociated:vMgrJoinBSSBegin Fail !!)\n");
+ pr_debug("wireless_send_event--->SIOCGIWAP(disassociated:vMgrJoinBSSBegin Fail !!)\n");
wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL);
}
#endif
}
else if (pMgmt->eCurrState < WMAC_STATE_AUTHPENDING) {
- printk("WLAN_AUTHENTICATE_WAIT:Authen Fail???\n");
+ pr_debug("WLAN_AUTHENTICATE_WAIT:Authen Fail???\n");
} else if (pDevice->byLinkWaitCount <= 4) { //mike add:wait another 2 sec if authenticated_frame delay!
pDevice->byLinkWaitCount++;
- printk("WLAN_AUTHENTICATE_WAIT:wait %d times!!\n", pDevice->byLinkWaitCount);
+ pr_debug("WLAN_AUTHENTICATE_WAIT:wait %d times!!\n", pDevice->byLinkWaitCount);
spin_unlock_irq(&pDevice->lock);
vCommandTimerWait((void *)pDevice, AUTHENTICATE_TIMEOUT/2);
return;
printk("WLAN_ASSOCIATE_WAIT:Association Fail???\n");
} else if (pDevice->byLinkWaitCount <= 4) { //mike add:wait another 2 sec if associated_frame delay!
pDevice->byLinkWaitCount++;
- printk("WLAN_ASSOCIATE_WAIT:wait %d times!!\n", pDevice->byLinkWaitCount);
+ pr_debug("WLAN_ASSOCIATE_WAIT:wait %d times!!\n", pDevice->byLinkWaitCount);
spin_unlock_irq(&pDevice->lock);
vCommandTimerWait((void *)pDevice, ASSOCIATE_TIMEOUT/2);
return;
pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate =
pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate;
#ifdef PLICE_DEBUG
- printk("RxAssocRequest:wTxDataRate is %d\n", pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate);
+ pr_debug("RxAssocRequest:wTxDataRate is %d\n", pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate);
#endif
// Todo: check sta preamble, if ap can't support, set status code
pMgmt->sNodeDBTable[uNodeIndex].bShortPreamble =
pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate =
pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate;
#ifdef PLICE_DEBUG
- printk("RxReAssocRequest:TxDataRate is %d\n", pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate);
+ pr_debug("RxReAssocRequest:TxDataRate is %d\n", pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate);
#endif
// Todo: check sta preamble, if ap can't support, set status code
pMgmt->sNodeDBTable[uNodeIndex].bShortPreamble =
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
{
union iwreq_data wrqu;
+
memset(&wrqu, 0, sizeof(wrqu));
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
- printk("wireless_send_event--->SIOCGIWAP(disassociated)\n");
+ pr_debug("wireless_send_event--->SIOCGIWAP(disassociated)\n");
wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL);
}
#endif
pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate = pMgmt->sNodeDBTable[uNodeIndex].wMaxSuppRate;
#ifdef PLICE_DEBUG
{
- printk("s_vMgrRxBeacon:TxDataRate is %d,Index is %d\n", pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate, uNodeIndex);
+ pr_debug("s_vMgrRxBeacon:TxDataRate is %d,Index is %d\n", pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate, uNodeIndex);
}
#endif
}
ptempBSS = kmalloc(sizeof(KnownBSS), GFP_ATOMIC);
if (ptempBSS == NULL) {
- printk(KERN_ERR "bubble sort kmalloc memory fail@@@\n");
+ pr_err("bubble sort kmalloc memory fail@@@\n");
ret = -ENOMEM;
);
if (pCurr == NULL) {
- printk("wpa_set_associate---->hidden mode site survey before associate.......\n");
+ pr_debug("wpa_set_associate---->hidden mode site survey before associate.......\n");
bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID);
}
}